Skip to content

Commit 64d105c

Browse files
Change grammar, enforce capabilities
1 parent bef7514 commit 64d105c

File tree

12 files changed

+1186
-1421
lines changed

12 files changed

+1186
-1421
lines changed

x-pack/plugin/esql/src/main/antlr/parser/Join.g4

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,8 @@ joinTarget
1818
;
1919

2020
joinCondition
21-
: ON qualifiedName (COMMA qualifiedName)* #fieldBasedLookupJoin
22-
| ON joinPredicateExpression (AND joinPredicateExpression)* #expressionBasedLookupJoin
21+
: ON booleanExpression (COMMA booleanExpression)*
2322
;
2423

25-
joinPredicate
26-
: valueExpression
27-
;
28-
29-
joinPredicateExpression
30-
: left=operatorExpression comparisonOperator right=operatorExpression
31-
;
3224

3325

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/ExpressionQueryList.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.ArrayList;
3838
import java.util.List;
3939

40+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.LOOKUP_JOIN_ON_BOOLEAN_EXPRESSION;
4041
import static org.elasticsearch.xpack.esql.planner.TranslatorHandler.TRANSLATOR_HANDLER;
4142

4243
/**
@@ -120,6 +121,9 @@ public static ExpressionQueryList expressionBasedJoin(
120121
AliasFilter aliasFilter,
121122
Warnings warnings
122123
) {
124+
if (LOOKUP_JOIN_ON_BOOLEAN_EXPRESSION.isEnabled() == false) {
125+
throw new UnsupportedOperationException("Lookup Join on Boolean Expression capability is not enabled");
126+
}
123127
if (request.getJoinOnConditions() == null) {
124128
throw new IllegalStateException("expressionBasedJoin must have join conditions");
125129
}

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

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

0 commit comments

Comments
 (0)