Skip to content

Commit 04231e9

Browse files
authored
ES|QL: Make fork available in release builds (#129606)
1 parent 22eb035 commit 04231e9

File tree

16 files changed

+2111
-2089
lines changed

16 files changed

+2111
-2089
lines changed

docs/changelog/129606.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
pr: 129606
2+
summary: Release FORK in tech preview
3+
area: ES|QL
4+
type: feature
5+
issues: []
6+
highlight:
7+
title: Release FORK in tech preview
8+
body: |-
9+
Fork is a foundational building block that allows multiple branches of execution.
10+
Conceptually, fork is:
11+
- a bifurcation of the stream, with all data going to each fork branch, followed by
12+
- a merge of the branches, enhanced with a discriminator column called FORK:
13+
14+
Example:
15+
16+
[source,yaml]
17+
----------------------------
18+
FROM test
19+
| FORK
20+
( WHERE content:"fox" )
21+
( WHERE content:"dog" )
22+
| SORT _fork
23+
----------------------------
24+
25+
The FORK command add a discriminator column called `_fork`:
26+
27+
[source,yaml]
28+
----------------------------
29+
| id | content | _fork |
30+
|-----|-----------|-------|
31+
| 3 | brown fox | fork1 |
32+
| 4 | white dog | fork2 |
33+
----------------------------
34+
35+
notable: true

x-pack/plugin/esql/qa/testFixtures/src/main/resources/rerank.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ book_no:keyword | title:text | author
9696

9797

9898
reranker after RRF
99-
required_capability: fork
99+
required_capability: fork_v9
100100
required_capability: rrf
101101
required_capability: match_operator_colon
102102
required_capability: rerank

x-pack/plugin/esql/qa/testFixtures/src/main/resources/rrf.csv-spec

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44

55
simpleRrf
6-
required_capability: fork
6+
required_capability: fork_v9
77
required_capability: rrf
88
required_capability: match_operator_colon
99

@@ -22,7 +22,7 @@ _score:double | _fork:keyword | emp_no:integer
2222
;
2323

2424
rrfWithMatchAndScore
25-
required_capability: fork
25+
required_capability: fork_v9
2626
required_capability: rrf
2727
required_capability: match_operator_colon
2828

@@ -44,7 +44,7 @@ _score:double | _fork:keyword | _id:keyword
4444
;
4545

4646
rrfWithDisjunctionAndPostFilter
47-
required_capability: fork
47+
required_capability: fork_v9
4848
required_capability: rrf
4949
required_capability: match_operator_colon
5050

@@ -66,7 +66,7 @@ _score:double | _fork:keyword | _id:keyword
6666
;
6767

6868
rrfWithStats
69-
required_capability: fork
69+
required_capability: fork_v9
7070
required_capability: rrf
7171
required_capability: match_operator_colon
7272

@@ -86,7 +86,7 @@ count_fork:long | _fork:keyword
8686
;
8787

8888
rrfWithMultipleForkBranches
89-
required_capability: fork
89+
required_capability: fork_v9
9090
required_capability: rrf
9191
required_capability: match_operator_colon
9292

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

114114
rrfWithSemanticSearch
115+
required_capability: fork_v9
115116
required_capability: rrf
116117
required_capability: semantic_text_field_caps
117118
required_capability: metadata_score

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ForkIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ForkIT extends AbstractEsqlIntegTestCase {
3232

3333
@Before
3434
public void setupIndex() {
35-
assumeTrue("requires FORK capability", EsqlCapabilities.Cap.FORK.isEnabled());
35+
assumeTrue("requires FORK capability", EsqlCapabilities.Cap.FORK_V9.isEnabled());
3636
createAndPopulateIndices();
3737
}
3838

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ processingCommand
5858
| changePointCommand
5959
| completionCommand
6060
| sampleCommand
61+
| forkCommand
6162
// in development
6263
| {this.isDevVersion()}? inlinestatsCommand
6364
| {this.isDevVersion()}? lookupCommand
6465
| {this.isDevVersion()}? insistCommand
65-
| {this.isDevVersion()}? forkCommand
6666
| {this.isDevVersion()}? rerankCommand
6767
| {this.isDevVersion()}? rrfCommand
6868
;
@@ -282,7 +282,7 @@ insistCommand
282282
;
283283

284284
forkCommand
285-
: DEV_FORK forkSubQueries
285+
: FORK forkSubQueries
286286
;
287287

288288
forkSubQueries

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.tokens

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/antlr/lexer/Fork.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lexer grammar Fork;
99
//
1010
// Fork
1111
//
12-
DEV_FORK : {this.isDevVersion()}? 'fork' -> pushMode(FORK_MODE);
12+
FORK : 'fork' -> pushMode(FORK_MODE);
1313

1414
mode FORK_MODE;
1515
// commands needs to break out of their mode and the default mode when they encounter RP

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,6 @@ public enum Cap {
917917
*/
918918
AGGREGATE_METRIC_DOUBLE_RENDERING(AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG),
919919

920-
/**
921-
* Support for FORK command
922-
*/
923-
FORK(Build.current().isSnapshot()),
924-
925920
/**
926921
* Support for RERANK command
927922
*/
@@ -1038,9 +1033,9 @@ public enum Cap {
10381033
MAX_OVER_TIME(Build.current().isSnapshot()),
10391034

10401035
/**
1041-
* Support streaming of sub plan results
1036+
* Support for FORK out of snapshot
10421037
*/
1043-
FORK_V9(Build.current().isSnapshot()),
1038+
FORK_V9,
10441039

10451040
/**
10461041
* Support for the {@code leading_zeros} named parameter.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)