You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2022/07/22 02:34:00 UTC

[jira] [Assigned] (FLINK-26542) Fix "schema of both sides of union should match" exception when one side of union select multiple same coulmns

     [ https://issues.apache.org/jira/browse/FLINK-26542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu reassigned FLINK-26542:
-------------------------------

    Assignee: luoyuxia

> Fix "schema of both sides of union should match" exception when one side of union select multiple same coulmns
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-26542
>                 URL: https://issues.apache.org/jira/browse/FLINK-26542
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Connectors / Hive
>            Reporter: luoyuxia
>            Assignee: luoyuxia
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.16.0
>
>
> With Hive dialect,  for union sql statement, if one side of union select multiple same columns, the columns will be duplicated, thus only retains one column. Then it will throw the exception "Schema of both sides of union should match" for it will loss some columns.
> It can be reproduced using the following code in HiveDialectQueryITCase:
> {code:java}
>  List<Row> result =
>                 CollectionUtil.iteratorToList(
>                         tableEnv.executeSql("select x,y from foo union all select i,i from bar")
>                                 .collect());
> {code}



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