[BugFix] Prevent push down limit with offset reach maxResultWindow#3713
Merged
penghuo merged 2 commits intoopensearch-project:mainfrom Jun 10, 2025
Merged
[BugFix] Prevent push down limit with offset reach maxResultWindow#3713penghuo merged 2 commits intoopensearch-project:mainfrom
penghuo merged 2 commits intoopensearch-project:mainfrom
Conversation
…ndow Signed-off-by: Heng Qian <qianheng@amazon.com>
LantaoJin
reviewed
Jun 4, 2025
Comment on lines
25
to
31
| teardown: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled : false | ||
| plugins.calcite.fallback.allowed : true |
Member
There was a problem hiding this comment.
why we need this teardown step? it seems not enable calcite in setup step.
@penghuo is each xyx.yml independent?
Collaborator
There was a problem hiding this comment.
no need revert setting, by default is disabled
| query: 'source=test | head 2 | head 1 from 1 ' | ||
| - match: { "total": 1 } | ||
| - match: { "schema": [ { "name": "id", "type": "bigint" } ] } | ||
| - match: { "datarows": [ [ 2 ] ] } |
Member
There was a problem hiding this comment.
what's the result without this fixing?
penghuo
reviewed
Jun 5, 2025
Comment on lines
25
to
31
| teardown: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled : false | ||
| plugins.calcite.fallback.allowed : true |
Collaborator
There was a problem hiding this comment.
nit, no need revert setting, by default is disabled
Comment on lines
25
to
31
| teardown: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled : false | ||
| plugins.calcite.fallback.allowed : true |
Collaborator
There was a problem hiding this comment.
no need revert setting, by default is disabled
Signed-off-by: Heng Qian <qianheng@amazon.com>
LantaoJin
approved these changes
Jun 10, 2025
penghuo
approved these changes
Jun 10, 2025
penghuo
pushed a commit
that referenced
this pull request
Jun 16, 2025
…3713) * [BugFix] Prevent push down limit with offset no less than maxResultWindow Signed-off-by: Heng Qian <qianheng@amazon.com> * Address comments Signed-off-by: Heng Qian <qianheng@amazon.com> --------- Signed-off-by: Heng Qian <qianheng@amazon.com> Signed-off-by: xinyual <xinyual@amazon.com>
This was referenced Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prevent push down limit with offset reach maxResultWindow
The index setting of
max_result_windowis the maximum restriction offrom + size.https://docs.opensearch.org/docs/latest/install-and-configure/configuring-opensearch/index-settings/
Thus in our code of building OpenSearch request, we have logic of using
sizeequals tomaxResultWindow -statFromifstartFrom + size > maxResultWindow. It will have problem if we got newsizeequal to 0 or less than 0.We could address this issue by preventing such limit from push down if it would cause the new
startFromto reach the maxResultWindow.Related Issues
Resolves #3102
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.