[ https://issues.apache.org/jira/browse/FLINK-31778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17764197#comment-17764197 ]
Nic Townsend edited comment on FLINK-31778 at 9/12/23 1:50 PM: --------------------------------------------------------------- Hi, I have encountered this in an additional scenario: {code:java} select commissions from (select ROW(ARRAY[ROW(123), ROW(234)]) commissions); {code} ++ {code:java} ----------------------------------+ op commissions ----------------------------------+ +I ([(123.0), (234.0)]) ----------------------------------+ {code} {code:java} create temporary view test as select commissions from (select ROW(ARRAY[ROW(123), ROW(234)]) commissions); select commissions from test; {code} {code:java} ----------------------------------+ op commissions ----------------------------------+ +I ([(234.0), (234.0)]) ----------------------------------+ {code} Is this the same problem with the `BinaryRowWriter` or should I raise a new issue? Many thanks! was (Author: JIRAUSER299501): Hi, I have encountered this in an additional scenario: {code:java} select commissions from (select ROW(ARRAY[ROW(123), ROW(234)]) commissions); {code} +----+--------------------------------+ | op | commissions | +----+--------------------------------+ | +I | ([(123.0), (234.0)]) | +----+--------------------------------+ {code:java} create temporary view test as select commissions from (select ROW(ARRAY[ROW(123), ROW(234)]) commissions); select commissions from test; {code} +----+--------------------------------+ | op | commissions | +----+--------------------------------+ | +I | ([(234.0), (234.0)]) | +----+--------------------------------+ Is this the same problem with the `BinaryRowWriter` or should I raise a new issue? Many thanks! > 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.16.1, 1.15.4 > Reporter: Ilya Soin > Assignee: Ilya Soin > Priority: Major > Labels: pull-request-available, stale-assigned > Attachments: image-2023-04-12-15-23-46-669.png, screenshot-2.png > > > {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)