想要将 redshift 连接到 R

Want to Connect redshift to R

我尝试使用 this link 中的代码,但出现错误

driver <- JDBC("com.amazon.redshift.jdbc41.Driver", "RedshiftJDBC41-1.1.9.1009.jar", identifier.quote="`") JavaVM: requested Java version ((null)) not available. Using Java at "" instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib JavaVM FATAL: Failed to load the jvm library. Error in .jinit(classPath) : JNI_GetCreatedJavaVMs returned -1

加载驱动程序并尝试连接后。我不知道如何将 Redshift 连接到 R。

这不会解决错误,但如果你想从 R 连接到 Redshift,你可以使用 RPostgreSQL 库。 如 another R-Redshift connection issue

中的答案
library (RPostgreSQL)
drv <- dbDriver("PostgreSQL")
conn <- dbConnect(drv, host="your.host.us-east-1.redshift.amazonaws.com", 
             port="5439",
             dbname="your_db_name", 
             user="user", 
             password="password")

您还需要确保您的IP是Redshift安全组白名单。