OHDSI Home | Forums | Wiki | Github

querySql error on Mac with Apple Chip (with Spark db)

Hi developers,

I’d like to report an error when running querySql on Mac with M1/M2 chip with Spark database in Databricks. FYI - I do not encounter this error on Windows connecting to the same database, so i believe it is a compatibility issue specific to Mac M1/M2 chip. Additionally, the function executeSql works well on Mac, so the error seems specific to displaying query results in Rstudio, if that helps.

To reproduce the error, simply run
sql ← SqlRender::render(“SELECT * FROM @cdm_database_schema.person”,
cdm_database_schema = cdmDatabaseSchema)
DatabaseConnector::querySql(conn, sql)

The error is:

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Error in .createErrorReport():
! Error executing SQL:
java.sql.SQLException: [Databricks]DatabricksJDBCDriver Error caught in BackgroundFetcher. Foreground thread ID: 1. Background thread ID: 36. Error caught: null.

Full error report as below:

DBMS:
spark

Error:
java.sql.SQLException: [Databricks]DatabricksJDBCDriver Error caught in BackgroundFetcher. Foreground thread ID: 1. Background thread ID: 36. Error caught: null.

SQL:
SELECT * FROM sandbox.wilcox_lab.person

R version:
R version 4.3.2 (2023-10-31)

Platform:
aarch64-apple-darwin20

Attached base packages:

  • stats
  • graphics
  • grDevices
  • utils
  • datasets
  • methods
  • base

Other attached packages:

Hi @linyingz ! I’m unable to reproduce this on my M3. It might actually be a Java issue. Do you know which Java version you’re running?

(You can run rJava::J("java.lang.System")$getProperty("java.version") in R to find out)

My Java is “21.0.1”. Thanks Martijn!

Although in theory Java should have backwards compatibility, I suspect it is breaking down here (Java version are also different from versions of other software. The latest Java 8 might very well be newer than the latest Java 21)

I’m running Java 11. Would it be possible to try that?

@schuemie: Problem solved. It is a java issue. I installed Java from Downloads for Amazon Corretto 8 - Amazon Corretto with Java version “1.8.0_402” and everything works. Thanks Martijn!

t