Skip to content

Commit febd41c

Browse files
authored
[DOCS] Update ES|QL applies to's (#131805) (#131989)
* 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 (cherry picked from commit 5d565b5) # Conflicts: # docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/grouping/Categorize.java
1 parent 447fa4f commit febd41c

File tree

7 files changed

+33
-9
lines changed

7 files changed

+33
-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 & 2 deletions
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
@@ -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.Param;
@@ -59,7 +61,9 @@ public class Sample extends AggregateFunction implements ToAggregator {
5961
"version" },
6062
description = "Collects sample values for a field.",
6163
type = FunctionType.AGGREGATE,
62-
examples = @Example(file = "stats_sample", tag = "doc")
64+
examples = @Example(file = "stats_sample", tag = "doc"),
65+
appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1.0") }
66+
6367
)
6468
public Sample(
6569
Source source,

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import org.elasticsearch.xpack.esql.core.tree.Source;
1919
import org.elasticsearch.xpack.esql.core.type.DataType;
2020
import org.elasticsearch.xpack.esql.expression.function.Example;
21+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesTo;
22+
import org.elasticsearch.xpack.esql.expression.function.FunctionAppliesToLifecycle;
2123
import org.elasticsearch.xpack.esql.expression.function.FunctionInfo;
2224
import org.elasticsearch.xpack.esql.expression.function.FunctionType;
2325
import org.elasticsearch.xpack.esql.expression.function.Param;
@@ -63,7 +65,10 @@ public class Categorize extends GroupingFunction.NonEvaluatableGroupingFunction
6365
tag = "docsCategorize",
6466
description = "This example categorizes server logs messages into categories and aggregates their counts. "
6567
) },
66-
type = FunctionType.GROUPING
68+
type = FunctionType.GROUPING,
69+
appliesTo = {
70+
@FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.PREVIEW, version = "9.0"),
71+
@FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.1") }
6772
)
6873
public Categorize(
6974
Source source,

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)