0
當我在服務器本身上使用R時,RStudio中出現一個RDOBC錯誤,該錯誤不會發生。RStudio - LD_PREOAD問題
的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)
RStudio -
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中使用相同的環境設置?