@@ -18,13 +18,15 @@ syntax = "proto3";
1818package google.cloud.bigquery.storage.v1beta1 ;
1919
2020import "google/api/annotations.proto" ;
21+ import "google/api/client.proto" ;
22+ import "google/api/field_behavior.proto" ;
23+ import "google/api/resource.proto" ;
2124import "google/cloud/bigquery/storage/v1beta1/arrow.proto" ;
2225import "google/cloud/bigquery/storage/v1beta1/avro.proto" ;
2326import "google/cloud/bigquery/storage/v1beta1/read_options.proto" ;
2427import "google/cloud/bigquery/storage/v1beta1/table_reference.proto" ;
2528import "google/protobuf/empty.proto" ;
2629import "google/protobuf/timestamp.proto" ;
27- import "google/api/client.proto" ;
2830
2931option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage" ;
3032option java_package = "com.google.cloud.bigquery.storage.v1beta1" ;
@@ -36,6 +38,7 @@ service BigQueryStorage {
3638 option (google.api.default_host ) = "bigquerystorage.googleapis.com" ;
3739 option (google.api.oauth_scopes ) =
3840 "https://www.googleapis.com/auth/bigquery,"
41+ "https://www.googleapis.com/auth/bigquery.readonly,"
3942 "https://www.googleapis.com/auth/cloud-platform" ;
4043
4144 // Creates a new read session. A read session divides the contents of a
@@ -59,6 +62,7 @@ service BigQueryStorage {
5962 body : "*"
6063 }
6164 };
65+ option (google.api.method_signature ) = "table_reference,parent,requested_streams" ;
6266 }
6367
6468 // Reads rows from the table in the format prescribed by the read session.
@@ -74,6 +78,7 @@ service BigQueryStorage {
7478 option (google.api.http ) = {
7579 get : "/v1beta1/{read_position.stream.name=projects/*/streams/*}"
7680 };
81+ option (google.api.method_signature ) = "read_position" ;
7782 }
7883
7984 // Creates additional streams for a ReadSession. This API can be used to
@@ -84,6 +89,7 @@ service BigQueryStorage {
8489 post : "/v1beta1/{session.name=projects/*/sessions/*}"
8590 body : "*"
8691 };
92+ option (google.api.method_signature ) = "session,requested_streams" ;
8793 }
8894
8995 // Triggers the graceful termination of a single stream in a ReadSession. This
@@ -105,6 +111,7 @@ service BigQueryStorage {
105111 post : "/v1beta1/{stream.name=projects/*/streams/*}"
106112 body : "*"
107113 };
114+ option (google.api.method_signature ) = "stream" ;
108115 }
109116
110117 // Splits a given read stream into two Streams. These streams are referred to
@@ -124,11 +131,17 @@ service BigQueryStorage {
124131 option (google.api.http ) = {
125132 get : "/v1beta1/{original_stream.name=projects/*/streams/*}"
126133 };
134+ option (google.api.method_signature ) = "original_stream" ;
127135 }
128136}
129137
130138// Information about a single data stream within a read session.
131139message Stream {
140+ option (google.api.resource ) = {
141+ type : "bigquerystorage.googleapis.com/Stream"
142+ pattern : "projects/{project}/locations/{location}/streams/{stream}"
143+ };
144+
132145 // Name of the stream, in the form
133146 // `projects/{project_id}/locations/{location}/streams/{stream_id}`.
134147 string name = 1 ;
@@ -145,6 +158,11 @@ message StreamPosition {
145158
146159// Information returned from a `CreateReadSession` request.
147160message ReadSession {
161+ option (google.api.resource ) = {
162+ type : "bigquerystorage.googleapis.com/ReadSession"
163+ pattern : "projects/{project}/locations/{location}/sessions/{session}"
164+ };
165+
148166 // Unique identifier for the session, in the form
149167 // `projects/{project_id}/locations/{location}/sessions/{session_id}`.
150168 string name = 1 ;
@@ -181,17 +199,17 @@ message ReadSession {
181199// requested parallelism, projection filters and constraints.
182200message CreateReadSessionRequest {
183201 // Required. Reference to the table to read.
184- TableReference table_reference = 1 ;
202+ TableReference table_reference = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
185203
186204 // Required. String of the form `projects/{project_id}` indicating the
187205 // project this ReadSession is associated with. This is the project that will
188206 // be billed for usage.
189- string parent = 6 ;
207+ string parent = 6 [ (google.api .field_behavior ) = REQUIRED ] ;
190208
191- // Optional. Any modifiers to the Table (e.g. snapshot timestamp).
209+ // Any modifiers to the Table (e.g. snapshot timestamp).
192210 TableModifiers table_modifiers = 2 ;
193211
194- // Optional. Initial number of streams. If unset or 0, we will
212+ // Initial number of streams. If unset or 0, we will
195213 // provide a value of streams so as to produce reasonable throughput. Must be
196214 // non-negative. The number of streams may be lower than the requested number,
197215 // depending on the amount parallelism that is reasonable for the table and
@@ -200,7 +218,7 @@ message CreateReadSessionRequest {
200218 // Streams must be read starting from offset 0.
201219 int32 requested_streams = 3 ;
202220
203- // Optional. Read options for this session (e.g. column selection, filters).
221+ // Read options for this session (e.g. column selection, filters).
204222 TableReadOptions read_options = 4 ;
205223
206224 // Data output format. Currently default to Avro.
@@ -248,7 +266,7 @@ message ReadRowsRequest {
248266 // Required. Identifier of the position in the stream to start reading from.
249267 // The offset requested must be less than the last row read from ReadRows.
250268 // Requesting a larger offset is undefined.
251- StreamPosition read_position = 1 ;
269+ StreamPosition read_position = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
252270}
253271
254272// Progress information for a given Stream.
@@ -267,6 +285,12 @@ message StreamStatus {
267285 // sharding strategy.
268286 float fraction_consumed = 2 ;
269287
288+ // Represents the progress of the current stream.
289+ //
290+ // Note: This value is under development and should not be used. Use
291+ // `fraction_consumed` instead.
292+ Progress progress = 4 ;
293+
270294 // Whether this stream can be split. For sessions that use the LIQUID sharding
271295 // strategy, this value is always false. For BALANCED sessions, this value is
272296 // false when enough data have been read such that no more splits are possible
@@ -275,6 +299,25 @@ message StreamStatus {
275299 bool is_splittable = 3 ;
276300}
277301
302+ message Progress {
303+ // The fraction of rows assigned to the stream that have been processed by the
304+ // server so far, not including the rows in the current response message.
305+ //
306+ // This value, along with `at_response_end`, can be used to interpolate the
307+ // progress made as the rows in the message are being processed using the
308+ // following formula: `at_response_start + (at_response_end -
309+ // at_response_start) * rows_processed_from_response / rows_in_response`.
310+ //
311+ // Note that if a filter is provided, the `at_response_end` value of the
312+ // previous response may not necessarily be equal to the `at_response_start`
313+ // value of the current response.
314+ float at_response_start = 1 ;
315+
316+ // Similar to `at_response_start`, except that this value includes the rows in
317+ // the current response.
318+ float at_response_end = 2 ;
319+ }
320+
278321// Information on if the current connection is being throttled.
279322message ThrottleStatus {
280323 // How much this connection is being throttled.
@@ -313,12 +356,12 @@ message ReadRowsResponse {
313356message BatchCreateReadSessionStreamsRequest {
314357 // Required. Must be a non-expired session obtained from a call to
315358 // CreateReadSession. Only the name field needs to be set.
316- ReadSession session = 1 ;
359+ ReadSession session = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
317360
318361 // Required. Number of new streams requested. Must be positive.
319362 // Number of added streams may be less than this, see CreateReadSessionRequest
320363 // for more information.
321- int32 requested_streams = 2 ;
364+ int32 requested_streams = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
322365}
323366
324367// The response from `BatchCreateReadSessionStreams` returns the stream
0 commit comments