Skip to content

Commit

Permalink
Fix minor issues with SQL pIT refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Manasvini B S <[email protected]>
  • Loading branch information
manasvinibs committed Sep 25, 2024
1 parent ce17d0a commit 8bebc36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ private Protocol buildProtocolForDefaultQuery(Client client, DefaultQueryAction

private boolean isDefaultCursor(SearchResponse searchResponse, DefaultQueryAction queryAction) {
if (LocalClusterState.state().getSettingValue(SQL_PAGINATION_API_SEARCH_AFTER)) {
if (searchResponse.getHits().getTotalHits().value < queryAction.getSqlRequest().fetchSize()) {
if (queryAction.getSqlRequest().fetchSize() == 0
|| searchResponse.getHits().getTotalHits().value
< queryAction.getSqlRequest().fetchSize()) {
return false;
} else {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void run() throws IOException, SqlParseException {
this.metaResults.setTookImMilli(joinTimeInMilli);
} catch (Exception e) {
LOG.error("Failed during join query run.", e);
throw new IllegalStateException("Error occurred during join query run", e);
} finally {
if (LocalClusterState.state().getSettingValue(SQL_PAGINATION_API_SEARCH_AFTER)) {
try {
Expand Down

0 comments on commit 8bebc36

Please sign in to comment.