I'm trying to establish a connection between my hosted Impala db and my local R session. When I try to do this in RStudio it bombs and in the R GUI it crashes with a segfault error and a message of invalid permissions. However, if I run the exact same commands in a terminal running R or wrapped in callr::r it executes just fine.
For context, I'm using the JDBC Impala Driver provided by Cloudera and I'm using the RJDBC package to connect to the driver. I'm using the DBI package to execute commands on the db.
While I can't share the code exactly as it's configured, here's what I'm running with sensitive information removed:
library(RJDBC)
library(DBI)
impala_classpath <- list.files(path = "[dir_containing_jdbc_driver]", pattern = "\\.jar$", full.names = TRUE)
.jinit(classpath = impala_classpath)
drv <- JDBC(
driverClass = "com.cloudera.impala.jdbc.Driver",
classPath = impala_classpath
)
# This chunk triggers the crash
impala <- dbConnect(
drv,
url = "jdbc:impala://[url-to-impala_db];AuthMech=3;",
uid = "[username]",
pwd = "[password]"
)
dbListTables(impala)
As stated, if I take all this code and run it in a terminal, it works fine. Similarly, executing via callr works fine too. I've seen similar issues around RStudio Server and/or Posit Cloud (see here), but I haven't come across any posts using local RStudio.
EDIT: Solution found. I was able to fix this by upgrading my local Java SDK.