google-cloud-bigquery 1.59.0 → 1.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +12 -1
- data/CHANGELOG.md +15 -0
- data/lib/google/cloud/bigquery/copy_job.rb +14 -1
- data/lib/google/cloud/bigquery/dataset.rb +241 -18
- data/lib/google/cloud/bigquery/extract_job.rb +14 -1
- data/lib/google/cloud/bigquery/load_job.rb +14 -2
- data/lib/google/cloud/bigquery/model.rb +15 -4
- data/lib/google/cloud/bigquery/project.rb +113 -18
- data/lib/google/cloud/bigquery/query_job.rb +14 -1
- data/lib/google/cloud/bigquery/service.rb +8 -6
- data/lib/google/cloud/bigquery/table.rb +115 -22
- data/lib/google/cloud/bigquery/version.rb +1 -1
- data/lib/google/cloud/bigquery.rb +25 -9
- data/lib/google-cloud-bigquery.rb +19 -3
- metadata +1 -1
|
@@ -1848,6 +1848,12 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
1848
1848
|
# @param [Boolean] dryrun If set, don't actually run this job. Behavior
|
|
1849
1849
|
# is undefined however for non-query jobs and may result in an error.
|
|
1850
1850
|
# Deprecated.
|
|
1851
|
+
# @param [String] operation_type The type of operation for this job.
|
|
1852
|
+
# @param [String] reservation The reservation that job would use. User
|
|
1853
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
1854
|
+
# set, reservation is determined based on the rules defined by the
|
|
1855
|
+
# reservation assignments. The expected format is
|
|
1856
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
1851
1857
|
#
|
|
1852
1858
|
# @yield [job] a job configuration object
|
|
1853
1859
|
# @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job
|
|
@@ -1880,7 +1886,7 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
1880
1886
|
# @!group Data
|
|
1881
1887
|
#
|
|
1882
1888
|
def copy_job destination_table, create: nil, write: nil, job_id: nil, prefix: nil, labels: nil, dryrun: nil,
|
|
1883
|
-
operation_type: nil
|
|
1889
|
+
operation_type: nil, reservation: nil
|
|
1884
1890
|
ensure_service!
|
|
1885
1891
|
options = { create: create,
|
|
1886
1892
|
write: write,
|
|
@@ -1888,7 +1894,8 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
1888
1894
|
labels: labels,
|
|
1889
1895
|
job_id: job_id,
|
|
1890
1896
|
prefix: prefix,
|
|
1891
|
-
operation_type: operation_type
|
|
1897
|
+
operation_type: operation_type,
|
|
1898
|
+
reservation: reservation }
|
|
1892
1899
|
updater = CopyJob::Updater.from_options(
|
|
1893
1900
|
service,
|
|
1894
1901
|
table_ref,
|
|
@@ -1941,6 +1948,12 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
1941
1948
|
# * `append` - BigQuery appends the data to the table.
|
|
1942
1949
|
# * `empty` - An error will be returned if the destination table
|
|
1943
1950
|
# already contains data.
|
|
1951
|
+
# @param [String] reservation The reservation that job would use. User
|
|
1952
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
1953
|
+
# set, reservation is determined based on the rules defined by the
|
|
1954
|
+
# reservation assignments. The expected format is
|
|
1955
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
1956
|
+
#
|
|
1944
1957
|
# @yield [job] a job configuration object
|
|
1945
1958
|
# @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job
|
|
1946
1959
|
# configuration object for setting additional options.
|
|
@@ -1968,11 +1981,12 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
1968
1981
|
#
|
|
1969
1982
|
# @!group Data
|
|
1970
1983
|
#
|
|
1971
|
-
def copy destination_table, create: nil, write: nil, &block
|
|
1984
|
+
def copy destination_table, create: nil, write: nil, reservation: nil, &block
|
|
1972
1985
|
copy_job_with_operation_type destination_table,
|
|
1973
1986
|
create: create,
|
|
1974
1987
|
write: write,
|
|
1975
1988
|
operation_type: OperationType::COPY,
|
|
1989
|
+
reservation: reservation,
|
|
1976
1990
|
&block
|
|
1977
1991
|
end
|
|
1978
1992
|
|
|
@@ -1998,6 +2012,11 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
1998
2012
|
# Reference](https://cloud.google.com/bigquery/query-reference#from)
|
|
1999
2013
|
# (`project-name:dataset_id.table_id`). This is useful for referencing
|
|
2000
2014
|
# tables in other projects and datasets.
|
|
2015
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2016
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2017
|
+
# set, reservation is determined based on the rules defined by the
|
|
2018
|
+
# reservation assignments. The expected format is
|
|
2019
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2001
2020
|
#
|
|
2002
2021
|
# @yield [job] a job configuration object
|
|
2003
2022
|
# @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job
|
|
@@ -2026,9 +2045,10 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2026
2045
|
#
|
|
2027
2046
|
# @!group Data
|
|
2028
2047
|
#
|
|
2029
|
-
def clone destination_table, &block
|
|
2048
|
+
def clone destination_table, reservation: nil, &block
|
|
2030
2049
|
copy_job_with_operation_type destination_table,
|
|
2031
2050
|
operation_type: OperationType::CLONE,
|
|
2051
|
+
reservation: reservation,
|
|
2032
2052
|
&block
|
|
2033
2053
|
end
|
|
2034
2054
|
|
|
@@ -2053,6 +2073,11 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2053
2073
|
# Reference](https://cloud.google.com/bigquery/query-reference#from)
|
|
2054
2074
|
# (`project-name:dataset_id.table_id`). This is useful for referencing
|
|
2055
2075
|
# tables in other projects and datasets.
|
|
2076
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2077
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2078
|
+
# set, reservation is determined based on the rules defined by the
|
|
2079
|
+
# reservation assignments. The expected format is
|
|
2080
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2056
2081
|
#
|
|
2057
2082
|
# @yield [job] a job configuration object
|
|
2058
2083
|
# @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job
|
|
@@ -2081,9 +2106,10 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2081
2106
|
#
|
|
2082
2107
|
# @!group Data
|
|
2083
2108
|
#
|
|
2084
|
-
def snapshot destination_table, &block
|
|
2109
|
+
def snapshot destination_table, reservation: nil, &block
|
|
2085
2110
|
copy_job_with_operation_type destination_table,
|
|
2086
2111
|
operation_type: OperationType::SNAPSHOT,
|
|
2112
|
+
reservation: reservation,
|
|
2087
2113
|
&block
|
|
2088
2114
|
end
|
|
2089
2115
|
|
|
@@ -2125,6 +2151,12 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2125
2151
|
# * `append` - BigQuery appends the data to the table.
|
|
2126
2152
|
# * `empty` - An error will be returned if the destination table
|
|
2127
2153
|
# already contains data.
|
|
2154
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2155
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2156
|
+
# set, reservation is determined based on the rules defined by the
|
|
2157
|
+
# reservation assignments. The expected format is
|
|
2158
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2159
|
+
#
|
|
2128
2160
|
# @yield [job] a job configuration object
|
|
2129
2161
|
# @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job
|
|
2130
2162
|
# configuration object for setting additional options.
|
|
@@ -2152,11 +2184,12 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2152
2184
|
#
|
|
2153
2185
|
# @!group Data
|
|
2154
2186
|
#
|
|
2155
|
-
def restore destination_table, create: nil, write: nil, &block
|
|
2187
|
+
def restore destination_table, create: nil, write: nil, reservation: nil, &block
|
|
2156
2188
|
copy_job_with_operation_type destination_table,
|
|
2157
2189
|
create: create,
|
|
2158
2190
|
write: write,
|
|
2159
2191
|
operation_type: OperationType::RESTORE,
|
|
2192
|
+
reservation: reservation,
|
|
2160
2193
|
&block
|
|
2161
2194
|
end
|
|
2162
2195
|
|
|
@@ -2229,6 +2262,11 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2229
2262
|
# @param [Boolean] dryrun If set, don't actually run this job. Behavior
|
|
2230
2263
|
# is undefined however for non-query jobs and may result in an error.
|
|
2231
2264
|
# Deprecated.
|
|
2265
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2266
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2267
|
+
# set, reservation is determined based on the rules defined by the
|
|
2268
|
+
# reservation assignments. The expected format is
|
|
2269
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2232
2270
|
#
|
|
2233
2271
|
# @yield [job] a job configuration object
|
|
2234
2272
|
# @yieldparam [Google::Cloud::Bigquery::ExtractJob::Updater] job a job
|
|
@@ -2251,10 +2289,10 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2251
2289
|
# @!group Data
|
|
2252
2290
|
#
|
|
2253
2291
|
def extract_job extract_url, format: nil, compression: nil, delimiter: nil, header: nil, job_id: nil,
|
|
2254
|
-
prefix: nil, labels: nil, dryrun: nil
|
|
2292
|
+
prefix: nil, labels: nil, dryrun: nil, reservation: nil
|
|
2255
2293
|
ensure_service!
|
|
2256
2294
|
options = { format: format, compression: compression, delimiter: delimiter, header: header, dryrun: dryrun,
|
|
2257
|
-
job_id: job_id, prefix: prefix, labels: labels }
|
|
2295
|
+
job_id: job_id, prefix: prefix, labels: labels, reservation: reservation }
|
|
2258
2296
|
updater = ExtractJob::Updater.from_options service, table_ref, extract_url, options
|
|
2259
2297
|
updater.location = location if location # may be table reference
|
|
2260
2298
|
|
|
@@ -2298,6 +2336,12 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2298
2336
|
# exported data. Default is <code>,</code>.
|
|
2299
2337
|
# @param [Boolean] header Whether to print out a header row in the
|
|
2300
2338
|
# results. Default is `true`.
|
|
2339
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2340
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2341
|
+
# set, reservation is determined based on the rules defined by the
|
|
2342
|
+
# reservation assignments. The expected format is
|
|
2343
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2344
|
+
#
|
|
2301
2345
|
# @yield [job] a job configuration object
|
|
2302
2346
|
# @yieldparam [Google::Cloud::Bigquery::ExtractJob::Updater] job a job
|
|
2303
2347
|
# configuration object for setting additional options.
|
|
@@ -2326,12 +2370,13 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2326
2370
|
#
|
|
2327
2371
|
# @!group Data
|
|
2328
2372
|
#
|
|
2329
|
-
def extract extract_url, format: nil, compression: nil, delimiter: nil, header: nil, &block
|
|
2373
|
+
def extract extract_url, format: nil, compression: nil, delimiter: nil, header: nil, reservation: nil, &block
|
|
2330
2374
|
job = extract_job extract_url,
|
|
2331
2375
|
format: format,
|
|
2332
2376
|
compression: compression,
|
|
2333
2377
|
delimiter: delimiter,
|
|
2334
2378
|
header: header,
|
|
2379
|
+
reservation: reservation,
|
|
2335
2380
|
&block
|
|
2336
2381
|
job.wait_until_done!
|
|
2337
2382
|
ensure_job_succeeded! job
|
|
@@ -2515,6 +2560,20 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2515
2560
|
# and reorders columns to match the field names in the schema.
|
|
2516
2561
|
# @param [String] time_zone The time zone used when parsing timestamp
|
|
2517
2562
|
# values.
|
|
2563
|
+
# @param [String] reference_file_schema_uri The URI of the reference
|
|
2564
|
+
# file with the reader schema. This file is only loaded if it is part
|
|
2565
|
+
# of source URIs, but is not loaded otherwise. It is enabled for the
|
|
2566
|
+
# following formats: `AVRO`, `PARQUET`, `ORC`.
|
|
2567
|
+
# @param [Boolean] preserve_ascii_control_characters When source_format
|
|
2568
|
+
# is set to `CSV`, indicates if the embedded ASCII control characters
|
|
2569
|
+
# (the first 32 characters in the ASCII-table, from `\x00` to `\x1F`)
|
|
2570
|
+
# are preserved. By default, ASCII control characters are not
|
|
2571
|
+
# preserved.
|
|
2572
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2573
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2574
|
+
# set, reservation is determined based on the rules defined by the
|
|
2575
|
+
# reservation assignments. The expected format is
|
|
2576
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2518
2577
|
#
|
|
2519
2578
|
# @yield [load_job] a block for setting the load job
|
|
2520
2579
|
# @yieldparam [LoadJob] load_job the load job object to be updated
|
|
@@ -2573,7 +2632,8 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2573
2632
|
quote: nil, skip_leading: nil, job_id: nil, prefix: nil, labels: nil, autodetect: nil,
|
|
2574
2633
|
null_marker: nil, dryrun: nil, create_session: nil, session_id: nil, schema: self.schema,
|
|
2575
2634
|
date_format: nil, datetime_format: nil, time_format: nil, timestamp_format: nil,
|
|
2576
|
-
null_markers: nil, source_column_match: nil, time_zone: nil
|
|
2635
|
+
null_markers: nil, source_column_match: nil, time_zone: nil, reference_file_schema_uri: nil,
|
|
2636
|
+
preserve_ascii_control_characters: nil, reservation: nil
|
|
2577
2637
|
ensure_service!
|
|
2578
2638
|
|
|
2579
2639
|
updater = load_job_updater format: format, create: create, write: write, projection_fields: projection_fields,
|
|
@@ -2585,7 +2645,10 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2585
2645
|
session_id: session_id, date_format: date_format,
|
|
2586
2646
|
datetime_format: datetime_format, time_format: time_format,
|
|
2587
2647
|
timestamp_format: timestamp_format, null_markers: null_markers,
|
|
2588
|
-
source_column_match: source_column_match, time_zone: time_zone
|
|
2648
|
+
source_column_match: source_column_match, time_zone: time_zone,
|
|
2649
|
+
reference_file_schema_uri: reference_file_schema_uri,
|
|
2650
|
+
preserve_ascii_control_characters: preserve_ascii_control_characters,
|
|
2651
|
+
reservation: reservation
|
|
2589
2652
|
|
|
2590
2653
|
yield updater if block_given?
|
|
2591
2654
|
|
|
@@ -2734,6 +2797,20 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2734
2797
|
# and reorders columns to match the field names in the schema.
|
|
2735
2798
|
# @param [String] time_zone The time zone used when parsing timestamp
|
|
2736
2799
|
# values.
|
|
2800
|
+
# @param [String] reference_file_schema_uri The URI of the reference
|
|
2801
|
+
# file with the reader schema. This file is only loaded if it is part
|
|
2802
|
+
# of source URIs, but is not loaded otherwise. It is enabled for the
|
|
2803
|
+
# following formats: `AVRO`, `PARQUET`, `ORC`.
|
|
2804
|
+
# @param [Boolean] preserve_ascii_control_characters When source_format
|
|
2805
|
+
# is set to `CSV`, indicates if the embedded ASCII control characters
|
|
2806
|
+
# (the first 32 characters in the ASCII-table, from `\x00` to `\x1F`)
|
|
2807
|
+
# are preserved. By default, ASCII control characters are not
|
|
2808
|
+
# preserved.
|
|
2809
|
+
# @param [String] reservation The reservation that job would use. User
|
|
2810
|
+
# can specify a reservation to execute the job. If reservation is not
|
|
2811
|
+
# set, reservation is determined based on the rules defined by the
|
|
2812
|
+
# reservation assignments. The expected format is
|
|
2813
|
+
# `projects/`project`/locations/`location`/reservations/`reservation``.
|
|
2737
2814
|
#
|
|
2738
2815
|
# @yield [updater] A block for setting the schema of the destination
|
|
2739
2816
|
# table and other options for the load job. The schema can be omitted
|
|
@@ -2797,7 +2874,8 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2797
2874
|
quoted_newlines: nil, encoding: nil, delimiter: nil, ignore_unknown: nil, max_bad_records: nil,
|
|
2798
2875
|
quote: nil, skip_leading: nil, autodetect: nil, null_marker: nil, session_id: nil,
|
|
2799
2876
|
schema: self.schema, date_format: nil, datetime_format: nil, time_format: nil, timestamp_format: nil,
|
|
2800
|
-
null_markers: nil, source_column_match: nil, time_zone: nil,
|
|
2877
|
+
null_markers: nil, source_column_match: nil, time_zone: nil, reference_file_schema_uri: nil,
|
|
2878
|
+
preserve_ascii_control_characters: nil, reservation: nil, &block
|
|
2801
2879
|
job = load_job files, format: format, create: create, write: write, projection_fields: projection_fields,
|
|
2802
2880
|
jagged_rows: jagged_rows, quoted_newlines: quoted_newlines, encoding: encoding,
|
|
2803
2881
|
delimiter: delimiter, ignore_unknown: ignore_unknown, max_bad_records: max_bad_records,
|
|
@@ -2805,7 +2883,10 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
2805
2883
|
null_marker: null_marker, session_id: session_id, schema: schema,
|
|
2806
2884
|
date_format: date_format, datetime_format: datetime_format, time_format: time_format,
|
|
2807
2885
|
timestamp_format: timestamp_format, null_markers: null_markers,
|
|
2808
|
-
source_column_match: source_column_match, time_zone: time_zone,
|
|
2886
|
+
source_column_match: source_column_match, time_zone: time_zone,
|
|
2887
|
+
reference_file_schema_uri: reference_file_schema_uri,
|
|
2888
|
+
preserve_ascii_control_characters: preserve_ascii_control_characters,
|
|
2889
|
+
reservation: reservation, &block
|
|
2809
2890
|
|
|
2810
2891
|
job.wait_until_done!
|
|
2811
2892
|
ensure_job_succeeded! job
|
|
@@ -3199,11 +3280,13 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3199
3280
|
|
|
3200
3281
|
protected
|
|
3201
3282
|
|
|
3202
|
-
def copy_job_with_operation_type destination_table, create: nil, write: nil, operation_type: nil,
|
|
3283
|
+
def copy_job_with_operation_type destination_table, create: nil, write: nil, operation_type: nil,
|
|
3284
|
+
reservation: nil, &block
|
|
3203
3285
|
job = copy_job destination_table,
|
|
3204
3286
|
create: create,
|
|
3205
3287
|
write: write,
|
|
3206
3288
|
operation_type: operation_type,
|
|
3289
|
+
reservation: reservation,
|
|
3207
3290
|
&block
|
|
3208
3291
|
job.wait_until_done!
|
|
3209
3292
|
ensure_job_succeeded! job
|
|
@@ -3254,7 +3337,7 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3254
3337
|
end
|
|
3255
3338
|
end
|
|
3256
3339
|
|
|
3257
|
-
def load_job_gapi table_id, dryrun, job_id: nil, prefix: nil
|
|
3340
|
+
def load_job_gapi table_id, dryrun, job_id: nil, prefix: nil, reservation: nil
|
|
3258
3341
|
job_ref = service.job_ref_from job_id, prefix
|
|
3259
3342
|
Google::Apis::BigqueryV2::Job.new(
|
|
3260
3343
|
job_reference: job_ref,
|
|
@@ -3266,13 +3349,15 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3266
3349
|
table_id: table_id
|
|
3267
3350
|
)
|
|
3268
3351
|
),
|
|
3269
|
-
dry_run: dryrun
|
|
3352
|
+
dry_run: dryrun,
|
|
3353
|
+
reservation: reservation
|
|
3270
3354
|
)
|
|
3271
3355
|
)
|
|
3272
3356
|
end
|
|
3273
3357
|
|
|
3274
3358
|
def load_job_csv_options! job, jagged_rows: nil, quoted_newlines: nil, delimiter: nil, quote: nil,
|
|
3275
|
-
skip_leading: nil, null_marker: nil, null_markers: nil, source_column_match: nil
|
|
3359
|
+
skip_leading: nil, null_marker: nil, null_markers: nil, source_column_match: nil,
|
|
3360
|
+
preserve_ascii_control_characters: nil
|
|
3276
3361
|
job.jagged_rows = jagged_rows unless jagged_rows.nil?
|
|
3277
3362
|
job.quoted_newlines = quoted_newlines unless quoted_newlines.nil?
|
|
3278
3363
|
job.delimiter = delimiter unless delimiter.nil?
|
|
@@ -3281,13 +3366,16 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3281
3366
|
job.skip_leading = skip_leading unless skip_leading.nil?
|
|
3282
3367
|
job.null_markers = null_markers unless null_markers.nil?
|
|
3283
3368
|
job.source_column_match = source_column_match unless source_column_match.nil?
|
|
3369
|
+
job.preserve_ascii_control_characters = preserve_ascii_control_characters unless
|
|
3370
|
+
preserve_ascii_control_characters.nil?
|
|
3284
3371
|
end
|
|
3285
3372
|
|
|
3286
3373
|
def load_job_file_options! job, format: nil, projection_fields: nil, jagged_rows: nil, quoted_newlines: nil,
|
|
3287
3374
|
encoding: nil, delimiter: nil, ignore_unknown: nil, max_bad_records: nil, quote: nil,
|
|
3288
3375
|
skip_leading: nil, null_marker: nil, date_format: nil, datetime_format: nil,
|
|
3289
3376
|
time_format: nil, timestamp_format: nil, null_markers: nil, source_column_match: nil,
|
|
3290
|
-
time_zone: nil
|
|
3377
|
+
time_zone: nil, reference_file_schema_uri: nil,
|
|
3378
|
+
preserve_ascii_control_characters: nil
|
|
3291
3379
|
job.format = format unless format.nil?
|
|
3292
3380
|
job.projection_fields = projection_fields unless projection_fields.nil?
|
|
3293
3381
|
job.encoding = encoding unless encoding.nil?
|
|
@@ -3298,6 +3386,7 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3298
3386
|
job.time_format = time_format unless time_format.nil?
|
|
3299
3387
|
job.timestamp_format = timestamp_format unless timestamp_format.nil?
|
|
3300
3388
|
job.time_zone = time_zone unless time_zone.nil?
|
|
3389
|
+
job.reference_file_schema_uri = reference_file_schema_uri unless reference_file_schema_uri.nil?
|
|
3301
3390
|
load_job_csv_options! job, jagged_rows: jagged_rows,
|
|
3302
3391
|
quoted_newlines: quoted_newlines,
|
|
3303
3392
|
delimiter: delimiter,
|
|
@@ -3305,7 +3394,8 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3305
3394
|
skip_leading: skip_leading,
|
|
3306
3395
|
null_marker: null_marker,
|
|
3307
3396
|
null_markers: null_markers,
|
|
3308
|
-
source_column_match: source_column_match
|
|
3397
|
+
source_column_match: source_column_match,
|
|
3398
|
+
preserve_ascii_control_characters: preserve_ascii_control_characters
|
|
3309
3399
|
end
|
|
3310
3400
|
|
|
3311
3401
|
def load_job_updater format: nil, create: nil, write: nil, projection_fields: nil, jagged_rows: nil,
|
|
@@ -3314,8 +3404,9 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3314
3404
|
prefix: nil, labels: nil, autodetect: nil, null_marker: nil,
|
|
3315
3405
|
create_session: nil, session_id: nil, date_format: nil, datetime_format: nil,
|
|
3316
3406
|
time_format: nil, timestamp_format: nil, null_markers: nil, source_column_match: nil,
|
|
3317
|
-
time_zone: nil
|
|
3318
|
-
|
|
3407
|
+
time_zone: nil, reference_file_schema_uri: nil, preserve_ascii_control_characters: nil,
|
|
3408
|
+
reservation: nil
|
|
3409
|
+
new_job = load_job_gapi table_id, dryrun, job_id: job_id, prefix: prefix, reservation: reservation
|
|
3319
3410
|
LoadJob::Updater.new(new_job).tap do |job|
|
|
3320
3411
|
job.location = location if location # may be table reference
|
|
3321
3412
|
job.create = create unless create.nil?
|
|
@@ -3342,7 +3433,9 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
|
3342
3433
|
timestamp_format: timestamp_format,
|
|
3343
3434
|
null_markers: null_markers,
|
|
3344
3435
|
source_column_match: source_column_match,
|
|
3345
|
-
time_zone: time_zone
|
|
3436
|
+
time_zone: time_zone,
|
|
3437
|
+
reference_file_schema_uri: reference_file_schema_uri,
|
|
3438
|
+
preserve_ascii_control_characters: preserve_ascii_control_characters
|
|
3346
3439
|
end
|
|
3347
3440
|
end
|
|
3348
3441
|
|
|
@@ -37,9 +37,26 @@ module Google
|
|
|
37
37
|
#
|
|
38
38
|
# @param [String] project_id Identifier for a BigQuery project. If not
|
|
39
39
|
# present, the default project for the credentials is used.
|
|
40
|
-
# @param [
|
|
41
|
-
#
|
|
42
|
-
#
|
|
40
|
+
# @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
|
|
41
|
+
# object. (See {Bigquery::Credentials})
|
|
42
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
43
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
44
|
+
# Google APIs can compromise the security of your systems and data.
|
|
45
|
+
#
|
|
46
|
+
# @example
|
|
47
|
+
#
|
|
48
|
+
# # The recommended way to provide credentials is to use the `make_creds` method
|
|
49
|
+
# # on the appropriate credentials class for your environment.
|
|
50
|
+
#
|
|
51
|
+
# require "googleauth"
|
|
52
|
+
#
|
|
53
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
54
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
55
|
+
# )
|
|
56
|
+
#
|
|
57
|
+
# client = ::Google::Cloud::Bigquery.new do |config|
|
|
58
|
+
# config.credentials = credentials
|
|
59
|
+
# end
|
|
43
60
|
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
|
|
44
61
|
# the set of resources and operations that the connection can access.
|
|
45
62
|
# See # [Using OAuth 2.0 to Access Google #
|
|
@@ -98,12 +115,11 @@ module Google
|
|
|
98
115
|
#
|
|
99
116
|
# * `project_id` - (String) Identifier for a BigQuery project. (The
|
|
100
117
|
# parameter `project` is considered deprecated, but may also be used.)
|
|
101
|
-
# * `credentials` - (
|
|
102
|
-
#
|
|
103
|
-
#
|
|
104
|
-
#
|
|
105
|
-
#
|
|
106
|
-
# to use the default endpoint.
|
|
118
|
+
# * `credentials` - (Google::Auth::Credentials) A Google::Auth::Credentials
|
|
119
|
+
# object. (See {Bigquery::Credentials})
|
|
120
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
121
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
122
|
+
# Google APIs can compromise the security of your systems and data.
|
|
107
123
|
# * `scope` - (String, Array<String>) The OAuth 2.0 scopes controlling
|
|
108
124
|
# the set of resources and operations that the connection can access.
|
|
109
125
|
# * `retries` - (Integer) Number of times to retry requests on server
|
|
@@ -87,9 +87,25 @@ module Google
|
|
|
87
87
|
#
|
|
88
88
|
# @param [String] project_id Identifier for a BigQuery project. If not
|
|
89
89
|
# present, the default project for the credentials is used.
|
|
90
|
-
# @param [
|
|
91
|
-
#
|
|
92
|
-
#
|
|
90
|
+
# @param [Google::Auth::Credentials] credentials A Google::Auth::Credentials
|
|
91
|
+
# object. (See {Bigquery::Credentials})
|
|
92
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
93
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
94
|
+
# Google APIs can compromise the security of your systems and data.
|
|
95
|
+
#
|
|
96
|
+
# @example
|
|
97
|
+
#
|
|
98
|
+
# # The recommended way to provide credentials is to use the `make_creds` method
|
|
99
|
+
# # on the appropriate credentials class for your environment.
|
|
100
|
+
#
|
|
101
|
+
# require "googleauth"
|
|
102
|
+
#
|
|
103
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
104
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
105
|
+
# )
|
|
106
|
+
#
|
|
107
|
+
# client = ::Google::Cloud::Bigquery.new credentials: credentials
|
|
108
|
+
#
|
|
93
109
|
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
|
|
94
110
|
# set of resources and operations that the connection can access. See
|
|
95
111
|
# [Using OAuth 2.0 to Access Google
|