Download Mac driver and install: http://www.cloudera.com/downloads.html.html
The *host address is the machine IP where Impala daemon resides, and the port can be set in 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.dylibHOST=192.168.2.103PORT=21050
Vi/usr/local/cellar/unixodbc/2.3.2_1/etc/odbcinst.ini
[ODBCDrivers]ClouderaImpalaODBCDriver64-bit=Installed[ClouderaImpalaODBCDriver64-bit]Description=ClouderaImpalaODBCDriver (64-bit)Driver=/opt/cloudera/impalaodbc/lib/universal/libclouderaimpalaodbc.dylib
Test:
Isql-v sample_cloudera_impala_dsn_64
PHP Connection:
$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.'
';}?>
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the Mac configuration Impala ODBC, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.