HIVE ODBC连接器设置

luc*_*one 2 odbc hadoop hive unixodbc cloudera

我将unixodbc配置为在我的Linux Mint机器中使用cloudera的hive连接器,但是在尝试连接到hive时我一直收到以下错误(例如使用isql -v hive)

S1000][unixODBC][Cloudera][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.
[ISQL]ERROR: Could not SQLConnect
Run Code Online (Sandbox Code Playgroud)

我想我以正确的方式设置了/etc/odbcinst.ini和〜/ .odbc.ini:

# content of /etc/odbcinst.ini
[hive]
Description = Cloudera ODBC Driver for Apache Hive (64-bit)
Driver=/opt/cloudera/hiveodbc/lib/64/libclouderahiveodbc64.so
ODBCInstLib=libodbcinst.a(libodbcinst.so.1)
UsageCount  = 1
DriverManagerEncoding=UTF-16
ErrorMessagesPath=/opt/cloudera/hiveodbc/ErrorMessages/
LogLevel=0
SwapFilePath=/tmp
Run Code Online (Sandbox Code Playgroud)

和我的〜/ .odbc.ini文件包含:

[hive]
Description=Cloudera ODBC Driver for Apache Hive (64-bit) DSN 
Driver = hive
ErrorMessagesPath=/opt/cloudera/hiveodbc/ErrorMessages/
# Values for HOST, PORT, KrbHostFQDN, and KrbServiceName should be set here.
# They can also be specified on the connection string.
HOST= <the host>
PORT= <the port>
Schema=<the schema>
# .. etc
Run Code Online (Sandbox Code Playgroud)

你能帮我找出导致错误的原因吗?

小智 10

是什么

ldd /opt/cloudera/hiveodbc/lib/64/libclouderahiveodbc64.so
Run Code Online (Sandbox Code Playgroud)

告诉你?

可能是驱动程序未链接到libodbcinst.so.

你可以尝试一下

LD_PRELOAD=/usr/local/libodbcinst.so
Run Code Online (Sandbox Code Playgroud)

或者您的机器上有libodbcinst.so的地方.

  • LD_PRELOAD =/usr/local/libodbcinst.so解决了我的问题 (3认同)