Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Table SQL / Planner
    • None

    Description

      When using flink batch sql to run hive sql queries, we load hive module to use Hive built-in functions.
      However some query plan plan are unexpected after loading hive module.
      For the following sql,

      load module hive;
      use modules hive,core;
      set table.sql-dialect=hive;
      
      select
        account_id,
        sum(impression)
      from test_db.test_table where dt = '2022-01-10' and hi = '0100' group by account_id
      

      The planner is:

      After remove 'load mudiles hive; use modules hive, core;', the planner is:

      After loading hive modules, hash aggregate is not final plan because the aggregate function is `HiveAggSqlFunction` and the aggregate buffer is not fixed length which type is as following:

      LEGACY('RAW', 'ANY<org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator$AggregationBuffer>')
      

      Attachments

        1. image-2022-01-13-15-52-27-783.png
          134 kB
          Jing Zhang
        2. image-2022-01-13-15-55-40-958.png
          152 kB
          Jing Zhang

        Issue Links

          Activity

            People

              luoyuxia luoyuxia
              jingzhang Jing Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: