2

I am trying to use dbWriteTable function in DBI package to upload a dataframe to presto server. It is throwing the following error:

"Error in .verify.JDBC.result(r, "Unable to retrieve JDBC tables list") : Unable to retrieve JDBC tables list ()"

I have also tried using insert into, create, drop commands in dbSendQuery with the same connection and it is working perfectly. I am facing issue when I use dbWriteTable function.

I have tried other functions of the DBI package like dbReadTable, dbCreateTable too which is working perfectly for me

Code:

dbWriteTable(conn,DBI::SQL("test.demo"),value =  df)
  • 1
    Check permissions of connected user. `dbWriteTable` performs `DROP` and `CREATE` commands. Are you allowed these two actions on that schema? – Parfait Jan 07 '19 at 21:26
  • I have both read and write access to this schema. I have tried using insert into, create, drop commands in dbSendQuery and it is working perfectly. The problem is with dbWriteTable function. I have tried other functions of the DBI package like dbReadTable, dbCreateTable too which is working perfectly. – Shreyas Balakrishna Jan 08 '19 at 08:32
  • Hadley Wickham recommends the [_RPresto_ package](https://cran.r-project.org/web/packages/RPresto/index.html): https://twitter.com/hadleywickham/status/1082422935154028544 – krlmlr Jan 08 '19 at 08:50

1 Answers1

0

I guess the problem is dbListTables(). The error probably comes from here:

https://github.com/s-u/RJDBC/blob/1a4fa8558bd20b5a6adbdd6588aa1f61bd51d7d7/R/class.R#L273 https://github.com/s-u/RJDBC/blob/1a4fa8558bd20b5a6adbdd6588aa1f61bd51d7d7/R/class.R#L183

Does this succeed?

dbListTables(conn, pattern = DBI::SQL("test.demo"))

If don't, maybe you don't have permission to read metadata, or something is wrong with your JDBC driver.

(I also recommend RPresto if it works. But, I know it's not always the case...)

yutannihilation
  • 798
  • 4
  • 9