我在 RStudio 中收到 RDOBC 错误,当我在服务器本身上使用 R 时不会发生该错误。
R -
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
library(RODBC)
conn = odbcConnect("Cloudera_HIVE64", uid="manishm", pwd="tdpass")
data = sqlQuery(conn,"SELECT * from default.test")
data
[1] test.id test.name
<0 rows> (or 0-length row.names)
工作室 -
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
library(RODBC)
conn = odbcConnect("ClouderaHIVE64", uid="manishm", pwd="tdpass")
Warning messages:
1: In odbcDriverConnect("DSN=ClouderaHIVE64;UID=manishm;PWD=tdpass") :
[RODBC] ERROR: state HY000, code 11560, message [unixODBC][Cloudera]ODBC Unable to locate SQLGetPrivateProfileString function.
2: In odbcDriverConnect("DSN=Cloudera_HIVE64;UID=manishm;PWD=tdpass") :
ODBC connection failed
我检查了环境变量并确保以下内容对所有用户都是正确的
ODBCINI=/opt/cloudera/hiveodbc/Setup/odbcinst.ini
LD_PRELOAD=/usr/lib64/libodbcinst.so
知道为什么这将在 R 而不是在具有相同环境设置的 RStudio 中工作吗?