google-cloud-bigquery 1.34.0 → 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/lib/google/cloud/bigquery/convert.rb +3 -0
- data/lib/google/cloud/bigquery/dataset.rb +28 -21
- data/lib/google/cloud/bigquery/external/avro_source.rb +107 -0
- data/lib/google/cloud/bigquery/external/data_source.rb +2 -2
- data/lib/google/cloud/bigquery/external.rb +16 -14
- data/lib/google/cloud/bigquery/job.rb +33 -2
- data/lib/google/cloud/bigquery/load_job.rb +48 -12
- data/lib/google/cloud/bigquery/model.rb +8 -8
- data/lib/google/cloud/bigquery/project.rb +26 -20
- data/lib/google/cloud/bigquery/query_job.rb +11 -6
- data/lib/google/cloud/bigquery/routine.rb +2 -2
- data/lib/google/cloud/bigquery/schema/field.rb +114 -29
- data/lib/google/cloud/bigquery/schema.rb +34 -12
- data/lib/google/cloud/bigquery/service.rb +9 -1
- data/lib/google/cloud/bigquery/table/async_inserter.rb +1 -0
- data/lib/google/cloud/bigquery/table.rb +62 -28
- data/lib/google/cloud/bigquery/version.rb +1 -1
- metadata +3 -2
@@ -287,7 +287,7 @@ module Google
|
|
287
287
|
# Adds a string field to the schema.
|
288
288
|
#
|
289
289
|
# @param [String] name The field name. The name must contain only
|
290
|
-
# letters (
|
290
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
291
291
|
# start with a letter or underscore. The maximum length is 128
|
292
292
|
# characters.
|
293
293
|
# @param [String] description A description of the field.
|
@@ -314,7 +314,7 @@ module Google
|
|
314
314
|
# Adds an integer field to the schema.
|
315
315
|
#
|
316
316
|
# @param [String] name The field name. The name must contain only
|
317
|
-
# letters (
|
317
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
318
318
|
# start with a letter or underscore. The maximum length is 128
|
319
319
|
# characters.
|
320
320
|
# @param [String] description A description of the field.
|
@@ -334,7 +334,7 @@ module Google
|
|
334
334
|
# Adds a floating-point number field to the schema.
|
335
335
|
#
|
336
336
|
# @param [String] name The field name. The name must contain only
|
337
|
-
# letters (
|
337
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
338
338
|
# start with a letter or underscore. The maximum length is 128
|
339
339
|
# characters.
|
340
340
|
# @param [String] description A description of the field.
|
@@ -365,7 +365,7 @@ module Google
|
|
365
365
|
# for financial calculations.
|
366
366
|
#
|
367
367
|
# @param [String] name The field name. The name must contain only
|
368
|
-
# letters (
|
368
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
369
369
|
# start with a letter or underscore. The maximum length is 128
|
370
370
|
# characters.
|
371
371
|
# @param [String] description A description of the field.
|
@@ -412,7 +412,7 @@ module Google
|
|
412
412
|
# for financial calculations.
|
413
413
|
#
|
414
414
|
# @param [String] name The field name. The name must contain only
|
415
|
-
# letters (
|
415
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
416
416
|
# start with a letter or underscore. The maximum length is 128
|
417
417
|
# characters.
|
418
418
|
# @param [String] description A description of the field.
|
@@ -448,7 +448,7 @@ module Google
|
|
448
448
|
# Adds a boolean field to the schema.
|
449
449
|
#
|
450
450
|
# @param [String] name The field name. The name must contain only
|
451
|
-
# letters (
|
451
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
452
452
|
# start with a letter or underscore. The maximum length is 128
|
453
453
|
# characters.
|
454
454
|
# @param [String] description A description of the field.
|
@@ -468,7 +468,7 @@ module Google
|
|
468
468
|
# Adds a bytes field to the schema.
|
469
469
|
#
|
470
470
|
# @param [String] name The field name. The name must contain only
|
471
|
-
# letters (
|
471
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
472
472
|
# start with a letter or underscore. The maximum length is 128
|
473
473
|
# characters.
|
474
474
|
# @param [String] description A description of the field.
|
@@ -490,7 +490,7 @@ module Google
|
|
490
490
|
# Adds a timestamp field to the schema.
|
491
491
|
#
|
492
492
|
# @param [String] name The field name. The name must contain only
|
493
|
-
# letters (
|
493
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
494
494
|
# start with a letter or underscore. The maximum length is 128
|
495
495
|
# characters.
|
496
496
|
# @param [String] description A description of the field.
|
@@ -510,7 +510,7 @@ module Google
|
|
510
510
|
# Adds a time field to the schema.
|
511
511
|
#
|
512
512
|
# @param [String] name The field name. The name must contain only
|
513
|
-
# letters (
|
513
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
514
514
|
# start with a letter or underscore. The maximum length is 128
|
515
515
|
# characters.
|
516
516
|
# @param [String] description A description of the field.
|
@@ -530,7 +530,7 @@ module Google
|
|
530
530
|
# Adds a datetime field to the schema.
|
531
531
|
#
|
532
532
|
# @param [String] name The field name. The name must contain only
|
533
|
-
# letters (
|
533
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
534
534
|
# start with a letter or underscore. The maximum length is 128
|
535
535
|
# characters.
|
536
536
|
# @param [String] description A description of the field.
|
@@ -550,7 +550,7 @@ module Google
|
|
550
550
|
# Adds a date field to the schema.
|
551
551
|
#
|
552
552
|
# @param [String] name The field name. The name must contain only
|
553
|
-
# letters (
|
553
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
554
554
|
# start with a letter or underscore. The maximum length is 128
|
555
555
|
# characters.
|
556
556
|
# @param [String] description A description of the field.
|
@@ -566,6 +566,28 @@ module Google
|
|
566
566
|
add_field name, :date, description: description, mode: mode, policy_tags: policy_tags
|
567
567
|
end
|
568
568
|
|
569
|
+
##
|
570
|
+
# Adds a geography field to the schema.
|
571
|
+
#
|
572
|
+
# @see https://cloud.google.com/bigquery/docs/gis-data Working with BigQuery GIS data
|
573
|
+
#
|
574
|
+
# @param [String] name The field name. The name must contain only
|
575
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
576
|
+
# start with a letter or underscore. The maximum length is 128
|
577
|
+
# characters.
|
578
|
+
# @param [String] description A description of the field.
|
579
|
+
# @param [Symbol] mode The field's mode. The possible values are
|
580
|
+
# `:nullable`, `:required`, and `:repeated`. The default value is
|
581
|
+
# `:nullable`.
|
582
|
+
# @param [Array<String>, String] policy_tags The policy tag list or
|
583
|
+
# single policy tag for the field. Policy tag identifiers are of
|
584
|
+
# the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
|
585
|
+
# At most 1 policy tag is currently allowed.
|
586
|
+
#
|
587
|
+
def geography name, description: nil, mode: :nullable, policy_tags: nil
|
588
|
+
add_field name, :geography, description: description, mode: mode, policy_tags: policy_tags
|
589
|
+
end
|
590
|
+
|
569
591
|
##
|
570
592
|
# Adds a record field to the schema. A block must be passed describing
|
571
593
|
# the nested fields of the record. For more information about nested
|
@@ -574,7 +596,7 @@ module Google
|
|
574
596
|
# ](https://cloud.google.com/bigquery/docs/loading-data#loading_denormalized_nested_and_repeated_data).
|
575
597
|
#
|
576
598
|
# @param [String] name The field name. The name must contain only
|
577
|
-
# letters (
|
599
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
578
600
|
# start with a letter or underscore. The maximum length is 128
|
579
601
|
# characters.
|
580
602
|
# @param [String] description A description of the field.
|
@@ -418,6 +418,14 @@ module Google
|
|
418
418
|
end
|
419
419
|
end
|
420
420
|
|
421
|
+
##
|
422
|
+
# Deletes the job specified by jobId and location (required).
|
423
|
+
def delete_job job_id, location: nil
|
424
|
+
execute do
|
425
|
+
service.delete_job @project, job_id, location: location
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
421
429
|
##
|
422
430
|
# Returns the query data for the job
|
423
431
|
def job_query_results job_id, location: nil, max: nil, token: nil, start: nil, timeout: nil
|
@@ -601,7 +609,7 @@ module Google
|
|
601
609
|
|
602
610
|
protected
|
603
611
|
|
604
|
-
def retry? result, current_retries
|
612
|
+
def retry? result, current_retries
|
605
613
|
if current_retries < @retries && retry_error_reason?(result)
|
606
614
|
return true
|
607
615
|
end
|
@@ -110,6 +110,7 @@ module Google
|
|
110
110
|
# | `BIGNUMERIC` | `String` | Pass as `String` to avoid rounding to scale 9. |
|
111
111
|
# | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
|
112
112
|
# | `DATE` | `Date` | |
|
113
|
+
# | `GEOGRAPHY` | `String` | |
|
113
114
|
# | `TIMESTAMP` | `Time` | |
|
114
115
|
# | `TIME` | `Google::Cloud::BigQuery::Time` | |
|
115
116
|
# | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
|
@@ -119,8 +119,8 @@ module Google
|
|
119
119
|
##
|
120
120
|
# A unique ID for this table.
|
121
121
|
#
|
122
|
-
# @return [String] The ID must contain only letters (
|
123
|
-
# (0-9), or underscores (_). The maximum length is 1,024 characters.
|
122
|
+
# @return [String] The ID must contain only letters (`[A-Za-z]`), numbers
|
123
|
+
# (`[0-9]`), or underscores (`_`). The maximum length is 1,024 characters.
|
124
124
|
#
|
125
125
|
# @!group Attributes
|
126
126
|
#
|
@@ -132,8 +132,8 @@ module Google
|
|
132
132
|
##
|
133
133
|
# The ID of the `Dataset` containing this table.
|
134
134
|
#
|
135
|
-
# @return [String] The ID must contain only letters (
|
136
|
-
# (0-9), or underscores (_). The maximum length is 1,024 characters.
|
135
|
+
# @return [String] The ID must contain only letters (`[A-Za-z]`), numbers
|
136
|
+
# (`[0-9]`), or underscores (`_`). The maximum length is 1,024 characters.
|
137
137
|
#
|
138
138
|
# @!group Attributes
|
139
139
|
#
|
@@ -1633,8 +1633,8 @@ module Google
|
|
1633
1633
|
# * `empty` - An error will be returned if the destination table
|
1634
1634
|
# already contains data.
|
1635
1635
|
# @param [String] job_id A user-defined ID for the copy job. The ID
|
1636
|
-
# must contain only letters (
|
1637
|
-
# (_), or dashes (
|
1636
|
+
# must contain only letters (`[A-Za-z]`), numbers (`[0-9]`), underscores
|
1637
|
+
# (`_`), or dashes (`-`). The maximum length is 1,024 characters. If
|
1638
1638
|
# `job_id` is provided, then `prefix` will not be used.
|
1639
1639
|
#
|
1640
1640
|
# See [Generating a job
|
@@ -1643,8 +1643,8 @@ module Google
|
|
1643
1643
|
# prepended to a generated value to produce a unique job ID. For
|
1644
1644
|
# example, the prefix `daily_import_job_` can be given to generate a
|
1645
1645
|
# job ID such as `daily_import_job_12vEDtMQ0mbp1Mo5Z7mzAFQJZazh`. The
|
1646
|
-
# prefix must contain only letters (
|
1647
|
-
# underscores (_), or dashes (
|
1646
|
+
# prefix must contain only letters (`[A-Za-z]`), numbers (`[0-9]`),
|
1647
|
+
# underscores (`_`), or dashes (`-`). The maximum length of the entire ID
|
1648
1648
|
# is 1,024 characters. If `job_id` is provided, then `prefix` will not
|
1649
1649
|
# be used.
|
1650
1650
|
# @param [Hash] labels A hash of user-provided labels associated with
|
@@ -1822,8 +1822,8 @@ module Google
|
|
1822
1822
|
# @param [Boolean] header Whether to print out a header row in the
|
1823
1823
|
# results. Default is `true`.
|
1824
1824
|
# @param [String] job_id A user-defined ID for the extract job. The ID
|
1825
|
-
# must contain only letters (
|
1826
|
-
# (_), or dashes (
|
1825
|
+
# must contain only letters (`[A-Za-z]`), numbers (`[0-9]`), underscores
|
1826
|
+
# (`_`), or dashes (`-`). The maximum length is 1,024 characters. If
|
1827
1827
|
# `job_id` is provided, then `prefix` will not be used.
|
1828
1828
|
#
|
1829
1829
|
# See [Generating a job
|
@@ -1832,8 +1832,8 @@ module Google
|
|
1832
1832
|
# prepended to a generated value to produce a unique job ID. For
|
1833
1833
|
# example, the prefix `daily_import_job_` can be given to generate a
|
1834
1834
|
# job ID such as `daily_import_job_12vEDtMQ0mbp1Mo5Z7mzAFQJZazh`. The
|
1835
|
-
# prefix must contain only letters (
|
1836
|
-
# underscores (_), or dashes (
|
1835
|
+
# prefix must contain only letters (`[A-Za-z]`), numbers (`[0-9]`),
|
1836
|
+
# underscores (`_`), or dashes (`-`). The maximum length of the entire ID
|
1837
1837
|
# is 1,024 characters. If `job_id` is provided, then `prefix` will not
|
1838
1838
|
# be used.
|
1839
1839
|
# @param [Hash] labels A hash of user-provided labels associated with
|
@@ -2070,8 +2070,8 @@ module Google
|
|
2070
2070
|
# value is `0`. This property is useful if you have header rows in the
|
2071
2071
|
# file that should be skipped.
|
2072
2072
|
# @param [String] job_id A user-defined ID for the load job. The ID
|
2073
|
-
# must contain only letters (
|
2074
|
-
# (_), or dashes (
|
2073
|
+
# must contain only letters (`[A-Za-z]`), numbers (`[0-9]`), underscores
|
2074
|
+
# (`_`), or dashes (`-`). The maximum length is 1,024 characters. If
|
2075
2075
|
# `job_id` is provided, then `prefix` will not be used.
|
2076
2076
|
#
|
2077
2077
|
# See [Generating a job
|
@@ -2080,8 +2080,8 @@ module Google
|
|
2080
2080
|
# prepended to a generated value to produce a unique job ID. For
|
2081
2081
|
# example, the prefix `daily_import_job_` can be given to generate a
|
2082
2082
|
# job ID such as `daily_import_job_12vEDtMQ0mbp1Mo5Z7mzAFQJZazh`. The
|
2083
|
-
# prefix must contain only letters (
|
2084
|
-
# underscores (_), or dashes (
|
2083
|
+
# prefix must contain only letters (`[A-Za-z]`), numbers (`[0-9]`),
|
2084
|
+
# underscores (`_`), or dashes (`-`). The maximum length of the entire ID
|
2085
2085
|
# is 1,024 characters. If `job_id` is provided, then `prefix` will not
|
2086
2086
|
# be used.
|
2087
2087
|
# @param [Hash] labels A hash of user-provided labels associated with
|
@@ -2369,12 +2369,15 @@ module Google
|
|
2369
2369
|
# | `BIGNUMERIC` | `String` | Pass as `String` to avoid rounding to scale 9. |
|
2370
2370
|
# | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
|
2371
2371
|
# | `DATE` | `Date` | |
|
2372
|
+
# | `GEOGRAPHY` | `String` | Well-known text (WKT) or GeoJSON. |
|
2372
2373
|
# | `TIMESTAMP` | `Time` | |
|
2373
2374
|
# | `TIME` | `Google::Cloud::BigQuery::Time` | |
|
2374
2375
|
# | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
|
2375
2376
|
# | `ARRAY` | `Array` | Nested arrays, `nil` values are not supported. |
|
2376
2377
|
# | `STRUCT` | `Hash` | Hash keys may be strings or symbols. |
|
2377
2378
|
#
|
2379
|
+
# For `GEOGRAPHY` data, see [Working with BigQuery GIS data](https://cloud.google.com/bigquery/docs/gis-data).
|
2380
|
+
#
|
2378
2381
|
# Because BigQuery's streaming API is designed for high insertion rates,
|
2379
2382
|
# modifications to the underlying table metadata are eventually
|
2380
2383
|
# consistent when interacting with the streaming system. In most cases
|
@@ -3231,7 +3234,7 @@ module Google
|
|
3231
3234
|
# See {Schema#string}.
|
3232
3235
|
#
|
3233
3236
|
# @param [String] name The field name. The name must contain only
|
3234
|
-
# letters (
|
3237
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3235
3238
|
# start with a letter or underscore. The maximum length is 128
|
3236
3239
|
# characters.
|
3237
3240
|
# @param [String] description A description of the field.
|
@@ -3265,7 +3268,7 @@ module Google
|
|
3265
3268
|
# See {Schema#integer}.
|
3266
3269
|
#
|
3267
3270
|
# @param [String] name The field name. The name must contain only
|
3268
|
-
# letters (
|
3271
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3269
3272
|
# start with a letter or underscore. The maximum length is 128
|
3270
3273
|
# characters.
|
3271
3274
|
# @param [String] description A description of the field.
|
@@ -3297,7 +3300,7 @@ module Google
|
|
3297
3300
|
# See {Schema#float}.
|
3298
3301
|
#
|
3299
3302
|
# @param [String] name The field name. The name must contain only
|
3300
|
-
# letters (
|
3303
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3301
3304
|
# start with a letter or underscore. The maximum length is 128
|
3302
3305
|
# characters.
|
3303
3306
|
# @param [String] description A description of the field.
|
@@ -3340,7 +3343,7 @@ module Google
|
|
3340
3343
|
# See {Schema#numeric}
|
3341
3344
|
#
|
3342
3345
|
# @param [String] name The field name. The name must contain only
|
3343
|
-
# letters (
|
3346
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3344
3347
|
# start with a letter or underscore. The maximum length is 128
|
3345
3348
|
# characters.
|
3346
3349
|
# @param [String] description A description of the field.
|
@@ -3398,7 +3401,7 @@ module Google
|
|
3398
3401
|
# See {Schema#bignumeric}
|
3399
3402
|
#
|
3400
3403
|
# @param [String] name The field name. The name must contain only
|
3401
|
-
# letters (
|
3404
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3402
3405
|
# start with a letter or underscore. The maximum length is 128
|
3403
3406
|
# characters.
|
3404
3407
|
# @param [String] description A description of the field.
|
@@ -3445,7 +3448,7 @@ module Google
|
|
3445
3448
|
# See {Schema#boolean}.
|
3446
3449
|
#
|
3447
3450
|
# @param [String] name The field name. The name must contain only
|
3448
|
-
# letters (
|
3451
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3449
3452
|
# start with a letter or underscore. The maximum length is 128
|
3450
3453
|
# characters.
|
3451
3454
|
# @param [String] description A description of the field.
|
@@ -3477,7 +3480,7 @@ module Google
|
|
3477
3480
|
# See {Schema#bytes}.
|
3478
3481
|
#
|
3479
3482
|
# @param [String] name The field name. The name must contain only
|
3480
|
-
# letters (
|
3483
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3481
3484
|
# start with a letter or underscore. The maximum length is 128
|
3482
3485
|
# characters.
|
3483
3486
|
# @param [String] description A description of the field.
|
@@ -3511,7 +3514,7 @@ module Google
|
|
3511
3514
|
# See {Schema#timestamp}.
|
3512
3515
|
#
|
3513
3516
|
# @param [String] name The field name. The name must contain only
|
3514
|
-
# letters (
|
3517
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3515
3518
|
# start with a letter or underscore. The maximum length is 128
|
3516
3519
|
# characters.
|
3517
3520
|
# @param [String] description A description of the field.
|
@@ -3543,7 +3546,7 @@ module Google
|
|
3543
3546
|
# See {Schema#time}.
|
3544
3547
|
#
|
3545
3548
|
# @param [String] name The field name. The name must contain only
|
3546
|
-
# letters (
|
3549
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3547
3550
|
# start with a letter or underscore. The maximum length is 128
|
3548
3551
|
# characters.
|
3549
3552
|
# @param [String] description A description of the field.
|
@@ -3575,7 +3578,7 @@ module Google
|
|
3575
3578
|
# See {Schema#datetime}.
|
3576
3579
|
#
|
3577
3580
|
# @param [String] name The field name. The name must contain only
|
3578
|
-
# letters (
|
3581
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3579
3582
|
# start with a letter or underscore. The maximum length is 128
|
3580
3583
|
# characters.
|
3581
3584
|
# @param [String] description A description of the field.
|
@@ -3607,7 +3610,7 @@ module Google
|
|
3607
3610
|
# See {Schema#date}.
|
3608
3611
|
#
|
3609
3612
|
# @param [String] name The field name. The name must contain only
|
3610
|
-
# letters (
|
3613
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3611
3614
|
# start with a letter or underscore. The maximum length is 128
|
3612
3615
|
# characters.
|
3613
3616
|
# @param [String] description A description of the field.
|
@@ -3633,6 +3636,37 @@ module Google
|
|
3633
3636
|
schema.date name, description: description, mode: mode, policy_tags: policy_tags
|
3634
3637
|
end
|
3635
3638
|
|
3639
|
+
##
|
3640
|
+
# Adds a geography field to the schema.
|
3641
|
+
#
|
3642
|
+
# @see https://cloud.google.com/bigquery/docs/gis-data Working with BigQuery GIS data
|
3643
|
+
#
|
3644
|
+
# @param [String] name The field name. The name must contain only
|
3645
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3646
|
+
# start with a letter or underscore. The maximum length is 128
|
3647
|
+
# characters.
|
3648
|
+
# @param [String] description A description of the field.
|
3649
|
+
# @param [Symbol] mode The field's mode. The possible values are
|
3650
|
+
# `:nullable`, `:required`, and `:repeated`. The default value is
|
3651
|
+
# `:nullable`.
|
3652
|
+
# @param [Array<String>, String] policy_tags The policy tag list or
|
3653
|
+
# single policy tag for the field. Policy tag identifiers are of
|
3654
|
+
# the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
|
3655
|
+
# At most 1 policy tag is currently allowed.
|
3656
|
+
#
|
3657
|
+
# @example
|
3658
|
+
# require "google/cloud/bigquery"
|
3659
|
+
#
|
3660
|
+
# bigquery = Google::Cloud::Bigquery.new
|
3661
|
+
# dataset = bigquery.dataset "my_dataset"
|
3662
|
+
# table = dataset.create_table "my_table" do |schema|
|
3663
|
+
# schema.geography "home", mode: :required
|
3664
|
+
# end
|
3665
|
+
#
|
3666
|
+
def geography name, description: nil, mode: :nullable, policy_tags: nil
|
3667
|
+
schema.geography name, description: description, mode: mode, policy_tags: policy_tags
|
3668
|
+
end
|
3669
|
+
|
3636
3670
|
##
|
3637
3671
|
# Adds a record field to the schema. A block must be passed describing
|
3638
3672
|
# the nested fields of the record. For more information about nested
|
@@ -3643,7 +3677,7 @@ module Google
|
|
3643
3677
|
# See {Schema#record}.
|
3644
3678
|
#
|
3645
3679
|
# @param [String] name The field name. The name must contain only
|
3646
|
-
# letters (
|
3680
|
+
# letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
|
3647
3681
|
# start with a letter or underscore. The maximum length is 128
|
3648
3682
|
# characters.
|
3649
3683
|
# @param [String] description A description of the field.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-bigquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -270,6 +270,7 @@ files:
|
|
270
270
|
- lib/google/cloud/bigquery/dataset/list.rb
|
271
271
|
- lib/google/cloud/bigquery/encryption_configuration.rb
|
272
272
|
- lib/google/cloud/bigquery/external.rb
|
273
|
+
- lib/google/cloud/bigquery/external/avro_source.rb
|
273
274
|
- lib/google/cloud/bigquery/external/bigtable_source.rb
|
274
275
|
- lib/google/cloud/bigquery/external/bigtable_source/column.rb
|
275
276
|
- lib/google/cloud/bigquery/external/bigtable_source/column_family.rb
|