[ https://issues.apache.org/jira/browse/CALCITE-4462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17440849#comment-17440849 ]
Julian Hyde commented on CALCITE-4462: -------------------------------------- I haven't checked the standard, but: * On MySQL, {{select 1 / 0}} and {{select sqrt(-1)}} return {{NULL}}; * On Postgres 9.3, {{select 1 / 0}} throws {{ERROR: division by zero}}, and {{select sqrt(-1)}} throws {{ERROR: cannot take square root of a negative number}}; * On Oracle, {{select 1 / 0 from dual}} throws {{ORA-01476: divisor is equal to zero}} and {{select sqrt(-1) from dual}} throws {{ORA-01428: argument '-1' is out of range}}. So, indications are that division by zero does not create NaN in SQL. > `ROUND` SQL function throws exception on Infinite or NaN arguments > ------------------------------------------------------------------ > > Key: CALCITE-4462 > URL: https://issues.apache.org/jira/browse/CALCITE-4462 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.25.0, 1.26.0 > Reporter: Yuriy Sazonets > Priority: Major > > Should return original value instead of throwing an exception. > h4. Stack trace > {noformat} > java.lang.NumberFormatException: Character I is neither a decimal digit > number, decimal point, nor "e" notation exponential > mark.java.lang.NumberFormatException: Character I is neither a decimal digit > number, decimal point, nor "e" notation exponential mark. > at java.base/java.math.BigDecimal.<init>(BigDecimal.java:519) > at java.base/java.math.BigDecimal.<init>(BigDecimal.java:402) > at java.base/java.math.BigDecimal.<init>(BigDecimal.java:835) > at java.base/java.math.BigDecimal.valueOf(BigDecimal.java:1305) > at org.apache.calcite.runtime.SqlFunctions.sround(SqlFunctions.java:1535) > at Baz$8$1.current(Unknown Source) at > org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.next(Linq4j.java:684) > at org.apache.calcite.avatica.util.IteratorCursor.next(IteratorCursor.java:46) > at org.apache.calcite.avatica.AvaticaResultSet.next(AvaticaResultSet.java:217) > {noformat} -- This message was sent by Atlassian Jira (v8.20.1#820001)