Jobs#
Define API Jobs.
-
class
gcloud.bigquery.job.Compression(name)[source]# Bases:
gcloud.bigquery._helpers._EnumPropertyPseudo-enum for
compressionproperties.
-
class
gcloud.bigquery.job.CopyJob(name, destination, sources, client)[source]# Bases:
gcloud.bigquery.job._AsyncJobAsynchronous job: copy data into a table from other tables.
Parameters: - name (string) – the name of the job
- destination (
gcloud.bigquery.table.Table) – Table into which data is to be loaded. - sources (list of
gcloud.bigquery.table.Table) – Table into which data is to be loaded. - client (
gcloud.bigquery.client.Client) – A client which holds credentials and project configuration for the dataset (which requires a project).
-
create_disposition# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy.createDisposition
-
classmethod
from_api_repr(resource, client)[source]# Factory: construct a job given its API representation
Parameters: - resource (dict) – dataset job representation returned from the API
- client (
gcloud.bigquery.client.Client) – Client which holds credentials and project configuration for the dataset.
Return type: Returns: Job parsed from
resource.
-
class
gcloud.bigquery.job.CreateDisposition(name)[source]# Bases:
gcloud.bigquery._helpers._EnumPropertyPseudo-enum for
create_dispositionproperties.
-
class
gcloud.bigquery.job.DestinationFormat(name)[source]# Bases:
gcloud.bigquery._helpers._EnumPropertyPseudo-enum for
destination_formatproperties.
-
class
gcloud.bigquery.job.Encoding(name)[source]# Bases:
gcloud.bigquery._helpers._EnumPropertyPseudo-enum for
encodingproperties.
-
class
gcloud.bigquery.job.ExtractTableToStorageJob(name, source, destination_uris, client)[source]# Bases:
gcloud.bigquery.job._AsyncJobAsynchronous job: extract data from a table into Cloud Storage.
Parameters: - name (string) – the name of the job
- source (
gcloud.bigquery.table.Table) – Table into which data is to be loaded. - destination_uris (list of string) – URIs describing Cloud Storage blobs into which
extracted data will be written, in format
gs://<bucket_name>/<object_name_or_glob>. - client (
gcloud.bigquery.client.Client) – A client which holds credentials and project configuration for the dataset (which requires a project).
-
compression# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.extracted.compression
-
destination_format# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.extracted.destinationFormat
-
field_delimiter# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.extracted.fieldDelimiter
-
classmethod
from_api_repr(resource, client)[source]# Factory: construct a job given its API representation
Parameters: - resource (dict) – dataset job representation returned from the API
- client (
gcloud.bigquery.client.Client) – Client which holds credentials and project configuration for the dataset.
Return type: Returns: Job parsed from
resource.
-
class
gcloud.bigquery.job.LoadTableFromStorageJob(name, destination, source_uris, client, schema=())[source]# Bases:
gcloud.bigquery.job._AsyncJobAsynchronous job for loading data into a table from CloudStorage.
Parameters: - name (string) – the name of the job
- destination (
gcloud.bigquery.table.Table) – Table into which data is to be loaded. - source_uris (sequence of string) – URIs of one or more data files to be loaded, in
format
gs://<bucket_name>/<object_name_or_glob>. - client (
gcloud.bigquery.client.Client) – A client which holds credentials and project configuration for the dataset (which requires a project). - schema (list of
gcloud.bigquery.table.SchemaField) – The job’s schema
-
allow_jagged_rows# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.allowJaggedRows
-
allow_quoted_newlines# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.allowQuotedNewlines
-
create_disposition# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.createDisposition
-
field_delimiter# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.fieldDelimiter
-
classmethod
from_api_repr(resource, client)[source]# Factory: construct a job given its API representation
Parameters: - resource (dict) – dataset job representation returned from the API
- client (
gcloud.bigquery.client.Client) – Client which holds credentials and project configuration for the dataset.
Return type: Returns: Job parsed from
resource.
-
ignore_unknown_values# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.ignoreUnknownValues
-
input_file_bytes# Count of bytes loaded from source files.
Return type: integer, or NoneTypeReturns: the count (None until set from the server).
-
input_files# Count of source files.
Return type: integer, or NoneTypeReturns: the count (None until set from the server).
-
max_bad_records# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.maxBadRecords
-
output_bytes# Count of bytes saved to destination table.
Return type: integer, or NoneTypeReturns: the count (None until set from the server).
-
output_rows# Count of rows saved to destination table.
Return type: integer, or NoneTypeReturns: the count (None until set from the server).
-
quote_character# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.quote
-
schema# Table’s schema.
Return type: list of SchemaFieldReturns: fields describing the schema
-
skip_leading_rows# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load.skipLeadingRows
-
class
gcloud.bigquery.job.QueryJob(name, query, client)[source]# Bases:
gcloud.bigquery.job._AsyncJobAsynchronous job: query tables.
Parameters: - name (string) – the name of the job
- query (string) – SQL query string
- client (
gcloud.bigquery.client.Client) – A client which holds credentials and project configuration for the dataset (which requires a project).
-
allow_large_results# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.allowLargeResults
-
create_disposition# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.createDisposition
-
default_dataset# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.defaultDataset
-
destination# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.destinationTable
-
flatten_results# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.flattenResults
-
classmethod
from_api_repr(resource, client)[source]# Factory: construct a job given its API representation
Parameters: - resource (dict) – dataset job representation returned from the API
- client (
gcloud.bigquery.client.Client) – Client which holds credentials and project configuration for the dataset.
Return type: gcloud.bigquery.job.RunAsyncQueryJobReturns: Job parsed from
resource.
-
priority# See: https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query.priority
-
class
gcloud.bigquery.job.QueryPriority(name)[source]# Bases:
gcloud.bigquery._helpers._EnumPropertyPseudo-enum for
QueryJob.priorityproperty.