Skip to content

Commit 5d3512f

Browse files
authored
ESQL: Fix Max doubles bug with negatives and add tests for Max and Min (#110586)
`MAX()` currently doesn't work with doubles smaller than `Double.MIN_VALUE` (Note that `Double.MIN_VALUE` returns the smallest non-zero positive, not the smallest double). This PR adds tests for Max and Min, and fixes the bug (Detected by the tests). Also, as the tests now generate the docs, replaced the old docs with the generated ones, and updated the Max&Min examples.
1 parent 38cd0b3 commit 5d3512f

File tree

25 files changed

+609
-87
lines changed

25 files changed

+609
-87
lines changed

docs/changelog/110586.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 110586
2+
summary: "ESQL: Fix Max doubles bug with negatives and add tests for Max and Min"
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/reference/esql/functions/aggregation-functions.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ The <<esql-stats-by>> command supports these aggregate functions:
1111
* <<esql-avg>>
1212
* <<esql-agg-count>>
1313
* <<esql-agg-count-distinct>>
14-
* <<esql-agg-max>>
14+
* <<esql-max>>
1515
* <<esql-agg-median>>
1616
* <<esql-agg-median-absolute-deviation>>
17-
* <<esql-agg-min>>
17+
* <<esql-min>>
1818
* <<esql-agg-percentile>>
1919
* experimental:[] <<esql-agg-st-centroid>>
2020
* <<esql-agg-sum>>
@@ -25,14 +25,14 @@ The <<esql-stats-by>> command supports these aggregate functions:
2525

2626
include::count.asciidoc[]
2727
include::count-distinct.asciidoc[]
28-
include::max.asciidoc[]
2928
include::median.asciidoc[]
3029
include::median-absolute-deviation.asciidoc[]
31-
include::min.asciidoc[]
3230
include::percentile.asciidoc[]
3331
include::st_centroid_agg.asciidoc[]
3432
include::sum.asciidoc[]
3533
include::layout/avg.asciidoc[]
34+
include::layout/max.asciidoc[]
35+
include::layout/min.asciidoc[]
3636
include::layout/top.asciidoc[]
3737
include::values.asciidoc[]
3838
include::weighted-avg.asciidoc[]

docs/reference/esql/functions/description/max.asciidoc

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

docs/reference/esql/functions/description/min.asciidoc

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

docs/reference/esql/functions/max.asciidoc renamed to docs/reference/esql/functions/examples/max.asciidoc

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

docs/reference/esql/functions/min.asciidoc renamed to docs/reference/esql/functions/examples/min.asciidoc

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

docs/reference/esql/functions/kibana/definition/max.json

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

docs/reference/esql/functions/kibana/definition/min.json

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

docs/reference/esql/functions/kibana/docs/max.md

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

docs/reference/esql/functions/kibana/docs/min.md

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

0 commit comments

Comments
 (0)