From 7d55e93eb7fd516a4c859dc8d7944503ed6c23e1 Mon Sep 17 00:00:00 2001 From: Mark Tozzi Date: Thu, 16 Nov 2023 13:38:58 -0500 Subject: [PATCH] clean up docs and examples a bit more --- docs/reference/esql/functions/pow.asciidoc | 24 ++----------------- .../src/main/resources/math.csv-spec | 4 ---- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/docs/reference/esql/functions/pow.asciidoc b/docs/reference/esql/functions/pow.asciidoc index f7ff3d4ea65b0..b13151c8cbd76 100644 --- a/docs/reference/esql/functions/pow.asciidoc +++ b/docs/reference/esql/functions/pow.asciidoc @@ -5,7 +5,8 @@ image::esql/functions/signature/pow.svg[Embedded,opts=inline] Returns the value of a base (first argument) raised to the power of an exponent (second argument). -Both arguments must be numeric. The output is always a double. +Both arguments must be numeric. The output is always a double. Note that it is still possible to overflow +a double result here; in that case, null will be returned. [source.merge.styled,esql] ---- @@ -17,27 +18,6 @@ include::{esql-specs}/math.csv-spec[tag=powDI-result] |=== -[discrete] -==== Arithmetic errors - -Arithmetic errors and numeric overflow do not result in an error. Instead, the result will be `null` -and a warning for the `ArithmeticException` added. -For example: - -[source.merge.styled,esql] ----- -include::{esql-specs}/math.csv-spec[tag=powULOverrun] ----- -[%header.monospaced.styled,format=dsv,separator=|] -|=== -include::{esql-specs}/math.csv-spec[tag=powULOverrun-warning] -|=== -[%header.monospaced.styled,format=dsv,separator=|] -|=== -include::{esql-specs}/math.csv-spec[tag=powULOverrun-result] -|=== - - [discrete] ==== Fractional exponents diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/math.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/math.csv-spec index 153143ef2abc1..d42495e3d01db 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/math.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/math.csv-spec @@ -357,16 +357,12 @@ base:double | exponent:integer | result:double ; powIntInt -// tag::powII[] ROW base = 2, exponent = 2 | EVAL s = POW(base, exponent) -// end::powII[] ; -// tag::powII-result[] base:integer | exponent:integer | s:double 2 | 2 | 4.0 -// end::powII-result[] ; powIntIntPlusInt