Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-19108

Stop expanding the identifiers with scope aliased by the system with 'EXPR$' prefix

    XMLWordPrintableJSON

    Details

      Description

      For query

      create view tmp_view as
      select * from (
        select f0,
        row_number() over (partition by f0 order by f0 desc) as rowNum
        from source) -- the query would be aliased as "EXPR$1"
        where rowNum = 1
      

      When validation, the inner query would have alias assigned by the system with prefix "EXPR$1", when in the `Expander`, we replace the id in the inner query all with this prefix which is wrong because we do not add the alias to the inner query anymore.

      To solve the problem, skip the expanding of id with "EXPR$" just like how SqlUtil#deriveAliasFromOrdinal added it.

      This was introduced by FLINK-18750.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                danny0405 Danny Chen
                Reporter:
                danny0405 Danny Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: