Class: Google::Apis::BigqueryV2::JobConfigurationQuery

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) ⇒ JobConfigurationQuery

Returns a new instance of JobConfigurationQuery.



1484
1485
1486
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1484

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

Instance Attribute Details

#allow_large_resultsBoolean Also known as: allow_large_results?

If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. Corresponds to the JSON property allowLargeResults

Returns:

  • (Boolean)


1352
1353
1354
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1352

def allow_large_results
  @allow_large_results
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)


1363
1364
1365
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1363

def create_disposition
  @create_disposition
end

#default_datasetGoogle::Apis::BigqueryV2::DatasetReference

[Optional] Specifies the default dataset to use for unqualified table names in the query. Corresponds to the JSON property defaultDataset



1369
1370
1371
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1369

def default_dataset
  @default_dataset
end

#destination_tableGoogle::Apis::BigqueryV2::TableReference

[Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. Corresponds to the JSON property destinationTable



1375
1376
1377
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1375

def destination_table
  @destination_table
end

#flatten_resultsBoolean Also known as: flatten_results?

[Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false. Corresponds to the JSON property flattenResults

Returns:

  • (Boolean)


1381
1382
1383
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1381

def flatten_results
  @flatten_results
end

#maximum_billing_tierFixnum

[Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default. Corresponds to the JSON property maximumBillingTier

Returns:

  • (Fixnum)


1389
1390
1391
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1389

def maximum_billing_tier
  @maximum_billing_tier
end

#maximum_bytes_billedString

[Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default. Corresponds to the JSON property maximumBytesBilled

Returns:

  • (String)


1396
1397
1398
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1396

def maximum_bytes_billed
  @maximum_bytes_billed
end

#parameter_modeString

[Experimental] Standard SQL only. Whether to use positional (?) or named (@ myparam) query parameters in this query. Corresponds to the JSON property parameterMode

Returns:

  • (String)


1402
1403
1404
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1402

def parameter_mode
  @parameter_mode
end

#preserve_nullsBoolean Also known as: preserve_nulls?

[Deprecated] This property is deprecated. Corresponds to the JSON property preserveNulls

Returns:

  • (Boolean)


1407
1408
1409
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1407

def preserve_nulls
  @preserve_nulls
end

#priorityString

[Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. Corresponds to the JSON property priority

Returns:

  • (String)


1414
1415
1416
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1414

def priority
  @priority
end

#queryString

[Required] BigQuery SQL query to execute. Corresponds to the JSON property query

Returns:

  • (String)


1419
1420
1421
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1419

def query
  @query
end

#query_parametersArray<Google::Apis::BigqueryV2::QueryParameter>

[Experimental] Query parameters for Standard SQL queries. Corresponds to the JSON property queryParameters



1424
1425
1426
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1424

def query_parameters
  @query_parameters
end

#schema_update_optionsArray<String>

[Experimental] Allows the schema of the desitination table to be updated as a side effect of the query 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. 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>)


1437
1438
1439
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1437

def schema_update_options
  @schema_update_options
end

#table_definitionsHash<String,Google::Apis::BigqueryV2::ExternalDataConfiguration>

[Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Corresponds to the JSON property tableDefinitions



1445
1446
1447
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1445

def table_definitions
  @table_definitions
end

#use_legacy_sqlBoolean Also known as: use_legacy_sql?

[Experimental] Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery' s standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the values of allowLargeResults and flattenResults are ignored; query will be run as if allowLargeResults is true and flattenResults is false. Corresponds to the JSON property useLegacySql

Returns:

  • (Boolean)


1455
1456
1457
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1455

def use_legacy_sql
  @use_legacy_sql
end

#use_query_cacheBoolean Also known as: use_query_cache?

[Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true. Corresponds to the JSON property useQueryCache

Returns:

  • (Boolean)


1464
1465
1466
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1464

def use_query_cache
  @use_query_cache
end

#user_defined_function_resourcesArray<Google::Apis::BigqueryV2::UserDefinedFunctionResource>

[Experimental] Describes user-defined function resources used in the query. Corresponds to the JSON property userDefinedFunctionResources



1470
1471
1472
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1470

def user_defined_function_resources
  @user_defined_function_resources
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_EMPTY. 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)


1482
1483
1484
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1482

def write_disposition
  @write_disposition
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
# File 'generated/google/apis/bigquery_v2/classes.rb', line 1489

def update!(**args)
  @allow_large_results = args[:allow_large_results] if args.key?(:allow_large_results)
  @create_disposition = args[:create_disposition] if args.key?(:create_disposition)
  @default_dataset = args[:default_dataset] if args.key?(:default_dataset)
  @destination_table = args[:destination_table] if args.key?(:destination_table)
  @flatten_results = args[:flatten_results] if args.key?(:flatten_results)
  @maximum_billing_tier = args[:maximum_billing_tier] if args.key?(:maximum_billing_tier)
  @maximum_bytes_billed = args[:maximum_bytes_billed] if args.key?(:maximum_bytes_billed)
  @parameter_mode = args[:parameter_mode] if args.key?(:parameter_mode)
  @preserve_nulls = args[:preserve_nulls] if args.key?(:preserve_nulls)
  @priority = args[:priority] if args.key?(:priority)
  @query = args[:query] if args.key?(:query)
  @query_parameters = args[:query_parameters] if args.key?(:query_parameters)
  @schema_update_options = args[:schema_update_options] if args.key?(:schema_update_options)
  @table_definitions = args[:table_definitions] if args.key?(:table_definitions)
  @use_legacy_sql = args[:use_legacy_sql] if args.key?(:use_legacy_sql)
  @use_query_cache = args[:use_query_cache] if args.key?(:use_query_cache)
  @user_defined_function_resources = args[:user_defined_function_resources] if args.key?(:user_defined_function_resources)
  @write_disposition = args[:write_disposition] if args.key?(:write_disposition)
end