This topic describes how to use the ISNAN function. This function checks whether the specified floating-point number is NAN (Not a number). This function is similar to the Double.isNan() or Float.isNan() function in Java.

Limits

This function is supported only in Realtime Compute for Apache Flink that uses Ververica Runtime (VVR) 3.0.0 or later.

Syntax

BOOLEAN ISNAN(DOUBLE d)
BOOLEAN ISNAN(FLOAT f)

Input parameters

Parameter Data type
d DOUBLE
f FLOAT

Example

  • Test data
    Table 1. T1
    d f
    0.1 0.1
    0 0
  • Test statement
    SELECT  
    ISNAN(CAST(d AS DOUBLE)) as d1,
    ISNAN(CAST(f AS FLOAT)) as d2
    FROM T1;         
  • Test result
    d1(BOOLEAN) d2(BOOLEAN)
    false false
    false false