Skip to content

Commit

Permalink
[BUG] error occurs when using the LIMIT clause with AthenaGoogleBigQu…
Browse files Browse the repository at this point in the history
…eryConnector (#1808)
  • Loading branch information
Trianz-Akshay authored Mar 8, 2024
1 parent ba27e15 commit 646e686
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private void getTableData(BlockSpiller spiller, ReadRecordsRequest recordsReques
for (ReadRowsResponse response : stream) {
Preconditions.checkState(response.hasArrowRecordBatch());
VectorSchemaRoot root = reader.processRows(response.getArrowRecordBatch());
long rowLimit = (recordsRequest.getConstraints().getLimit() > 0) ? recordsRequest.getConstraints().getLimit() : root.getRowCount();
long rowLimit = (recordsRequest.getConstraints().getLimit() > 0 && recordsRequest.getConstraints().getLimit() < root.getRowCount()) ? recordsRequest.getConstraints().getLimit() : root.getRowCount();
for (int rowIndex = 0; rowIndex < rowLimit; rowIndex++) {
outputResults(spiller, recordsRequest, root, rowIndex);
}
Expand Down

0 comments on commit 646e686

Please sign in to comment.