Skip to content

Commit 841299d

Browse files
committed
Return null in BigQuery getNextSourcePage
1 parent af8e88d commit 841299d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryQueryPageSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ public long getMemoryUsage()
161161
public SourcePage getNextSourcePage()
162162
{
163163
verify(pageBuilder.isEmpty());
164+
if (!tableResultFuture.isDone()) {
165+
return null;
166+
}
164167
if (tableResult == null) {
165168
tableResult = getFutureValue(tableResultFuture);
166169
}

plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryStorageArrowPageSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public boolean isFinished()
106106
public SourcePage getNextSourcePage()
107107
{
108108
checkState(pageBuilder.isEmpty(), "PageBuilder is not empty at the beginning of a new page");
109+
if (!nextResponse.isDone()) {
110+
return null;
111+
}
109112
ReadRowsResponse response;
110113
try {
111114
response = getFutureValue(nextResponse);

plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryStorageAvroPageSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ public boolean isFinished()
159159
public SourcePage getNextSourcePage()
160160
{
161161
checkState(pageBuilder.isEmpty(), "PageBuilder is not empty at the beginning of a new page");
162+
if (!nextResponse.isDone()) {
163+
return null;
164+
}
162165
ReadRowsResponse response;
163166
try {
164167
response = getFutureValue(nextResponse);

0 commit comments

Comments
 (0)