You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Caizhi Weng (Jira)" <ji...@apache.org> on 2022/05/16 04:49:00 UTC

[jira] [Created] (FLINK-27628) Table Store records and fetches incorrect results with NaN

Caizhi Weng created FLINK-27628:
-----------------------------------

             Summary: Table Store records and fetches incorrect results with NaN
                 Key: FLINK-27628
                 URL: https://issues.apache.org/jira/browse/FLINK-27628
             Project: Flink
          Issue Type: Bug
          Components: Table Store
    Affects Versions: table-store-0.2.0
            Reporter: Caizhi Weng


Use the following test data and SQL to reproduce this issue.

gao.csv:
{code}
1.0,2.0,aaaaaaaaaaaaaaa
0.0,0.0,aaaaaaaaaaaaaaa
1.0,1.0,aaaaaaaaaaaaaaa
0.0,0.0,aaaaaaaaaaaaaaa
1.0,0.0,aaaaaaaaaaaaaaa
0.0,0.0,aaaaaaaaaaaaaaa
-1.0,0.0,aaaaaaaaaaaaaaa
1.0,-1.0,aaaaaaaaaaaaaaa
1.0,-2.0,aaaaaaaaaaaaaaa
{code}

Flink SQL:
{code}
Flink SQL> create table T ( a double, b double, c string ) WITH ( 'connector' = 'filesystem', 'path' = '/tmp/gao.csv', 'format' = 'csv' );
[INFO] Execute statement succeed.

Flink SQL> create table S ( a string, b double ) WITH ( 'path' = '/tmp/store' );
[INFO] Execute statement succeed.

Flink SQL> insert into S select c, a / b from T;
[INFO] Submitting SQL update statement to the cluster...
[INFO] SQL update statement has been successfully submitted to the cluster:
Job ID: 851d7b3c233061733bdabbf30f20d16f


Flink SQL> select c, a / b from T;
+-----------------+-----------+
|               c |    EXPR$1 |
+-----------------+-----------+
| aaaaaaaaaaaaaaa |       0.5 |
| aaaaaaaaaaaaaaa |       NaN |
| aaaaaaaaaaaaaaa |       1.0 |
| aaaaaaaaaaaaaaa |       NaN |
| aaaaaaaaaaaaaaa |  Infinity |
| aaaaaaaaaaaaaaa |       NaN |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa |      -1.0 |
| aaaaaaaaaaaaaaa |      -0.5 |
+-----------------+-----------+
9 rows in set

Flink SQL> select * from S;
+-----------------+-----------+
|               a |         b |
+-----------------+-----------+
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa | -Infinity |
| aaaaaaaaaaaaaaa |      -1.0 |
| aaaaaaaaaaaaaaa |      -0.5 |
+-----------------+-----------+
9 rows in set
{code}

Note that this issue may also affect {{FieldStatsCollector}}.



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