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);
}