lucacerone
lucacerone

Reputation: 10149

Cannot find hive odbc connector error messages using unixODBC

I am trying to setup unixodbc to use the hive driver connector from cloudera (in an Ubuntu machine).

In my ~/.local/lib folder I have links to the .so files provided by cloudera, also the env variable LD_LIBRARY_PATH contains /home/luca/.local/lib:/opt/cloudera/hiveodbc/lib/64/.

I created the file /etc/odbcinst.ini containing the following:

[hive]
Description = Cloudera ODBC Driver for Apache Hive (64-bit)
Driver      = /home/luca/.local/lib/libclouderahiveodbc64.so
ODBCInstLib= /home/luca/.local/lib/libodbcinst.so
UsageCount  = 1
DriverManagerEncoding=UTF-16
ErrorMessagesPath=/opt/cloudera/hiveodbc/ErrorMessages/
LogLevel=0
SwapFilePath=/tmp

and in my home folder I have .odbc.ini containing:

[hive]
Driver=hive
HOST=<thehost>
PORT=<theport>
Schema=<theschema>
FastSQLPrepare=0
UseNativeQuery=0
HiveServerType=2
AuthMech=2
#KrbHostFQDN=[Hive Server 2 Host FQDN]
#KrbServiceName=[Hive Server 2 Kerberos service name]
UID=<myuid>

When I test the connection using isql -v hive I get the following error message:

[S1000][unixODBC][DSI] The error message NoSQLGetPrivateProfileString could not be found in the en-US locale. Check that /en-US/ODBCMessages.xml exists.
[ISQL]ERROR: Could not SQLConnect

How can I fix this issue (why is the path absolute for /en-US/)?

Upvotes: 2

Views: 1636

Answers (1)

Gavin Haynes
Gavin Haynes

Reputation: 2002

The SQLGetPrivateProfileString was not found in your ODBCInstLib library. Either the library could not be loaded, or the library did not contain the symbol.

Use strace isql -v hive 2>&1 | grep ini to see if your configuration file is being loaded. Use strace isql -v hive 2>&1 | grep odbcinst.so to see where it is looking for the library.

Make sure that the library exists in the given location and has the correct architecture. Use file -L /home/luca/.local/lib/libodbcinst.so to check the architecture. Use nm /home/luca/.local/lib/libodbcinst.so | grep SQLGetPrivateProfilString to check if it has the correct symbol.

Upvotes: 1

Related Questions