PHP code example of axm-sysdev / td-client-php

1. Go to this page and download the library: Download axm-sysdev/td-client-php 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/ */

    

axm-sysdev / td-client-php example snippets




XM\TD\Client;
use AXM\TD\Job;

$client = new Client('YOUR-API-KEY-HERE');

$jobId = $client->query('mydatabase', 'hive', 'SELECT * FROM mytable WHERE value >= 500');

while (true) {
    $status = $client->jobStatus($jobId);
    if (Job::isFinished($status)) {
        break;
    }
    sleep(1);
}

$result = $client->jobResult($jobId);

$client->hiveQuery($dbName, $query, ['priority' => Job::PRIORITY_VERY_HIGH, 'engine_version' => 'stable']);

$options['client_config'] = ['timeout' => 1];

$client = new Client('YOUR-API-KEY-HERE', $options);

composer