Reference documentation and code samples for the BigQuery Client class Job.
Jobs are objects that manage asynchronous tasks such as running queries, loading data, and exporting data.
Namespace
Google \ Cloud \ BigQueryMethods
__construct
connection
Google\Cloud\BigQuery\Connection\ConnectionInterface
Represents a connection to BigQuery. This object is created by BigQueryClient, and should not be instantiated outside of this client.
id
string
The job's ID.
projectId
string
The project's ID.
mapper
info
array
[optional] The job's metadata.
location
string|null
[optional] A default geographic location, used when no job metadata exists.
exists
Check whether or not the job exists.
Example:
echo $job->exists();
bool
cancel
See also:
options
array
[optional] Configuration options.
queryResults
See also:
options
array
Configuration options.
↳ maxResults
int
Maximum number of results to read per page.
↳ startIndex
int
Zero-based index of the starting row.
↳ initialTimeoutMs
int
How long, in milliseconds, to wait for query results to become available before timing out. Defaults to 0
milliseconds (0 seconds). Please note that this option is used only for the initial call to get query results. To control the timeout for any subsequent calls while polling for query results to complete, please see the $timeoutMs
option.
↳ timeoutMs
int
How long, in milliseconds, each API call will wait for query results to become available before timing out. Depending on whether the $maxRetries has been exceeded, the results will be polled again after the timeout has been reached. Defaults to 10000
milliseconds (10 seconds). Please note that this option is used when iterating on the returned class, and will not apply immediately upon calling of this method.
↳ maxRetries
int
The number of times to poll the Job status, until the job is complete. By default, will poll indefinitely. Please note that this option is used when iterating on the returned class, and will not block immediately upon calling of this method.
waitUntilComplete
Blocks until the job is complete.
Example:
$job->waitUntilComplete();
options
array
Configuration options.
↳ maxRetries
int
The number of times to poll the Job status, until the job is complete. By default, will poll indefinitely.
isComplete
Checks the job's completeness.
Useful in combination with Google\Cloud\BigQuery\Job::reload() to poll for job status.
Example:
$isComplete = $job->isComplete();
while (!$isComplete) {
sleep(1); // let's wait for a moment...
$job->reload();
$isComplete = $job->isComplete();
}
echo 'Query complete!';
options
array
[optional] Configuration options.
bool
info
See also:
options
array
[optional] Configuration options.
array
reload
See also:
options
array
[optional] Configuration options.
array
id
Retrieves the job's ID.
Example:
echo $job->id();
string
identity
Retrieves the job's identity.
An identity provides a description of a nested resource.
Example:
echo $job->identity()['projectId'];
array
Constants
MAX_RETRIES
Value: PHP_INT_MAX