|
11 | 11 | import org.elasticsearch.common.io.stream.StreamInput; |
12 | 12 | import org.elasticsearch.common.io.stream.StreamOutput; |
13 | 13 | import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; |
| 14 | +import org.elasticsearch.license.License; |
| 15 | +import org.elasticsearch.license.XPackLicenseState; |
| 16 | +import org.elasticsearch.xpack.esql.LicenseAware; |
14 | 17 | import org.elasticsearch.xpack.esql.core.expression.Expression; |
15 | 18 | import org.elasticsearch.xpack.esql.core.expression.Nullability; |
16 | 19 | import org.elasticsearch.xpack.esql.core.tree.NodeInfo; |
|
21 | 24 | import org.elasticsearch.xpack.esql.expression.function.FunctionType; |
22 | 25 | import org.elasticsearch.xpack.esql.expression.function.Param; |
23 | 26 | import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput; |
| 27 | +import org.elasticsearch.xpack.ml.MachineLearning; |
24 | 28 |
|
25 | 29 | import java.io.IOException; |
26 | 30 | import java.util.List; |
|
37 | 41 | * For the implementation, see {@link org.elasticsearch.compute.aggregation.blockhash.CategorizeBlockHash} |
38 | 42 | * </p> |
39 | 43 | */ |
40 | | -public class Categorize extends GroupingFunction { |
| 44 | +public class Categorize extends GroupingFunction implements LicenseAware { |
41 | 45 | public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry( |
42 | 46 | Expression.class, |
43 | 47 | "Categorize", |
@@ -134,4 +138,9 @@ public Expression field() { |
134 | 138 | public String toString() { |
135 | 139 | return "Categorize{field=" + field + "}"; |
136 | 140 | } |
| 141 | + |
| 142 | + @Override |
| 143 | + public boolean licenseCheck(XPackLicenseState state) { |
| 144 | + return MachineLearning.CATEGORIZE_TEXT_AGG_FEATURE.check(state); |
| 145 | + } |
137 | 146 | } |
0 commit comments