mac配置impala odbc

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ggz631047367/article/details/50704011

下载mac对应驱动并安装:http://www.cloudera.com/downloads.html.html

*HOST 地址是impala Daemon所在的机器ip,端口可以在cm中设置
vi /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbc.ini

[ODBC Data Sources]
Sample_Cloudera_Impala_DSN_64=Cloudera Impala ODBC Driver 64-bit

[Sample_Cloudera_Impala_DSN_64]
Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib
HOST=192.168.2.103
PORT=21050

vi /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbcinst.ini

[ODBC Drivers]
Cloudera Impala ODBC Driver 64-bit=Installed

[Cloudera Impala ODBC Driver 64-bit]
Description=Cloudera Impala ODBC Driver (64-bit)
Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib

测试:
isql -v Sample_Cloudera_Impala_DSN_64

PHP连接:

<?php
$connection=odbc_connect('Sample_Cloudera_Impala_DSN_64','','');
$SQL_Exec_String="show tables";
$result=odbc_exec($connection, $SQL_Exec_String);
while(odbc_fetch_row($result))
{
$Tables=odbc_result($result, 1);
echo $Tables.'<br/>';
}
?>
展开阅读全文

没有更多推荐了,返回首页