Jark Wu created FLINK-27368:
-------------------------------

             Summary: CAST(' 1 ' as BIGINT) reutrns wrong result
                 Key: FLINK-27368
                 URL: https://issues.apache.org/jira/browse/FLINK-27368
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner, Table SQL / Runtime
    Affects Versions: 1.15.0
            Reporter: Jark Wu
             Fix For: 1.15.0


{code:sql}
select
                    cast(' 1 ' as tinyint),
                    cast(' 1 ' as smallint),
                    cast(' 1 ' as int),
                    cast(' 1 ' as bigint),
                    cast(' 1 ' as float),
                    cast(' 1 ' as double);
{code}

The above query should return {{[1, 1, 1, 1, 1.0, 1.0]}} , but is {{[null, 
null, null, null, 1.0, 1.0]}}. 

In Postgres:
{code}
postgres=# select cast(' 1 ' as int), cast(' 1 ' as bigint), cast(' 1 ' as 
float);
 int4 | int8 | float8
------+------+--------
    1 |    1 |      1
(1 row)
{code}



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

Reply via email to