diff --git a/DESCRIPTION b/DESCRIPTION index 2b08c7ffc..c0921e86c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -187,6 +187,7 @@ Collate: 'dbiDataType_POSIXct.R' 'dbiDataType_character.R' 'dbiDataType_data.frame.R' + 'dbiDataType_default.R' 'dbiDataType_difftime.R' 'dbiDataType_integer.R' 'dbiDataType_list.R' diff --git a/R/dbiDataType_default.R b/R/dbiDataType_default.R new file mode 100644 index 000000000..3eae09586 --- /dev/null +++ b/R/dbiDataType_default.R @@ -0,0 +1,8 @@ +dbiDataType_default <- function(x) { + if (inherits(x, c("blob", "arrow_binary"))) { + return("BLOB") + } + stop("SQL type unknown for objects of class ", paste(class(x), collapse = "/")) +} + +setMethod("dbiDataType", signature("ANY"), dbiDataType_default) diff --git a/tests/testthat/test-stream.R b/tests/testthat/test-stream.R index 51f4c376c..005997bbb 100644 --- a/tests/testthat/test-stream.R +++ b/tests/testthat/test-stream.R @@ -1,7 +1,7 @@ context("arrow") test_that("write arrow to sqlite", { - skip_if_not_installed("arrow") + skip_if_not_installed("arrow", "10.0.1") skip_if_not_installed("RSQLite") con <- dbConnect(RSQLite::SQLite(), ":memory:") @@ -13,8 +13,7 @@ test_that("write arrow to sqlite", { c = "three", stringsAsFactors = FALSE ) - # https://issues.apache.org/jira/projects/ARROW/issues/ARROW-17885 - # data$d <- blob::blob(as.raw(1:10)) + data$d <- blob::blob(as.raw(1:10)) tbl <- arrow::as_arrow_table(data)