PHP code example of semir / laravel2impala

1. Go to this page and download the library: Download semir/laravel2impala library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

semir / laravel2impala example snippets


use App\Http\Proxy\ImpalaProxy;
$sql = "show tables";
// $keys 参数可选传,如果不传则返回纯数据(没有key只有value);如果传值,需要与select后的属性相对应
$keys = []; 
// 返回数组 只有value
$result1 = ImpalaProxy::getInstance()->execute($sql);
// 返回数组 key=>value 形式
$result2 = ImpalaProxy::getInstance()->execute($sql, $keys);
print_r($result1);
print_r($result2);