From fd2dd41d55eb2e743ffab08e373bb4af2558215a Mon Sep 17 00:00:00 2001 From: Kostas Krikellas Date: Wed, 29 Oct 2025 17:06:45 +0200 Subject: [PATCH 1/3] Remove `first` and `last` functions from documentation --- .../esql/_snippets/functions/layout/first.md | 2 +- .../query-languages/esql/_snippets/functions/layout/last.md | 2 +- .../esql/_snippets/lists/aggregation-functions.md | 2 -- .../esql/functions-operators/aggregation-functions.md | 6 ------ .../xpack/esql/expression/function/aggregate/First.java | 2 +- .../xpack/esql/expression/function/aggregate/Last.java | 2 +- 6 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/first.md b/docs/reference/query-languages/esql/_snippets/functions/layout/first.md index ef9e358866153..be1f1859c153e 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/first.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/first.md @@ -2,7 +2,7 @@ ## `FIRST` [esql-first] ```{applies_to} -stack: ga 9.2.0 +stack: unavailable 9.2.0 ``` **Syntax** diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/last.md b/docs/reference/query-languages/esql/_snippets/functions/layout/last.md index ac4254c526a30..6c2959eff7791 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/last.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/last.md @@ -2,7 +2,7 @@ ## `LAST` [esql-last] ```{applies_to} -stack: ga 9.2.0 +stack: unavailable 9.2.0 ``` **Syntax** diff --git a/docs/reference/query-languages/esql/_snippets/lists/aggregation-functions.md b/docs/reference/query-languages/esql/_snippets/lists/aggregation-functions.md index 11dfbcd102601..9f367439c1e35 100644 --- a/docs/reference/query-languages/esql/_snippets/lists/aggregation-functions.md +++ b/docs/reference/query-languages/esql/_snippets/lists/aggregation-functions.md @@ -2,8 +2,6 @@ * [`AVG`](../../functions-operators/aggregation-functions.md#esql-avg) * [`COUNT`](../../functions-operators/aggregation-functions.md#esql-count) * [`COUNT_DISTINCT`](../../functions-operators/aggregation-functions.md#esql-count_distinct) -* [`FIRST`](../../functions-operators/aggregation-functions.md#esql-first) {applies_to}`stack: ga 9.2` -* [`LAST`](../../functions-operators/aggregation-functions.md#esql-last) {applies_to}`stack: ga 9.2` * [`MAX`](../../functions-operators/aggregation-functions.md#esql-max) * [`MEDIAN`](../../functions-operators/aggregation-functions.md#esql-median) * [`MEDIAN_ABSOLUTE_DEVIATION`](../../functions-operators/aggregation-functions.md#esql-median_absolute_deviation) diff --git a/docs/reference/query-languages/esql/functions-operators/aggregation-functions.md b/docs/reference/query-languages/esql/functions-operators/aggregation-functions.md index 602a65cd5e282..264a8381dddc6 100644 --- a/docs/reference/query-languages/esql/functions-operators/aggregation-functions.md +++ b/docs/reference/query-languages/esql/functions-operators/aggregation-functions.md @@ -28,12 +28,6 @@ The [`STATS`](/reference/query-languages/esql/commands/stats-by.md) and [`INLINE :::{include} ../_snippets/functions/layout/count_distinct.md ::: -:::{include} ../_snippets/functions/layout/first.md -::: - -:::{include} ../_snippets/functions/layout/last.md -::: - :::{include} ../_snippets/functions/layout/max.md ::: diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java index 2a9b43371b7ea..8c090f5afa58d 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java @@ -47,7 +47,7 @@ public class First extends AggregateFunction implements ToAggregator { type = FunctionType.AGGREGATE, returnType = { "long", "integer", "double", "keyword" }, description = "Calculates the earliest value of a field.", - appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.2.0") }, + appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.UNAVAILABLE, version = "9.2.0") }, examples = @Example(file = "stats_first", tag = "first") ) public First( diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java index bcacae6d380e9..a3166c378768f 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java @@ -47,7 +47,7 @@ public class Last extends AggregateFunction implements ToAggregator { type = FunctionType.AGGREGATE, returnType = { "long", "integer", "double", "keyword" }, description = "Calculates the latest value of a field.", - appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.2.0") }, + appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.UNAVAILABLE, version = "9.2.0") }, examples = @Example(file = "stats_last", tag = "last") ) public Last( From 44048796ee014d4dd7b72f8ec1e42f15cf8f4e30 Mon Sep 17 00:00:00 2001 From: Kostas Krikellas <131142368+kkrik-es@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:42:46 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Liam Thompson --- .../xpack/esql/expression/function/aggregate/First.java | 2 +- .../xpack/esql/expression/function/aggregate/Last.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java index 8c090f5afa58d..83522080f13ad 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/First.java @@ -47,7 +47,7 @@ public class First extends AggregateFunction implements ToAggregator { type = FunctionType.AGGREGATE, returnType = { "long", "integer", "double", "keyword" }, description = "Calculates the earliest value of a field.", - appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.UNAVAILABLE, version = "9.2.0") }, + appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.3.0") }, examples = @Example(file = "stats_first", tag = "first") ) public First( diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java index a3166c378768f..d042c7528dcdd 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/aggregate/Last.java @@ -47,7 +47,7 @@ public class Last extends AggregateFunction implements ToAggregator { type = FunctionType.AGGREGATE, returnType = { "long", "integer", "double", "keyword" }, description = "Calculates the latest value of a field.", - appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.UNAVAILABLE, version = "9.2.0") }, + appliesTo = { @FunctionAppliesTo(lifeCycle = FunctionAppliesToLifecycle.GA, version = "9.3.0") }, examples = @Example(file = "stats_last", tag = "last") ) public Last( From 8b632cfe1e16476a2840b50ecadacbe7bb97e072 Mon Sep 17 00:00:00 2001 From: Kostas Krikellas Date: Wed, 29 Oct 2025 20:44:21 +0200 Subject: [PATCH 3/3] update --- .../query-languages/esql/_snippets/functions/layout/first.md | 2 +- .../query-languages/esql/_snippets/functions/layout/last.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/first.md b/docs/reference/query-languages/esql/_snippets/functions/layout/first.md index be1f1859c153e..a9a2b064e43cb 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/first.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/first.md @@ -2,7 +2,7 @@ ## `FIRST` [esql-first] ```{applies_to} -stack: unavailable 9.2.0 +stack: ga 9.3.0 ``` **Syntax** diff --git a/docs/reference/query-languages/esql/_snippets/functions/layout/last.md b/docs/reference/query-languages/esql/_snippets/functions/layout/last.md index 6c2959eff7791..39104fdd08e38 100644 --- a/docs/reference/query-languages/esql/_snippets/functions/layout/last.md +++ b/docs/reference/query-languages/esql/_snippets/functions/layout/last.md @@ -2,7 +2,7 @@ ## `LAST` [esql-last] ```{applies_to} -stack: unavailable 9.2.0 +stack: ga 9.3.0 ``` **Syntax**