Skip to content

Commit 1a7d764

Browse files
Google APIscopybara-github
authored andcommitted
feat: deprecate bigquery storage v1alpha2 API
Committer: @yirutang PiperOrigin-RevId: 366823379
1 parent b1614aa commit 1a7d764

File tree

5 files changed

+39
-10
lines changed

5 files changed

+39
-10
lines changed

google/cloud/bigquery/storage/v1alpha2/bigquerystorage_v1alpha2.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ title: BigQuery Storage API
66
apis:
77
- name: google.cloud.bigquery.storage.v1alpha2.BigQueryWrite
88

9+
backend:
10+
rules:
11+
- selector: 'google.cloud.bigquery.storage.v1alpha2.BigQueryWrite.*'
12+
deadline: 120.0
13+
- selector: google.cloud.bigquery.storage.v1alpha2.BigQueryWrite.AppendRows
14+
deadline: 21600.0
15+
916
authentication:
1017
rules:
1118
- selector: 'google.cloud.bigquery.storage.v1alpha2.BigQueryWrite.*'

google/cloud/bigquery/storage/v1alpha2/protobuf.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.

google/cloud/bigquery/storage/v1alpha2/storage.proto

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.
@@ -50,13 +50,19 @@ message CreateWriteStreamRequest {
5050
//
5151
// The Write API can be used to write data to BigQuery.
5252
service BigQueryWrite {
53+
option deprecated = true;
5354
option (google.api.default_host) = "bigquerystorage.googleapis.com";
5455
option (google.api.oauth_scopes) =
5556
"https://www.googleapis.com/auth/bigquery,"
5657
"https://www.googleapis.com/auth/bigquery.insertdata,"
5758
"https://www.googleapis.com/auth/cloud-platform";
5859

5960
// Creates a write stream to the given table.
61+
// Additionally, every table has a special COMMITTED stream named '_default'
62+
// to which data can be written. This stream doesn't need to be created using
63+
// CreateWriteStream. It is a stream that can be used simultaneously by any
64+
// number of clients. Data written to this stream is considered committed as
65+
// soon as an acknowledgement is received.
6066
rpc CreateWriteStream(CreateWriteStreamRequest) returns (WriteStream) {
6167
option (google.api.http) = {
6268
post: "/v1alpha2/{parent=projects/*/datasets/*/tables/*}"
@@ -102,7 +108,7 @@ service BigQueryWrite {
102108
}
103109

104110
// Finalize a write stream so that no new data can be appended to the
105-
// stream.
111+
// stream. Finalize is not supported on the '_default' stream.
106112
rpc FinalizeWriteStream(FinalizeWriteStreamRequest) returns (FinalizeWriteStreamResponse) {
107113
option (google.api.http) = {
108114
post: "/v1alpha2/{name=projects/*/datasets/*/tables/*/streams/*}"
@@ -128,6 +134,7 @@ service BigQueryWrite {
128134
// required in order for the rows to become available for reading. A
129135
// Flush operation flushes up to any previously flushed offset in a BUFFERED
130136
// stream, to the offset specified in the request.
137+
// Flush is not supported on the _default stream, since it is not BUFFERED.
131138
rpc FlushRows(FlushRowsRequest) returns (FlushRowsResponse) {
132139
option (google.api.http) = {
133140
post: "/v1alpha2/{write_stream=projects/*/datasets/*/tables/*/streams/*}"
@@ -150,6 +157,8 @@ message AppendRowsRequest {
150157
// Required. The stream that is the target of the append operation. This value must be
151158
// specified for the initial request. If subsequent requests specify the
152159
// stream name, it must equal to the value provided in the first request.
160+
// To write to the _default stream, populate this field with a string in the
161+
// format `projects/{project}/datasets/{dataset}/tables/{table}/_default`.
153162
string write_stream = 1 [
154163
(google.api.field_behavior) = REQUIRED,
155164
(google.api.resource_reference) = {
@@ -159,7 +168,8 @@ message AppendRowsRequest {
159168

160169
// Optional. If present, the write is only performed if the next append offset is same
161170
// as the provided value. If not present, the write is performed at the
162-
// current end of stream.
171+
// current end of stream. Specifying a value for this field is not allowed
172+
// when calling AppendRows for the '_default' stream.
163173
google.protobuf.Int64Value offset = 2 [(google.api.field_behavior) = OPTIONAL];
164174

165175
// Input rows. The `writer_schema` field must be specified at the initial
@@ -183,7 +193,18 @@ message AppendRowsResponse {
183193
int64 offset = 1;
184194

185195
// Error in case of append failure. If set, it means rows are not accepted
186-
// into the system. Users can retry within the same connection.
196+
// into the system. Users can retry or continue with other requests within
197+
// the same connection.
198+
// ALREADY_EXISTS: happens when offset is specified, it means the row is
199+
// already appended, it is safe to ignore this error.
200+
// OUT_OF_RANGE: happens when offset is specified, it means the specified
201+
// offset is beyond the end of the stream.
202+
// INVALID_ARGUMENT: error caused by malformed request or data.
203+
// RESOURCE_EXHAUSTED: request rejected due to throttling. Only happens when
204+
// append without offset.
205+
// ABORTED: request processing is aborted because of prior failures, request
206+
// can be retried if previous failure is fixed.
207+
// INTERNAL: server side errors that can be retried.
187208
google.rpc.Status error = 2;
188209
}
189210

google/cloud/bigquery/storage/v1alpha2/stream.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.
@@ -56,7 +56,8 @@ message WriteStream {
5656

5757
Type type = 2 [(google.api.field_behavior) = IMMUTABLE];
5858

59-
// Output only. Create time of the stream.
59+
// Output only. Create time of the stream. For the _default stream, this is the
60+
// creation_time of the table.
6061
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
6162

6263
// Output only. Commit time of the stream.

google/cloud/bigquery/storage/v1alpha2/table.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 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.
@@ -63,10 +63,10 @@ message TableFieldSchema {
6363
// Combination of civil date and civil time
6464
DATETIME = 10;
6565

66-
// Geography object (go/googlesql_geography)
66+
// Geography object
6767
GEOGRAPHY = 11;
6868

69-
// Numeric value (go/googlesql_numeric)
69+
// Numeric value
7070
NUMERIC = 12;
7171
}
7272

0 commit comments

Comments
 (0)