Package com.google.cloud.bigquery
Class LoadJobConfiguration
- java.lang.Object
-
- com.google.cloud.bigquery.JobConfiguration
-
- com.google.cloud.bigquery.LoadJobConfiguration
-
- All Implemented Interfaces:
LoadConfiguration
,Serializable
public final class LoadJobConfiguration extends JobConfiguration implements LoadConfiguration
Google BigQuery load job configuration. A load job loads data from one of several formats into a table. Data is provided as URIs that point to objects in Google Cloud Storage. Load job configurations haveJobConfiguration.Type.LOAD
type.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LoadJobConfiguration.Builder
-
Nested classes/interfaces inherited from class com.google.cloud.bigquery.JobConfiguration
JobConfiguration.Type
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LoadJobConfiguration.Builder
builder(TableId destinationTable, String sourceUri)
Creates a builder for a BigQuery Load Job configuration given the destination table and source URI.boolean
equals(Object obj)
Boolean
getAutodetect()
[Experimental] Returns whether automatic inference of the options and schema for CSV and JSON sources is set.Clustering
getClustering()
Returns the clustering specification for the definition table.List<ConnectionProperty>
getConnectionProperties()
JobInfo.CreateDisposition
getCreateDisposition()
Returns whether the job is allowed to create new tables.Boolean
getCreateSession()
CsvOptions
getCsvOptions()
Returns additional properties used to parse CSV data (used whenLoadConfiguration.getFormat()
is set to CSV).DatastoreBackupOptions
getDatastoreBackupOptions()
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.EncryptionConfiguration
getDestinationEncryptionConfiguration()
TableId
getDestinationTable()
Returns the destination table to load the data into.String
getFormat()
Returns the format of the data files.HivePartitioningOptions
getHivePartitioningOptions()
Long
getJobTimeoutMs()
Returns the timeout associated with this jobMap<String,String>
getLabels()
Returns the labels associated with this jobInteger
getMaxBadRecords()
Returns the maximum number of bad records that BigQuery can ignore when running the job.String
getNullMarker()
Returns the string that represents a null value in a CSV file.ParquetOptions
getParquetOptions()
RangePartitioning
getRangePartitioning()
Returns the range partitioning specification for the tableString
getReferenceFileSchemaUri()
Schema
getSchema()
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.List<String>
getSourceUris()
Returns the fully-qualified URIs that point to source data in Google Cloud Storage (e.g.TimePartitioning
getTimePartitioning()
Returns the time partitioning specification defined for the destination table.Boolean
getUseAvroLogicalTypes()
Returns True/False.JobInfo.WriteDisposition
getWriteDisposition()
Returns the action that should occur if the destination table already exists.int
hashCode()
Boolean
ignoreUnknownValues()
Returns whether BigQuery should allow extra values that are not represented in the table schema.static LoadJobConfiguration.Builder
newBuilder(TableId destinationTable, String sourceUri)
Creates a builder for a BigQuery Load Job configuration given the destination table and source URI.static LoadJobConfiguration.Builder
newBuilder(TableId destinationTable, String sourceUri, FormatOptions format)
Creates a builder for a BigQuery Load Job configuration given the destination table, format and source URI.static LoadJobConfiguration.Builder
newBuilder(TableId destinationTable, List<String> sourceUris)
Creates a builder for a BigQuery Load Job configuration given the destination table and source URIs.static LoadJobConfiguration.Builder
newBuilder(TableId destinationTable, List<String> sourceUris, FormatOptions format)
Creates a builder for a BigQuery Load Job configuration given the destination table, format and source URIs.static LoadJobConfiguration
of(TableId destinationTable, String sourceUri)
Returns a BigQuery Load Job Configuration for the given destination table and source URI.static LoadJobConfiguration
of(TableId destinationTable, String sourceUri, FormatOptions format)
Returns a BigQuery Load Job Configuration for the given destination table, format and source URI.static LoadJobConfiguration
of(TableId destinationTable, List<String> sourceUris)
Returns a BigQuery Load Job Configuration for the given destination table and source URIs.static LoadJobConfiguration
of(TableId destinationTable, List<String> sourceUris, FormatOptions format)
Returns a BigQuery Load Job Configuration for the given destination table, format and source URI.LoadJobConfiguration.Builder
toBuilder()
Returns a builder for the object.-
Methods inherited from class com.google.cloud.bigquery.JobConfiguration
getType, toString
-
-
-
-
Method Detail
-
getDestinationTable
public TableId getDestinationTable()
Description copied from interface:LoadConfiguration
Returns the destination table to load the data into.- Specified by:
getDestinationTable
in interfaceLoadConfiguration
-
getDestinationEncryptionConfiguration
public EncryptionConfiguration getDestinationEncryptionConfiguration()
- Specified by:
getDestinationEncryptionConfiguration
in interfaceLoadConfiguration
-
getCreateDisposition
public JobInfo.CreateDisposition getCreateDisposition()
Description copied from interface:LoadConfiguration
Returns whether the job is allowed to create new tables.- Specified by:
getCreateDisposition
in interfaceLoadConfiguration
- See Also:
- Create Disposition
-
getWriteDisposition
public JobInfo.WriteDisposition getWriteDisposition()
Description copied from interface:LoadConfiguration
Returns the action that should occur if the destination table already exists.- Specified by:
getWriteDisposition
in interfaceLoadConfiguration
- See Also:
- Write Disposition
-
getNullMarker
public String getNullMarker()
Description copied from interface:LoadConfiguration
Returns the string that represents a null value in a CSV file.- Specified by:
getNullMarker
in interfaceLoadConfiguration
- See Also:
- Null Marker
-
getCsvOptions
public CsvOptions getCsvOptions()
Description copied from interface:LoadConfiguration
Returns additional properties used to parse CSV data (used whenLoadConfiguration.getFormat()
is set to CSV). Returnsnull
if not set.- Specified by:
getCsvOptions
in interfaceLoadConfiguration
-
getParquetOptions
public ParquetOptions getParquetOptions()
-
getDatastoreBackupOptions
public DatastoreBackupOptions getDatastoreBackupOptions()
Description copied from interface:LoadConfiguration
Returns additional options used to load from a Cloud datastore backup.- Specified by:
getDatastoreBackupOptions
in interfaceLoadConfiguration
-
getFormat
public String getFormat()
Description copied from interface:LoadConfiguration
Returns the format of the data files.- Specified by:
getFormat
in interfaceLoadConfiguration
-
getMaxBadRecords
public Integer getMaxBadRecords()
Description copied from interface:LoadConfiguration
Returns 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:
getMaxBadRecords
in interfaceLoadConfiguration
-
getSchema
public Schema getSchema()
Description copied from interface:LoadConfiguration
Returns the schema for the destination table, if set. Returnsnull
otherwise.- Specified by:
getSchema
in interfaceLoadConfiguration
-
ignoreUnknownValues
public Boolean ignoreUnknownValues()
Description copied from interface:LoadConfiguration
Returns 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:
ignoreUnknownValues
in interfaceLoadConfiguration
-
getSourceUris
public List<String> getSourceUris()
Returns the fully-qualified URIs that point to source data in Google Cloud Storage (e.g. gs://bucket/path). Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.
-
getDecimalTargetTypes
public List<String> getDecimalTargetTypes()
Description copied from interface:LoadConfiguration
Returns 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:
getDecimalTargetTypes
in 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:
getAutodetect
in interfaceLoadConfiguration
-
getTimePartitioning
public TimePartitioning getTimePartitioning()
Description copied from interface:LoadConfiguration
Returns the time partitioning specification defined for the destination table.- Specified by:
getTimePartitioning
in interfaceLoadConfiguration
-
getClustering
public Clustering getClustering()
Description copied from interface:LoadConfiguration
Returns the clustering specification for the definition table.- Specified by:
getClustering
in interfaceLoadConfiguration
-
getUseAvroLogicalTypes
public Boolean getUseAvroLogicalTypes()
Description copied from interface:LoadConfiguration
Returns True/False. Indicates whether the logical type is interpreted.- Specified by:
getUseAvroLogicalTypes
in 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:
getSchemaUpdateOptions
in interfaceLoadConfiguration
-
getJobTimeoutMs
public Long getJobTimeoutMs()
Returns the timeout associated with this job
-
getRangePartitioning
public RangePartitioning getRangePartitioning()
Returns the range partitioning specification for the table
-
getHivePartitioningOptions
public HivePartitioningOptions getHivePartitioningOptions()
-
getReferenceFileSchemaUri
public String getReferenceFileSchemaUri()
-
getConnectionProperties
public List<ConnectionProperty> getConnectionProperties()
-
getCreateSession
public Boolean getCreateSession()
-
toBuilder
public LoadJobConfiguration.Builder toBuilder()
Description copied from class:JobConfiguration
Returns a builder for the object.- Specified by:
toBuilder
in interfaceLoadConfiguration
- Specified by:
toBuilder
in classJobConfiguration
-
newBuilder
public static LoadJobConfiguration.Builder newBuilder(TableId destinationTable, List<String> sourceUris)
Creates a builder for a BigQuery Load Job configuration given the destination table and source URIs.
-
builder
public static LoadJobConfiguration.Builder builder(TableId destinationTable, String sourceUri)
Creates a builder for a BigQuery Load Job configuration given the destination table and source URI.
-
newBuilder
public static LoadJobConfiguration.Builder newBuilder(TableId destinationTable, String sourceUri)
Creates a builder for a BigQuery Load Job configuration given the destination table and source URI.
-
newBuilder
public static LoadJobConfiguration.Builder newBuilder(TableId destinationTable, List<String> sourceUris, FormatOptions format)
Creates a builder for a BigQuery Load Job configuration given the destination table, format and source URIs.
-
newBuilder
public static LoadJobConfiguration.Builder newBuilder(TableId destinationTable, String sourceUri, FormatOptions format)
Creates a builder for a BigQuery Load Job configuration given the destination table, format and source URI.
-
of
public static LoadJobConfiguration of(TableId destinationTable, List<String> sourceUris)
Returns a BigQuery Load Job Configuration for the given destination table and source URIs.
-
of
public static LoadJobConfiguration of(TableId destinationTable, String sourceUri)
Returns a BigQuery Load Job Configuration for the given destination table and source URI.
-
of
public static LoadJobConfiguration of(TableId destinationTable, List<String> sourceUris, FormatOptions format)
Returns a BigQuery Load Job Configuration for the given destination table, format and source URI.
-
of
public static LoadJobConfiguration of(TableId destinationTable, String sourceUri, FormatOptions format)
Returns a BigQuery Load Job Configuration for the given destination table, format and source URI.
-
-