diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/categorize.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/categorize.csv-spec index 076f3ee092ec..8e0fcd78f032 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/categorize.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/categorize.csv-spec @@ -2,8 +2,9 @@ categorize required_capability: categorize FROM sample_data - | STATS count=COUNT(), values=VALUES(message) BY category=CATEGORIZE(message) - | SORT count DESC, category ASC + | SORT message ASC + | STATS count=COUNT(), values=MV_SORT(VALUES(message)) BY category=CATEGORIZE(message) + | SORT category ; count:long | values:keyword | category:integer diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java index 4cb3ced2c86a..89b3c3d9f956 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java @@ -304,7 +304,12 @@ public enum Cap { /** * Support explicit casting from string literal to DATE_PERIOD or TIME_DURATION. */ - CAST_STRING_LITERAL_TO_TEMPORAL_AMOUNT; + CAST_STRING_LITERAL_TO_TEMPORAL_AMOUNT, + + /** + * Supported the text categorization function "CATEGORIZE". + */ + CATEGORIZE(true); private final boolean snapshotOnly; private final FeatureFlag featureFlag; diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java index f19e6523aa07..4b6a38a3e876 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlFeatures.java @@ -179,14 +179,9 @@ public class EsqlFeatures implements FeatureSpecification { */ public static final NodeFeature RESOLVE_FIELDS_API = new NodeFeature("esql.resolve_fields_api"); - /** - * Support categorize - */ - public static final NodeFeature CATEGORIZE = new NodeFeature("esql.categorize"); - private Set snapshotBuildFeatures() { assert Build.current().isSnapshot() : Build.current(); - return Set.of(METRICS_SYNTAX, CATEGORIZE); + return Set.of(METRICS_SYNTAX); } @Override