能夠使用ODBC實現第三方產品與Impala的集成。爲了得到最佳體驗,確保你計劃使用的第三方產品支持ODBC。驗證支持包括檢查Impala、ODBC、操做系統、以及第三方軟件的版本容許一塊兒使用。在配置你的系統使用ODBC以前,先下載一個鏈接器。html
注意:在訪問下載ODBC鏈接器下載頁面以前,你可能須要先登陸、接受受權協議。linux
Cloudera ODBC 鏈接器 1.x版使用原有的 HiveServer1 協議,與 Impala 21000 端口通信。數據庫
新的 2.5 和 2.0 版本,已經認證了部分而不是所有 BI 應用,使用 HiveServer2 協議,與 Impala 21050 端口通信。儘管 2.x 版本驅動支持經過 Kerberos tickets 或 用戶名/密碼進行身份驗證,但 Impala 只支持 Kerberos 方式。windows
Connector | 下載頁 | 注意 |
---|---|---|
Cloudera ODBC Driver 2.5 for Impala架構 |
通用的ODBC驅動,可用於任意的、這裏沒有列出的、基於ODBC的應用與 Impala 的集成。可用於Linux 和 Windows 系統 | |
Cloudera ODBC Connector 2.0 for Microstrategyide |
可用於Linux 和 Windows 系統 |
|
Cloudera ODBC Connector 2.5 for Qlikview網站 |
可用於Linux 和 Windows 系統 |
|
Cloudera ODBC Connector 1.2 for Tableau |
僅可用於Windows 系統 | |
Previous ODBC Connectors |
可用於 Windows 和 Linux 系統。最新版本的鏈接器在它們各自下載頁面有單獨的安裝手冊連接,較老版本鏈接器的手冊章節: Configuration Instructions for Cloudera ODBC Connector 1.2. |
Important: If you are using the Cloudera Connector for Tableau, to connect Impala to your Kerberos-secured CDH clusters, contact your Tableau account representative for an updated Tableau Data-connection Customization (TDC) file. The updated TDC file will override the Tableau connection settings to set specific parameters on the connection string that are required for a secure connection.
本節的說明針對較老的Cloudera ODBC 驅動版本(1.2)。許多應用已經使用 2.x 版本的驅動,已經有單獨的安裝說明,參見 本章其餘部分。關於 1.2 版本ODBC 驅動的配置說明,請根據你的平臺參閱不一樣部分:
Configuring MicroStrategy to Use the Cloudera ODBC Driver 1.2 on Linux
Configuring MicroStrategy and Qlikview to Use the Cloudera ODBC Driver 1.2 on Windows
必須使用 1.2 及以上的ODBC驅動,以前版本再也不支持。
下載鏈接器後,配置系統使用它。
注意:
一般用於測試驅動的 unixODBC 驅動管理器須要 home 目錄下有 odbc.ini 文件。假如使用 unixODBC 驅動管理器,你必須經過使用相似下面示例中複製文件的命令,準備你的環境,:
$ cp /etc/odbc.ini ~/odbc.ini
To configure Microstrategy to use ODBC on Linux:
使用 tar 從 ODBC 驅動歸檔中解壓並安裝到你選擇的目錄。例如,使用下面的命令,安裝驅動到標準位置/usr下:
tar -zxf ClouderaHiveODBC-v1.20.tar.gz -C /usr
按照不一樣的版本時,放到另外的位置,如/opt/。
在odbc.ini文件添加以下值,爲Impala建立系統 DSN。
[ODBC Data Sources] IMPALA-SERVER=Hive ODBC Driver [IMPALA-SERVER] Driver=ODBC_DRIVER_LIBS_PATH/libhiveodbc.so.1 Description=Hive ODBC Driver Host=IMPALAD_HOST Port=IMPALAD_PORT Database= FRAMED=0 Trace=Yes TraceFile=/tmp/odbc.log Type=Beeswax
注意: 在上面的例子裏,須要替換這些值:ODBC_DRIVER_LIBS_PATH: ODBC 驅動庫的完整路徑,一般是/usr/lib。IMPALAD_HOST: 任意運行impalad主機的完整主機名。IMPALAD_PORT: impalad進程的端口號,默認 21000。
在ODBC.sh追加如下內容設置環境變量:
# # ODBC Driver for Hive # HIVE_CONFIG='ODBC_DRIVER_INSTALL_PATH' if [ "${HIVE_CONFIG}" != '<HIVE_CONFIG>' ]; then export HIVE_CONFIG mstr_append_path LD_LIBRARY_PATH "${HIVE_CONFIG:?}"/lib export LD_LIBRARY_PATH mstr_append_path PATH "${HIVE_CONFIG:?}"/bin export PATH fi
Note: 在上面的例子裏,替換 ODBC_DRIVER_INSTALL_PATH 爲驅動庫和包含文件父目錄的網站路徑,一般爲/usr。
在odbcinst.ini中添加ODBC驅動
[ODBC Drivers] Hive Driver=Installed [Hive Driver] Driver=ODBC_DRIVER_LIBS_PATH/libhiveodbc.so.1 Description=Hive Driver Setup=ODBC_DRIVER_LIBS_PATH/libhiveodbc.so.1 APILevel=2 ConnectFunctions=YYY DriverODBCVer=1.0 FileUsage=0 SQLLevel=1
Note: 在上面的例子裏,替換 ODBC_DRIVER_LIBS_PATH 爲ODBC 驅動庫的完整路徑,一般爲 /usr/lib。
下載鏈接器後,配置系統使用它。
To configure Microstrategy, Qlikview, or other tools except Tableau to use ODBC on Windows:
運行下載的".exe"文件來調用安裝嚮導。你將須要接受許可協議,接受或修改安裝路徑。當前只提供32位版本驅動,不過也能夠運行在64位環境下。
注意: 經過執行<Install_exe>/S /D="<Dir_to_install>",能夠執行靜默(非交互式)安裝。例如:ClouderaHiveODBCSetup_v1_20.exe /S /D="C:\Program Files (x86)\Hive ODBC" 將安裝驅動和反安裝腳本到 C:\Program Files (x86)\Hive ODBC 目錄下。靜默模式下自動接收受權。
打開ODBC Data Source Administrator. 必須使用32位版本。
點擊 System DSN 選項卡,點擊 Add.
選擇 Cloudera ODBC Driver for Apache Hive 並點擊 Finish.
爲下列字段輸入值:
Data Source Name – DSN名稱
Host – 運行impalad 進程節點的完整主機名.
Port – impalad 進程端口,默認 21000。
Type – Beeswax
Click OK.
If you would like to use Tableau with the Cloudera Connector for Tableau, use the same Tableau documentation as Hive. Tableau does not use the system DSN configuration described here, but instead requires configuring the connection within Tableau itself.
使用ODBC驅動的用戶,應花時間熟悉應用與Impala,瞭解使用Cloudera ODBC Connector的限制(Users of this ODBC driver should take the time to familiarize themselves with Impala and the limitations when using it with the Cloudera ODBC Connector)。
Impala 不是關係數據庫,不支持不少一般關係數據庫具備的功能。缺乏的功能以下:
不支持事務
不支持遊標或可滾動遊標(scrollable cursors)
不支持行級別的插入、更新、刪除
對取消正在運行的查詢沒有明確的支持
不支持prepared statements
用戶應當注意 Impala 支持的SQL功能。鼓勵用戶閱讀 Language Reference 並與應用開發者在嘗試使用這些驅動前確認Impala支持。
這些限制在兩個方面影響驅動使用:
由於底層系統不支持,許多類型的 SQL 語句沒法經過驅動運行
由於不支持所需的基礎架構,Hive上許多 ODBC API 中的功能不支持
驅動中下面列出的 ODBC 功能不支持:
SQLBindParameter
SQLBrowseConnect
SQLBulkOperations
SQLCancel
SQLCloseCursor
SQLColumnPrivileges
SQLCopyDesc
SQLDataSources
SQLDrivers
SQLEndTrans
SQLForeignKeys
SQLGetCursorName
SQLGetDescField
SQLGetDescRec
SQLGetTypeInfo
SQLMoreResults
SQLNativeSQL
SQLParamOptions
SQLPrepare
SQLPrimaryKeys
SQLProcedureColumns
SQLProcedures
SQLSetCursorName
SQLSetDescField
SQLSetDescRec
SQLSetPos
SQLSetScrollOptions
SQLSpecialColumns
SQLStatistics
SQLTablePrivileges
SQLTransact
驅動支持下面的 ODBC 功能,但可能存在bug:
SQLAllocConnect
SQLAllocEnv
SQLAllocHandle
SQLAllocStmt
SQLBindCol
SQLColAttribute
SQLColAttributes
SQLColumns
SQLConnect
SQLDescribeCol
SQLDescribeParam
SQLDisconnect
SQLDriverConnect
SQLError
SQLExecDirect
SQLExecute
SQLFetch
SQLFreeConnect
SQLFreeEnv
SQLFreeHandle
SQLFreeStmt
SQLGetConnectAttr
SQLGetConnectOption
SQLGetConnectionOption
SQLGetData
SQLGetDiagField
SQLGetDiagRec
SQLGetEnvAttr
SQLGetFunctions
SQLGetInfo
SQLGetStmtAttr
SQLGetStmtOption
SQLNumParams
SQLNumResultCols
SQLParamData
SQLPutData
SQLRowCount (Always returns -1)
SQLSetConnectAttr
SQLSetEnvAttr
SQLSetParam
SQLSetStmtAttr
SQLSetStmtOption
SQLTables