google.cloud.bigquery.job.QueryJobConfig¶
-
class
google.cloud.bigquery.job.
QueryJobConfig
(**kwargs)[source]¶ Configuration options for query jobs.
All properties in this class are optional. Values which are
None
-> server defaults. Set properties on the constructed configuration by using the property name as the name of a keyword argument.Methods
__init__
(**kwargs)Initialize self.
from_api_repr
(resource)Factory: construct a job configuration given its API representation
Build an API representation of the query job config.
Attributes
Allow large query results tables (legacy SQL, only)
Fields defining clustering for the table
Specifies behavior for creating tables.
the default dataset to use for unqualified table names in the query or
None
if not set.table where results are written or
None
if not set.Custom encryption configuration for the destination table.
True
if this query should be a dry run to estimate costs.Flatten nested/repeated fields in results.
labels
Labels for the job.
Deprecated.
Maximum bytes to be billed for this job or
None
if not set.Priority of the query.
list of parameters for parameterized query (empty by default)
Optional[google.cloud.bigquery.table.RangePartitioning]: Configures range-based partitioning for destination table.
Specifies updates to the destination table schema to allow as a side effect of the query job.
Dict[str, google.cloud.bigquery.external_config.ExternalConfig]: Definitions for external tables or
None
if not set.Specifies time-based partitioning for the destination table.
user defined function resources (empty by default)
Use legacy SQL syntax.
Look for the query result in the cache.
Action that occurs if the destination table already exists.
-
property
allow_large_results
¶ Allow large query results tables (legacy SQL, only)
- Type
-
property
clustering_fields
¶ Fields defining clustering for the table
(Defaults to
None
).Clustering fields are immutable after table creation.
Note
As of 2018-06-29, clustering fields cannot be set on a table which does not also have time partioning defined.
- Type
Optional[List[str]]
-
property
create_disposition
¶ Specifies behavior for creating tables.
-
property
default_dataset
¶ the default dataset to use for unqualified table names in the query or
None
if not set.The
default_dataset
setter accepts:a
Dataset
, ora
DatasetReference
, ora
str
of the fully-qualified dataset ID in standard SQL format. The value must included a project ID and dataset ID separated by.
. For example:your-project.your_dataset
.
-
property
destination
¶ table where results are written or
None
if not set.The
destination
setter accepts:a
Table
, ora
TableReference
, ora
str
of the fully-qualified table ID in standard SQL format. The value must included a project ID, dataset ID, and table ID, each separated by.
. For example:your-project.your_dataset.your_table
.
-
property
destination_encryption_configuration
¶ Custom encryption configuration for the destination table.
Custom encryption configuration (e.g., Cloud KMS keys) or
None
if using default encryption.
-
property
dry_run
¶ True
if this query should be a dry run to estimate costs.See https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfiguration.FIELDS.dry_run
- Type
-
property
flatten_results
¶ Flatten nested/repeated fields in results. (Legacy SQL only)
- Type
-
property
maximum_billing_tier
¶ Deprecated. Changes the billing tier to allow high-compute queries.
- Type
-
property
priority
¶ Priority of the query.
See https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationQuery.FIELDS.priority
-
property
query_parameters
¶ list of parameters for parameterized query (empty by default)
-
property
range_partitioning
¶ Optional[google.cloud.bigquery.table.RangePartitioning]: Configures range-based partitioning for destination table.
Note
Beta. The integer range partitioning feature is in a pre-release state and might change or have limited support.
Only specify at most one of
time_partitioning
orrange_partitioning
.- Raises
ValueError – If the value is not
RangePartitioning
orNone
.
-
property
schema_update_options
¶ Specifies updates to the destination table schema to allow as a side effect of the query job.
- Type
-
property
table_definitions
¶ Dict[str, google.cloud.bigquery.external_config.ExternalConfig]: Definitions for external tables or
None
if not set.
-
property
time_partitioning
¶ Specifies time-based partitioning for the destination table.
Only specify at most one of
time_partitioning
orrange_partitioning
.- Raises
ValueError – If the value is not
TimePartitioning
orNone
.- Type
-
to_api_repr
()[source]¶ Build an API representation of the query job config.
- Returns
A dictionary in the format used by the BigQuery API.
- Return type
Dict
-
property
udf_resources
¶ user defined function resources (empty by default)
- Type
-
property
use_legacy_sql
¶ Use legacy SQL syntax.
- Type
-
property
use_query_cache
¶ Look for the query result in the cache.
- Type
-
property
write_disposition
¶ Action that occurs if the destination table already exists.
-
property