Impala online documentation describes Impala ODBC interface installation and configuration
http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/Impala/ Installing-and-using-impala/ciiu_impala_odbc.html
Impala ODBC Driver:
http://www.cloudera.com/content/support/en/downloads/connectors.html
This paper explains the installation and use of Impala ODBC in centos-6.5-x86_64 environment.
First, check whether the UNIXODBC is installed:
Rpm-qa|grep UnixODBC
Assume that there is no installation. Use the following command to install:
Yum Install UnixODBC
Yum Install Unixodbc-devel
Use the Odbcinst command to view the UNIXODBC profile path, different version number of the UNIXODBC configuration file path is different, assuming that the source way to install UNIXODBC, but also by compiling the parameters--sysconfdir specified.
[e-mail protected] ~]# odbcinst-j
unixODBC 2.2.14
DRIVERS ...:/etc/odbcinst.ini
SYSTEM DATA SOURCES:/etc/odbc.ini
FILE data SOURCES:/etc/odbcdatasources
USER data SOURCES ...:/root/.odbc.ini
Sqlulen size ....: 8
Sqllen size ....: 8
sqlsetposirow size.: 8.
Ii. Installing Impala ODBC driver
Download clouderaimpalaodbc-2.5.15.1015-1.el6.x86_64.rpm, save to:/home/soft folder, and install:
[[email protected] soft]# ll total
16232
-rw-r--r--. 1 root root 16619934 in 06:37 ClouderaImpalaODBC-2.5.15.1 015-1.el6.x86_64.rpm
[[email protected] soft]# RPM-IVH clouderaimpalaodbc-2.5.15.1015-1.el6.x86_64.rpm Preparing ... ########################################### [100%]
1:clouderaimpalaodbc ############################### ############ [100%]
After installation of the file in:/opt/cloudera/impalaodbc folder, this folder includes installation documents, LIB package, configuration file Demo sample.
[[email protected] impalaodbc]# pwd
/opt/cloudera/impalaodbc
[[email protected] impalaodbc]# ll
Total 1016
-rwxr-xr-x. 1 root root 1007048 Apr 12:21 Cloudera ODBC Driver for Impala Install guide.pdf
-rwxr-xr-x. 1 Root root 12003 Apr 12:21 cloudera-eula.txt
drwxr-xr-x. 3 root root 4096 April 07:15 errormessages
-RW Xr-xr-x. 1 root root 3261 Apr 12:21 Readme.txt
-rwxr-xr-x. 1 root root 2350 Apr 12:21 Release Notes.txt
Dr Wxr-xr-x. 2 root root 4096 07:15 Setup
drwxr-xr-x. 3 root root 4096 07:15 Lib
Set the driving environment variables:
In/etc/profile last add:
Export LD_LIBRARY_PATH=/USR/LOCAL/LIB:/OPT/CLOUDERA/IMPALAODBC/LIB/64
Then run: source/etc/profile
Make the changed script take effect immediately.
Copy: Cloudera.impalaodbc.ini to/etc/folder:
[Email protected] setup]# pwd
/opt/cloudera/impalaodbc/setup
[[email protected] setup]# CP cloudera.impalaodbc.ini/etc/
Changes: For example, the following entry in/etc/cloudera.impalaodbc.ini:
# Generic Odbcinstlib
# iodbc
#ODBCInstLib =libiodbcinst.so
# Simbadm/unixodbc
Odbcinstlib=libodbcinst.so
That means not using IODBC, using UnixODBC
Third, change the/etc/odbc.ini file
Take a look at the/opt/cloudera/impalaodbc/setup/odbc.ini and add the following to the/etc/odbc.ini such as:
[IMPALAODBC] # DESCRIPTION:DSN Description.
# This key was not necessary and was only to give a description of the data source.
Description=cloudera ODBC Driver for Impala (64-bit) DSN # driver:the location where the ODBC Driver are installed to. Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so # The Driverunicodeencoding setting is a used for
Simbadm # When set to 1, Simbadm runs in UTF-16 mode.
# When set to 2, Simbadm runs in UTF-8 mode.
#DriverUnicodeEncoding =2 # Values for HOST, PORT, Krbfqdn, and Krbservicename should is set here.
# They can also is specified on the connection string.
host=172.16.230.152 port=21050 Database=default # the authentication mechanism.
# 0-no authentication.
# 1-kerberos Authentication # 2-username authentication.
# 3-username/password authentication.
# 4-username/password authentication with SSL.
Authmech=0 # Kerberos Related settings. krbfqdn= krbrealm= krbservicename= # username/password authentication with SSL SETtings. uid= pwd= caissuedcertnamesmismatch=1 Trustedcerts=/opt/cloudera/impalaodbc/lib/64/cacerts.pem # Specify the proxy
User ID to use.
#DelegationUID = # General Settings tsasltransportbufsize=1000 rowsfetchedperblock=1000 sockettimeout=0 stringcolumnlength=32767 usenativequery=0
Iv. Verifying the success of the installation
Run Isql-v IMPALAODBC
[[email protected] ~]# isql-v impalaodbc +---------------------------------------+ | connected! |
| |
| sql-statement | | Help [TableName] | | Quit | |
|
+---------------------------------------+ sql> select * from Tab1; [S1000] [UnixODBC] [Cloudera] [IMPALAODBC] Error while executing a query in Impala: [HY000]: Error:Error:could not match input [Isql]error:could not Sqlpre Pare sql> SELECT * from TAB1 +------------+------+-------------------------+------------------------------+ | ID | col_1| col_2 |
Col_3 | +------------+------+-------------------------+------------------------------+
| 1 | 1 | 123.123 | 2012-10-24 08:55:00 | | 2 | 0 | 1243.5 | 2012-10-25 13:40:00 |
| 3 | 0 | 24453.325 | 2008-08-22 09:33:21.123000000| | 4 | 0 | 243423.325 | 2007-05-12 22:32:21.334540000| | 5 | 1 | 243.325 |
1953-04-22 09:11:33 | +------------+------+-------------------------+------------------------------+ sqlrowcount returns-1 5 rows fetched
Note: The SQL that runs does not end with the seal number.
After this is configured. UNIXODBC can access the data in Impala through the C + + program.
V. License issues
The default installed Impala ODBC is an evaluation version and requires a purchase of license. See Installation documentation Cloudera ODBC Driver for Impala install guide.pdf in this paragraph:
If you were installing a driver with an evaluation license and you had purchased a perpetual license, then copy the Licens E.lic file you received via e-mail into THE/OPT/CLOUDERA/IMPALAODBC/LIB/32 or/opt/cloudera/impalaodbc/lib/64 folder, DEP Ending on the version of the driver you installed.
How long is the assessment, and the answer is not yet found. or let you always evaluate it:)
Original works. Reprint please specify the source http://blog.csdn.net/yangzhaohui168/article/details/38800803
Impala ODBC Installation Notes