You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Ilya Soin (Jira)" <ji...@apache.org> on 2023/04/12 12:09:00 UTC

[jira] [Created] (FLINK-31778) Casting array of rows produces incorrect result

Ilya Soin created FLINK-31778:
---------------------------------

             Summary: Casting array of rows produces incorrect result
                 Key: FLINK-31778
                 URL: https://issues.apache.org/jira/browse/FLINK-31778
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 1.15.4, 1.16.1
            Reporter: Ilya Soin


{code:java}
select CAST(commissions AS ARRAY<ROW<amount DOUBLE>>) as commissions             from (select ARRAY[ROW(123), ROW(234)] commissions){code}
Expected output:
{code:java}
+----+--------------------------------+
| op |                    commissions |
+----+--------------------------------+
| +I |             [(123.0), (234.0)] |
+----+--------------------------------+
 {code}
Actual output:
{code:java}
+----+--------------------------------+
| op |                    commissions |
+----+--------------------------------+
| +I |             [(234.0), (234.0)] |
+----+--------------------------------+ {code}
Full working example: https://gist.github.com/soin08/5e0038dbefeba9192706e05a78ef3bc1



--
This message was sent by Atlassian Jira
(v8.20.10#820010)