Package com.google.cloud.bigquery
Interface LoadConfiguration.Builder
-
- All Known Implementing Classes:
LoadJobConfiguration.Builder
,WriteChannelConfiguration.Builder
- Enclosing interface:
- LoadConfiguration
public static interface LoadConfiguration.Builder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LoadConfiguration
build()
LoadConfiguration.Builder
setAutodetect(Boolean autodetect)
[Experimental] Sets automatic inference of the options and schema for CSV and JSON sources.LoadConfiguration.Builder
setClustering(Clustering clustering)
Sets the clustering specification for the destination table.LoadConfiguration.Builder
setCreateDisposition(JobInfo.CreateDisposition createDisposition)
Sets whether the job is allowed to create new tables.LoadConfiguration.Builder
setDecimalTargetTypes(List<String> decimalTargetTypes)
Defines the list of possible SQL data types to which the source decimal values are converted.LoadConfiguration.Builder
setDestinationEncryptionConfiguration(EncryptionConfiguration encryptionConfiguration)
LoadConfiguration.Builder
setDestinationTable(TableId destinationTable)
Sets the destination table to load the data into.LoadConfiguration.Builder
setFormatOptions(FormatOptions formatOptions)
Sets the source format, and possibly some parsing options, of the external data.LoadConfiguration.Builder
setIgnoreUnknownValues(Boolean ignoreUnknownValues)
Sets whether BigQuery should allow extra values that are not represented in the table schema.LoadConfiguration.Builder
setMaxBadRecords(Integer maxBadRecords)
Sets the maximum number of bad records that BigQuery can ignore when running the job.LoadConfiguration.Builder
setNullMarker(String nullMarker)
Sets the string that represents a null value in a CSV file.LoadConfiguration.Builder
setSchema(Schema schema)
Sets the schema for the destination table.LoadConfiguration.Builder
setSchemaUpdateOptions(List<JobInfo.SchemaUpdateOption> schemaUpdateOptions)
[Experimental] Sets options allowing the schema of the destination table to be updated as a side effect of the load job.LoadConfiguration.Builder
setTimePartitioning(TimePartitioning timePartitioning)
Sets the time partitioning specification for the destination table.LoadConfiguration.Builder
setUseAvroLogicalTypes(Boolean useAvroLogicalTypes)
If FormatOptions is set to AVRO, you can interpret logical types into their corresponding types (such as TIMESTAMP) instead of only using their raw types (such as INTEGER).LoadConfiguration.Builder
setWriteDisposition(JobInfo.WriteDisposition writeDisposition)
Sets the action that should occur if the destination table already exists.
-
-
-
Method Detail
-
setDestinationTable
LoadConfiguration.Builder setDestinationTable(TableId destinationTable)
Sets the destination table to load the data into.
-
setDestinationEncryptionConfiguration
LoadConfiguration.Builder setDestinationEncryptionConfiguration(EncryptionConfiguration encryptionConfiguration)
-
setCreateDisposition
LoadConfiguration.Builder setCreateDisposition(JobInfo.CreateDisposition createDisposition)
Sets whether the job is allowed to create new tables.- See Also:
- Create Disposition
-
setWriteDisposition
LoadConfiguration.Builder setWriteDisposition(JobInfo.WriteDisposition writeDisposition)
Sets the action that should occur if the destination table already exists.- See Also:
- Write Disposition
-
setFormatOptions
LoadConfiguration.Builder setFormatOptions(FormatOptions formatOptions)
Sets the source format, and possibly some parsing options, of the external data. Supported formats areCSV
,NEWLINE_DELIMITED_JSON
andDATASTORE_BACKUP
. If not specified,CSV
format is assumed.
-
setNullMarker
LoadConfiguration.Builder setNullMarker(String nullMarker)
Sets the string that represents a null value in a CSV file. For example, if you specify "\N", BigQuery interprets "\N" as a null value when loading a CSV file. The default value is the empty string. If you set this property to a custom value, BigQuery throws an error if an empty string is present for all data types except forSTRING
andBYTE
. ForSTRING
andBYTE
columns, BigQuery interprets the empty string as an empty value.
-
setMaxBadRecords
LoadConfiguration.Builder setMaxBadRecords(Integer maxBadRecords)
Sets the maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an invalid error is returned in the job result. By default no bad record is ignored.
-
setSchema
LoadConfiguration.Builder setSchema(Schema schema)
Sets the schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from a Google Cloud Datastore backup (i.e.DATASTORE_BACKUP
format option).
-
setIgnoreUnknownValues
LoadConfiguration.Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues)
Sets whether BigQuery should allow extra values that are not represented in the table schema. Iftrue
, the extra values are ignored. Iffalse
, 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. By default unknown values are not allowed.
-
setSchemaUpdateOptions
LoadConfiguration.Builder setSchemaUpdateOptions(List<JobInfo.SchemaUpdateOption> schemaUpdateOptions)
[Experimental] Sets options allowing the schema of the destination table to be updated as a side effect of the load job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema.
-
setAutodetect
LoadConfiguration.Builder setAutodetect(Boolean autodetect)
[Experimental] Sets automatic inference of the options and schema for CSV and JSON sources.
-
setTimePartitioning
LoadConfiguration.Builder setTimePartitioning(TimePartitioning timePartitioning)
Sets the time partitioning specification for the destination table.
-
setClustering
LoadConfiguration.Builder setClustering(Clustering clustering)
Sets the clustering specification for the destination table.
-
setUseAvroLogicalTypes
LoadConfiguration.Builder setUseAvroLogicalTypes(Boolean useAvroLogicalTypes)
If FormatOptions is set to AVRO, you can interpret logical types into their corresponding types (such as TIMESTAMP) instead of only using their raw types (such as INTEGER). The value may benull
.
-
setDecimalTargetTypes
LoadConfiguration.Builder setDecimalTargetTypes(List<String> decimalTargetTypes)
Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values.- Parameters:
decimalTargetTypes
- decimalTargetType ornull
for none
-
build
LoadConfiguration build()
-
-