google-cloud-bigquery 0.27.1 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/bigquery/table.rb +90 -0
- data/lib/google/cloud/bigquery/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41cd0596408cd35451c4db0c52fe0b7901dff7ea
|
4
|
+
data.tar.gz: fb36dac2c6d09940b4335980b808fc6d9564b84d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf8190937417f431a6221c408b911c958c2c83be1b4cce3688a130e2f9f44a5645c68e81f16368a3b3e524e9c5ae87ea095e4b3791bbd8970d93dc5afafb4d32
|
7
|
+
data.tar.gz: 2ad979a3b853e4e2fc6813f5e98279181a39d082b843079752d3d4fd63c1732f37e261584b5b77c3aa0f47f6b3a45386bd1ea5e3ac97cb4acaf35d84d3d83ff7
|
@@ -118,6 +118,96 @@ module Google
|
|
118
118
|
table_ref
|
119
119
|
end
|
120
120
|
|
121
|
+
###
|
122
|
+
# Is the table partitioned?
|
123
|
+
#
|
124
|
+
# @!group Attributes
|
125
|
+
#
|
126
|
+
def time_partitioning?
|
127
|
+
!@gapi.time_partitioning.nil?
|
128
|
+
end
|
129
|
+
|
130
|
+
###
|
131
|
+
# The period for which the table is partitioned, if any.
|
132
|
+
#
|
133
|
+
# @!group Attributes
|
134
|
+
#
|
135
|
+
def time_partitioning_type
|
136
|
+
ensure_full_data!
|
137
|
+
@gapi.time_partitioning.type if time_partitioning?
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Sets the partitioning for the table. See [Partitioned Tables
|
142
|
+
# ](https://cloud.google.com/bigquery/docs/partitioned-tables).
|
143
|
+
#
|
144
|
+
# You can only set partitioning when creating a table as in
|
145
|
+
# the example below. BigQuery does not allow you to change partitioning
|
146
|
+
# on an existing table.
|
147
|
+
#
|
148
|
+
# @param [String] type The partition type. Currently the only
|
149
|
+
# supported value is "DAY".
|
150
|
+
#
|
151
|
+
# @example
|
152
|
+
# require "google/cloud/bigquery"
|
153
|
+
#
|
154
|
+
# bigquery = Google::Cloud::Bigquery.new
|
155
|
+
# dataset = bigquery.dataset "my_dataset"
|
156
|
+
# table = dataset.create_table "my_table" do |table|
|
157
|
+
# table.time_partitioning_type = "DAY"
|
158
|
+
# end
|
159
|
+
#
|
160
|
+
# @!group Attributes
|
161
|
+
#
|
162
|
+
def time_partitioning_type= type
|
163
|
+
@gapi.time_partitioning ||=
|
164
|
+
Google::Apis::BigqueryV2::TimePartitioning.new
|
165
|
+
@gapi.time_partitioning.type = type
|
166
|
+
patch_gapi! :time_partitioning
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
###
|
171
|
+
# The expiration for the table partitions, if any, in seconds.
|
172
|
+
#
|
173
|
+
# @!group Attributes
|
174
|
+
#
|
175
|
+
def time_partitioning_expiration
|
176
|
+
ensure_full_data!
|
177
|
+
@gapi.time_partitioning.expiration_ms / 1_000 if
|
178
|
+
time_partitioning? &&
|
179
|
+
!@gapi.time_partitioning.expiration_ms.nil?
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# Sets the partition expiration for the table. See [Partitioned Tables
|
184
|
+
# ](https://cloud.google.com/bigquery/docs/partitioned-tables). The
|
185
|
+
# table must also be partitioned.
|
186
|
+
#
|
187
|
+
# See {Table#time_partitioning_type=}.
|
188
|
+
#
|
189
|
+
# @param [Integer] expiration An expiration time, in seconds,
|
190
|
+
# for data in partitions.
|
191
|
+
#
|
192
|
+
# @example
|
193
|
+
# require "google/cloud/bigquery"
|
194
|
+
#
|
195
|
+
# bigquery = Google::Cloud::Bigquery.new
|
196
|
+
# dataset = bigquery.dataset "my_dataset"
|
197
|
+
# table = dataset.create_table "my_table" do |table|
|
198
|
+
# table.time_partitioning_type = "DAY"
|
199
|
+
# table.time_partitioning_expiration = 86_400
|
200
|
+
# end
|
201
|
+
#
|
202
|
+
# @!group Attributes
|
203
|
+
#
|
204
|
+
def time_partitioning_expiration= expiration
|
205
|
+
@gapi.time_partitioning ||=
|
206
|
+
Google::Apis::BigqueryV2::TimePartitioning.new
|
207
|
+
@gapi.time_partitioning.expiration_ms = expiration * 1000
|
208
|
+
patch_gapi! :time_partitioning
|
209
|
+
end
|
210
|
+
|
121
211
|
##
|
122
212
|
# The combined Project ID, Dataset ID, and Table ID for this table, in
|
123
213
|
# the format specified by the [Legacy SQL Query
|
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: 0.
|
4
|
+
version: 0.28.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: 2017-
|
12
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.14.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.
|
41
|
+
version: 0.14.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: minitest
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
224
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.6.
|
225
|
+
rubygems_version: 2.6.13
|
226
226
|
signing_key:
|
227
227
|
specification_version: 4
|
228
228
|
summary: API Client library for Google BigQuery
|