diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/categorize.md b/docs/reference/query-languages/esql/_snippets/functions/layout/categorize.md index 2e331187665f4..4d39f03ae394c 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/categorize.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/categorize.md @@ -1,6 +1,9 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. ## `CATEGORIZE` [esql-categorize] +```{applies_to} +stack: preview 9.0, ga 9.1 +``` **Syntax** diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/sample.md b/docs/reference/query-languages/esql/_snippets/functions/layout/sample.md index 05d8cef498116..9fd348abe8cd9 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/sample.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/sample.md @@ -1,6 +1,9 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. ## `SAMPLE` [esql-sample] +```{applies_to} +stack: ga 9.1.0 +``` **Syntax** diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/scalb.md b/docs/reference/query-languages/esql/_snippets/functions/layout/scalb.md index 19ff3246f4ca1..bae02950efa6c 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/scalb.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/scalb.md @@ -1,6 +1,9 @@ % This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. ## `SCALB` [esql-scalb] +```{applies_to} +stack: ga 9.1.0 +``` **Syntax** diff --git a/docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md b/docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md index c013b67375a3d..77acd0393d0c7 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md +++ b/docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md @@ -6,5 +6,5 @@ : Expression to categorize `options` -: (Optional) Categorize additional options as [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params). +: (Optional) Categorize additional options as [function named parameters](/reference/query-languages/esql/esql-syntax.md#esql-function-named-params). {applies_to}`stack: ga 9.2`} diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sample.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sample.java index ec9b0c60ff33d..9030824dd2f01 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sample.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sample.java @@ -25,6 +25,8 @@ import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.expression.function.Example; +import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo; +import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle; import org.elasticsearch.xpack.esql.expression.function.FunctionInfo; import org.elasticsearch.xpack.esql.expression.function.FunctionType; import org.elasticsearch.xpack.esql.expression.function.FunctionUtils; @@ -63,7 +65,9 @@ public class Sample extends AggregateFunction implements ToAggregator, PostOptim "version" }, description = "Collects sample values for a field.", type = FunctionType.AGGREGATE, - examples = @Example(file = "stats_sample", tag = "doc") + examples = @Example(file = "stats_sample", tag = "doc"), + appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1.0") } + ) public Sample( Source source, diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java index 75918091f9ecd..b9785624ff512 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java @@ -24,6 +24,8 @@ import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.expression.function.Example; +import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo; +import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle; import org.elasticsearch.xpack.esql.expression.function.FunctionInfo; import org.elasticsearch.xpack.esql.expression.function.FunctionType; import org.elasticsearch.xpack.esql.expression.function.MapParam; @@ -93,14 +95,19 @@ public class Categorize extends GroupingFunction.NonEvaluatableGroupingFunction tag = "docsCategorize", description = "This example categorizes server logs messages into categories and aggregates their counts. " ) }, - type = FunctionType.GROUPING + type = FunctionType.GROUPING, + appliesTo = { + @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.PREVIEW, version = "9.0"), + @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1") } ) public Categorize( Source source, @Param(name = "field", type = { "text", "keyword" }, description = "Expression to categorize") Expression field, @MapParam( name = "options", - description = "(Optional) Categorize additional options as <>.", + description = "(Optional) Categorize additional options as " + + "<>. " + + "{applies_to}`stack: ga 9.2`}", params = { @MapParam.MapParamEntry( name = ANALYZER, diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Scalb.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Scalb.java index b23b2323d0498..ff07e1c71a4c6 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Scalb.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Scalb.java @@ -20,6 +20,8 @@ import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.core.util.NumericUtils; import org.elasticsearch.xpack.esql.expression.function.Example; +import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo; +import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle; import org.elasticsearch.xpack.esql.expression.function.FunctionInfo; import org.elasticsearch.xpack.esql.expression.function.Param; import org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction; @@ -40,11 +42,16 @@ public class Scalb extends EsqlScalarFunction { private final Expression d; private final Expression scaleFactor; - @FunctionInfo(returnType = "double", description = """ - Returns the result of `d * 2 ^ scaleFactor`, - Similar to Java's `scalb` function. Result is rounded as if - performed by a single correctly rounded floating-point multiply - to a member of the double value set.""", examples = @Example(file = "floats", tag = "scalb")) + @FunctionInfo( + returnType = "double", + description = """ + Returns the result of `d * 2 ^ scaleFactor`, + Similar to Java's `scalb` function. Result is rounded as if + performed by a single correctly rounded floating-point multiply + to a member of the double value set.""", + examples = @Example(file = "floats", tag = "scalb"), + appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1.0") } + ) public Scalb( Source source,