RStudio infinite hang connecting to Presto database

I get an infinite hang in RStudio when I try to access data in my Presto database. This used to work fine (only a couple of months ago), but now it works only in R terminal and I am stumped as to why. I have tried a number of solutions related to R versions and paths but none work. I eventually have to kill RStudio to exit.

First, my session info is:

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dbplyr_1.4.3 RJDBC_0.2-8  rJava_0.9-12 DBI_1.1.0   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6     dplyr_0.8.5      crayon_1.3.4     assertthat_0.2.1 R6_2.4.1         lifecycle_0.2.0 
 [7] magrittr_1.5     pillar_1.4.4     rlang_0.4.6      rstudioapi_0.11  vctrs_0.2.4      ellipsis_0.3.0  
[13] tools_4.0.0      glue_1.4.0       purrr_0.3.4      compiler_4.0.0   pkgconfig_2.0.3  tidyselect_1.0.0
[19] tibble_3.0.1   

The code I'm running works flawlessly in R terminal, but hangs for an infinite period when I run in RStudio. I'm just connecting to a Presto server (given an alias here).

I load the necessary packages here and initiate java.

library(DBI)
require(RJDBC)
library(dbplyr)
library(dplyr)
.jinit()

I specify the drivers here and the server config settings. Again, all works fine in R terminal.

drv <- JDBC("com.facebook.presto.jdbc.PrestoDriver",
            "/Users/me/Library/.../com.facebook.presto/presto-jdbc-0.224.jar",
            identifier.quote='"')

presto <- dbConnect(drv,
                    url = "jdbc:presto://presto-server:443/mydatabase/default?SSL=true",
                    type="presto",
                    user = "me",
                    password = rstudioapi::askForPassword("Please enter your presto password"),
                    schema = "")

Then, running the following code never completes and I have to force close RStudio:

tbl(presto, in_schema("source", "flatfiles")) %>% head()

I have tried:

  • Making the paths between R terminal and RStudio identical
  • Installing a new version of R (3.6->4.0)
  • Starting RStudio in admin mode

Thanks in advance!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.