google-cloud-bigquery 1.46.1 → 1.48.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 608b8602a5b5af958a8041da97abd1a676f5fabca08f2c7c602b4b5fcdf287fd
4
- data.tar.gz: c2fd47001c69ef30fc37007cef0d2fca3d0f3e8fc706198970ea4d8b5353ed5e
3
+ metadata.gz: 4de4c60c60c2292576d5aa738640a81a268d6bd427c8172e329abdca39402d5c
4
+ data.tar.gz: 7e5a702ac9bf88fdced2bf990e03f896bd927a6f0048cb4bcce739a1677dfd2e
5
5
  SHA512:
6
- metadata.gz: 534de3f92ebda331c48ba33767983945ba6a803095e26efe7db43f037272136b582816e3c4650b82ea731c5b7749b5bfcf87075dbc5576d49083051a87fb0f7c
7
- data.tar.gz: 53cd0d50cfd12a6c79e4501ba0b5771362c5a1fd58af70c3c62748a3d4f20d1e72fa98ef74ff9f67751a1a3883b5a74302a080fa81ed3fb1a9d3d9faf30f591c
6
+ metadata.gz: b53ff655c2f1cd0d69cc9131dc5850e57d241070c30fa612c608b465ff8defc33296ee7d28cce9ba829de6aea6efdb3a4d29c90c8686e7e861a03647b01d2c73
7
+ data.tar.gz: 9b059241b299394cb5b970199513ce7b1e586ed06d2092b98f1e7e01c5ba9302229568baf02f6f4e23c6da8ed948d31aa563c56472ce61552ea3ed08aec675e8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 1.48.0 (2024-02-08)
4
+
5
+ #### Features
6
+
7
+ * Support accessing storage_ billing_model field in a dataset ([#24755](https://github.com/googleapis/google-cloud-ruby/issues/24755))
8
+
9
+ ### 1.47.0 (2024-02-05)
10
+
11
+ #### Features
12
+
13
+ * add json type support ([#24491](https://github.com/googleapis/google-cloud-ruby/issues/24491))
14
+
3
15
  ### 1.46.1 (2024-01-26)
4
16
 
5
17
  #### Bug Fixes
@@ -39,6 +39,7 @@ module Google
39
39
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
40
40
  # | `DATE` | `Date` | |
41
41
  # | `GEOGRAPHY` | `String` | |
42
+ # | `JSON` | `String` | String, as JSON does not have a schema to verify. |
42
43
  # | `TIMESTAMP` | `Time` | |
43
44
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
44
45
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -72,7 +73,7 @@ module Google
72
73
  value[:v].map { |v| format_value v, field }
73
74
  elsif Hash === value[:v]
74
75
  format_row value[:v], field.fields
75
- elsif field.type == "STRING"
76
+ elsif field.type == "STRING" || field.type == "JSON" || field.type == "GEOGRAPHY"
76
77
  String value[:v]
77
78
  elsif field.type == "INTEGER"
78
79
  Integer value[:v]
@@ -102,8 +103,6 @@ module Google
102
103
  ::Time.parse("#{value[:v]} UTC").to_datetime
103
104
  elsif field.type == "DATE"
104
105
  Date.parse value[:v]
105
- elsif field.type == "GEOGRAPHY"
106
- String value[:v]
107
106
  else
108
107
  value[:v]
109
108
  end
@@ -412,6 +412,56 @@ module Google
412
412
  patch_gapi! :default_encryption_configuration
413
413
  end
414
414
 
415
+ ##
416
+ # Gets the Storage Billing Model for the dataset.
417
+ #
418
+ # @see https://cloud.google.com/blog/products/data-analytics/new-bigquery-billing-model-helps-reduce-physical-storage-costs
419
+ #
420
+ # @return [String, nil] A string containing the storage billing model, or `nil`.
421
+ # Possible values of the string are `LOGICAL`, `PHYSICAL`.
422
+ # It returns `nil` if either the object is a reference (see {#reference?}),
423
+ # or if the storage billing model is unspecified.
424
+ #
425
+ # @example
426
+ #
427
+ # require "google/cloud/bigquery"
428
+ #
429
+ # bigquery = Google::Cloud::Bigquery.new
430
+ # dataset = bigquery.dataset "my_dataset"
431
+ #
432
+ # storage_billing_model = dataset.storage_billing_model
433
+ #
434
+ # @!group Attributes
435
+ #
436
+ def storage_billing_model
437
+ return nil if reference?
438
+ ensure_full_data!
439
+ @gapi.storage_billing_model
440
+ end
441
+
442
+ ##
443
+ # Sets the Storage Billing Model for the dataset.
444
+ #
445
+ # @see https://cloud.google.com/blog/products/data-analytics/new-bigquery-billing-model-helps-reduce-physical-storage-costs
446
+ #
447
+ # @param value [String] The new storage billing model. Accepted values
448
+ # are `LOGICAL` and `PHYSICAL`.
449
+ #
450
+ # @example
451
+ # require "google/cloud/bigquery"
452
+ #
453
+ # bigquery = Google::Cloud::Bigquery.new
454
+ # dataset = bigquery.dataset "my_dataset"
455
+ # storage_billing_model = dataset.storage_billing_model "LOGICAL"
456
+ #
457
+ # @!group Attributes
458
+ #
459
+ def storage_billing_model= value
460
+ ensure_full_data!
461
+ @gapi.storage_billing_model = value
462
+ patch_gapi! :storage_billing_model
463
+ end
464
+
415
465
  ##
416
466
  # Retrieves the access rules for a Dataset. The rules can be updated
417
467
  # when passing a block, see {Dataset::Access} for all the methods
@@ -1180,6 +1230,7 @@ module Google
1180
1230
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
1181
1231
  # | `DATE` | `Date` | |
1182
1232
  # | `GEOGRAPHY` | `String` (WKT or GeoJSON) | NOT AUTOMATIC: Must be mapped using `types`, below.|
1233
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
1183
1234
  # | `TIMESTAMP` | `Time` | |
1184
1235
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
1185
1236
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -1206,6 +1257,7 @@ module Google
1206
1257
  # * `:DATETIME`
1207
1258
  # * `:DATE`
1208
1259
  # * `:GEOGRAPHY`
1260
+ # * `:JSON`
1209
1261
  # * `:TIMESTAMP`
1210
1262
  # * `:TIME`
1211
1263
  # * `:BYTES`
@@ -1585,6 +1637,7 @@ module Google
1585
1637
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
1586
1638
  # | `DATE` | `Date` | |
1587
1639
  # | `GEOGRAPHY` | `String` (WKT or GeoJSON) | NOT AUTOMATIC: Must be mapped using `types`, below.|
1640
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
1588
1641
  # | `TIMESTAMP` | `Time` | |
1589
1642
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
1590
1643
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -1611,6 +1664,7 @@ module Google
1611
1664
  # * `:DATETIME`
1612
1665
  # * `:DATE`
1613
1666
  # * `:GEOGRAPHY`
1667
+ # * `:JSON`
1614
1668
  # * `:TIMESTAMP`
1615
1669
  # * `:TIME`
1616
1670
  # * `:BYTES`
@@ -2553,6 +2607,7 @@ module Google
2553
2607
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
2554
2608
  # | `DATE` | `Date` | |
2555
2609
  # | `GEOGRAPHY` | `String` | |
2610
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
2556
2611
  # | `TIMESTAMP` | `Time` | |
2557
2612
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
2558
2613
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -1531,6 +1531,71 @@ module Google
1531
1531
  default_value_expression: default_value_expression
1532
1532
  end
1533
1533
 
1534
+ ##
1535
+ # Adds an json field to the schema.
1536
+ #
1537
+ # See {Schema#json}.
1538
+ # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#json_type
1539
+ #
1540
+ # @param [String] name The field name. The name must contain only
1541
+ # letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
1542
+ # start with a letter or underscore. The maximum length is 128
1543
+ # characters.
1544
+ # @param [String] description A description of the field.
1545
+ # @param [Symbol] mode The field's mode. The possible values are
1546
+ # `:nullable`, `:required`, and `:repeated`. The default value is
1547
+ # `:nullable`.
1548
+ # @param [Array<String>, String] policy_tags The policy tag list or
1549
+ # single policy tag for the field. Policy tag identifiers are of
1550
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
1551
+ # At most 1 policy tag is currently allowed.
1552
+ # @param default_value_expression [String] The default value of a field
1553
+ # using a SQL expression. It can only be set for top level fields (columns).
1554
+ # Use a struct or array expression to specify default value for the entire struct or
1555
+ # array. The valid SQL expressions are:
1556
+ # - Literals for all data types, including STRUCT and ARRAY.
1557
+ # - The following functions:
1558
+ # `CURRENT_TIMESTAMP`
1559
+ # `CURRENT_TIME`
1560
+ # `CURRENT_DATE`
1561
+ # `CURRENT_DATETIME`
1562
+ # `GENERATE_UUID`
1563
+ # `RAND`
1564
+ # `SESSION_USER`
1565
+ # `ST_GEOPOINT`
1566
+ # - Struct or array composed with the above allowed functions, for example:
1567
+ # "[CURRENT_DATE(), DATE '2020-01-01'"]
1568
+ #
1569
+ # @example
1570
+ # require "google/cloud/bigquery"
1571
+ #
1572
+ # bigquery = Google::Cloud::Bigquery.new
1573
+ # dataset = bigquery.dataset "my_dataset"
1574
+ # job = dataset.load_job "my_table", "gs://abc/file" do |schema|
1575
+ # schema.record "cities_lived", mode: :repeated do |cities_lived|
1576
+ # cities_lived.geography "location", mode: :required
1577
+ # cities_lived.integer "number_of_years", mode: :required
1578
+ # cities_lived.json "address", mode: :required
1579
+ # end
1580
+ # end
1581
+ #
1582
+ # @example Add field with default value.
1583
+ # require "google/cloud/bigquery"
1584
+ #
1585
+ # bigquery = Google::Cloud::Bigquery.new
1586
+ # dataset = bigquery.dataset "my_dataset"
1587
+ # job = dataset.load_job "my_table", "gs://abc/file" do |schema|
1588
+ # schema.json "person", default_value_expression: "JSON '{"name": "Alice", "age": 30}'"
1589
+ # end
1590
+ #
1591
+ # @!group Schema
1592
+ #
1593
+ def json name, description: nil, mode: :nullable, policy_tags: nil,
1594
+ default_value_expression: nil
1595
+ schema.json name, description: description, mode: mode, policy_tags: policy_tags,
1596
+ default_value_expression: default_value_expression
1597
+ end
1598
+
1534
1599
  ##
1535
1600
  # Adds a record field to the schema. A block must be passed describing
1536
1601
  # the nested fields of the record. For more information about nested
@@ -313,6 +313,7 @@ module Google
313
313
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
314
314
  # | `DATE` | `Date` | |
315
315
  # | `GEOGRAPHY` | `String` (WKT or GeoJSON) | NOT AUTOMATIC: Must be mapped using `types`, below.|
316
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
316
317
  # | `TIMESTAMP` | `Time` | |
317
318
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
318
319
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -339,6 +340,7 @@ module Google
339
340
  # * `:DATETIME`
340
341
  # * `:DATE`
341
342
  # * `:GEOGRAPHY`
343
+ # * `:JSON`
342
344
  # * `:TIMESTAMP`
343
345
  # * `:TIME`
344
346
  # * `:BYTES`
@@ -700,6 +702,7 @@ module Google
700
702
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
701
703
  # | `DATE` | `Date` | |
702
704
  # | `GEOGRAPHY` | `String` (WKT or GeoJSON) | NOT AUTOMATIC: Must be mapped using `types`, below.|
705
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
703
706
  # | `TIMESTAMP` | `Time` | |
704
707
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
705
708
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -726,6 +729,7 @@ module Google
726
729
  # * `:DATETIME`
727
730
  # * `:DATE`
728
731
  # * `:GEOGRAPHY`
732
+ # * `:JSON`
729
733
  # * `:TIMESTAMP`
730
734
  # * `:TIME`
731
735
  # * `:BYTES`
@@ -927,6 +927,7 @@ module Google
927
927
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
928
928
  # | `DATE` | `Date` | |
929
929
  # | `GEOGRAPHY` | `String` (WKT or GeoJSON) | NOT AUTOMATIC: Must be mapped using `types`. |
930
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify.|
930
931
  # | `TIMESTAMP` | `Time` | |
931
932
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
932
933
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -964,6 +965,7 @@ module Google
964
965
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
965
966
  # | `DATE` | `Date` | |
966
967
  # | `GEOGRAPHY` | `String` (WKT or GeoJSON) | NOT AUTOMATIC: Must be mapped using `types`. |
968
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify.|
967
969
  # | `TIMESTAMP` | `Time` | |
968
970
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
969
971
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -990,6 +992,7 @@ module Google
990
992
  # * `:DATETIME`
991
993
  # * `:DATE`
992
994
  # * `:GEOGRAPHY`
995
+ # * `:JSON`
993
996
  # * `:TIMESTAMP`
994
997
  # * `:TIME`
995
998
  # * `:BYTES`
@@ -52,6 +52,7 @@ module Google
52
52
  "GEOGRAPHY",
53
53
  "INTEGER",
54
54
  "INT64",
55
+ "JSON",
55
56
  "NUMERIC",
56
57
  "RECORD",
57
58
  "STRING",
@@ -98,6 +99,7 @@ module Google
98
99
  # * `FLOAT`
99
100
  # * `FLOAT64` (same as `FLOAT`)
100
101
  # * `GEOGRAPHY`
102
+ # * `JSON`
101
103
  # * `INTEGER`
102
104
  # * `INT64` (same as `INTEGER`)
103
105
  # * `NUMERIC`
@@ -125,6 +127,7 @@ module Google
125
127
  # * `FLOAT`
126
128
  # * `FLOAT64` (same as `FLOAT`)
127
129
  # * `GEOGRAPHY`
130
+ # * `JSON`
128
131
  # * `INTEGER`
129
132
  # * `INT64` (same as `INTEGER`)
130
133
  # * `NUMERIC`
@@ -456,6 +459,15 @@ module Google
456
459
  type == "GEOGRAPHY"
457
460
  end
458
461
 
462
+ ##
463
+ # Checks if the type of the field is `JSON`.
464
+ #
465
+ # @return [Boolean] `true` when `JSON`, `false` otherwise.
466
+ #
467
+ def json?
468
+ type == "JSON"
469
+ end
470
+
459
471
  ##
460
472
  # Checks if the type of the field is `RECORD`.
461
473
  #
@@ -893,6 +905,30 @@ module Google
893
905
  add_field name, :geography, description: description, mode: mode, policy_tags: policy_tags
894
906
  end
895
907
 
908
+ ##
909
+ # Adds a json field to the nested schema of a record field.
910
+ #
911
+ # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#json_type
912
+ #
913
+ # @param [String] name The field name. The name must contain only
914
+ # letters (a-z, A-Z), numbers (0-9), or underscores (_), and must
915
+ # start with a letter or underscore. The maximum length is 128
916
+ # characters.
917
+ # @param [String] description A description of the field.
918
+ # @param [Symbol] mode The field's mode. The possible values are
919
+ # `:nullable`, `:required`, and `:repeated`. The default value is
920
+ # `:nullable`.
921
+ # @param [Array<String>, String] policy_tags The policy tag list or
922
+ # single policy tag for the field. Policy tag identifiers are of
923
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
924
+ # At most 1 policy tag is currently allowed.
925
+ #
926
+ def json name, description: nil, mode: :nullable, policy_tags: nil
927
+ record_check!
928
+
929
+ add_field name, :json, description: description, mode: mode, policy_tags: policy_tags
930
+ end
931
+
896
932
  ##
897
933
  # Adds a record field to the nested schema of a record field. A block
898
934
  # must be passed describing the nested fields of the record. For more
@@ -829,6 +829,49 @@ module Google
829
829
  default_value_expression: default_value_expression
830
830
  end
831
831
 
832
+ ##
833
+ # Adds a JSON field to the schema.
834
+ #
835
+ # @see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#json_type
836
+ #
837
+ # @param [String] name The field name. The name must contain only
838
+ # letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
839
+ # start with a letter or underscore. The maximum length is 128
840
+ # characters.
841
+ # @param [String] description A description of the field.
842
+ # @param [Symbol] mode The field's mode. The possible values are
843
+ # `:nullable`, `:required`, and `:repeated`. The default value is
844
+ # `:nullable`.
845
+ # @param [Array<String>, String] policy_tags The policy tag list or
846
+ # single policy tag for the field. Policy tag identifiers are of
847
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
848
+ # At most 1 policy tag is currently allowed.
849
+ # @param default_value_expression [String] The default value of a field
850
+ # using a SQL expression. It can only be set for top level fields (columns).
851
+ # Use a struct or array expression to specify default value for the entire struct or
852
+ # array. The valid SQL expressions are:
853
+ # - Literals for all data types, including STRUCT and ARRAY.
854
+ # - The following functions:
855
+ # `CURRENT_TIMESTAMP`
856
+ # `CURRENT_TIME`
857
+ # `CURRENT_DATE`
858
+ # `CURRENT_DATETIME`
859
+ # `GENERATE_UUID`
860
+ # `RAND`
861
+ # `SESSION_USER`
862
+ # `ST_GEOPOINT`
863
+ # - Struct or array composed with the above allowed functions, for example:
864
+ # "[CURRENT_DATE(), DATE '2020-01-01'"]
865
+ #
866
+ def json name, description: nil, mode: :nullable,
867
+ policy_tags: nil, default_value_expression: nil
868
+ add_field name, :json,
869
+ description: description,
870
+ mode: mode,
871
+ policy_tags: policy_tags,
872
+ default_value_expression: default_value_expression
873
+ end
874
+
832
875
  ##
833
876
  # Adds a record field to the schema. A block must be passed describing
834
877
  # the nested fields of the record. For more information about nested
@@ -111,6 +111,7 @@ module Google
111
111
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
112
112
  # | `DATE` | `Date` | |
113
113
  # | `GEOGRAPHY` | `String` | |
114
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
114
115
  # | `TIMESTAMP` | `Time` | |
115
116
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
116
117
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -2648,6 +2648,7 @@ module Google
2648
2648
  # | `DATETIME` | `DateTime` | `DATETIME` does not support time zone. |
2649
2649
  # | `DATE` | `Date` | |
2650
2650
  # | `GEOGRAPHY` | `String` | Well-known text (WKT) or GeoJSON. |
2651
+ # | `JSON` | `String` (Stringified JSON) | String, as JSON does not have a schema to verify. |
2651
2652
  # | `TIMESTAMP` | `Time` | |
2652
2653
  # | `TIME` | `Google::Cloud::BigQuery::Time` | |
2653
2654
  # | `BYTES` | `File`, `IO`, `StringIO`, or similar | |
@@ -4284,6 +4285,66 @@ module Google
4284
4285
  default_value_expression: default_value_expression
4285
4286
  end
4286
4287
 
4288
+ ##
4289
+ # Adds an json field to the schema.
4290
+ #
4291
+ # See {Schema#json}.
4292
+ # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#json_type
4293
+ #
4294
+ # @param [String] name The field name. The name must contain only
4295
+ # letters (`[A-Za-z]`), numbers (`[0-9]`), or underscores (`_`), and must
4296
+ # start with a letter or underscore. The maximum length is 128
4297
+ # characters.
4298
+ # @param [String] description A description of the field.
4299
+ # @param [Symbol] mode The field's mode. The possible values are
4300
+ # `:nullable`, `:required`, and `:repeated`. The default value is
4301
+ # `:nullable`.
4302
+ # @param [Array<String>, String] policy_tags The policy tag list or
4303
+ # single policy tag for the field. Policy tag identifiers are of
4304
+ # the form `projects/*/locations/*/taxonomies/*/policyTags/*`.
4305
+ # At most 1 policy tag is currently allowed.
4306
+ # @param default_value_expression [String] The default value of a field
4307
+ # using a SQL expression. It can only be set for top level fields (columns).
4308
+ # Use a struct or array expression to specify default value for the entire struct or
4309
+ # array. The valid SQL expressions are:
4310
+ # - Literals for all data types, including STRUCT and ARRAY.
4311
+ # - The following functions:
4312
+ # `CURRENT_TIMESTAMP`
4313
+ # `CURRENT_TIME`
4314
+ # `CURRENT_DATE`
4315
+ # `CURRENT_DATETIME`
4316
+ # `GENERATE_UUID`
4317
+ # `RAND`
4318
+ # `SESSION_USER`
4319
+ # `ST_GEOPOINT`
4320
+ # - Struct or array composed with the above allowed functions, for example:
4321
+ # "[CURRENT_DATE(), DATE '2020-01-01'"]
4322
+ #
4323
+ # @example
4324
+ # require "google/cloud/bigquery"
4325
+ #
4326
+ # bigquery = Google::Cloud::Bigquery.new
4327
+ # dataset = bigquery.dataset "my_dataset"
4328
+ # table = dataset.create_table "my_table" do |schema|
4329
+ # schema.json "person", mode: :required
4330
+ # end
4331
+ #
4332
+ # @example Add field with default value.
4333
+ # require "google/cloud/bigquery"
4334
+ #
4335
+ # bigquery = Google::Cloud::Bigquery.new
4336
+ # dataset = bigquery.dataset "my_dataset"
4337
+ # table = dataset.create_table "my_table" do |schema|
4338
+ # schema.json "person", default_value_expression: "JSON '{"name": "Alice", "age": 30}'"
4339
+ # end
4340
+ #
4341
+ # @!group Schema
4342
+ def json name, description: nil, mode: :nullable, policy_tags: nil,
4343
+ default_value_expression: nil
4344
+ schema.json name, description: description, mode: mode, policy_tags: policy_tags,
4345
+ default_value_expression: default_value_expression
4346
+ end
4347
+
4287
4348
  ##
4288
4349
  # Adds a record field to the schema. A block must be passed describing
4289
4350
  # the nested fields of the record. For more information about nested
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Bigquery
19
- VERSION = "1.46.1".freeze
19
+ VERSION = "1.48.0".freeze
20
20
  end
21
21
  end
22
22
  end
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.46.1
4
+ version: 1.48.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: 2024-01-26 00:00:00.000000000 Z
12
+ date: 2024-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby