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

Dezhi Cai updated FLINK-14970:
------------------------------
    Attachment: image-2019-12-04-13-56-14-815.png

> Doomed test for equality to NaN
> -------------------------------
>
>                 Key: FLINK-14970
>                 URL: https://issues.apache.org/jira/browse/FLINK-14970
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Legacy Planner, Table SQL / Planner
>    Affects Versions: 1.8.2, 1.9.0, 1.9.1
>            Reporter: Dezhi Cai
>            Assignee: Dezhi Cai
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>         Attachments: image-2019-11-27-16-51-00-150.png, 
> image-2019-11-27-16-51-06-801.png, image-2019-12-04-13-39-38-549.png, 
> image-2019-12-04-13-40-19-441.png, image-2019-12-04-13-55-14-117.png, 
> image-2019-12-04-13-56-14-815.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> scala pattern matching can't handle "NaN","NegativeInfinity " etc.
> in GenerateUtils, CodeGenerator, some code logic fall into this issue, please 
> refer to
> the screenshot for details.
> {code:java}
> def main(args: Array[String]): Unit = {
>   val floatVaue = Float.NaN
>   floatVaue match {
>     case Float.NaN => println("Float.NaN")
>     case Float.NegativeInfinity => println("Float.NegativeInfinity")
>     case _ => println("not match")
>   }
> }
> will output: not match
> {code}
> {code:java}
> // this one works
> def main(args: Array[String]): Unit = {
>   val floatVaue = Float.NaN
>   floatVaue match {
>     case value if value.isNaN => println("Float.NaN")
>     case value if value.isNegInfinity  => println("Float.NegativeInfinity")
>     case _ => println("not match")
>   }
> }
> will output: Float.NaN
> {code}
>  
>  
> org.apache.flink.table.planner.codegen.GenerateUtils
> !image-2019-11-27-16-51-06-801.png|width=723,height=257!
> org.apache.flink.table.codegen.CodeGenerator
> !image-2019-11-27-16-51-00-150.png|width=727,height=158!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to