Skip to content

Commit

Permalink
Fix BQ storage stream split (apache#32376)
Browse files Browse the repository at this point in the history
A variable shadowing was introduced, preventing modification of the
stream reader source after splitting.
  • Loading branch information
RustedBones authored Aug 30, 2024
1 parent fd8d146 commit 52ab49e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public synchronized BigQueryStorageStreamSource<T> getCurrentSource() {
// Because superclass cannot have preconditions around these variables, cannot use
// @RequiresNonNull
Preconditions.checkStateNotNull(responseStream);
BigQueryServerStream<ReadRowsResponse> responseStream = this.responseStream;
final BigQueryServerStream<ReadRowsResponse> responseStream = this.responseStream;
totalSplitCalls.inc();
LOG.debug(
"Received BigQuery Storage API split request for stream {} at fraction {}.",
Expand Down Expand Up @@ -433,9 +433,9 @@ public synchronized BigQueryStorageStreamSource<T> getCurrentSource() {

// Cancels the parent stream before replacing it with the primary stream.
responseStream.cancel();
source = source.fromExisting(splitResponse.getPrimaryStream());
responseStream = newResponseStream;
responseIterator = newResponseIterator;
this.source = source.fromExisting(splitResponse.getPrimaryStream());
this.responseStream = newResponseStream;
this.responseIterator = newResponseIterator;
reader.resetBuffer();
}

Expand Down

0 comments on commit 52ab49e

Please sign in to comment.