connection success but query failed
Closed this issue · 5 comments
hi ,I used implyr and RJDBC to connect R and impala succed, but when I use dbGetQuery to select some data from database, I got en error;
the sql was below:
testdata <- dbGetQuery(
impala,
"SELECT * FROM jolly.who_orderinfo limit 10"
)
and the error was below:
Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for ", :
Unable to retrieve JDBC result set for SELECT * FROM jolly.who_orderinfo limit 10 ([Simba]ImpalaJDBCDriver ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AuthorizationException: User '' does not have privileges to execute 'SELECT' on: jolly.who_orderinfo
), Query: SELECT * FROM jolly.who_orderinfo limit 10.)
can anyone tell me why and how can I solve this problems, thanks!
It looks like maybe the username was not passed correctly to src_impala()
? With RJDBC, you should use one of these two methods:
impala <- src_impala(drv, "jdbc:impala://host:21050", "username", "password")
or
impala <- src_impala(drv, "jdbc:impala://host:21050;UID=username;PWD=password")
If you're using Kerberos, use the second method and see the Impala JDBC driver installation guide for details.
I give up RJDBC, use ODBC to connect impala,then "bang" sucessed!
Ok, good to hear the odbc package works for you. I recommend odbc over RJDBC.
yes, thank you for your reply!