Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-26360 [Umbrella] Improvement for Hive Query Syntax Compatibility
  3. FLINK-26542

Fix "schema of both sides of union should match" exception when one side of union select multiple same coulmns

    XMLWordPrintableJSON

Details

    Description

      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:

       List<Row> result =
                      CollectionUtil.iteratorToList(
                              tableEnv.executeSql("select x,y from foo union all select i,i from bar")
                                      .collect());
      

      Attachments

        Issue Links

          Activity

            People

              luoyuxia luoyuxia
              luoyuxia luoyuxia
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: