Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit fff5c89

Browse files
docs: Align session length with public documentation feat: Expose estimated bytes that a session will scan. (#1310)
* docs: Align session length with public documentation feat: Expose estimated bytes that a session will scan. Committer: @emkornfield PiperOrigin-RevId: 396849937 Source-Link: googleapis/googleapis@5661452 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ef220dabba6365d8294cd95618ab96f53529ea6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGVmMjIwZGFiYmE2MzY1ZDgyOTRjZDk1NjE4YWI5NmY1MzUyOWVhNiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 7be798d commit fff5c89

File tree

8 files changed

+159
-31
lines changed

8 files changed

+159
-31
lines changed

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public BigQueryReadStub getStub() {
163163
* limits are enforced based on the number of pre-filtered rows, so some filters can lead to
164164
* lopsided assignments.
165165
*
166-
* <p>Read sessions automatically expire 24 hours after they are created and do not require manual
166+
* <p>Read sessions automatically expire 6 hours after they are created and do not require manual
167167
* clean-up by the caller.
168168
*
169169
* <p>Sample code:
@@ -216,7 +216,7 @@ public final ReadSession createReadSession(
216216
* limits are enforced based on the number of pre-filtered rows, so some filters can lead to
217217
* lopsided assignments.
218218
*
219-
* <p>Read sessions automatically expire 24 hours after they are created and do not require manual
219+
* <p>Read sessions automatically expire 6 hours after they are created and do not require manual
220220
* clean-up by the caller.
221221
*
222222
* <p>Sample code:
@@ -269,7 +269,7 @@ public final ReadSession createReadSession(
269269
* limits are enforced based on the number of pre-filtered rows, so some filters can lead to
270270
* lopsided assignments.
271271
*
272-
* <p>Read sessions automatically expire 24 hours after they are created and do not require manual
272+
* <p>Read sessions automatically expire 6 hours after they are created and do not require manual
273273
* clean-up by the caller.
274274
*
275275
* <p>Sample code:
@@ -309,7 +309,7 @@ public final ReadSession createReadSession(CreateReadSessionRequest request) {
309309
* limits are enforced based on the number of pre-filtered rows, so some filters can lead to
310310
* lopsided assignments.
311311
*
312-
* <p>Read sessions automatically expire 24 hours after they are created and do not require manual
312+
* <p>Read sessions automatically expire 6 hours after they are created and do not require manual
313313
* clean-up by the caller.
314314
*
315315
* <p>Sample code:

google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/BaseBigQueryReadClientTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public void createReadSessionTest() throws Exception {
9292
.setTableModifiers(ReadSession.TableModifiers.newBuilder().build())
9393
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build())
9494
.addAllStreams(new ArrayList<ReadStream>())
95+
.setEstimatedTotalBytesScanned(452788190)
9596
.build();
9697
mockBigQueryRead.addResponse(expectedResponse);
9798

@@ -142,6 +143,7 @@ public void createReadSessionTest2() throws Exception {
142143
.setTableModifiers(ReadSession.TableModifiers.newBuilder().build())
143144
.setReadOptions(ReadSession.TableReadOptions.newBuilder().build())
144145
.addAllStreams(new ArrayList<ReadStream>())
146+
.setEstimatedTotalBytesScanned(452788190)
145147
.build();
146148
mockBigQueryRead.addResponse(expectedResponse);
147149

grpc-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/BigQueryReadGrpc.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public abstract static class BigQueryReadImplBase implements io.grpc.BindableSer
244244
* each stream will return the same number or rows. Additionally, the
245245
* limits are enforced based on the number of pre-filtered rows, so some
246246
* filters can lead to lopsided assignments.
247-
* Read sessions automatically expire 24 hours after they are created and do
247+
* Read sessions automatically expire 6 hours after they are created and do
248248
* not require manual clean-up by the caller.
249249
* </pre>
250250
*/
@@ -365,7 +365,7 @@ protected BigQueryReadStub build(io.grpc.Channel channel, io.grpc.CallOptions ca
365365
* each stream will return the same number or rows. Additionally, the
366366
* limits are enforced based on the number of pre-filtered rows, so some
367367
* filters can lead to lopsided assignments.
368-
* Read sessions automatically expire 24 hours after they are created and do
368+
* Read sessions automatically expire 6 hours after they are created and do
369369
* not require manual clean-up by the caller.
370370
* </pre>
371371
*/
@@ -465,7 +465,7 @@ protected BigQueryReadBlockingStub build(
465465
* each stream will return the same number or rows. Additionally, the
466466
* limits are enforced based on the number of pre-filtered rows, so some
467467
* filters can lead to lopsided assignments.
468-
* Read sessions automatically expire 24 hours after they are created and do
468+
* Read sessions automatically expire 6 hours after they are created and do
469469
* not require manual clean-up by the caller.
470470
* </pre>
471471
*/
@@ -555,7 +555,7 @@ protected BigQueryReadFutureStub build(
555555
* each stream will return the same number or rows. Additionally, the
556556
* limits are enforced based on the number of pre-filtered rows, so some
557557
* filters can lead to lopsided assignments.
558-
* Read sessions automatically expire 24 hours after they are created and do
558+
* Read sessions automatically expire 6 hours after they are created and do
559559
* not require manual clean-up by the caller.
560560
* </pre>
561561
*/

proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSession.java

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ private ReadSession(
192192
com.google.cloud.bigquery.storage.v1.ReadStream.parser(), extensionRegistry));
193193
break;
194194
}
195+
case 96:
196+
{
197+
estimatedTotalBytesScanned_ = input.readInt64();
198+
break;
199+
}
195200
default:
196201
{
197202
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -3161,6 +3166,27 @@ public com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getStreamsOrBuil
31613166
return streams_.get(index);
31623167
}
31633168

3169+
public static final int ESTIMATED_TOTAL_BYTES_SCANNED_FIELD_NUMBER = 12;
3170+
private long estimatedTotalBytesScanned_;
3171+
/**
3172+
*
3173+
*
3174+
* <pre>
3175+
* Output only. An estimate on the number of bytes this session will scan when
3176+
* all streams are completely consumed. This estimate is based on
3177+
* metadata from the table which might be incomplete or stale.
3178+
* </pre>
3179+
*
3180+
* <code>int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
3181+
* </code>
3182+
*
3183+
* @return The estimatedTotalBytesScanned.
3184+
*/
3185+
@java.lang.Override
3186+
public long getEstimatedTotalBytesScanned() {
3187+
return estimatedTotalBytesScanned_;
3188+
}
3189+
31643190
private byte memoizedIsInitialized = -1;
31653191

31663192
@java.lang.Override
@@ -3203,6 +3229,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
32033229
for (int i = 0; i < streams_.size(); i++) {
32043230
output.writeMessage(10, streams_.get(i));
32053231
}
3232+
if (estimatedTotalBytesScanned_ != 0L) {
3233+
output.writeInt64(12, estimatedTotalBytesScanned_);
3234+
}
32063235
unknownFields.writeTo(output);
32073236
}
32083237

@@ -3244,6 +3273,10 @@ public int getSerializedSize() {
32443273
for (int i = 0; i < streams_.size(); i++) {
32453274
size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, streams_.get(i));
32463275
}
3276+
if (estimatedTotalBytesScanned_ != 0L) {
3277+
size +=
3278+
com.google.protobuf.CodedOutputStream.computeInt64Size(12, estimatedTotalBytesScanned_);
3279+
}
32473280
size += unknownFields.getSerializedSize();
32483281
memoizedSize = size;
32493282
return size;
@@ -3276,6 +3309,7 @@ public boolean equals(final java.lang.Object obj) {
32763309
if (!getReadOptions().equals(other.getReadOptions())) return false;
32773310
}
32783311
if (!getStreamsList().equals(other.getStreamsList())) return false;
3312+
if (getEstimatedTotalBytesScanned() != other.getEstimatedTotalBytesScanned()) return false;
32793313
if (!getSchemaCase().equals(other.getSchemaCase())) return false;
32803314
switch (schemaCase_) {
32813315
case 4:
@@ -3320,6 +3354,8 @@ public int hashCode() {
33203354
hash = (37 * hash) + STREAMS_FIELD_NUMBER;
33213355
hash = (53 * hash) + getStreamsList().hashCode();
33223356
}
3357+
hash = (37 * hash) + ESTIMATED_TOTAL_BYTES_SCANNED_FIELD_NUMBER;
3358+
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEstimatedTotalBytesScanned());
33233359
switch (schemaCase_) {
33243360
case 4:
33253361
hash = (37 * hash) + AVRO_SCHEMA_FIELD_NUMBER;
@@ -3509,6 +3545,8 @@ public Builder clear() {
35093545
} else {
35103546
streamsBuilder_.clear();
35113547
}
3548+
estimatedTotalBytesScanned_ = 0L;
3549+
35123550
schemaCase_ = 0;
35133551
schema_ = null;
35143552
return this;
@@ -3580,6 +3618,7 @@ public com.google.cloud.bigquery.storage.v1.ReadSession buildPartial() {
35803618
} else {
35813619
result.streams_ = streamsBuilder_.build();
35823620
}
3621+
result.estimatedTotalBytesScanned_ = estimatedTotalBytesScanned_;
35833622
result.schemaCase_ = schemaCase_;
35843623
onBuilt();
35853624
return result;
@@ -3678,6 +3717,9 @@ public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.ReadSession other)
36783717
}
36793718
}
36803719
}
3720+
if (other.getEstimatedTotalBytesScanned() != 0L) {
3721+
setEstimatedTotalBytesScanned(other.getEstimatedTotalBytesScanned());
3722+
}
36813723
switch (other.getSchemaCase()) {
36823724
case AVRO_SCHEMA:
36833725
{
@@ -5622,6 +5664,67 @@ public com.google.cloud.bigquery.storage.v1.ReadStream.Builder addStreamsBuilder
56225664
return streamsBuilder_;
56235665
}
56245666

5667+
private long estimatedTotalBytesScanned_;
5668+
/**
5669+
*
5670+
*
5671+
* <pre>
5672+
* Output only. An estimate on the number of bytes this session will scan when
5673+
* all streams are completely consumed. This estimate is based on
5674+
* metadata from the table which might be incomplete or stale.
5675+
* </pre>
5676+
*
5677+
* <code>int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
5678+
* </code>
5679+
*
5680+
* @return The estimatedTotalBytesScanned.
5681+
*/
5682+
@java.lang.Override
5683+
public long getEstimatedTotalBytesScanned() {
5684+
return estimatedTotalBytesScanned_;
5685+
}
5686+
/**
5687+
*
5688+
*
5689+
* <pre>
5690+
* Output only. An estimate on the number of bytes this session will scan when
5691+
* all streams are completely consumed. This estimate is based on
5692+
* metadata from the table which might be incomplete or stale.
5693+
* </pre>
5694+
*
5695+
* <code>int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
5696+
* </code>
5697+
*
5698+
* @param value The estimatedTotalBytesScanned to set.
5699+
* @return This builder for chaining.
5700+
*/
5701+
public Builder setEstimatedTotalBytesScanned(long value) {
5702+
5703+
estimatedTotalBytesScanned_ = value;
5704+
onChanged();
5705+
return this;
5706+
}
5707+
/**
5708+
*
5709+
*
5710+
* <pre>
5711+
* Output only. An estimate on the number of bytes this session will scan when
5712+
* all streams are completely consumed. This estimate is based on
5713+
* metadata from the table which might be incomplete or stale.
5714+
* </pre>
5715+
*
5716+
* <code>int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
5717+
* </code>
5718+
*
5719+
* @return This builder for chaining.
5720+
*/
5721+
public Builder clearEstimatedTotalBytesScanned() {
5722+
5723+
estimatedTotalBytesScanned_ = 0L;
5724+
onChanged();
5725+
return this;
5726+
}
5727+
56255728
@java.lang.Override
56265729
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
56275730
return super.setUnknownFields(unknownFields);

proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/ReadSessionOrBuilder.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,5 +402,21 @@ public interface ReadSessionOrBuilder
402402
*/
403403
com.google.cloud.bigquery.storage.v1.ReadStreamOrBuilder getStreamsOrBuilder(int index);
404404

405+
/**
406+
*
407+
*
408+
* <pre>
409+
* Output only. An estimate on the number of bytes this session will scan when
410+
* all streams are completely consumed. This estimate is based on
411+
* metadata from the table which might be incomplete or stale.
412+
* </pre>
413+
*
414+
* <code>int64 estimated_total_bytes_scanned = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
415+
* </code>
416+
*
417+
* @return The estimatedTotalBytesScanned.
418+
*/
419+
long getEstimatedTotalBytesScanned();
420+
405421
public com.google.cloud.bigquery.storage.v1.ReadSession.SchemaCase getSchemaCase();
406422
}

proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
5858
+ "le/api/resource.proto\032,google/cloud/bigq"
5959
+ "uery/storage/v1/arrow.proto\032+google/clou"
6060
+ "d/bigquery/storage/v1/avro.proto\032\037google"
61-
+ "/protobuf/timestamp.proto\"\370\007\n\013ReadSessio"
61+
+ "/protobuf/timestamp.proto\"\244\010\n\013ReadSessio"
6262
+ "n\022\021\n\004name\030\001 \001(\tB\003\340A\003\0224\n\013expire_time\030\002 \001("
6363
+ "\0132\032.google.protobuf.TimestampB\003\340A\003\022F\n\013da"
6464
+ "ta_format\030\003 \001(\0162,.google.cloud.bigquery."
@@ -74,27 +74,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
7474
+ "bigquery.storage.v1.ReadSession.TableRea"
7575
+ "dOptionsB\003\340A\001\022B\n\007streams\030\n \003(\0132,.google."
7676
+ "cloud.bigquery.storage.v1.ReadStreamB\003\340A"
77-
+ "\003\032C\n\016TableModifiers\0221\n\rsnapshot_time\030\001 \001"
78-
+ "(\0132\032.google.protobuf.Timestamp\032\324\001\n\020Table"
79-
+ "ReadOptions\022\027\n\017selected_fields\030\001 \003(\t\022\027\n\017"
80-
+ "row_restriction\030\002 \001(\t\022g\n\033arrow_serializa"
81-
+ "tion_options\030\003 \001(\0132;.google.cloud.bigque"
82-
+ "ry.storage.v1.ArrowSerializationOptionsB"
83-
+ "\003\340A\001H\000B%\n#output_format_serialization_op"
84-
+ "tions:k\352Ah\n*bigquerystorage.googleapis.c"
85-
+ "om/ReadSession\022:projects/{project}/locat"
86-
+ "ions/{location}/sessions/{session}B\010\n\006sc"
87-
+ "hema\"\234\001\n\nReadStream\022\021\n\004name\030\001 \001(\tB\003\340A\003:{"
88-
+ "\352Ax\n)bigquerystorage.googleapis.com/Read"
89-
+ "Stream\022Kprojects/{project}/locations/{lo"
90-
+ "cation}/sessions/{session}/streams/{stre"
91-
+ "am}*>\n\nDataFormat\022\033\n\027DATA_FORMAT_UNSPECI"
92-
+ "FIED\020\000\022\010\n\004AVRO\020\001\022\t\n\005ARROW\020\002B\304\001\n$com.goog"
93-
+ "le.cloud.bigquery.storage.v1B\013StreamProt"
94-
+ "oP\001ZGgoogle.golang.org/genproto/googleap"
95-
+ "is/cloud/bigquery/storage/v1;storage\252\002 G"
96-
+ "oogle.Cloud.BigQuery.Storage.V1\312\002 Google"
97-
+ "\\Cloud\\BigQuery\\Storage\\V1b\006proto3"
77+
+ "\003\022*\n\035estimated_total_bytes_scanned\030\014 \001(\003"
78+
+ "B\003\340A\003\032C\n\016TableModifiers\0221\n\rsnapshot_time"
79+
+ "\030\001 \001(\0132\032.google.protobuf.Timestamp\032\324\001\n\020T"
80+
+ "ableReadOptions\022\027\n\017selected_fields\030\001 \003(\t"
81+
+ "\022\027\n\017row_restriction\030\002 \001(\t\022g\n\033arrow_seria"
82+
+ "lization_options\030\003 \001(\0132;.google.cloud.bi"
83+
+ "gquery.storage.v1.ArrowSerializationOpti"
84+
+ "onsB\003\340A\001H\000B%\n#output_format_serializatio"
85+
+ "n_options:k\352Ah\n*bigquerystorage.googleap"
86+
+ "is.com/ReadSession\022:projects/{project}/l"
87+
+ "ocations/{location}/sessions/{session}B\010"
88+
+ "\n\006schema\"\234\001\n\nReadStream\022\021\n\004name\030\001 \001(\tB\003\340"
89+
+ "A\003:{\352Ax\n)bigquerystorage.googleapis.com/"
90+
+ "ReadStream\022Kprojects/{project}/locations"
91+
+ "/{location}/sessions/{session}/streams/{"
92+
+ "stream}*>\n\nDataFormat\022\033\n\027DATA_FORMAT_UNS"
93+
+ "PECIFIED\020\000\022\010\n\004AVRO\020\001\022\t\n\005ARROW\020\002B\304\001\n$com."
94+
+ "google.cloud.bigquery.storage.v1B\013Stream"
95+
+ "ProtoP\001ZGgoogle.golang.org/genproto/goog"
96+
+ "leapis/cloud/bigquery/storage/v1;storage"
97+
+ "\252\002 Google.Cloud.BigQuery.Storage.V1\312\002 Go"
98+
+ "ogle\\Cloud\\BigQuery\\Storage\\V1b\006proto3"
9899
};
99100
descriptor =
100101
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -121,6 +122,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
121122
"TableModifiers",
122123
"ReadOptions",
123124
"Streams",
125+
"EstimatedTotalBytesScanned",
124126
"Schema",
125127
});
126128
internal_static_google_cloud_bigquery_storage_v1_ReadSession_TableModifiers_descriptor =

proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/storage.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ service BigQueryRead {
6262
// limits are enforced based on the number of pre-filtered rows, so some
6363
// filters can lead to lopsided assignments.
6464
//
65-
// Read sessions automatically expire 24 hours after they are created and do
65+
// Read sessions automatically expire 6 hours after they are created and do
6666
// not require manual clean-up by the caller.
6767
rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) {
6868
option (google.api.http) = {

proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ message ReadSession {
126126
// in that case, the user will need to use a List method to get the streams
127127
// instead, which is not yet available.
128128
repeated ReadStream streams = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
129+
130+
// Output only. An estimate on the number of bytes this session will scan when
131+
// all streams are completely consumed. This estimate is based on
132+
// metadata from the table which might be incomplete or stale.
133+
int64 estimated_total_bytes_scanned = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
129134
}
130135

131136
// Information about a single stream that gets data out of the storage system.

0 commit comments

Comments
 (0)