我尝试通过 Ubuntu 18.04 服务器上的 R 脚本连接到 Athena,但该脚本在到达具有“dbConnect”函数的行后会打印出错误。它还会卡住控制台,并且除了停止整个进程之外不接受任何其他命令。
我使用的代码是:
library(DBI)
library(AWR.Athena)
Sys.setenv(AWS_ACCESS_KEY_ID = "my_id", AWS_SECRET_ACCESS_KEY = "my_pwd")
con <- dbConnect(Athena(), region = "us-east-2", S3OutputLocation = "s3://aws-athena-query-results-xxxx-us-east-2/API+export", Schema = "default")
sql <- dbGetQuery(con, sql_query)
我收到的错误:
log4j:WARN No appenders could be found for logger (com.simba.athena.amazonaws.AmazonWebServiceClient).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
奇怪的是,如果我也在本地运行该脚本,它会打印出错误,但它会继续并成功执行。谁能解释一下可能的原因是什么?
最佳答案
在这里回答我自己的问题。设置java选项
options(java.parameters=c("-Dhttp.proxyHost=主机名", "-Dhttp.proxyPort=端口号", "-Dhttps.proxyHost=主机名", "-Dhttps.proxyPort=端口号"))
解决了这个问题。
关于java - 在 Ubuntu 服务器上通过 R 连接到 Athena 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57784385/