duckdb-r
duckdb-r copied to clipboard
Error: String contains null byte
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)