duckdb-r icon indicating copy to clipboard operation
duckdb-r copied to clipboard

Error: String contains null byte

Open vincentarelbundock opened this issue 9 months ago • 0 comments

Thanks for your great work on this package!

I get this error when trying to read a table into R and a string includes \x0, such as in row 201753 of the example database below:

Error: String contains null byte

To reproduce the issue, download my example database file (150MB):

wget https://arelbundock.com/example.duckdb

Reading the table into a Polars data frame works fine in Python:

import polars
import duckdb
import pyarrow
con = duckdb.connect("example.duckdb")
df = con.sql("SELECT * FROM  sentences_narrative").pl()
print(df)
con.close()

But it generates an error in R:

library(duckdb)
con = dbConnect(duckdb(), "example.duckdb")
df = dbGetQuery(con, "SELECT * FROM sentences_narrative")
dbDisconnect(con)

vincentarelbundock avatar May 03 '24 19:05 vincentarelbundock