新优化器查询hudi表异常

Viewed 61

Doris版本:doris-2.1.4-rc03

该问题升级到2.1.4时才出现

启用新优化器时

        SET enable_nereids_planner=true;
        SET enable_fallback_to_original_planner=true;

实际该表为四千多万行数据

  • 启用新优化器后count(1) --- 结果异常
    image.png
  • 执行计划
Explain String(Old Planner)                                     |
----------------------------------------------------------------+
PLAN FRAGMENT 0                                                 |
  OUTPUT EXPRS:                                                 |
    count(1)                                                    |
  PARTITION: RANDOM                                             |
                                                                |
  HAS_COLO_PLAN_NODE: false                                     |
                                                                |
  VRESULT SINK                                                  |
     MYSQL_PROTOCAL                                             |
                                                                |
  1:VAGGREGATE (update finalize)                                |
  |  output: count(1)                                           |
  |  group by:                                                  |
  |  cardinality=1                                              |
  |                                                             |
  0:VHUDI_SCAN_NODE                                             |
     table: ods_xxx                                   |
     inputSplitNum=315, totalFileSize=3411603856, scanRanges=315|
     partition=80/80                                            |
     numNodes=6                                                 |
     pushdown agg=COUNT                                         |
     hudiNativeReadSplits=315/315                               |
  • 启用新优化器后group by子查询再count(1) --- 结果正常
    image.png

关闭新优化器时

       SET enable_nereids_planner=false;
  • count(1) --- 结果正常
    image.png
  • 执行计划
Explain String(Old Planner)                                     |
----------------------------------------------------------------+
PLAN FRAGMENT 0                                                 |
  OUTPUT EXPRS:                                                 |
    count(1)                                                    |
  PARTITION: UNPARTITIONED                                      |
                                                                |
  HAS_COLO_PLAN_NODE: false                                     |
                                                                |
  VRESULT SINK                                                  |
     MYSQL_PROTOCAL                                             |
                                                                |
  3:VAGGREGATE (merge finalize)                                 |
  |  output: count(count(1))                                    |
  |  group by:                                                  |
  |  cardinality=-1                                             |
  |                                                             |
  2:VEXCHANGE                                                   |
     offset: 0                                                  |
                                                                |
PLAN FRAGMENT 1                                                 |
                                                                |
  PARTITION: RANDOM                                             |
                                                                |
  HAS_COLO_PLAN_NODE: false                                     |
                                                                |
  STREAM DATA SINK                                              |
    EXCHANGE ID: 02                                             |
    UNPARTITIONED                                               |
                                                                |
  1:VAGGREGATE (update serialize)                               |
  |  output: count(1)                                           |
  |  group by:                                                  |
  |  cardinality=1                                              |
  |                                                             |
  0:VHUDI_SCAN_NODE                                             |
     table: ods_xxx                               |
     inputSplitNum=315, totalFileSize=3411603856, scanRanges=315|
     partition=80/80                                            |
     numNodes=6                                                 |
     pushdown agg=COUNT                                         |
     hudiNativeReadSplits=315/315                               |
1 Answers