Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [`PI`](../../functions-operators/math-functions.md#esql-pi)
* [`POW`](../../functions-operators/math-functions.md#esql-pow)
* [`ROUND`](../../functions-operators/math-functions.md#esql-round)
* [`ROUND_TO`](../../functions-operators/math-functions.md#esql-round-to)

Check failure on line 19 in docs/reference/query-languages/esql/_snippets/lists/math-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`esql-round-to` does not exist in reference/query-languages/esql/functions-operators/math-functions.md.

Check failure on line 19 in docs/reference/query-languages/esql/_snippets/lists/math-functions.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`esql-round-to` does not exist in reference/query-languages/esql/functions-operators/math-functions.md.
* [`SCALB`](../../functions-operators/math-functions.md#esql-scalb)
* [`SIGNUM`](../../functions-operators/math-functions.md#esql-signum)
* [`SIN`](../../functions-operators/math-functions.md#esql-sin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ mapped_pages:
:::{include} ../_snippets/functions/layout/round.md
:::

:::{include} ../_snippets/functions/layout/round_to.md
:::

:::{include} ../_snippets/functions/layout/scalb.md
:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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.Param;
import org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction;
Expand Down Expand Up @@ -50,8 +52,18 @@ public class RoundTo extends EsqlScalarFunction {

private DataType resultType;

@FunctionInfo(returnType = { "double", "integer", "long", "date", "date_nanos" }, description = """
Rounds down to one of a list of fixed points.""", examples = @Example(file = "math", tag = "round_to"))
@FunctionInfo(
returnType = { "double", "integer", "long", "date", "date_nanos" },
description = """
Rounds down to one of a list of fixed points.""",
examples = @Example(file = "math", tag = "round_to"),
appliesTo = {
@FunctionAppliesTo(
lifeCycle = FunctionAppliesToLifecycle.COMING,
version = "8.19.0/9.1.0"
)
}
)
public RoundTo(
Source source,
@Param(
Expand Down
Loading