tranch-xiao/php-thrift-impala

用于Impala和Hive查询的PHP Thrift客户端

v0.1.2 2015-07-24 02:01 UTC

This package is auto-updated.

Last update: 2024-09-07 19:08:18 UTC


README

该项目基于 Automattic/php-thrift-sql.

目前支持以下引擎

  • Hive -- 通过HiveServer2 Thrift接口,默认启用SASL,因此必须提供用户名和密码。然而,可以在调用connect()之前使用setSasl()方法将其关闭。
  • Impala -- 通过扩展Beeswax协议的Impala服务Thrift接口。

使用示例

// Load this lib
require_once __DIR__ . '/vendor/autoload.php';

// Try out an Impala query
$impala = new \ThriftSQL\Impala( 'hd-node1' );
$impalaTables = $impala
  ->connect()
  ->queryAndFetchAll( 'SHOW TABLES' );
print_r( $impalaTables );

// Don't forget to clear the client and close socket.
$impala->disconnect();