我安装了最新的 Java,使用 Windows 命令提示符进行检查
java --version
C:\Users\sweepydodo>java --version
java 17.0.1 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
我已经运行了以下命令
library(RJDBC)
drv <- JDBC(driverClass = "net.snowflake.client.jdbc.SnowflakeDriver"
, classPath = "C:/Users/sweepydodo/Documents/R/snowflake-jdbc-3.13.9.jar"
, identifier.quote = "`"
)
con <- dbConnect(drv, "jdbc:snowflake://gs46004.eu-west-1.snowflakecomputing.com:443?warehouse=prd_wh&ROLE=prod_readonly&authenticator=externalbrowser&database=dwh_db", "[email protected] /cdn-cgi/l/email-protection", "dummy password")
R 控制台然后读取
Nov 17, 2021 3:37:01 PM net.snowflake.client.core.CredentialManager fillCachedCredential
INFO: JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.
Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
然后,它会打开一个白色背景的浏览器窗口,其中一行内容如下:
您的身份已得到确认并传播到 Snowflake JDBC 驱动程序。
您现在可以关闭此窗口并返回到起点。
然后我回到R并跑
dbListTables(con) # list all tables
一切都很好,我看到了一张桌子清单。当我运行实际查询时,我的问题出现了:
dbGetQuery(con,
"
select *
from FACT_VISIT
limit 10
"
)
读取错误
Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set", :
Unable to retrieve JDBC result set
JDBC ERROR: SQL compilation error:
Object 'FACT_VISIT' does not exist or not authorized.
Statement:
select *
from FACT_VISIT
limit 10
我觉得很奇怪我可以使用查看表列表dbListTables(con)
,但无法查询任何表。我期待任何想法/解决方案。