能够使用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