Class: Google::Apis::BigqueryV2::JobConfigurationLoad
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::JobConfigurationLoad
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/bigquery_v2/classes.rb,
lib/google/apis/bigquery_v2/representations.rb,
lib/google/apis/bigquery_v2/representations.rb
Instance Attribute Summary collapse
-
#allow_jagged_rows ⇒ Boolean
(also: #allow_jagged_rows?)
[Optional] Accept rows that are missing trailing optional columns.
-
#allow_quoted_newlines ⇒ Boolean
(also: #allow_quoted_newlines?)
Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file.
-
#autodetect ⇒ Boolean
(also: #autodetect?)
[Optional] Indicates if we should automatically infer the options and schema for CSV and JSON sources.
-
#clustering ⇒ Google::Apis::BigqueryV2::Clustering
[Beta] Clustering specification for the destination table.
-
#create_disposition ⇒ String
[Optional] Specifies whether the job is allowed to create new tables.
-
#decimal_target_types ⇒ Array<String>
[Optional] Defines the list of possible SQL data types to which the source decimal values are converted.
-
#destination_encryption_configuration ⇒ Google::Apis::BigqueryV2::EncryptionConfiguration
Custom encryption configuration (e.g., Cloud KMS keys).
-
#destination_table ⇒ Google::Apis::BigqueryV2::TableReference
[Required] The destination table to load the data into.
-
#destination_table_properties ⇒ Google::Apis::BigqueryV2::DestinationTableProperties
[Beta] [Optional] Properties with which to create the destination table if it is new.
-
#encoding ⇒ String
[Optional] The character encoding of the data.
-
#field_delimiter ⇒ String
[Optional] The separator for fields in a CSV file.
-
#hive_partitioning_options ⇒ Google::Apis::BigqueryV2::HivePartitioningOptions
[Optional] Options to configure hive partitioning support.
-
#ignore_unknown_values ⇒ Boolean
(also: #ignore_unknown_values?)
[Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema.
-
#json_extension ⇒ String
[Optional] If sourceFormat is set to newline-delimited JSON, indicates whether it should be processed as a JSON variant such as GeoJSON.
-
#max_bad_records ⇒ Fixnum
[Optional] The maximum number of bad records that BigQuery can ignore when running the job.
-
#null_marker ⇒ String
[Optional] Specifies a string that represents a null value in a CSV file.
-
#parquet_options ⇒ Google::Apis::BigqueryV2::ParquetOptions
[Optional] Options to configure parquet support.
-
#projection_fields ⇒ Array<String>
If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup.
-
#quote ⇒ String
[Optional] The value that is used to quote data sections in a CSV file.
-
#range_partitioning ⇒ Google::Apis::BigqueryV2::RangePartitioning
[TrustedTester] Range partitioning specification for this table.
-
#schema ⇒ Google::Apis::BigqueryV2::TableSchema
[Optional] The schema for the destination table.
-
#schema_inline ⇒ String
[Deprecated] The inline schema.
-
#schema_inline_format ⇒ String
[Deprecated] The format of the schemaInline property.
-
#schema_update_options ⇒ Array<String>
Allows the schema of the destination table to be updated as a side effect of the load job if a schema is autodetected or supplied in the job configuration.
-
#skip_leading_rows ⇒ Fixnum
[Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data.
-
#source_format ⇒ String
[Optional] The format of the data files.
-
#source_uris ⇒ Array<String>
[Required] The fully-qualified URIs that point to your data in Google Cloud.
-
#time_partitioning ⇒ Google::Apis::BigqueryV2::TimePartitioning
Time-based partitioning specification for the destination table.
-
#use_avro_logical_types ⇒ Boolean
(also: #use_avro_logical_types?)
[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).
-
#write_disposition ⇒ String
[Optional] Specifies the action that occurs if the destination table already exists.
Instance Method Summary collapse
-
#initialize(**args) ⇒ JobConfigurationLoad
constructor
A new instance of JobConfigurationLoad.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ JobConfigurationLoad
Returns a new instance of JobConfigurationLoad.
3382 3383 3384 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3382 def initialize(**args) update!(**args) end |
Instance Attribute Details
#allow_jagged_rows ⇒ Boolean Also known as: allow_jagged_rows?
[Optional] Accept rows that are missing trailing optional columns. The missing
values are treated as nulls. If false, records with missing trailing 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. Only
applicable to CSV, ignored for other formats.
Corresponds to the JSON property allowJaggedRows
3136 3137 3138 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3136 def allow_jagged_rows @allow_jagged_rows end |
#allow_quoted_newlines ⇒ Boolean Also known as: allow_quoted_newlines?
Indicates if BigQuery should allow quoted data sections that contain newline
characters in a CSV file. The default value is false.
Corresponds to the JSON property allowQuotedNewlines
3143 3144 3145 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3143 def allow_quoted_newlines @allow_quoted_newlines end |
#autodetect ⇒ Boolean Also known as: autodetect?
[Optional] Indicates if we should automatically infer the options and schema
for CSV and JSON sources.
Corresponds to the JSON property autodetect
3150 3151 3152 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3150 def autodetect @autodetect end |
#clustering ⇒ Google::Apis::BigqueryV2::Clustering
[Beta] Clustering specification for the destination table. Must be specified
with time-based partitioning, data in the table will be first partitioned and
subsequently clustered.
Corresponds to the JSON property clustering
3158 3159 3160 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3158 def clustering @clustering end |
#create_disposition ⇒ String
[Optional] Specifies whether the job is allowed to create new tables. The
following values are supported: CREATE_IF_NEEDED: If the table does not exist,
BigQuery creates the table. CREATE_NEVER: The table must already exist. If it
does not, a 'notFound' error is returned in the job result. The default value
is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one
atomic update upon job completion.
Corresponds to the JSON property createDisposition
3168 3169 3170 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3168 def create_disposition @create_disposition end |
#decimal_target_types ⇒ Array<String>
[Optional] 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. If none of the listed types supports the precision
and the scale, the type supporting the widest range in the specified list is
picked, and if a value exceeds the supported range when reading the data, an
error will be thrown. Example: Suppose the value of this field is ["NUMERIC", "
BIGNUMERIC"]. If (precision,scale) is: (38,9) -> NUMERIC; (39,9) -> BIGNUMERIC
(NUMERIC cannot hold 30 integer digits); (38,10) -> BIGNUMERIC (NUMERIC cannot
hold 10 fractional digits); (76,38) -> BIGNUMERIC; (77,38) -> BIGNUMERIC (
error if value exeeds supported range). This field cannot contain duplicate
types. The order of the types in this field is ignored. For example, ["
BIGNUMERIC", "NUMERIC"] is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC
always takes precedence over BIGNUMERIC. Defaults to ["NUMERIC", "STRING"] for
ORC and ["NUMERIC"] for the other file formats.
Corresponds to the JSON property decimalTargetTypes
3189 3190 3191 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3189 def decimal_target_types @decimal_target_types end |
#destination_encryption_configuration ⇒ Google::Apis::BigqueryV2::EncryptionConfiguration
Custom encryption configuration (e.g., Cloud KMS keys).
Corresponds to the JSON property destinationEncryptionConfiguration
3194 3195 3196 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3194 def destination_encryption_configuration @destination_encryption_configuration end |
#destination_table ⇒ Google::Apis::BigqueryV2::TableReference
[Required] The destination table to load the data into.
Corresponds to the JSON property destinationTable
3199 3200 3201 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3199 def destination_table @destination_table end |
#destination_table_properties ⇒ Google::Apis::BigqueryV2::DestinationTableProperties
[Beta] [Optional] Properties with which to create the destination table if it
is new.
Corresponds to the JSON property destinationTableProperties
3205 3206 3207 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3205 def destination_table_properties @destination_table_properties end |
#encoding ⇒ String
[Optional] The character encoding of the data. The supported values are UTF-8
or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the
raw, binary data has been split using the values of the quote and
fieldDelimiter properties.
Corresponds to the JSON property encoding
3213 3214 3215 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3213 def encoding @encoding end |
#field_delimiter ⇒ String
[Optional] The separator for fields in a CSV file. The separator can be any
ISO-8859-1 single-byte character. To use a character in the range 128-255, you
must encode the character as UTF8. BigQuery converts the string to ISO-8859-1
encoding, and then uses the first byte of the encoded string to split the data
in its raw, binary state. BigQuery also supports the escape sequence "\t" to
specify a tab separator. The default value is a comma (',').
Corresponds to the JSON property fieldDelimiter
3223 3224 3225 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3223 def field_delimiter @field_delimiter end |
#hive_partitioning_options ⇒ Google::Apis::BigqueryV2::HivePartitioningOptions
[Optional] Options to configure hive partitioning support.
Corresponds to the JSON property hivePartitioningOptions
3228 3229 3230 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3228 def @hive_partitioning_options end |
#ignore_unknown_values ⇒ Boolean Also known as: ignore_unknown_values?
[Optional] 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. The sourceFormat property determines what BigQuery
treats as an extra value: CSV: Trailing columns JSON: Named values that don't
match any column names
Corresponds to the JSON property ignoreUnknownValues
3239 3240 3241 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3239 def ignore_unknown_values @ignore_unknown_values end |
#json_extension ⇒ String
[Optional] If sourceFormat is set to newline-delimited JSON, indicates whether
it should be processed as a JSON variant such as GeoJSON. For a sourceFormat
other than JSON, omit this field. If the sourceFormat is newline-delimited
JSON: - for newline-delimited GeoJSON: set to GEOJSON.
Corresponds to the JSON property jsonExtension
3248 3249 3250 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3248 def json_extension @json_extension end |
#max_bad_records ⇒ Fixnum
[Optional] 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. This is only valid for CSV and JSON. The
default value is 0, which requires that all records are valid.
Corresponds to the JSON property maxBadRecords
3256 3257 3258 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3256 def max_bad_records @max_bad_records end |
#null_marker ⇒ String
[Optional] Specifies a 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 for STRING and BYTE. For STRING and BYTE
columns, BigQuery interprets the empty string as an empty value.
Corresponds to the JSON property nullMarker
3266 3267 3268 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3266 def null_marker @null_marker end |
#parquet_options ⇒ Google::Apis::BigqueryV2::ParquetOptions
[Optional] Options to configure parquet support.
Corresponds to the JSON property parquetOptions
3271 3272 3273 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3271 def @parquet_options end |
#projection_fields ⇒ Array<String>
If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity
properties to load into BigQuery from a Cloud Datastore backup. Property names
are case sensitive and must be top-level properties. If no properties are
specified, BigQuery loads all properties. If any named property isn't found in
the Cloud Datastore backup, an invalid error is returned in the job result.
Corresponds to the JSON property projectionFields
3280 3281 3282 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3280 def projection_fields @projection_fields end |
#quote ⇒ String
[Optional] The value that is used to quote data sections in a CSV file.
BigQuery converts the string to ISO-8859-1 encoding, and then uses the first
byte of the encoded string to split the data in its raw, binary state. The
default value is a double-quote ('"'). If your data does not contain quoted
sections, set the property value to an empty string. If your data contains
quoted newline characters, you must also set the allowQuotedNewlines property
to true.
Corresponds to the JSON property quote
3291 3292 3293 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3291 def quote @quote end |
#range_partitioning ⇒ Google::Apis::BigqueryV2::RangePartitioning
[TrustedTester] Range partitioning specification for this table. Only one of
timePartitioning and rangePartitioning should be specified.
Corresponds to the JSON property rangePartitioning
3297 3298 3299 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3297 def range_partitioning @range_partitioning end |
#schema ⇒ Google::Apis::BigqueryV2::TableSchema
[Optional] The schema for the destination table. The schema can be omitted if
the destination table already exists, or if you're loading data from Google
Cloud Datastore.
Corresponds to the JSON property schema
3304 3305 3306 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3304 def schema @schema end |
#schema_inline ⇒ String
[Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,
Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT".
Corresponds to the JSON property schemaInline
3310 3311 3312 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3310 def schema_inline @schema_inline end |
#schema_inline_format ⇒ String
[Deprecated] The format of the schemaInline property.
Corresponds to the JSON property schemaInlineFormat
3315 3316 3317 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3315 def schema_inline_format @schema_inline_format end |
#schema_update_options ⇒ Array<String>
Allows the schema of the destination table to be updated as a side effect of
the load job if a schema is autodetected or supplied in the job configuration.
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. One or more of the
following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable
field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field
in the original schema to nullable.
Corresponds to the JSON property schemaUpdateOptions
3328 3329 3330 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3328 def @schema_update_options end |
#skip_leading_rows ⇒ Fixnum
[Optional] The number of rows at the top of a CSV file that BigQuery will skip
when loading the data. The default value is 0. This property is useful if you
have header rows in the file that should be skipped.
Corresponds to the JSON property skipLeadingRows
3335 3336 3337 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3335 def skip_leading_rows @skip_leading_rows end |
#source_format ⇒ String
[Optional] The format of the data files. For CSV files, specify "CSV". For
datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON,
specify "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". For parquet,
specify "PARQUET". For orc, specify "ORC". The default value is CSV.
Corresponds to the JSON property sourceFormat
3343 3344 3345 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3343 def source_format @source_format end |
#source_uris ⇒ Array<String>
[Required] The fully-qualified URIs that point to your data in Google Cloud.
For Google Cloud Storage URIs: Each URI can contain one '' wildcard character
and it must come after the 'bucket' name. Size limits related to load jobs
apply to external data sources. For Google Cloud Bigtable URIs: Exactly one
URI can be specified and it has be a fully specified and valid HTTPS URL for a
Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly one
URI can be specified. Also, the '' wildcard character is not allowed.
Corresponds to the JSON property sourceUris
3354 3355 3356 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3354 def source_uris @source_uris end |
#time_partitioning ⇒ Google::Apis::BigqueryV2::TimePartitioning
Time-based partitioning specification for the destination table. Only one of
timePartitioning and rangePartitioning should be specified.
Corresponds to the JSON property timePartitioning
3360 3361 3362 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3360 def time_partitioning @time_partitioning end |
#use_avro_logical_types ⇒ Boolean Also known as: use_avro_logical_types?
[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).
Corresponds to the JSON property useAvroLogicalTypes
3367 3368 3369 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3367 def use_avro_logical_types @use_avro_logical_types end |
#write_disposition ⇒ String
[Optional] Specifies the action that occurs if the destination table already
exists. The following values are supported: WRITE_TRUNCATE: If the table
already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table
already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the
table already exists and contains data, a 'duplicate' error is returned in the
job result. The default value is WRITE_APPEND. Each action is atomic and only
occurs if BigQuery is able to complete the job successfully. Creation,
truncation and append actions occur as one atomic update upon job completion.
Corresponds to the JSON property writeDisposition
3380 3381 3382 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3380 def write_disposition @write_disposition end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 3387 def update!(**args) @allow_jagged_rows = args[:allow_jagged_rows] if args.key?(:allow_jagged_rows) @allow_quoted_newlines = args[:allow_quoted_newlines] if args.key?(:allow_quoted_newlines) @autodetect = args[:autodetect] if args.key?(:autodetect) @clustering = args[:clustering] if args.key?(:clustering) @create_disposition = args[:create_disposition] if args.key?(:create_disposition) @decimal_target_types = args[:decimal_target_types] if args.key?(:decimal_target_types) @destination_encryption_configuration = args[:destination_encryption_configuration] if args.key?(:destination_encryption_configuration) @destination_table = args[:destination_table] if args.key?(:destination_table) @destination_table_properties = args[:destination_table_properties] if args.key?(:destination_table_properties) @encoding = args[:encoding] if args.key?(:encoding) @field_delimiter = args[:field_delimiter] if args.key?(:field_delimiter) @hive_partitioning_options = args[:hive_partitioning_options] if args.key?(:hive_partitioning_options) @ignore_unknown_values = args[:ignore_unknown_values] if args.key?(:ignore_unknown_values) @json_extension = args[:json_extension] if args.key?(:json_extension) @max_bad_records = args[:max_bad_records] if args.key?(:max_bad_records) @null_marker = args[:null_marker] if args.key?(:null_marker) @parquet_options = args[:parquet_options] if args.key?(:parquet_options) @projection_fields = args[:projection_fields] if args.key?(:projection_fields) @quote = args[:quote] if args.key?(:quote) @range_partitioning = args[:range_partitioning] if args.key?(:range_partitioning) @schema = args[:schema] if args.key?(:schema) @schema_inline = args[:schema_inline] if args.key?(:schema_inline) @schema_inline_format = args[:schema_inline_format] if args.key?(:schema_inline_format) @schema_update_options = args[:schema_update_options] if args.key?(:schema_update_options) @skip_leading_rows = args[:skip_leading_rows] if args.key?(:skip_leading_rows) @source_format = args[:source_format] if args.key?(:source_format) @source_uris = args[:source_uris] if args.key?(:source_uris) @time_partitioning = args[:time_partitioning] if args.key?(:time_partitioning) @use_avro_logical_types = args[:use_avro_logical_types] if args.key?(:use_avro_logical_types) @write_disposition = args[:write_disposition] if args.key?(:write_disposition) end |