Search code examples
rodbcdbirodbc

R dbWriteTable More Than One Class Warning


I've had a working R script that uses the dbWriteTable command to write to a SQL Server table. It has worked well without issue for a while ... until the last few days.

Now when I run the dbWriteTable command, I get the following warning:

Found more than one class "blob" in cache; using the first, from namespace 'blob'
Also defined by ‘jsonlite’

Interestingly enough the table appears to write successfully.

Here is some sample code:

library("DBI")

db_test <- dbConnect(
  odbc(),
  driver = "SQL Server",
  server = "test_server",
  port = 1234,
  database = "test_db"
)

dbWriteTable(
  conn = db_test,
  name = SQL("dbo.swc_test_write_table"),
  value = df_test,
  overwrite = TRUE
)

I've tried explicitly naming the package, DBI::dbWriteTable, but it throws the same warning. For reference, I'm not using using the jsonlite package, but I have it installed.

Any thoughts on why this is happening?


Solution

  • This seems to be a bug, which is caused by the jsonlite package in its latest release 1.7.3. See the bug report https://github.com/jeroen/jsonlite/issues/373 It seems to be fixed upstream and as of now there's also an updated version available, Changelog from 1.7.3 to 1.8.0.