public runQueryAsJob ( string $query, array $options = [] ) : |
||
$query | string | A BigQuery SQL query. |
$options | array | [optional] { Configuration options. @type array $parameters Only available for standard SQL queries. When providing a non-associative array positional parameters (`?`) will be used. When providing an associative array named parameters will be used (`@name`). @type array $jobConfig Configuration settings for a query job are outlined in the [API Docs for `configuration.query`](https://goo.gl/PuRa3I). If not provided default settings will be used. } |
Résultat |
public function runQueryAsJob($query, array $options = [])
{
if (isset($options['parameters'])) {
if (!isset($options['jobConfig'])) {
$options['jobConfig'] = [];
}
$options['jobConfig'] += $this->formatQueryParameters($options['parameters']);
unset($options['parameters']);
}
$config = $this->buildJobConfig('query', $this->projectId, ['query' => $query], $options);
$response = $this->connection->insertJob($config);
return new Job($this->connection, $response['jobReference']['jobId'], $this->projectId, $response, $this->mapper);
}