Skip to content

Commit

Permalink
FlinkResultSet#close will do nothing if all results are fetched from …
Browse files Browse the repository at this point in the history
…a job
  • Loading branch information
tsreaper authored and godfreyhe committed Apr 8, 2020
1 parent da1ed7f commit a24cc26
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public synchronized void close() throws SQLException {
return;
}

if (jobIdOrResultSet.isLeft()) {
if (jobIdOrResultSet.isLeft() && rowData.hasMoreResponse()) {
// no need to lock, closing while fetching new results should throw exception
session.cancelJob(jobIdOrResultSet.left());
}
Expand Down Expand Up @@ -1395,6 +1395,10 @@ boolean isAfterLast() {
return ret;
}

boolean hasMoreResponse() {
return hasMoreResponse;
}

Row getCurrentRow() {
lock.readLock().lock();
Row ret = currentRow;
Expand Down

0 comments on commit a24cc26

Please sign in to comment.