Open palesz opened 3 years ago
The following SQL query:
SELECT ROUND('NaN'::double)
results in:
ROUND('NaN'::double) -------------------- -0.0
Other major relational DBs behave differently.
MySQL and MSSQL does not have NaN (only NULL ), ROUND(NULL) is NULL. PostgreSQL and Oracle has NaN and ROUND(NaN) returns NaN.
NaN
NULL
ROUND(NULL)
ROUND(NaN)
Was it intentional that we kept this in-sync with the Math.round() behaviour and different from the relational DBs above?
Math.round()
Note: H2 (that we check against in integration tests) also follows the behaviour of Math.round().
Pinging @elastic/es-ql (Team:QL)
Potentially related to #3516
3516
I think you meant https://github.com/elastic/elasticsearch/pull/35164
Pinging @elastic/es-analytical-engine (Team:Analytics)
The following SQL query:
results in:
Other major relational DBs behave differently.
MySQL and MSSQL does not have
NaN
(onlyNULL
),ROUND(NULL)
isNULL
. PostgreSQL and Oracle hasNaN
andROUND(NaN)
returnsNaN
.Was it intentional that we kept this in-sync with the
Math.round()
behaviour and different from the relational DBs above?Note: H2 (that we check against in integration tests) also follows the behaviour of
Math.round()
.