|
@@ -10,6 +10,8 @@ package org.elasticsearch.xpack.esql.expression.function.grouping;
|
|
|
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
|
|
import org.elasticsearch.common.io.stream.StreamInput;
|
|
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
|
|
+import org.elasticsearch.license.XPackLicenseState;
|
|
|
+import org.elasticsearch.xpack.esql.LicenseAware;
|
|
|
import org.elasticsearch.xpack.esql.core.expression.Expression;
|
|
|
import org.elasticsearch.xpack.esql.core.expression.Nullability;
|
|
|
import org.elasticsearch.xpack.esql.core.tree.NodeInfo;
|
|
@@ -20,6 +22,7 @@ import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
|
|
|
import org.elasticsearch.xpack.esql.expression.function.FunctionType;
|
|
|
import org.elasticsearch.xpack.esql.expression.function.Param;
|
|
|
import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput;
|
|
|
+import org.elasticsearch.xpack.ml.MachineLearning;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
@@ -36,7 +39,7 @@ import static org.elasticsearch.xpack.esql.core.expression.TypeResolutions.isStr
|
|
|
* For the implementation, see {@link org.elasticsearch.compute.aggregation.blockhash.CategorizeBlockHash}
|
|
|
* </p>
|
|
|
*/
|
|
|
-public class Categorize extends GroupingFunction.NonEvaluatableGroupingFunction {
|
|
|
+public class Categorize extends GroupingFunction.NonEvaluatableGroupingFunction implements LicenseAware {
|
|
|
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(
|
|
|
Expression.class,
|
|
|
"Categorize",
|
|
@@ -128,4 +131,9 @@ public class Categorize extends GroupingFunction.NonEvaluatableGroupingFunction
|
|
|
public String toString() {
|
|
|
return "Categorize{field=" + field + "}";
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean licenseCheck(XPackLicenseState state) {
|
|
|
+ return MachineLearning.CATEGORIZE_TEXT_AGG_FEATURE.check(state);
|
|
|
+ }
|
|
|
}
|