Skip to content

Commit 5d565b5

Browse files
authored
[DOCS] Update ES|QL applies to's (#131805)
* Add applies to to ScalB function in #127696 * Add applies_to to categorize, follow up to #129398 * Add version info, following #127629 * SAMPLE is new + GA in 9.1 #127629 * add applies to for 9.2 option
1 parent d3d21ad commit 5d565b5

File tree

7 files changed

+36
-9
lines changed

7 files changed

+36
-9
lines changed

docs/reference/query-languages/esql/_snippets/functions/layout/categorize.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/sample.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/scalb.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Sample.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import org.elasticsearch.xpack.esql.core.tree.Source;
2626
import org.elasticsearch.xpack.esql.core.type.DataType;
2727
import org.elasticsearch.xpack.esql.expression.function.Example;
28+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo;
29+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle;
2830
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
2931
import org.elasticsearch.xpack.esql.expression.function.FunctionType;
3032
import org.elasticsearch.xpack.esql.expression.function.FunctionUtils;
@@ -63,7 +65,9 @@ public class Sample extends AggregateFunction implements ToAggregator, PostOptim
6365
"version" },
6466
description = "Collects sample values for a field.",
6567
type = FunctionType.AGGREGATE,
66-
examples = @Example(file = "stats_sample", tag = "doc")
68+
examples = @Example(file = "stats_sample", tag = "doc"),
69+
appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1.0") }
70+
6771
)
6872
public Sample(
6973
Source source,

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.elasticsearch.xpack.esql.core.tree.Source;
2525
import org.elasticsearch.xpack.esql.core.type.DataType;
2626
import org.elasticsearch.xpack.esql.expression.function.Example;
27+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo;
28+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle;
2729
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
2830
import org.elasticsearch.xpack.esql.expression.function.FunctionType;
2931
import org.elasticsearch.xpack.esql.expression.function.MapParam;
@@ -93,14 +95,19 @@ public class Categorize extends GroupingFunction.NonEvaluatableGroupingFunction
9395
tag = "docsCategorize",
9496
description = "This example categorizes server logs messages into categories and aggregates their counts. "
9597
) },
96-
type = FunctionType.GROUPING
98+
type = FunctionType.GROUPING,
99+
appliesTo = {
100+
@FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.PREVIEW, version = "9.0"),
101+
@FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1") }
97102
)
98103
public Categorize(
99104
Source source,
100105
@Param(name = "field", type = { "text", "keyword" }, description = "Expression to categorize") Expression field,
101106
@MapParam(
102107
name = "options",
103-
description = "(Optional) Categorize additional options as <<esql-function-named-params,function named parameters>>.",
108+
description = "(Optional) Categorize additional options as "
109+
+ "<<esql-function-named-params,function named parameters>>. "
110+
+ "{applies_to}`stack: ga 9.2`}",
104111
params = {
105112
@MapParam.MapParamEntry(
106113
name = ANALYZER,

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Scalb.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import org.elasticsearch.xpack.esql.core.type.DataType;
2121
import org.elasticsearch.xpack.esql.core.util.NumericUtils;
2222
import org.elasticsearch.xpack.esql.expression.function.Example;
23+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo;
24+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle;
2325
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
2426
import org.elasticsearch.xpack.esql.expression.function.Param;
2527
import org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction;
@@ -40,11 +42,16 @@ public class Scalb extends EsqlScalarFunction {
4042
private final Expression d;
4143
private final Expression scaleFactor;
4244

43-
@FunctionInfo(returnType = "double", description = """
44-
Returns the result of `d * 2 ^ scaleFactor`,
45-
Similar to Java's `scalb` function. Result is rounded as if
46-
performed by a single correctly rounded floating-point multiply
47-
to a member of the double value set.""", examples = @Example(file = "floats", tag = "scalb"))
45+
@FunctionInfo(
46+
returnType = "double",
47+
description = """
48+
Returns the result of `d * 2 ^ scaleFactor`,
49+
Similar to Java's `scalb` function. Result is rounded as if
50+
performed by a single correctly rounded floating-point multiply
51+
to a member of the double value set.""",
52+
examples = @Example(file = "floats", tag = "scalb"),
53+
appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1.0") }
54+
)
4855

4956
public Scalb(
5057
Source source,

0 commit comments

Comments
 (0)