You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2022/06/24 07:08:00 UTC

[jira] [Assigned] (FLINK-28234) Infinite or NaN exception for power(-1, 0.5)

     [ https://issues.apache.org/jira/browse/FLINK-28234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martijn Visser reassigned FLINK-28234:
--------------------------------------

    Assignee: luoyuxia

>  Infinite or NaN exception for power(-1, 0.5)
> ---------------------------------------------
>
>                 Key: FLINK-28234
>                 URL: https://issues.apache.org/jira/browse/FLINK-28234
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>            Reporter: luoyuxia
>            Assignee: luoyuxia
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.16.0
>
>
> When using the follwiing sql  , it will throw the "java.lang.NumberFormatException: Infinite or NaN"
>  
> {code:java}
> SELECT power(-1, 0.5) {code}
> It happen in ExpressionReducer, and power(-1, 0.5)  is NaN, which can't be used to construct BigDecimal, so the exception throws.
> But for the sql,
>  
> {code:java}
> create table src(key int);
> insert into src values (-1);
> SELECT power(key, 0.5) from src;{code}
>  
> it will run normally.
> I think we  should keep same behavror for these two case, instead of throw exception for one case, and run normally for another case.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)