[
https://issues.apache.org/jira/browse/CALCITE-6279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17820260#comment-17820260
]
Caican Cai commented on CALCITE-6279:
-------------------------------------
It seems that my understanding of sql was wrong before. I used to think that
sql was a sql protocol similar to mysql and postgres. We need to follow one of
them. Now it seems that is not the case. sql rules are a similar programming
language. , it follows relational algebra, not which dialect.
> 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)