Package com.google.cloud.bigquery
Class WriteChannelConfiguration
- java.lang.Object
-
- com.google.cloud.bigquery.WriteChannelConfiguration
-
- All Implemented Interfaces:
LoadConfiguration,Serializable
public final class WriteChannelConfiguration extends Object implements LoadConfiguration, Serializable
Google BigQuery Configuration for a load operation. A load configuration can be used to load data into a table with aWriteChannel(BigQuery.writer(WriteChannelConfiguration)).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWriteChannelConfiguration.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedWriteChannelConfiguration(WriteChannelConfiguration.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)BooleangetAutodetect()[Experimental] Returns whether automatic inference of the options and schema for CSV and JSON sources is set.ClusteringgetClustering()Returns the clustering specification for the definition table.List<ConnectionProperty>getConnectionProperties()JobInfo.CreateDispositiongetCreateDisposition()Returns whether the job is allowed to create new tables.BooleangetCreateSession()CsvOptionsgetCsvOptions()Returns additional properties used to parse CSV data (used whenLoadConfiguration.getFormat()is set to CSV).DatastoreBackupOptionsgetDatastoreBackupOptions()Returns additional options used to load from a Cloud datastore backup.List<String>getDecimalTargetTypes()Returns the list of possible SQL data types to which the source decimal values are converted.EncryptionConfigurationgetDestinationEncryptionConfiguration()TableIdgetDestinationTable()Returns the destination table to load the data into.StringgetFormat()Returns the format of the data files.Map<String,String>getLabels()IntegergetMaxBadRecords()Returns the maximum number of bad records that BigQuery can ignore when running the job.StringgetNullMarker()Returns the string that represents a null value in a CSV file.SchemagetSchema()Returns the schema for the destination table, if set.List<JobInfo.SchemaUpdateOption>getSchemaUpdateOptions()[Experimental] Returns options allowing the schema of the destination table to be updated as a side effect of the load job.TimePartitioninggetTimePartitioning()Returns the time partitioning specification defined for the destination table.BooleangetUseAvroLogicalTypes()Returns True/False.JobInfo.WriteDispositiongetWriteDisposition()Returns the action that should occur if the destination table already exists.inthashCode()BooleanignoreUnknownValues()Returns whether BigQuery should allow extra values that are not represented in the table schema.static WriteChannelConfiguration.BuildernewBuilder(TableId destinationTable)Creates a builder for a BigQuery Load Configuration given the destination table.static WriteChannelConfiguration.BuildernewBuilder(TableId destinationTable, FormatOptions format)Creates a builder for a BigQuery Load Configuration given the destination table and format.static WriteChannelConfigurationof(TableId destinationTable)Returns a BigQuery Load Configuration for the given destination table.static WriteChannelConfigurationof(TableId destinationTable, FormatOptions format)Returns a BigQuery Load Configuration for the given destination table and format.WriteChannelConfiguration.BuildertoBuilder()Returns a builder for the load configuration object.StringtoString()
-
-
-
Constructor Detail
-
WriteChannelConfiguration
protected WriteChannelConfiguration(WriteChannelConfiguration.Builder builder)
-
-
Method Detail
-
getDestinationTable
public TableId getDestinationTable()
Description copied from interface:LoadConfigurationReturns the destination table to load the data into.- Specified by:
getDestinationTablein interfaceLoadConfiguration
-
getDestinationEncryptionConfiguration
public EncryptionConfiguration getDestinationEncryptionConfiguration()
- Specified by:
getDestinationEncryptionConfigurationin interfaceLoadConfiguration
-
getCreateDisposition
public JobInfo.CreateDisposition getCreateDisposition()
Description copied from interface:LoadConfigurationReturns whether the job is allowed to create new tables.- Specified by:
getCreateDispositionin interfaceLoadConfiguration- See Also:
- Create Disposition
-
getWriteDisposition
public JobInfo.WriteDisposition getWriteDisposition()
Description copied from interface:LoadConfigurationReturns the action that should occur if the destination table already exists.- Specified by:
getWriteDispositionin interfaceLoadConfiguration- See Also:
- Write Disposition
-
getNullMarker
public String getNullMarker()
Description copied from interface:LoadConfigurationReturns the string that represents a null value in a CSV file.- Specified by:
getNullMarkerin interfaceLoadConfiguration- See Also:
- Null Marker
-
getCsvOptions
public CsvOptions getCsvOptions()
Description copied from interface:LoadConfigurationReturns additional properties used to parse CSV data (used whenLoadConfiguration.getFormat()is set to CSV). Returnsnullif not set.- Specified by:
getCsvOptionsin interfaceLoadConfiguration
-
getMaxBadRecords
public Integer getMaxBadRecords()
Description copied from interface:LoadConfigurationReturns 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.- Specified by:
getMaxBadRecordsin interfaceLoadConfiguration
-
getSchema
public Schema getSchema()
Description copied from interface:LoadConfigurationReturns the schema for the destination table, if set. Returnsnullotherwise.- Specified by:
getSchemain interfaceLoadConfiguration
-
getFormat
public String getFormat()
Description copied from interface:LoadConfigurationReturns the format of the data files.- Specified by:
getFormatin interfaceLoadConfiguration
-
ignoreUnknownValues
public Boolean ignoreUnknownValues()
Description copied from interface:LoadConfigurationReturns whether BigQuery should allow extra values that are not represented in the table schema. Iftrue, the extra values are ignored. Iftrue, 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.- Specified by:
ignoreUnknownValuesin interfaceLoadConfiguration
-
getDatastoreBackupOptions
public DatastoreBackupOptions getDatastoreBackupOptions()
Description copied from interface:LoadConfigurationReturns additional options used to load from a Cloud datastore backup.- Specified by:
getDatastoreBackupOptionsin interfaceLoadConfiguration
-
getSchemaUpdateOptions
public List<JobInfo.SchemaUpdateOption> getSchemaUpdateOptions()
Description copied from interface:LoadConfiguration[Experimental] Returns 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.- Specified by:
getSchemaUpdateOptionsin interfaceLoadConfiguration
-
getAutodetect
public Boolean getAutodetect()
Description copied from interface:LoadConfiguration[Experimental] Returns whether automatic inference of the options and schema for CSV and JSON sources is set.- Specified by:
getAutodetectin interfaceLoadConfiguration
-
getTimePartitioning
public TimePartitioning getTimePartitioning()
Description copied from interface:LoadConfigurationReturns the time partitioning specification defined for the destination table.- Specified by:
getTimePartitioningin interfaceLoadConfiguration
-
getClustering
public Clustering getClustering()
Description copied from interface:LoadConfigurationReturns the clustering specification for the definition table.- Specified by:
getClusteringin interfaceLoadConfiguration
-
getUseAvroLogicalTypes
public Boolean getUseAvroLogicalTypes()
Description copied from interface:LoadConfigurationReturns True/False. Indicates whether the logical type is interpreted.- Specified by:
getUseAvroLogicalTypesin interfaceLoadConfiguration
-
getDecimalTargetTypes
public List<String> getDecimalTargetTypes()
Description copied from interface:LoadConfigurationReturns 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.- Specified by:
getDecimalTargetTypesin interfaceLoadConfiguration
-
getConnectionProperties
public List<ConnectionProperty> getConnectionProperties()
-
getCreateSession
public Boolean getCreateSession()
-
toBuilder
public WriteChannelConfiguration.Builder toBuilder()
Description copied from interface:LoadConfigurationReturns a builder for the load configuration object.- Specified by:
toBuilderin interfaceLoadConfiguration
-
newBuilder
public static WriteChannelConfiguration.Builder newBuilder(TableId destinationTable)
Creates a builder for a BigQuery Load Configuration given the destination table.
-
newBuilder
public static WriteChannelConfiguration.Builder newBuilder(TableId destinationTable, FormatOptions format)
Creates a builder for a BigQuery Load Configuration given the destination table and format.
-
of
public static WriteChannelConfiguration of(TableId destinationTable)
Returns a BigQuery Load Configuration for the given destination table.
-
of
public static WriteChannelConfiguration of(TableId destinationTable, FormatOptions format)
Returns a BigQuery Load Configuration for the given destination table and format.
-
-