Support Questions
Find answers, ask questions, and share your expertise

ODBC via Knox on Linux

Highlighted

ODBC via Knox on Linux

Rising Star

I am trying to get ODBC via Knox working on CentOS 7 using this Hortonworks ODBC driver (which support said is the right one for my Linux OS version):

hive-odbc-native-2.1.4.1004-1.el7.x86_64.rpm

After installing that, I am able to use this driver to connect directly to Hive using a DSN string like this in odbc.ini:

[testdsn]
Description=Test
Driver=/usr/lib/hive/lib/native/Linux-amd64-64/libhortonworkshiveodbc64.so
Host=sn01.qa.quasar.local:2181
Schema=default
ServiceDiscoveryMode=1
ZKNamespace=/hiveserver2
HiveServerType=2
AuthMech=3
ThriftTransport=2
Port=10001
HttpPath=cliservice

And I can test access like this and all works well. I can also use this via pyodbc and that works too.

[mpetronic@mpws ~]$ echo "show tables" | isql testdsn mpetronic anypwd
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> show tables
+---------------------------------------+
| tab_name                              |
+---------------------------------------+
| test                                  |
+---------------------------------------+
SQLRowCount returns -1
1 rows fetched

Now, I need to make this work via Knox. I have read everything I could possibly find on setting up Hive access via ODBC via Knox. Most postings are about Windows. I need help with Linux configuration. There does not seem to be any clear documentation on how to setup this up on Linux. Can anyone provide the actual, specific odbc.ini settings or DSN you are using to connect to Hive via Knox from a Linux client over ODBC? Here is the connect string that I can use to directly connect to Hive via Knox without ODBC. Just cannot figure out how to make it work via ODBC.

beeline -u "jdbc:hive2://api01.qa:8443/;ssl=true;sslTrustStore=/home/mpetronic/keystore/keystore.jks;trustStorePassword=password;transportMode=http;httpPath=quasar/jupstats/hive" -n mpetronic -w ~/pw.txt
1 REPLY 1

Re: ODBC via Knox on Linux

Rising Star

I figured it out and posted this article