google-cloud-bigquery-storage-v1 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -1
- data/lib/google-cloud-bigquery-storage-v1.rb +21 -1
- data/lib/google/cloud/bigquery/storage/v1.rb +18 -0
- data/lib/google/cloud/bigquery/storage/v1/big_query_read.rb +34 -1
- data/lib/google/cloud/bigquery/storage/v1/big_query_read/client.rb +31 -62
- data/lib/google/cloud/bigquery/storage/v1/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7337540110b472ba215f9c619a0adaf365f165b5c2925bbdfb1f09643ff20fb6
|
4
|
+
data.tar.gz: f88a1ca2cee278fd0fa21c7902f52498dce2d6b64dbcbad61bff0236d8356d22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6936a74f38e76ec24e8c011fb694e33a790c0f326e49bea2c7ba21df89426bdfd7d0c5cd635ba898b0998065cf3c225da5e0dda7fc6742e4399fa4ebd7efc95
|
7
|
+
data.tar.gz: 47367aede21c530fb8600b7b7ba31b059d50ead93cfce3718edcfd31e3b28e08422aaeab3559bc195c9389f1e0a13983607e4536d6ccfe285c19ccd545a49ec4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# BigQuery Storage V1
|
1
|
+
# Ruby Client for the BigQuery Storage V1 API
|
2
2
|
|
3
3
|
API Client library for the BigQuery Storage V1 API
|
4
4
|
|
@@ -12,6 +12,53 @@ https://github.com/googleapis/google-cloud-ruby
|
|
12
12
|
$ gem install google-cloud-bigquery-storage-v1
|
13
13
|
```
|
14
14
|
|
15
|
+
## Before You Begin
|
16
|
+
|
17
|
+
In order to use this library, you first need to go through the following steps:
|
18
|
+
|
19
|
+
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
20
|
+
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
21
|
+
1. {file:AUTHENTICATION.md Set up authentication.}
|
22
|
+
|
23
|
+
## Quick Start
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require "google/cloud/bigquery/storage/v1"
|
27
|
+
|
28
|
+
client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
|
29
|
+
request = my_create_request
|
30
|
+
response = client.create_read_session request
|
31
|
+
```
|
32
|
+
|
33
|
+
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-bigquery-storage-v1/latest)
|
34
|
+
for class and method documentation.
|
35
|
+
|
36
|
+
## Enabling Logging
|
37
|
+
|
38
|
+
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
39
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
40
|
+
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
41
|
+
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
42
|
+
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
43
|
+
|
44
|
+
Configuring a Ruby stdlib logger:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
require "logger"
|
48
|
+
|
49
|
+
module MyLogger
|
50
|
+
LOGGER = Logger.new $stderr, level: Logger::WARN
|
51
|
+
def logger
|
52
|
+
LOGGER
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
57
|
+
module GRPC
|
58
|
+
extend MyLogger
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
15
62
|
## Supported Ruby Versions
|
16
63
|
|
17
64
|
This library is supported on Ruby 2.4+.
|
@@ -1 +1,21 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
# This gem does not autoload during Bundler.require. To load this gem,
|
20
|
+
# issue explicit require statements for the packages desired, e.g.:
|
21
|
+
# require "google/cloud/bigquery/storage/v1"
|
@@ -17,3 +17,21 @@
|
|
17
17
|
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
18
|
|
19
19
|
require "google/cloud/bigquery/storage/v1/big_query_read"
|
20
|
+
require "google/cloud/bigquery/storage/v1/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Bigquery
|
25
|
+
module Storage
|
26
|
+
##
|
27
|
+
# To load this package, including all its services, and instantiate a client:
|
28
|
+
#
|
29
|
+
# require "google/cloud/bigquery/storage/v1"
|
30
|
+
# client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
|
31
|
+
#
|
32
|
+
module V1
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -16,5 +16,38 @@
|
|
16
16
|
|
17
17
|
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
18
|
|
19
|
-
require "
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/bigquery/storage/v1/version"
|
24
|
+
|
20
25
|
require "google/cloud/bigquery/storage/v1/big_query_read/credentials"
|
26
|
+
require "google/cloud/bigquery/storage/v1/big_query_read/paths"
|
27
|
+
require "google/cloud/bigquery/storage/v1/big_query_read/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Bigquery
|
32
|
+
module Storage
|
33
|
+
module V1
|
34
|
+
##
|
35
|
+
# BigQuery Read API.
|
36
|
+
#
|
37
|
+
# The Read API can be used to read data from BigQuery.
|
38
|
+
#
|
39
|
+
# To load this service and instantiate a client:
|
40
|
+
#
|
41
|
+
# require "google/cloud/bigquery/storage/v1/big_query_read"
|
42
|
+
# client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
|
43
|
+
#
|
44
|
+
module BigQueryRead
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
helper_path = ::File.join __dir__, "big_query_read", "helpers.rb"
|
53
|
+
require "google/cloud/bigquery/storage/v1/big_query_read/helpers" if ::File.file? helper_path
|
@@ -16,15 +16,8 @@
|
|
16
16
|
|
17
17
|
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
18
|
|
19
|
-
require "gapic/common"
|
20
|
-
require "gapic/config"
|
21
|
-
require "gapic/config/method"
|
22
|
-
|
23
19
|
require "google/cloud/errors"
|
24
|
-
require "google/cloud/bigquery/storage/v1/version"
|
25
20
|
require "google/cloud/bigquery/storage/v1/storage_pb"
|
26
|
-
require "google/cloud/bigquery/storage/v1/big_query_read/credentials"
|
27
|
-
require "google/cloud/bigquery/storage/v1/big_query_read/paths"
|
28
21
|
|
29
22
|
module Google
|
30
23
|
module Cloud
|
@@ -199,34 +192,24 @@ module Google
|
|
199
192
|
# not require manual clean-up by the caller.
|
200
193
|
#
|
201
194
|
# @overload create_read_session(request, options = nil)
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
#
|
208
|
-
#
|
209
|
-
# A particular row can be read by at most one stream. When the caller has
|
210
|
-
# reached the end of each stream in the session, then all the data in the
|
211
|
-
# table has been read.
|
212
|
-
#
|
213
|
-
# Data is assigned to each stream such that roughly the same number of
|
214
|
-
# rows can be read from each stream. Because the server-side unit for
|
215
|
-
# assigning data is collections of rows, the API does not guarantee that
|
216
|
-
# each stream will return the same number or rows. Additionally, the
|
217
|
-
# limits are enforced based on the number of pre-filtered rows, so some
|
218
|
-
# filters can lead to lopsided assignments.
|
219
|
-
#
|
220
|
-
# Read sessions automatically expire 24 hours after they are created and do
|
221
|
-
# not require manual clean-up by the caller.
|
195
|
+
# Pass arguments to `create_read_session` via a request object, either of type
|
196
|
+
# {Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest} or an equivalent Hash.
|
197
|
+
#
|
198
|
+
# @param request [Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest, Hash]
|
199
|
+
# A request object representing the call parameters. Required. To specify no
|
200
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
222
201
|
# @param options [Gapic::CallOptions, Hash]
|
223
202
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
224
203
|
#
|
225
204
|
# @overload create_read_session(parent: nil, read_session: nil, max_stream_count: nil)
|
205
|
+
# Pass arguments to `create_read_session` via keyword arguments. Note that at
|
206
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
207
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
208
|
+
#
|
226
209
|
# @param parent [String]
|
227
210
|
# Required. The request project that owns the session, in the form of
|
228
211
|
# `projects/{project_id}`.
|
229
|
-
# @param read_session [Google::Cloud::Bigquery::Storage::V1::ReadSession
|
212
|
+
# @param read_session [Google::Cloud::Bigquery::Storage::V1::ReadSession, Hash]
|
230
213
|
# Required. Session to be created.
|
231
214
|
# @param max_stream_count [Integer]
|
232
215
|
# Max initial number of streams. If unset or zero, the server will
|
@@ -238,7 +221,6 @@ module Google
|
|
238
221
|
#
|
239
222
|
# Streams must be read starting from offset 0.
|
240
223
|
#
|
241
|
-
#
|
242
224
|
# @yield [response, operation] Access the result along with the RPC operation
|
243
225
|
# @yieldparam response [Google::Cloud::Bigquery::Storage::V1::ReadSession]
|
244
226
|
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
@@ -294,18 +276,20 @@ module Google
|
|
294
276
|
# state of the stream.
|
295
277
|
#
|
296
278
|
# @overload read_rows(request, options = nil)
|
297
|
-
#
|
298
|
-
#
|
299
|
-
#
|
300
|
-
#
|
301
|
-
#
|
302
|
-
#
|
303
|
-
# Each request also returns a set of stream statistics reflecting the current
|
304
|
-
# state of the stream.
|
279
|
+
# Pass arguments to `read_rows` via a request object, either of type
|
280
|
+
# {Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest} or an equivalent Hash.
|
281
|
+
#
|
282
|
+
# @param request [Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest, Hash]
|
283
|
+
# A request object representing the call parameters. Required. To specify no
|
284
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
305
285
|
# @param options [Gapic::CallOptions, Hash]
|
306
286
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
307
287
|
#
|
308
288
|
# @overload read_rows(read_stream: nil, offset: nil)
|
289
|
+
# Pass arguments to `read_rows` via keyword arguments. Note that at
|
290
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
291
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
292
|
+
#
|
309
293
|
# @param read_stream [String]
|
310
294
|
# Required. Stream to read rows from.
|
311
295
|
# @param offset [Integer]
|
@@ -313,7 +297,6 @@ module Google
|
|
313
297
|
# Requesting a larger offset is undefined. If not specified, start reading
|
314
298
|
# from offset zero.
|
315
299
|
#
|
316
|
-
#
|
317
300
|
# @yield [response, operation] Access the result along with the RPC operation
|
318
301
|
# @yieldparam response [Enumerable<Google::Cloud::Bigquery::Storage::V1::ReadRowsResponse>]
|
319
302
|
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
@@ -374,23 +357,20 @@ module Google
|
|
374
357
|
# completion.
|
375
358
|
#
|
376
359
|
# @overload split_read_stream(request, options = nil)
|
377
|
-
#
|
378
|
-
#
|
379
|
-
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
# the same as the rows read from the original stream.
|
384
|
-
#
|
385
|
-
# Moreover, the two child streams will be allocated back-to-back in the
|
386
|
-
# original `ReadStream`. Concretely, it is guaranteed that for streams
|
387
|
-
# original, primary, and residual, that original[0-j] = primary[0-j] and
|
388
|
-
# original[j-n] = residual[0-m] once the streams have been read to
|
389
|
-
# completion.
|
360
|
+
# Pass arguments to `split_read_stream` via a request object, either of type
|
361
|
+
# {Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest} or an equivalent Hash.
|
362
|
+
#
|
363
|
+
# @param request [Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest, Hash]
|
364
|
+
# A request object representing the call parameters. Required. To specify no
|
365
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
390
366
|
# @param options [Gapic::CallOptions, Hash]
|
391
367
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
392
368
|
#
|
393
369
|
# @overload split_read_stream(name: nil, fraction: nil)
|
370
|
+
# Pass arguments to `split_read_stream` via keyword arguments. Note that at
|
371
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
372
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
373
|
+
#
|
394
374
|
# @param name [String]
|
395
375
|
# Required. Name of the stream to split.
|
396
376
|
# @param fraction [Float]
|
@@ -402,7 +382,6 @@ module Google
|
|
402
382
|
# server-side unit for assigning data is collections of rows, this fraction
|
403
383
|
# will always map to a data storage boundary on the server side.
|
404
384
|
#
|
405
|
-
#
|
406
385
|
# @yield [response, operation] Access the result along with the RPC operation
|
407
386
|
# @yieldparam response [Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse]
|
408
387
|
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
@@ -616,13 +595,3 @@ module Google
|
|
616
595
|
end
|
617
596
|
end
|
618
597
|
end
|
619
|
-
|
620
|
-
# rubocop:disable Lint/HandleExceptions
|
621
|
-
|
622
|
-
# Once client is loaded, load helpers.rb if it exists.
|
623
|
-
begin
|
624
|
-
require "google/cloud/bigquery/storage/v1/big_query_read/helpers"
|
625
|
-
rescue LoadError
|
626
|
-
end
|
627
|
-
|
628
|
-
# rubocop:enable Lint/HandleExceptions
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-bigquery-storage-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|