Skip to content

Commit 7bf5c48

Browse files
authored
ES|QL: Make FUSE available in release builds (#135603)
1 parent c71588b commit 7bf5c48

File tree

17 files changed

+2236
-2232
lines changed

17 files changed

+2236
-2232
lines changed

docs/changelog/135603.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135603
2+
summary: Make FUSE available in release builds
3+
area: ES|QL
4+
type: feature
5+
issues: []

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ fuseWithLinearAndL2Norm
363363

364364
required_capability: fork_v9
365365
required_capability: fuse_v6
366-
required_capability: semantic_text_field_caps
367-
required_capability: metadata_score
366+
required_capability: fuse_l2_norm
368367

369368
FROM books METADATA _id, _index, _score
370369
| FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 )
@@ -658,6 +657,7 @@ id_0.0 | 0.0
658657
fuseWithRowLinearAndL2Norm
659658

660659
required_capability: fuse_v6
660+
required_capability: fuse_l2_norm
661661

662662
ROW my_score = [0, 1, 2, 3, 4]::double, _index = "my_index", _fork = "foo"
663663
| MV_EXPAND my_score
@@ -759,6 +759,7 @@ id_4.0 | 0.01563 | foo
759759
fuseWithRowLinearL2NormAndZeroScores
760760

761761
required_capability: fuse_v6
762+
required_capability: fuse_l2_norm
762763

763764
ROW _id = ["a", "b", "c"], _score = 0.0, _index = "my_index", my_fork = "foo"
764765
| MV_EXPAND _id

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public void testFuseSimpleLinear() {
137137
}
138138

139139
public void testFuseLinearWithWeightsAndNormalizer() {
140+
assumeTrue("requires FUSE_L2_NORM capability", EsqlCapabilities.Cap.FUSE_L2_NORM.isEnabled());
141+
140142
var query = """
141143
FROM test METADATA _score, _id, _index
142144
| WHERE id > 2

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: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ processingCommand
6666
| forkCommand
6767
| rerankCommand
6868
| inlineStatsCommand
69+
| fuseCommand
6970
// in development
7071
| {this.isDevVersion()}? lookupCommand
7172
| {this.isDevVersion()}? insistCommand
72-
| {this.isDevVersion()}? fuseCommand
7373
;
7474

7575
whereCommand
@@ -326,6 +326,17 @@ inlineStatsCommand
326326
| INLINESTATS stats=aggFields (BY grouping=fields)?
327327
;
328328

329+
fuseCommand
330+
: FUSE (fuseType=identifier)? (fuseConfiguration)*
331+
;
332+
333+
fuseConfiguration
334+
: SCORE BY score=qualifiedName
335+
| KEY BY key=fields
336+
| GROUP BY group=qualifiedName
337+
| WITH options=mapExpression
338+
;
339+
329340
//
330341
// In development
331342
//
@@ -337,17 +348,6 @@ insistCommand
337348
: DEV_INSIST qualifiedNamePatterns
338349
;
339350

340-
fuseCommand
341-
: DEV_FUSE (fuseType=identifier)? (fuseConfiguration)*
342-
;
343-
344-
fuseConfiguration
345-
: SCORE BY score=qualifiedName
346-
| KEY BY key=fields
347-
| GROUP BY group=qualifiedName
348-
| WITH options=mapExpression
349-
;
350-
351351
setCommand
352352
: SET setField SEMICOLON
353353
;

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/Fuse.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
lexer grammar Fuse;
99

10-
DEV_FUSE : {this.isDevVersion()}? 'fuse' -> pushMode(FUSE_MODE);
10+
FUSE : 'fuse' -> pushMode(FUSE_MODE);
1111

1212
mode FUSE_MODE;
1313
FUSE_PIPE : PIPE -> type(PIPE), popMode;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ public enum Cap {
13721372
/**
13731373
* FUSE command
13741374
*/
1375-
FUSE_V6(Build.current().isSnapshot()),
1375+
FUSE_V6,
13761376

13771377
/**
13781378
* Support improved behavior for LIKE operator when used with index fields.
@@ -1560,6 +1560,11 @@ public enum Cap {
15601560

15611561
DENSE_VECTOR_AGG_METRIC_DOUBLE_IF_FNS,
15621562

1563+
/**
1564+
* FUSE L2_NORM score normalization support
1565+
*/
1566+
FUSE_L2_NORM(Build.current().isSnapshot()),
1567+
15631568
/**
15641569
* Support for requesting the "_tsid" metadata field.
15651570
*/

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.

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

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

0 commit comments

Comments
 (0)