0

我正在尝试使用以下代码使用 MonetDBLite 将 80GB csv 文件写入 MonetDB。

mtcars[1:12,] %>% write_csv("mtcars1_12.csv")
mtcars[13:32,] %>% write_csv("mtcars13_32.csv")

setwd("path") # please use your folder path

dbdir <- "path" # provide path where you want to create the MonetDB

con <- dbConnect(MonetDBLite::MonetDBLite(), dbdir)

f <- function(x, pos) dbWriteTable(conn=con, name="mtcars1", value= x, header = T, append = T)

read_csv_chunked("mtcars1_12.csv", DataFrameCallback$new(f), chunk_size = 10)
read_csv_chunked("mtcars13_32.csv", DataFrameCallback$new(f), chunk_size = 10)

现在,这个 mtcars 数据工作得很好,但是我的实际数据与完全相同的代码会引发以下错误。

Evaluation error: Failed to insert data: MALException:embedded:Could not convert column 2 var_abc to type 5.

不幸的是,我无法使用 mtcars 重现上述错误,因为我不知道是什么原因造成的!

什么是“将列转换为类型 5”问题,我该如何解决?

4

0 回答 0