google-cloud-bigquery 1.58.0 → 1.59.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/CHANGELOG.md +6 -0
- data/lib/google/cloud/bigquery/dataset.rb +31 -0
- data/lib/google/cloud/bigquery/schema/field.rb +31 -3
- data/lib/google/cloud/bigquery/schema.rb +6 -3
- data/lib/google/cloud/bigquery/table.rb +39 -3
- data/lib/google/cloud/bigquery/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1f6d09bd925b1c1b03aa149fc848ab6e1524207045ef6abb2101f57254f9b5c
|
4
|
+
data.tar.gz: 28e45683731235e96448f1b4d5eb3e20d14be7966fa0ad7e12f4cf342342dd3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e4dbca7f7e8194694b7ee127f822fb405d482610f84a6245b994d4b100c91e110a5d60737b9a889dd99cc5c28154bb62c64bff467078d4ced7bd78845dd268
|
7
|
+
data.tar.gz: ee80b48d42b3a99e2f3cbc4cfb9297ccaa02f2c715bde3221dba31380eac3745822de30c7e50a9b263f3179108b62495238cf155a6bc7f4c6c6e33fb3a05b5e0
|
data/CHANGELOG.md
CHANGED
@@ -197,6 +197,37 @@ module Google
|
|
197
197
|
patch_gapi! :description
|
198
198
|
end
|
199
199
|
|
200
|
+
##
|
201
|
+
# The default collation of the dataset.
|
202
|
+
#
|
203
|
+
# @return [String, nil] The default collation, or `nil` if not present or the object is a
|
204
|
+
# reference (see {#reference?}).
|
205
|
+
#
|
206
|
+
# @!group Attributes
|
207
|
+
#
|
208
|
+
def default_collation
|
209
|
+
return nil if reference?
|
210
|
+
ensure_full_data!
|
211
|
+
@gapi.default_collation
|
212
|
+
end
|
213
|
+
|
214
|
+
##
|
215
|
+
# Updates the default collation of the dataset.
|
216
|
+
#
|
217
|
+
# If the dataset is not a full resource representation (see
|
218
|
+
# {#resource_full?}), the full representation will be retrieved before
|
219
|
+
# the update to comply with ETag-based optimistic concurrency control.
|
220
|
+
#
|
221
|
+
# @param [String] new_default_collation The new default collation for the dataset.
|
222
|
+
#
|
223
|
+
# @!group Attributes
|
224
|
+
#
|
225
|
+
def default_collation= new_default_collation
|
226
|
+
reload! unless resource_full?
|
227
|
+
@gapi.update! default_collation: new_default_collation
|
228
|
+
patch_gapi! :default_collation
|
229
|
+
end
|
230
|
+
|
200
231
|
##
|
201
232
|
# The default lifetime of all tables in the dataset, in milliseconds.
|
202
233
|
#
|
@@ -351,6 +351,31 @@ module Google
|
|
351
351
|
@gapi.scale
|
352
352
|
end
|
353
353
|
|
354
|
+
##
|
355
|
+
# The collation of the field.
|
356
|
+
#
|
357
|
+
# Collation can be set only when the type of field is `STRING`.
|
358
|
+
# The following values are supported:
|
359
|
+
#
|
360
|
+
# * `und:ci`: undetermined locale, case insensitive.
|
361
|
+
# * (empty string): Default to case-sensitive behavior.
|
362
|
+
#
|
363
|
+
# @return [String, nil] The collation for the field, or `nil`.
|
364
|
+
#
|
365
|
+
def collation
|
366
|
+
@gapi.collation
|
367
|
+
end
|
368
|
+
|
369
|
+
##
|
370
|
+
# Updates the collation of the field.
|
371
|
+
#
|
372
|
+
# @param [String] new_collation The new collation. See {#collation}
|
373
|
+
# for supported values.
|
374
|
+
#
|
375
|
+
def collation= new_collation
|
376
|
+
@gapi.update! collation: new_collation
|
377
|
+
end
|
378
|
+
|
354
379
|
##
|
355
380
|
# Checks if the type of the field is `STRING`.
|
356
381
|
#
|
@@ -568,7 +593,7 @@ module Google
|
|
568
593
|
# @param [Integer] max_length The maximum UTF-8 length of strings
|
569
594
|
# allowed in the field.
|
570
595
|
#
|
571
|
-
def string name, description: nil, mode: :nullable, policy_tags: nil, max_length: nil
|
596
|
+
def string name, description: nil, mode: :nullable, policy_tags: nil, max_length: nil, collation: nil
|
572
597
|
record_check!
|
573
598
|
|
574
599
|
add_field name,
|
@@ -576,7 +601,8 @@ module Google
|
|
576
601
|
description: description,
|
577
602
|
mode: mode,
|
578
603
|
policy_tags: policy_tags,
|
579
|
-
max_length: max_length
|
604
|
+
max_length: max_length,
|
605
|
+
collation: collation
|
580
606
|
end
|
581
607
|
|
582
608
|
##
|
@@ -1029,7 +1055,8 @@ module Google
|
|
1029
1055
|
policy_tags: nil,
|
1030
1056
|
max_length: nil,
|
1031
1057
|
precision: nil,
|
1032
|
-
scale: nil
|
1058
|
+
scale: nil,
|
1059
|
+
collation: nil
|
1033
1060
|
frozen_check!
|
1034
1061
|
|
1035
1062
|
new_gapi = Google::Apis::BigqueryV2::TableFieldSchema.new(
|
@@ -1046,6 +1073,7 @@ module Google
|
|
1046
1073
|
new_gapi.max_length = max_length if max_length
|
1047
1074
|
new_gapi.precision = precision if precision
|
1048
1075
|
new_gapi.scale = scale if scale
|
1076
|
+
new_gapi.collation = collation if collation
|
1049
1077
|
# Remove any existing field of this name
|
1050
1078
|
@gapi.fields ||= []
|
1051
1079
|
@gapi.fields.reject! { |f| f.name == new_gapi.name }
|
@@ -318,13 +318,14 @@ module Google
|
|
318
318
|
# "[CURRENT_DATE(), DATE '2020-01-01'"]
|
319
319
|
#
|
320
320
|
def string name, description: nil, mode: :nullable, policy_tags: nil,
|
321
|
-
max_length: nil, default_value_expression: nil
|
321
|
+
max_length: nil, default_value_expression: nil, collation: nil
|
322
322
|
add_field name, :string,
|
323
323
|
description: description,
|
324
324
|
mode: mode,
|
325
325
|
policy_tags: policy_tags,
|
326
326
|
max_length: max_length,
|
327
|
-
default_value_expression: default_value_expression
|
327
|
+
default_value_expression: default_value_expression,
|
328
|
+
collation: collation
|
328
329
|
end
|
329
330
|
|
330
331
|
##
|
@@ -981,7 +982,8 @@ module Google
|
|
981
982
|
max_length: nil,
|
982
983
|
precision: nil,
|
983
984
|
scale: nil,
|
984
|
-
default_value_expression: nil
|
985
|
+
default_value_expression: nil,
|
986
|
+
collation: nil
|
985
987
|
frozen_check!
|
986
988
|
|
987
989
|
new_gapi = Google::Apis::BigqueryV2::TableFieldSchema.new(
|
@@ -999,6 +1001,7 @@ module Google
|
|
999
1001
|
new_gapi.precision = precision if precision
|
1000
1002
|
new_gapi.scale = scale if scale
|
1001
1003
|
new_gapi.default_value_expression = default_value_expression if default_value_expression
|
1004
|
+
new_gapi.collation = collation if collation
|
1002
1005
|
# Remove any existing field of this name
|
1003
1006
|
@gapi.fields ||= []
|
1004
1007
|
@gapi.fields.reject! { |f| f.name == new_gapi.name }
|
@@ -752,6 +752,37 @@ module Google
|
|
752
752
|
patch_gapi! :description
|
753
753
|
end
|
754
754
|
|
755
|
+
##
|
756
|
+
# The default collation of the table.
|
757
|
+
#
|
758
|
+
# @return [String, nil] The default collation, or `nil` if not present or the object is a
|
759
|
+
# reference (see {#reference?}).
|
760
|
+
#
|
761
|
+
# @!group Attributes
|
762
|
+
#
|
763
|
+
def default_collation
|
764
|
+
return nil if reference?
|
765
|
+
ensure_full_data!
|
766
|
+
@gapi.default_collation
|
767
|
+
end
|
768
|
+
|
769
|
+
##
|
770
|
+
# Updates the default collation of the table.
|
771
|
+
#
|
772
|
+
# If the table is not a full resource representation (see
|
773
|
+
# {#resource_full?}), the full representation will be retrieved before
|
774
|
+
# the update to comply with ETag-based optimistic concurrency control.
|
775
|
+
#
|
776
|
+
# @param [String] new_default_collation The new default collation for the table.
|
777
|
+
#
|
778
|
+
# @!group Attributes
|
779
|
+
#
|
780
|
+
def default_collation= new_default_collation
|
781
|
+
reload! unless resource_full?
|
782
|
+
@gapi.update! default_collation: new_default_collation
|
783
|
+
patch_gapi! :default_collation
|
784
|
+
end
|
785
|
+
|
755
786
|
##
|
756
787
|
# The number of bytes in the table.
|
757
788
|
#
|
@@ -3706,7 +3737,7 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
3706
3737
|
# At most 1 policy tag is currently allowed.
|
3707
3738
|
# @param [Integer] max_length The maximum UTF-8 length of strings
|
3708
3739
|
# allowed in the field.
|
3709
|
-
# @param
|
3740
|
+
# @param [String] default_value_expression The default value of a field
|
3710
3741
|
# using a SQL expression. It can only be set for top level fields (columns).
|
3711
3742
|
# Use a struct or array expression to specify default value for the entire struct or
|
3712
3743
|
# array. The valid SQL expressions are:
|
@@ -3722,6 +3753,11 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
3722
3753
|
# `ST_GEOPOINT`
|
3723
3754
|
# - Struct or array composed with the above allowed functions, for example:
|
3724
3755
|
# "[CURRENT_DATE(), DATE '2020-01-01'"]
|
3756
|
+
# @param [String] collation The collation of the field.
|
3757
|
+
# Collation can be set only when the type of field is `STRING`.
|
3758
|
+
# The following values are supported:
|
3759
|
+
# - `und:ci`: undetermined locale, case insensitive.
|
3760
|
+
# - (empty string): Default to case-sensitive behavior.
|
3725
3761
|
#
|
3726
3762
|
# @example
|
3727
3763
|
# require "google/cloud/bigquery"
|
@@ -3743,9 +3779,9 @@ format_options_use_int64_timestamp: format_options_use_int64_timestamp
|
|
3743
3779
|
#
|
3744
3780
|
# @!group Schema
|
3745
3781
|
def string name, description: nil, mode: :nullable, policy_tags: nil, max_length: nil,
|
3746
|
-
default_value_expression: nil
|
3782
|
+
default_value_expression: nil, collation: nil
|
3747
3783
|
schema.string name, description: description, mode: mode, policy_tags: policy_tags, max_length: max_length,
|
3748
|
-
default_value_expression: default_value_expression
|
3784
|
+
default_value_expression: default_value_expression, collation: collation
|
3749
3785
|
end
|
3750
3786
|
|
3751
3787
|
##
|