[
https://issues.apache.org/jira/browse/CALCITE-6279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17820175#comment-17820175
]
Mihai Budiu commented on CALCITE-6279:
--------------------------------------
Also, "the result is empty" does not make sense. You can only talk about
"empty" when the result is a collection type.
> Use Null to replace the results of some Math functions that return NaN.
> -----------------------------------------------------------------------
>
> Key: CALCITE-6279
> URL: https://issues.apache.org/jira/browse/CALCITE-6279
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.36.0
> Reporter: Caican Cai
> Priority: Minor
> Fix For: 1.37.0
>
>
> Among Calcite's Math functions, there are some functions that return double
> types. They are calculated using Java's Math method in SqlFunctions, so when
> the result is empty, NaN will be returned, but according to SQL rules, NULL
> should be returned.
> e.g
> {code:java}
> f.checkScalarApprox("sqrt(-1)", "DOUBLE NOT NULL",
> "NaN"); {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)