Skip to content

Commit c64c1fb

Browse files
Remove match command (#113383) (#113525)
* Remove match command * Remove assertMatchCommand * Remove unused import Co-authored-by: Elastic Machine <[email protected]>
1 parent 8539876 commit c64c1fb

File tree

15 files changed

+681
-1108
lines changed

15 files changed

+681
-1108
lines changed

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

-47
This file was deleted.

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

-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ processingCommand
5555
// in development
5656
| {this.isDevVersion()}? inlinestatsCommand
5757
| {this.isDevVersion()}? lookupCommand
58-
| {this.isDevVersion()}? matchCommand
5958
;
6059

6160
whereCommand
@@ -312,11 +311,3 @@ lookupCommand
312311
inlinestatsCommand
313312
: DEV_INLINESTATS stats=fields (BY grouping=fields)?
314313
;
315-
316-
matchCommand
317-
: DEV_MATCH matchQuery
318-
;
319-
320-
matchQuery
321-
: QUOTED_STRING
322-
;

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

-5
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,6 @@ public enum Cap {
268268
*/
269269
COMBINE_BINARY_COMPARISONS,
270270

271-
/**
272-
* MATCH command support
273-
*/
274-
MATCH_COMMAND(true),
275-
276271
/**
277272
* Support for nanosecond dates as a data type
278273
*/

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java

-18
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.elasticsearch.xpack.esql.core.expression.TypeResolutions;
2222
import org.elasticsearch.xpack.esql.core.expression.predicate.BinaryOperator;
2323
import org.elasticsearch.xpack.esql.core.expression.predicate.fulltext.MatchQueryPredicate;
24-
import org.elasticsearch.xpack.esql.core.expression.predicate.fulltext.StringQueryPredicate;
2524
import org.elasticsearch.xpack.esql.core.expression.predicate.operator.comparison.BinaryComparison;
2625
import org.elasticsearch.xpack.esql.core.type.DataType;
2726
import org.elasticsearch.xpack.esql.core.util.Holder;
@@ -187,7 +186,6 @@ else if (p instanceof Lookup lookup) {
187186
checkForSortOnSpatialTypes(p, failures);
188187

189188
checkFilterMatchConditions(p, failures);
190-
checkMatchCommand(p, failures);
191189
checkFullTextQueryFunctions(p, failures);
192190
});
193191
checkRemoteEnrich(plan, failures);
@@ -644,22 +642,6 @@ private static void checkFilterMatchConditions(LogicalPlan plan, Set<Failure> fa
644642
}
645643
}
646644

647-
private static void checkMatchCommand(LogicalPlan plan, Set<Failure> failures) {
648-
if (plan instanceof Filter f) {
649-
Expression condition = f.condition();
650-
if (condition instanceof StringQueryPredicate) {
651-
// Similar to cases present in org.elasticsearch.xpack.esql.optimizer.rules.PushDownAndCombineFilters -
652-
// we can't check if it can be pushed down as we don't have yet information about the fields present in the
653-
// StringQueryPredicate
654-
plan.forEachDown(LogicalPlan.class, lp -> {
655-
if ((lp instanceof Filter || lp instanceof OrderBy || lp instanceof EsRelation) == false) {
656-
failures.add(fail(plan, "MATCH cannot be used after {}", lp.sourceText().split(" ")[0].toUpperCase(Locale.ROOT)));
657-
}
658-
});
659-
}
660-
}
661-
}
662-
663645
private static void checkFullTextQueryFunctions(LogicalPlan plan, Set<Failure> failures) {
664646
if (plan instanceof Filter f) {
665647
Expression condition = f.condition();

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

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)