Class: Google::Apis::BigqueryV2::JobConfigurationLoad

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/bigquery_v2/classes.rb,
generated/google/apis/bigquery_v2/representations.rb,
generated/google/apis/bigquery_v2/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ JobConfigurationLoad

Returns a new instance of JobConfigurationLoad



1723
1724
1725
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1723

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#allow_jagged_rowsBoolean 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

Returns:

  • (Boolean)


1507
1508
1509
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1507

def allow_jagged_rows
  @allow_jagged_rows
end

#allow_quoted_newlinesBoolean 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

Returns:

  • (Boolean)


1514
1515
1516
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1514

def allow_quoted_newlines
  @allow_quoted_newlines
end

#autodetectBoolean 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

Returns:

  • (Boolean)


1521
1522
1523
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1521

def autodetect
  @autodetect
end

#clusteringGoogle::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



1529
1530
1531
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1529

def clustering
  @clustering
end

#create_dispositionString

[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

Returns:

  • (String)


1539
1540
1541
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1539

def create_disposition
  @create_disposition
end

#destination_encryption_configurationGoogle::Apis::BigqueryV2::EncryptionConfiguration

Custom encryption configuration (e.g., Cloud KMS keys). Corresponds to the JSON property destinationEncryptionConfiguration



1544
1545
1546
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1544

def destination_encryption_configuration
  @destination_encryption_configuration
end

#destination_tableGoogle::Apis::BigqueryV2::TableReference

[Required] The destination table to load the data into. Corresponds to the JSON property destinationTable



1549
1550
1551
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1549

def destination_table
  @destination_table
end

#destination_table_propertiesGoogle::Apis::BigqueryV2::DestinationTableProperties

[Beta] [Optional] Properties with which to create the destination table if it is new. Corresponds to the JSON property destinationTableProperties



1555
1556
1557
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1555

def destination_table_properties
  @destination_table_properties
end

#encodingString

[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

Returns:

  • (String)


1563
1564
1565
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1563

def encoding
  @encoding
end

#field_delimiterString

[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

Returns:

  • (String)


1573
1574
1575
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1573

def field_delimiter
  @field_delimiter
end

#hive_partitioning_modeString

[Optional, Experimental] If hive partitioning is enabled, which mode to use. Two modes are supported: - AUTO: automatically infer partition key name(s) and type(s). - STRINGS: automatic infer partition key name(s). All types are strings. Not all storage formats support hive partitioning -- requesting hive partitioning on an unsupported format will lead to an error. Corresponds to the JSON property hivePartitioningMode

Returns:

  • (String)


1582
1583
1584
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1582

def hive_partitioning_mode
  @hive_partitioning_mode
end

#ignore_unknown_valuesBoolean 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

Returns:

  • (Boolean)


1593
1594
1595
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1593

def ignore_unknown_values
  @ignore_unknown_values
end

#max_bad_recordsFixnum

[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

Returns:

  • (Fixnum)


1602
1603
1604
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1602

def max_bad_records
  @max_bad_records
end

#null_markerString

[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

Returns:

  • (String)


1612
1613
1614
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1612

def null_marker
  @null_marker
end

#projection_fieldsArray<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

Returns:

  • (Array<String>)


1621
1622
1623
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1621

def projection_fields
  @projection_fields
end

#quoteString

[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

Returns:

  • (String)


1632
1633
1634
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1632

def quote
  @quote
end

#range_partitioningGoogle::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



1638
1639
1640
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1638

def range_partitioning
  @range_partitioning
end

#schemaGoogle::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



1645
1646
1647
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1645

def schema
  @schema
end

#schema_inlineString

[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

Returns:

  • (String)


1651
1652
1653
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1651

def schema_inline
  @schema_inline
end

#schema_inline_formatString

[Deprecated] The format of the schemaInline property. Corresponds to the JSON property schemaInlineFormat

Returns:

  • (String)


1656
1657
1658
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1656

def schema_inline_format
  @schema_inline_format
end

#schema_update_optionsArray<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

Returns:

  • (Array<String>)


1669
1670
1671
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1669

def schema_update_options
  @schema_update_options
end

#skip_leading_rowsFixnum

[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

Returns:

  • (Fixnum)


1676
1677
1678
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1676

def skip_leading_rows
  @skip_leading_rows
end

#source_formatString

[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

Returns:

  • (String)


1684
1685
1686
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1684

def source_format
  @source_format
end

#source_urisArray<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

Returns:

  • (Array<String>)


1695
1696
1697
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1695

def source_uris
  @source_uris
end

#time_partitioningGoogle::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



1701
1702
1703
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1701

def time_partitioning
  @time_partitioning
end

#use_avro_logical_typesBoolean Also known as: use_avro_logical_types?

[Optional] If sourceFormat is set to "AVRO", indicates whether to enable interpreting logical types into their corresponding types (ie. TIMESTAMP), instead of only using their raw types (ie. INTEGER). Corresponds to the JSON property useAvroLogicalTypes

Returns:

  • (Boolean)


1708
1709
1710
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1708

def use_avro_logical_types
  @use_avro_logical_types
end

#write_dispositionString

[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

Returns:

  • (String)


1721
1722
1723
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1721

def write_disposition
  @write_disposition
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1728

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)
  @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_mode = args[:hive_partitioning_mode] if args.key?(:hive_partitioning_mode)
  @ignore_unknown_values = args[:ignore_unknown_values] if args.key?(:ignore_unknown_values)
  @max_bad_records = args[:max_bad_records] if args.key?(:max_bad_records)
  @null_marker = args[:null_marker] if args.key?(:null_marker)
  @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