ES|QL: Remove implicit limit in FORK branches in CSV tests#143601
Merged
ioanatia merged 5 commits intoelastic:mainfrom Mar 6, 2026
Merged
ES|QL: Remove implicit limit in FORK branches in CSV tests#143601ioanatia merged 5 commits intoelastic:mainfrom
ioanatia merged 5 commits intoelastic:mainfrom
Conversation
ioanatia
commented
Mar 5, 2026
| if (preference != null) { | ||
| pragmaBuilder.put(QueryPragmas.FIELD_EXTRACT_PREFERENCE.getKey(), preference.toString()).build(); | ||
| } | ||
| if (randomBoolean()) { |
Member
Author
There was a problem hiding this comment.
I removed this check here, because we already use randomBoolean in addRandomPragma
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
carlosdelest
approved these changes
Mar 6, 2026
Member
carlosdelest
left a comment
There was a problem hiding this comment.
LGTM, thanks for explaining the problem so thoroughly 👍
spinscale
pushed a commit
to spinscale/elasticsearch
that referenced
this pull request
Mar 6, 2026
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Mar 6, 2026
…locations * upstream/main: (153 commits) ES|QL: Update docs for TOP_SNIPPETS and DECAY (elastic#143739) Correctly include endpoint id in log msg in AuthorizationPoller (elastic#143743) Bar searching or sorting on _seq_no when disabled (elastic#143600) Generalize `testClientCancellation` test (elastic#143586) JSON_EXTRACT: zero-copy byte slicing for object, array, and number extraction (elastic#143702) Track recycler pages in circuit breaker (elastic#143738) [ESQL] Enable distributed pipeline breakers for external sources via FragmentExec (elastic#143696) Adding 'mode' and 'codec' fields to ES monitoring template (elastic#143673) [ESQL] Columnar I/O and vectorized block conversion for external sources (elastic#143703) Fix flaky MMR diversification YAML tests (elastic#143706) ES|QL codegen: check builder arguments for vector support (elastic#143724) Add Views Security Model (elastic#141050) ESQL: Prevent pushdown of unmapped fields in filters and sorts (elastic#143460) Don't run seq_no pruning tests in release CI (elastic#143725) ESQL: Support intra-row field references in ROW command (elastic#140217) ES|QL: Remove implicit limit in FORK branches in CSV tests (elastic#143601) IndexRoutingTests with and without synthetic id (elastic#143566) Synthetic id upgrade test in serverless (elastic#142471) Disable "Review skipped" comments for PRs without specified labels (elastic#143728) Cleanup ES|QL T-Digest code duplication, add memory accounting (elastic#143662) ...
sidosera
pushed a commit
to sidosera/elasticsearch
that referenced
this pull request
Mar 6, 2026
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.
We only remove the implicit limit we add to FORK branches, when the tests are running under snapshot (with a 50% chance, since we randomize this).
The more interesting case is when we running
GenerativeForkITwhich reuses all the existing CSV tests to generate new queries using FORK.When I removed the implicit limit, I noticed that
GenerativeForkITstarted failing with unbounded SORT errors.For example:
will get transformed into:
This query would then fail because the SORT is not bounded by a LIMIT and we cannot execute it.
I had to adjust
GenerativeForkRestTestto make sure a LIMIT is added immediately after FORK, so the query becomes:At the moment we don't push filters that are present after FORK into FORK branches (we should), so the implicit LIMIT we add at the end of each ES|QL query does not get to be pushed down into FORK branches.
Adding a LIMIT after FORK, ensured our optimizations will push the LIMIT into FORK branches.
I also had to adjust our existing optimizations, to recognize that when we have an unbounded SORT in the FORK branches, and we have a LIMIT (or a SORT + LIMIT) following FORK, we should still do a push down into the FORK branches, even if another pipeline breaker is present in the FORK branch.