As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

BigQuery Format Options

class google.cloud.bigquery.format_options.AvroOptions[source]

Options if source format is set to AVRO.

classmethod from_api_repr(resource: Dict[str, bool]) google.cloud.bigquery.format_options.AvroOptions[source]

Factory: construct an instance from a resource dict.

Parameters

resource (Dict[str, bool]) – Definition of a AvroOptions instance in the same representation as is returned from the API.

Returns

Configuration parsed from resource.

Return type

AvroOptions

to_api_repr() dict[source]

Build an API representation of this object.

Returns

A dictionary in the format used by the BigQuery API.

Return type

Dict[str, bool]

property use_avro_logical_types: Optional[bool]

[Optional] If sourceFormat is set to ‘AVRO’, indicates whether to interpret logical types as the corresponding BigQuery data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER).

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#AvroOptions.FIELDS.use_avro_logical_types

class google.cloud.bigquery.format_options.ParquetOptions[source]

Additional options if the PARQUET source format is used.

property enable_list_inference: bool

Indicates whether to use schema inference specifically for Parquet LIST logical type.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ParquetOptions.FIELDS.enable_list_inference

property enum_as_string: bool

Indicates whether to infer Parquet ENUM logical type as STRING instead of BYTES by default.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#ParquetOptions.FIELDS.enum_as_string

classmethod from_api_repr(resource: Dict[str, bool]) google.cloud.bigquery.format_options.ParquetOptions[source]

Factory: construct an instance from a resource dict.

Parameters

resource (Dict[str, bool]) – Definition of a ParquetOptions instance in the same representation as is returned from the API.

Returns

Configuration parsed from resource.

Return type

ParquetOptions

property map_target_type: str

Indicates whether to simplify the representation of parquet maps to only show keys and values.

to_api_repr() dict[source]

Build an API representation of this object.

Returns

A dictionary in the format used by the BigQuery API.

Return type

Dict[str, bool]