Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/changelog/129606.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pr: 129606
summary: Release FORK in tech preview
area: ES|QL
type: feature
issues: []
highlight:
title: Release FORK in tech preview
body: |-
Fork is a foundational building block that allows multiple branches of execution.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪 This is a thorough changelog entry.

Conceptually, fork is:
- a bifurcation of the stream, with all data going to each fork branch, followed by
- a merge of the branches, enhanced with a discriminator column called FORK:
Example:
[source,yaml]
----------------------------
FROM test
| FORK
( WHERE content:"fox" )
( WHERE content:"dog" )
| SORT _fork
----------------------------
The FORK command add a discriminator column called `_fork`:
[source,yaml]
----------------------------
| id | content | _fork |
|-----|-----------|-------|
| 3 | brown fox | fork1 |
| 4 | white dog | fork2 |
----------------------------
notable: true
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ book_no:keyword | title:text | author


reranker after RRF
required_capability: fork
required_capability: fork_v9
required_capability: rrf
required_capability: match_operator_colon
required_capability: rerank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//

simpleRrf
required_capability: fork
required_capability: fork_v9
required_capability: rrf
required_capability: match_operator_colon

Expand All @@ -22,7 +22,7 @@ _score:double | _fork:keyword | emp_no:integer
;

rrfWithMatchAndScore
required_capability: fork
required_capability: fork_v9
required_capability: rrf
required_capability: match_operator_colon

Expand All @@ -44,7 +44,7 @@ _score:double | _fork:keyword | _id:keyword
;

rrfWithDisjunctionAndPostFilter
required_capability: fork
required_capability: fork_v9
required_capability: rrf
required_capability: match_operator_colon

Expand All @@ -66,7 +66,7 @@ _score:double | _fork:keyword | _id:keyword
;

rrfWithStats
required_capability: fork
required_capability: fork_v9
required_capability: rrf
required_capability: match_operator_colon

Expand All @@ -86,7 +86,7 @@ count_fork:long | _fork:keyword
;

rrfWithMultipleForkBranches
required_capability: fork
required_capability: fork_v9
required_capability: rrf
required_capability: match_operator_colon

Expand All @@ -112,6 +112,7 @@ _score:double | author:keyword | title:keyword | _fork
;

rrfWithSemanticSearch
required_capability: fork_v9
required_capability: rrf
required_capability: semantic_text_field_caps
required_capability: metadata_score
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ForkIT extends AbstractEsqlIntegTestCase {

@Before
public void setupIndex() {
assumeTrue("requires FORK capability", EsqlCapabilities.Cap.FORK.isEnabled());
assumeTrue("requires FORK capability", EsqlCapabilities.Cap.FORK_V9.isEnabled());
createAndPopulateIndices();
}

Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ processingCommand
| changePointCommand
| completionCommand
| sampleCommand
| forkCommand
// in development
| {this.isDevVersion()}? inlinestatsCommand
| {this.isDevVersion()}? lookupCommand
| {this.isDevVersion()}? insistCommand
| {this.isDevVersion()}? forkCommand
| {this.isDevVersion()}? rerankCommand
| {this.isDevVersion()}? rrfCommand
;
Expand Down Expand Up @@ -282,7 +282,7 @@ insistCommand
;

forkCommand
: DEV_FORK forkSubQueries
: FORK forkSubQueries
;

forkSubQueries
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/plugin/esql/src/main/antlr/lexer/Fork.g4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lexer grammar Fork;
//
// Fork
//
DEV_FORK : {this.isDevVersion()}? 'fork' -> pushMode(FORK_MODE);
FORK : 'fork' -> pushMode(FORK_MODE);

mode FORK_MODE;
// commands needs to break out of their mode and the default mode when they encounter RP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,11 +917,6 @@ public enum Cap {
*/
AGGREGATE_METRIC_DOUBLE_RENDERING(AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG),

/**
* Support for FORK command
*/
FORK(Build.current().isSnapshot()),

/**
* Support for RERANK command
*/
Expand Down Expand Up @@ -1038,9 +1033,9 @@ public enum Cap {
MAX_OVER_TIME(Build.current().isSnapshot()),

/**
* Support streaming of sub plan results
* Support for FORK out of snapshot
*/
FORK_V9(Build.current().isSnapshot()),
FORK_V9,

/**
* Support for the {@code leading_zeros} named parameter.
Expand Down

Large diffs are not rendered by default.

Loading
Loading