From 1afc9eb5d3e037f7987f707bdec2a67179a4ce39 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 16 Aug 2021 09:34:06 -0500 Subject: [PATCH 1/2] check query status after query, and warn --- R/TileDBArray.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/TileDBArray.R b/R/TileDBArray.R index 9c465a22e4..97f35b7d3a 100644 --- a/R/TileDBArray.R +++ b/R/TileDBArray.R @@ -638,8 +638,14 @@ setMethod("[", "tiledb_array", qryptr <- libtiledb_query_set_condition(qryptr, x@query_condition@ptr) } - ## fire off query and close array + ## fire off query qryptr <- libtiledb_query_submit(qryptr) + + ## check status + status <- libtiledb_query_status(qryptr) + if (status != "COMPLETE") warning("Query returned '", status, "'.", call. = FALSE) + + ## close array libtiledb_array_close(arrptr) ## retrieve actual result size (from fixed size element columns) From c85175ce9173aaa76bc810b622876230bab040e0 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 16 Aug 2021 09:47:39 -0500 Subject: [PATCH 2/2] add test for warning under (onerous) memory limit --- inst/tinytest/test_query.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inst/tinytest/test_query.R b/inst/tinytest/test_query.R index 5df95423a2..91257b983a 100644 --- a/inst/tinytest/test_query.R +++ b/inst/tinytest/test_query.R @@ -193,3 +193,12 @@ expect_equal(n, 4L) expect_equal(rowdat[1:n], rows[4:7]) expect_equal(valdat[1:n], vals[4:7]) #}) + +## check for warning in insufficient memory +cfg <- tiledb_config() +cfg["sm.memory_budget"] <- "16" +cfg["sm.memory_budget_var"] <- "32" +ctx <- tiledb_ctx(cfg) +array <- tiledb_array(tmp, as.data.frame=TRUE) + +expect_warning(array[])