[ES|QL] Allow single fork branch#136805
Conversation
|
Hi @pmpailis, I've created a changelog YAML for you. |
|
@ioanatia went through the documentation but could not find any specific references to the >= 2 branches limitation that needed to be updated. |
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
| expectError("FROM foo* | FORK (LIMIT 10)", "line 1:13: Fork requires at least 2 branches"); | ||
| expectError("FROM foo* | FORK (SORT a)", "line 1:13: Fork requires at least 2 branches"); | ||
| expectError("FROM foo* | FORK (WHERE x>1 | LIMIT 5)", "line 1:13: Fork requires at least 2 branches"); | ||
| expectError("FROM foo* | WHERE x>1 | FORK (WHERE a:\"baz\")", "Fork requires at least 2 branches"); |
There was a problem hiding this comment.
can we get a test for FORK with no branches? I think the grammar does not support it, but I don't think I added a test for that.
There was a problem hiding this comment.
Updated in a8ce7b9. I've also added a test in FuseIT to consume the result of a single-branched FORK. Let me know if you see any issues :)
|
also thought a bit more about the discussion we had around doing an optimization, like in the LogicalPlanBuilder when a single FORK branch is being used, to not even use the FORK logical plan, but have a "linear" plan. |
…d chaining fuse after a one-branch fork
…csearch into allow_single_fork_branch
|
Thanks for reviewing this (again) @ioanatia ! |
## Summary After elastic/elasticsearch#136805, FORK can be run using a single branch. Removed the "Must include at least two branches" validation. <img width="1144" height="360" alt="image" src="https://github.com/user-attachments/assets/2ce81fec-51d6-46c5-b562-8f068ab5ee40" /> The pipe is now suggested after the first branch.
# Backport This will backport the following commits from `main` to `9.4`: - [[ES|QL] FORK now can be run on only one branch (#267712)](#267712) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sebastian Delle Donne","email":"sebastian.delledonne@elastic.co"},"sourceCommit":{"committedDate":"2026-05-06T07:15:08Z","message":"[ES|QL] FORK now can be run on only one branch (#267712)\n\n## Summary\nAfter elastic/elasticsearch#136805, FORK can be\nrun using a single branch.\n\nRemoved the \"Must include at least two branches\" validation.\n<img width=\"1144\" height=\"360\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2ce81fec-51d6-46c5-b562-8f068ab5ee40\"\n/>\n\nThe pipe is now suggested after the first branch.","sha":"c743a2f1d6cece659b7547272c747c9914f21620","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:ES|QL","Team:ESQL","backport:version","v9.3.0","v9.4.0","v9.5.0"],"title":"[ES|QL] FORK now can be run on only one branch","number":267712,"url":"https://github.com/elastic/kibana/pull/267712","mergeCommit":{"message":"[ES|QL] FORK now can be run on only one branch (#267712)\n\n## Summary\nAfter elastic/elasticsearch#136805, FORK can be\nrun using a single branch.\n\nRemoved the \"Must include at least two branches\" validation.\n<img width=\"1144\" height=\"360\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2ce81fec-51d6-46c5-b562-8f068ab5ee40\"\n/>\n\nThe pipe is now suggested after the first branch.","sha":"c743a2f1d6cece659b7547272c747c9914f21620"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.4"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/267712","number":267712,"mergeCommit":{"message":"[ES|QL] FORK now can be run on only one branch (#267712)\n\n## Summary\nAfter elastic/elasticsearch#136805, FORK can be\nrun using a single branch.\n\nRemoved the \"Must include at least two branches\" validation.\n<img width=\"1144\" height=\"360\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/2ce81fec-51d6-46c5-b562-8f068ab5ee40\"\n/>\n\nThe pipe is now suggested after the first branch.","sha":"c743a2f1d6cece659b7547272c747c9914f21620"}}]}] BACKPORT--> Co-authored-by: Sebastian Delle Donne <sebastian.delledonne@elastic.co>
Removing the requirement for > 2 fork branches. So a query like
will now be allowed, and only
fork1will be added to the result set.Closes #135825