TableExternalDataConfiguration

data class TableExternalDataConfiguration(val autodetect: Boolean, val avroOptions: TableExternalDataConfigurationAvroOptions? = null, val compression: String? = null, val connectionId: String? = null, val csvOptions: TableExternalDataConfigurationCsvOptions? = null, val googleSheetsOptions: TableExternalDataConfigurationGoogleSheetsOptions? = null, val hivePartitioningOptions: TableExternalDataConfigurationHivePartitioningOptions? = null, val ignoreUnknownValues: Boolean? = null, val maxBadRecords: Int? = null, val referenceFileSchemaUri: String? = null, val schema: String? = null, val sourceFormat: String, val sourceUris: List<String>)

Constructors

Link copied to clipboard
fun TableExternalDataConfiguration(autodetect: Boolean, avroOptions: TableExternalDataConfigurationAvroOptions? = null, compression: String? = null, connectionId: String? = null, csvOptions: TableExternalDataConfigurationCsvOptions? = null, googleSheetsOptions: TableExternalDataConfigurationGoogleSheetsOptions? = null, hivePartitioningOptions: TableExternalDataConfigurationHivePartitioningOptions? = null, ignoreUnknownValues: Boolean? = null, maxBadRecords: Int? = null, referenceFileSchemaUri: String? = null, schema: String? = null, sourceFormat: String, sourceUris: List<String>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Let BigQuery try to autodetect the schema and format of the table.

Link copied to clipboard

Additional options if source_format is set to "AVRO". Structure is documented below.

Link copied to clipboard
val compression: String? = null

The compression type of the data source. Valid values are "NONE" or "GZIP".

Link copied to clipboard
val connectionId: String? = null

The connection specifying the credentials to be used to read external storage, such as Azure Blob, Cloud Storage, or S3. The connection_id can have the form {{project}}.{{location}}.{{connection_id}} or projects/{{project}}/locations/{{location}}/connections/{{connection_id}}.

Link copied to clipboard

Additional properties to set if source_format is set to "CSV". Structure is documented below.

Link copied to clipboard

Additional options if source_format is set to "GOOGLE_SHEETS". Structure is documented below.

Link copied to clipboard

When set, configures hive partitioning support. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error, as will providing an invalid specification. Structure is documented below.

Link copied to clipboard

Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false.

Link copied to clipboard
val maxBadRecords: Int? = null

The maximum number of bad records that BigQuery can ignore when reading data.

Link copied to clipboard

When creating an external table, the user can provide a reference file with the table schema. This is enabled for the following formats: AVRO, PARQUET, ORC.

Link copied to clipboard
val schema: String? = null

A JSON schema for the external table. Schema is required for CSV and JSON formats if autodetect is not on. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, Avro, ORC and Parquet formats. ~>NOTE: Because this field expects a JSON string, any changes to the string will create a diff, even if the JSON itself hasn't changed. Furthermore drift for this field cannot not be detected because BigQuery only uses this schema to compute the effective schema for the table, therefore any changes on the configured value will force the table to be recreated. This schema is effectively only applied when creating a table from an external datasource, after creation the computed schema will be stored in google_bigquery_table.schema

Link copied to clipboard

The data format. Supported values are: "CSV", "GOOGLE_SHEETS", "NEWLINE_DELIMITED_JSON", "AVRO", "PARQUET", "ORC", "DATSTORE_BACKUP", and "BIGTABLE". To use "GOOGLE_SHEETS" the scopes must include "https://www.googleapis.com/auth/drive.readonly".

Link copied to clipboard

A list of the fully-qualified URIs that point to your data in Google Cloud.