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

Support fold expression before transfer to RexNode

    XMLWordPrintableJSON

Details

    Description

      Hive will fold expression in optimization stage. But flink-hive-parser use flink optimization.

      And flink can't know some hive function can be constant value.

      It can be reproduce by follow sql

      select distinct(dep), UNIX_TIMESTAMP()  from employee 

      Some hive code reference:

      https://github.com/apache/hive/blob/rel/release-2.3.9/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRexExecutorImpl.java#L62

      https://github.com/apache/hive/blob/rel/release-2.3.9/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java#L1776

      https://github.com/apache/hive/blob/rel/release-2.3.9/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java#L1069

      Attachments

        Activity

          People

            Unassigned Unassigned
            yunfanfighting@foxmail.com yunfan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: