Skip to content

Commit 25d691b

Browse files
Google APIscopybara-github
authored andcommitted
docs: improve documentation for write client
feat: update default timeout/retry information feat: update parent annotation for BatchCommitWriteStreamsRequest feat: expose additional StorageError enum values PiperOrigin-RevId: 431973595
1 parent c392eb0 commit 25d691b

3 files changed

Lines changed: 60 additions & 34 deletions

File tree

google/cloud/bigquery/storage/v1/bigquerystorage_grpc_service_config.json

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,38 @@
55
{
66
"service": "google.cloud.bigquery.storage.v1.BigQueryRead",
77
"method": "CreateReadSession"
8-
},
8+
}
9+
],
10+
"timeout": "600s",
11+
"retryPolicy": {
12+
"initialBackoff": "0.100s",
13+
"maxBackoff": "60s",
14+
"backoffMultiplier": 1.3,
15+
"retryableStatusCodes": [
16+
"DEADLINE_EXCEEDED",
17+
"UNAVAILABLE"
18+
]
19+
}
20+
},
21+
{
22+
"name": [
23+
{
24+
"service": "google.cloud.bigquery.storage.v1.BigQueryRead",
25+
"method": "ReadRows"
26+
}
27+
],
28+
"timeout": "86400s",
29+
"retryPolicy": {
30+
"initialBackoff": "0.100s",
31+
"maxBackoff": "60s",
32+
"backoffMultiplier": 1.3,
33+
"retryableStatusCodes": [
34+
"UNAVAILABLE"
35+
]
36+
}
37+
},
38+
{
39+
"name": [
940
{
1041
"service": "google.cloud.bigquery.storage.v1.BigQueryRead",
1142
"method": "SplitReadStream"
@@ -25,8 +56,8 @@
2556
{
2657
"name": [
2758
{
28-
"service": "google.cloud.bigquery.storage.v1.BigQueryRead",
29-
"method": "ReadRows"
59+
"service": "google.cloud.bigquery.storage.v1.BigQueryWrite",
60+
"method": "AppendRows"
3061
}
3162
],
3263
"timeout": "86400s",
@@ -38,7 +69,8 @@
3869
"UNAVAILABLE"
3970
]
4071
}
41-
}, {
72+
},
73+
{
4274
"name": [
4375
{
4476
"service": "google.cloud.bigquery.storage.v1.BigQueryWrite",
@@ -71,22 +103,6 @@
71103
"UNAVAILABLE"
72104
]
73105
}
74-
}, {
75-
"name": [
76-
{
77-
"service": "google.cloud.bigquery.storage.v1.BigQueryWrite",
78-
"method": "AppendRows"
79-
}
80-
],
81-
"timeout": "86400s",
82-
"retryPolicy": {
83-
"initialBackoff": "0.100s",
84-
"maxBackoff": "60s",
85-
"backoffMultiplier": 1.3,
86-
"retryableStatusCodes": [
87-
"UNAVAILABLE"
88-
]
89-
}
90106
}
91107
]
92108
}

google/cloud/bigquery/storage/v1/bigquerystorage_v1.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,10 @@ backend:
1515
deadline: 21600.0
1616
- selector: google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream
1717
deadline: 120.0
18-
- selector: google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStram
19-
deadline: 120.0
20-
- selector: google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream
21-
deadline: 120.0
22-
- selector: google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams
23-
deadline: 120.0
24-
- selector: google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream
25-
deadline: 120.0
26-
- selector: google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows
18+
- selector: 'google.cloud.bigquery.storage.v1.BigQueryWrite.*'
2719
deadline: 120.0
2820
- selector: google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows
29-
deadline: 86400.0
21+
deadline: 21600.0
3022

3123
authentication:
3224
rules:

google/cloud/bigquery/storage/v1/storage.proto

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -167,6 +167,13 @@ service BigQueryWrite {
167167
// * For PENDING streams, data is not made visible until the stream itself is
168168
// finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly
169169
// committed via the `BatchCommitWriteStreams` rpc.
170+
//
171+
// Note: For users coding against the gRPC api directly, it may be
172+
// necessary to supply the x-goog-request-params system parameter
173+
// with `write_stream=<full_write_stream_name>`.
174+
//
175+
// More information about system parameters:
176+
// https://cloud.google.com/apis/docs/system-parameters
170177
rpc AppendRows(stream AppendRowsRequest) returns (stream AppendRowsResponse) {
171178
option (google.api.http) = {
172179
post: "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}"
@@ -408,10 +415,12 @@ message AppendRowsRequest {
408415
// request.
409416
//
410417
// For explicitly created write streams, the format is:
411-
// `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}`
418+
//
419+
// * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}`
412420
//
413421
// For the special default stream, the format is:
414-
// `projects/{project}/datasets/{dataset}/tables/{table}/_default`.
422+
//
423+
// * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`.
415424
string write_stream = 1 [
416425
(google.api.field_behavior) = REQUIRED,
417426
(google.api.resource_reference) = {
@@ -498,7 +507,10 @@ message BatchCommitWriteStreamsRequest {
498507
// Required. Parent table that all the streams should belong to, in the form of
499508
// `projects/{project}/datasets/{dataset}/tables/{table}`.
500509
string parent = 1 [
501-
(google.api.field_behavior) = REQUIRED
510+
(google.api.field_behavior) = REQUIRED,
511+
(google.api.resource_reference) = {
512+
type: "bigquery.googleapis.com/Table"
513+
}
502514
];
503515

504516
// Required. The group of streams that will be committed atomically.
@@ -593,6 +605,12 @@ message StorageError {
593605
// There is a schema mismatch and it is caused by user schema has extra
594606
// field than bigquery schema.
595607
SCHEMA_MISMATCH_EXTRA_FIELDS = 7;
608+
609+
// Offset already exists.
610+
OFFSET_ALREADY_EXISTS = 8;
611+
612+
// Offset out of range.
613+
OFFSET_OUT_OF_RANGE = 9;
596614
}
597615

598616
// BigQuery Storage specific error code.

0 commit comments

Comments
 (0)