You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by kx...@apache.org on 2023/06/09 16:17:52 UTC

[doris] branch branch-2.0-beta updated (3dc9aa05ae -> 237a4837e7)

This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a change to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git


    from 3dc9aa05ae [feature-wip](duplicate_no_keys) Add some test cases of all the duplicate tables in test case tpcds_sf100_dup_without_key_p2 and make them duplicate tables without keys (#20431)
     new 35f438ec74 [opt](planner)(Nereids) add switch to determine if some unfixed functions will be folded on fe. (#20270)
     new c43dcb222e [fix](stats) set analysis job status to finished when be crashed by mistake (#20485)
     new 56a6d566d9 [fix](regression) unique_with_mow_p2/test_pk_uk_case (#20497)
     new 2121aa6460 [enhancement](stats) Forbid unknown stats check for internal_column (#20535)
     new 99615e31cb [improvement](exception-safe) create and prepare node/sink support exception safe (#20551)
     new 46e2277a30 [Improvement](column) reduce cache miss for data copy (#20583)
     new 0be6785858  [performance](executor) remove repeated call within the loop in validate_column
     new 4a33b956e6 [enhancement](index) Nereids support no need to read raw data for index column that only in filter conditions (#20605)
     new cbfaec4c9c [minor](Nereids) remove some invasive code of  minidump in cascades framework (#20606)
     new 8ec410794a [opt](Nereids) remove running in OptimizeGroup to avoid recompute on it parent (#20608)
     new 05877f555c [regression](nereids) check tpch sf1T and sf500 plan shape on 3 BE environment #20610
     new de0bbc3d3c [fix](memory) Fix runtime state default mem tracker (#20615)
     new 237a4837e7 [enhancement](stats) ignore view by default when analyze whole DB #20630

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 be/src/common/exception.h                          |  22 +
 be/src/exec/data_sink.cpp                          |  49 +--
 be/src/olap/push_handler.cpp                       |   6 +-
 be/src/olap/rowset/segment_v2/page_io.cpp          |   2 +-
 be/src/olap/rowset/segment_v2/segment_iterator.cpp |  19 +-
 be/src/olap/rowset/segment_v2/segment_iterator.h   |   1 +
 be/src/pipeline/pipeline_fragment_context.cpp      |   2 +-
 be/src/runtime/fold_constant_executor.cpp          |   6 +-
 be/src/runtime/plan_fragment_executor.cpp          |  13 +-
 be/src/runtime/runtime_state.cpp                   |  12 +-
 be/src/runtime/runtime_state.h                     |   6 +-
 be/src/vec/columns/column.h                        |   1 +
 be/src/vec/columns/column_decimal.h                |   3 +
 be/src/vec/columns/column_string.cpp               |   3 +
 be/src/vec/columns/column_string.h                 |   5 +
 be/src/vec/columns/column_vector.cpp               |   6 +
 be/src/vec/core/block.cpp                          |   4 +-
 be/src/vec/data_types/data_type_decimal.cpp        |  11 +-
 be/src/vec/data_types/data_type_time_v2.cpp        |   4 +-
 be/src/vec/exec/format/orc/vorc_reader.cpp         |   4 +-
 .../exec/format/parquet/vparquet_group_reader.cpp  |   4 +-
 be/src/vec/exec/join/vhash_join_node.cpp           |   4 +-
 be/src/vec/exec/scan/new_olap_scan_node.cpp        |   3 -
 be/src/vec/exec/scan/vfile_scanner.cpp             |  13 +-
 be/src/vec/exec/vsort_node.cpp                     |   4 +-
 be/src/vec/sink/vtablet_sink.cpp                   |  11 +-
 .../apache/doris/analysis/ExpressionFunctions.java |  16 +
 .../doris/catalog/InternalSchemaInitializer.java   |   2 +-
 .../java/org/apache/doris/nereids/cost/Cost.java   |  14 +-
 .../apache/doris/nereids/cost/CostCalculator.java  |  16 +-
 .../org/apache/doris/nereids/cost/CostModelV1.java |   5 +-
 .../org/apache/doris/nereids/cost/CostWeight.java  |   9 +-
 .../nereids/jobs/cascades/CostAndEnforcerJob.java  |  33 +-
 .../nereids/jobs/cascades/OptimizeGroupJob.java    |   3 +-
 .../jobs/joinorder/hypergraph/GraphSimplifier.java |   4 +-
 .../apache/doris/nereids/memo/GroupExpression.java |   2 +-
 .../expression/rules/FoldConstantRuleOnFE.java     |   3 +
 .../doris/nereids/stats/StatsCalculator.java       |  14 +-
 .../nereids/trees/expressions/Expression.java      |   5 -
 .../trees/expressions/ExpressionEvaluator.java     |   2 +-
 .../doris/nereids/trees/expressions/Foldable.java  |  24 --
 .../expressions/functions/ExpressionTrait.java     |   4 +
 .../expressions/functions/Nondeterministic.java    |  10 +-
 .../expressions/functions/scalar/CurrentDate.java  |   3 +-
 .../expressions/functions/scalar/CurrentTime.java  |   3 +-
 .../functions/scalar/UnixTimestamp.java            |  11 +-
 .../org/apache/doris/planner/OriginalPlanner.java  |  44 +-
 .../java/org/apache/doris/qe/SessionVariable.java  |  13 +
 .../java/org/apache/doris/qe/StmtExecutor.java     |  10 +-
 .../apache/doris/statistics/AnalysisManager.java   |  20 +-
 .../doris/statistics/AnalysisTaskExecutor.java     |   2 +-
 .../doris/statistics/AnalysisTaskWrapper.java      |   4 +-
 .../apache/doris/statistics/ColumnStatistic.java   |   3 +-
 .../apache/doris/statistics/OlapAnalysisTask.java  |  12 +-
 .../doris/statistics/StatisticsAutoAnalyzer.java   |   1 -
 .../doris/statistics/util/StatisticsUtil.java      |   4 +-
 .../org/apache/doris/system/SystemInfoService.java |   9 +
 .../org/apache/doris/nereids/memo/MemoTest.java    |   2 +-
 .../org/apache/doris/planner/QueryPlanTest.java    |   2 +-
 .../apache/doris/statistics/AnalysisJobTest.java   |   9 +
 .../doris/statistics/AnalysisTaskExecutorTest.java |  18 +
 .../test_index_no_need_read_data.out               | 129 ++++++
 .../nereids_tpcds_shape_sf100_p0/shape/query33.out |  44 +-
 .../data/nereids_tpch_shape_sf1000_p0/shape/q2.out |  19 +-
 .../data/nereids_tpch_shape_sf1_p0/shape/q1.out    |  12 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q10.out   |  25 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q11.out   |  39 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q12.out   |  16 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q13.out   |  19 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q14.out   |  15 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q15.out   |  30 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q16.out   |  22 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q17.out   |  20 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q18.out   |  25 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q19.out   |  15 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q2.out    |  30 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q20.out   |  32 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q21.out   |  33 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q22.out   |  26 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q3.out    |  22 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q4.out    |  17 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q5.out    |  35 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q6.out    |   9 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q7.out    |  36 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q8.out    |  48 ---
 .../data/nereids_tpch_shape_sf1_p0/shape/q9.out    |  35 --
 .../data/nereids_tpch_shape_sf500_p0/shape/q2.out  |  19 +-
 .../test_index_no_need_read_data.groovy            |  88 ++++
 .../unique_with_mow/test_pk_uk_case.groovy         |   7 +-
 .../nereids_tpch_shape_sf1000_p0/shape/q1.groovy   | 114 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q10.groovy  | 136 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q11.groovy  | 130 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q12.groovy  | 126 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q13.groovy  | 118 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q14.groovy  |  98 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q15.groovy  | 118 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q16.groovy  | 140 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q17.groovy  | 114 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q18.groovy  | 146 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q19.groovy  | 154 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q2.groovy   |   6 +-
 .../nereids_tpch_shape_sf1000_p0/shape/q20.groovy  | 156 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q21.groovy  | 160 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q22.groovy  | 154 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q3.groovy   | 128 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q4.groovy   | 118 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q5.groovy   | 128 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q6.groovy   |  98 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q7.groovy   | 158 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q8.groovy   | 154 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q9.groovy   | 144 +++----
 .../suites/nereids_tpch_shape_sf1_p0/load.groovy   | 467 ---------------------
 .../nereids_tpch_shape_sf1_p0/shape/q1.groovy      |  56 ---
 .../nereids_tpch_shape_sf1_p0/shape/q10.groovy     |  71 ----
 .../nereids_tpch_shape_sf1_p0/shape/q11.groovy     |  66 ---
 .../nereids_tpch_shape_sf1_p0/shape/q12.groovy     |  67 ---
 .../nereids_tpch_shape_sf1_p0/shape/q13.groovy     |  59 ---
 .../nereids_tpch_shape_sf1_p0/shape/q14.groovy     |  52 ---
 .../nereids_tpch_shape_sf1_p0/shape/q15.groovy     |  58 ---
 .../nereids_tpch_shape_sf1_p0/shape/q16.groovy     |  69 ---
 .../nereids_tpch_shape_sf1_p0/shape/q17.groovy     |  56 ---
 .../nereids_tpch_shape_sf1_p0/shape/q18.groovy     |  72 ----
 .../nereids_tpch_shape_sf1_p0/shape/q19.groovy     |  76 ----
 .../nereids_tpch_shape_sf1_p0/shape/q2.groovy      |  83 ----
 .../nereids_tpch_shape_sf1_p0/shape/q20.groovy     |  77 ----
 .../nereids_tpch_shape_sf1_p0/shape/q21.groovy     |  79 ----
 .../nereids_tpch_shape_sf1_p0/shape/q22.groovy     |  76 ----
 .../nereids_tpch_shape_sf1_p0/shape/q3.groovy      |  63 ---
 .../nereids_tpch_shape_sf1_p0/shape/q4.groovy      |  60 ---
 .../nereids_tpch_shape_sf1_p0/shape/q5.groovy      |  64 ---
 .../nereids_tpch_shape_sf1_p0/shape/q6.groovy      |  49 ---
 .../nereids_tpch_shape_sf1_p0/shape/q7.groovy      |  79 ----
 .../nereids_tpch_shape_sf1_p0/shape/q8.groovy      |  76 ----
 .../nereids_tpch_shape_sf1_p0/shape/q9.groovy      |  71 ----
 .../nereids_tpch_shape_sf500_p0/shape/q1.groovy    | 116 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q10.groovy   | 144 +++----
 .../nereids_tpch_shape_sf500_p0/shape/q11.groovy   | 134 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q12.groovy   | 136 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q13.groovy   | 114 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q14.groovy   | 100 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q15.groovy   | 118 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q16.groovy   | 140 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q17.groovy   | 114 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q18.groovy   | 146 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q19.groovy   | 154 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q2.groovy    |   6 +-
 .../nereids_tpch_shape_sf500_p0/shape/q20.groovy   | 156 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q21.groovy   | 160 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q22.groovy   | 154 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q3.groovy    | 134 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q4.groovy    | 126 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q5.groovy    | 122 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q6.groovy    |  92 ++--
 .../nereids_tpch_shape_sf500_p0/shape/q7.groovy    | 152 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q8.groovy    | 146 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q9.groovy    | 138 +++---
 .../unique_with_mow_p0/test_pk_uk_case.groovy      |   9 +-
 .../unique_with_mow_p2/test_pk_uk_case.groovy      |   7 +-
 158 files changed, 3281 insertions(+), 5702 deletions(-)
 delete mode 100644 fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Foldable.java
 create mode 100644 regression-test/data/inverted_index_p0/test_index_no_need_read_data.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q1.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q10.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q11.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q12.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q13.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q14.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q15.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q16.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q17.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q18.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q19.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q2.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q20.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q21.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q22.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q3.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q4.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q5.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q6.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q7.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q8.out
 delete mode 100644 regression-test/data/nereids_tpch_shape_sf1_p0/shape/q9.out
 create mode 100644 regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/load.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q1.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q10.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q11.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q12.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q13.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q14.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q15.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q16.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q17.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q18.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q19.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q2.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q20.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q21.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q22.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q3.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q4.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q5.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q6.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q7.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q8.groovy
 delete mode 100644 regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q9.groovy


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 03/13: [fix](regression) unique_with_mow_p2/test_pk_uk_case (#20497)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 56a6d566d9c45824631e0303eb8fe449e688e3bc
Author: zhannngchen <48...@users.noreply.github.com>
AuthorDate: Wed Jun 7 21:34:34 2023 +0800

    [fix](regression) unique_with_mow_p2/test_pk_uk_case (#20497)
---
 .../inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy     | 7 ++-----
 regression-test/suites/unique_with_mow_p0/test_pk_uk_case.groovy | 9 +++------
 regression-test/suites/unique_with_mow_p2/test_pk_uk_case.groovy | 7 ++-----
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy b/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy
index 2f1487a822..fbf4e3a95e 100644
--- a/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy
+++ b/regression-test/suites/inverted_index_p0/unique_with_mow/test_pk_uk_case.groovy
@@ -93,7 +93,8 @@ suite("test_pk_uk_case", "inverted_index") {
         UNIQUE KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER)
         DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1
         PROPERTIES (
-        "replication_num" = "1"
+        "replication_num" = "1",
+        "enable_unique_key_merge_on_write" = "false"
         )       
     """
 
@@ -212,8 +213,6 @@ suite("test_pk_uk_case", "inverted_index") {
                             count(*)                                              AS count_order
                             FROM
                             ${tableNamePk}
-                            WHERE
-                            l_shipdate <= DATE '2023-01-01' - INTERVAL '90' DAY
                             GROUP BY
                             l_returnflag,
                             l_linestatus
@@ -234,8 +233,6 @@ suite("test_pk_uk_case", "inverted_index") {
                             count(*)                                              AS count_order
                             FROM
                             ${tableNameUk}
-                            WHERE
-                            l_shipdate <= DATE '2023-01-01' - INTERVAL '90' DAY
                             GROUP BY
                             l_returnflag,
                             l_linestatus
diff --git a/regression-test/suites/unique_with_mow_p0/test_pk_uk_case.groovy b/regression-test/suites/unique_with_mow_p0/test_pk_uk_case.groovy
index 02fb51a30b..410e209721 100644
--- a/regression-test/suites/unique_with_mow_p0/test_pk_uk_case.groovy
+++ b/regression-test/suites/unique_with_mow_p0/test_pk_uk_case.groovy
@@ -86,8 +86,9 @@ suite("test_pk_uk_case") {
         UNIQUE KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER)
         DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1
         PROPERTIES (
-        "replication_num" = "1"
-        )       
+        "replication_num" = "1",
+        "enable_unique_key_merge_on_write" = "false"
+        )
     """
 
     Random rd = new Random()
@@ -205,8 +206,6 @@ suite("test_pk_uk_case") {
                             count(*)                                              AS count_order
                             FROM
                             ${tableNamePk}
-                            WHERE
-                            l_shipdate <= DATE '2023-01-01' - INTERVAL '90' DAY
                             GROUP BY
                             l_returnflag,
                             l_linestatus
@@ -227,8 +226,6 @@ suite("test_pk_uk_case") {
                             count(*)                                              AS count_order
                             FROM
                             ${tableNameUk}
-                            WHERE
-                            l_shipdate <= DATE '2023-01-01' - INTERVAL '90' DAY
                             GROUP BY
                             l_returnflag,
                             l_linestatus
diff --git a/regression-test/suites/unique_with_mow_p2/test_pk_uk_case.groovy b/regression-test/suites/unique_with_mow_p2/test_pk_uk_case.groovy
index 3739ed25af..4e9ab47a48 100644
--- a/regression-test/suites/unique_with_mow_p2/test_pk_uk_case.groovy
+++ b/regression-test/suites/unique_with_mow_p2/test_pk_uk_case.groovy
@@ -86,7 +86,8 @@ suite("test_pk_uk_case") {
         UNIQUE KEY(L_ORDERKEY, L_PARTKEY, L_SUPPKEY, L_LINENUMBER)
         DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1
         PROPERTIES (
-        "replication_num" = "1"
+        "replication_num" = "1",
+        "enable_unique_key_merge_on_write" = "false"
         )       
     """
 
@@ -205,8 +206,6 @@ suite("test_pk_uk_case") {
                             count(*)                                              AS count_order
                             FROM
                             ${tableNamePk}
-                            WHERE
-                            l_shipdate <= DATE '2023-01-01' - INTERVAL '90' DAY
                             GROUP BY
                             l_returnflag,
                             l_linestatus
@@ -227,8 +226,6 @@ suite("test_pk_uk_case") {
                             count(*)                                              AS count_order
                             FROM
                             ${tableNameUk}
-                            WHERE
-                            l_shipdate <= DATE '2023-01-01' - INTERVAL '90' DAY
                             GROUP BY
                             l_returnflag,
                             l_linestatus


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 11/13: [regression](nereids) check tpch sf1T and sf500 plan shape on 3 BE environment #20610

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 05877f555c1843c8810f963ddf27248bbc46c1b6
Author: minghong <en...@gmail.com>
AuthorDate: Fri Jun 9 22:46:40 2023 +0800

    [regression](nereids) check tpch sf1T and sf500 plan shape on 3 BE environment #20610
---
 .../org/apache/doris/nereids/cost/CostModelV1.java |   5 +-
 .../org/apache/doris/system/SystemInfoService.java |   9 +
 .../data/nereids_tpch_shape_sf1000_p0/shape/q2.out |  19 +-
 .../data/nereids_tpch_shape_sf1_p0/shape/q1.out    |  12 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q10.out   |  25 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q11.out   |  39 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q12.out   |  16 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q13.out   |  19 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q14.out   |  15 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q15.out   |  30 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q16.out   |  22 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q17.out   |  20 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q18.out   |  25 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q19.out   |  15 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q2.out    |  30 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q20.out   |  32 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q21.out   |  33 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q22.out   |  26 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q3.out    |  22 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q4.out    |  17 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q5.out    |  35 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q6.out    |   9 -
 .../data/nereids_tpch_shape_sf1_p0/shape/q7.out    |  36 --
 .../data/nereids_tpch_shape_sf1_p0/shape/q8.out    |  48 ---
 .../data/nereids_tpch_shape_sf1_p0/shape/q9.out    |  35 --
 .../data/nereids_tpch_shape_sf500_p0/shape/q2.out  |  19 +-
 .../nereids_tpch_shape_sf1000_p0/shape/q1.groovy   | 114 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q10.groovy  | 136 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q11.groovy  | 130 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q12.groovy  | 126 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q13.groovy  | 118 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q14.groovy  |  98 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q15.groovy  | 118 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q16.groovy  | 140 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q17.groovy  | 114 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q18.groovy  | 146 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q19.groovy  | 154 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q2.groovy   |   6 +-
 .../nereids_tpch_shape_sf1000_p0/shape/q20.groovy  | 156 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q21.groovy  | 160 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q22.groovy  | 154 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q3.groovy   | 128 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q4.groovy   | 118 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q5.groovy   | 128 +++---
 .../nereids_tpch_shape_sf1000_p0/shape/q6.groovy   |  98 +++--
 .../nereids_tpch_shape_sf1000_p0/shape/q7.groovy   | 158 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q8.groovy   | 154 ++++---
 .../nereids_tpch_shape_sf1000_p0/shape/q9.groovy   | 144 +++----
 .../suites/nereids_tpch_shape_sf1_p0/load.groovy   | 467 ---------------------
 .../nereids_tpch_shape_sf1_p0/shape/q1.groovy      |  56 ---
 .../nereids_tpch_shape_sf1_p0/shape/q10.groovy     |  71 ----
 .../nereids_tpch_shape_sf1_p0/shape/q11.groovy     |  66 ---
 .../nereids_tpch_shape_sf1_p0/shape/q12.groovy     |  67 ---
 .../nereids_tpch_shape_sf1_p0/shape/q13.groovy     |  59 ---
 .../nereids_tpch_shape_sf1_p0/shape/q14.groovy     |  52 ---
 .../nereids_tpch_shape_sf1_p0/shape/q15.groovy     |  58 ---
 .../nereids_tpch_shape_sf1_p0/shape/q16.groovy     |  69 ---
 .../nereids_tpch_shape_sf1_p0/shape/q17.groovy     |  56 ---
 .../nereids_tpch_shape_sf1_p0/shape/q18.groovy     |  72 ----
 .../nereids_tpch_shape_sf1_p0/shape/q19.groovy     |  76 ----
 .../nereids_tpch_shape_sf1_p0/shape/q2.groovy      |  83 ----
 .../nereids_tpch_shape_sf1_p0/shape/q20.groovy     |  77 ----
 .../nereids_tpch_shape_sf1_p0/shape/q21.groovy     |  79 ----
 .../nereids_tpch_shape_sf1_p0/shape/q22.groovy     |  76 ----
 .../nereids_tpch_shape_sf1_p0/shape/q3.groovy      |  63 ---
 .../nereids_tpch_shape_sf1_p0/shape/q4.groovy      |  60 ---
 .../nereids_tpch_shape_sf1_p0/shape/q5.groovy      |  64 ---
 .../nereids_tpch_shape_sf1_p0/shape/q6.groovy      |  49 ---
 .../nereids_tpch_shape_sf1_p0/shape/q7.groovy      |  79 ----
 .../nereids_tpch_shape_sf1_p0/shape/q8.groovy      |  76 ----
 .../nereids_tpch_shape_sf1_p0/shape/q9.groovy      |  71 ----
 .../nereids_tpch_shape_sf500_p0/shape/q1.groovy    | 116 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q10.groovy   | 144 +++----
 .../nereids_tpch_shape_sf500_p0/shape/q11.groovy   | 134 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q12.groovy   | 136 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q13.groovy   | 114 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q14.groovy   | 100 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q15.groovy   | 118 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q16.groovy   | 140 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q17.groovy   | 114 +++--
 .../nereids_tpch_shape_sf500_p0/shape/q18.groovy   | 146 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q19.groovy   | 154 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q2.groovy    |   6 +-
 .../nereids_tpch_shape_sf500_p0/shape/q20.groovy   | 156 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q21.groovy   | 160 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q22.groovy   | 154 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q3.groovy    | 134 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q4.groovy    | 126 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q5.groovy    | 122 +++---
 .../nereids_tpch_shape_sf500_p0/shape/q6.groovy    |  92 ++--
 .../nereids_tpch_shape_sf500_p0/shape/q7.groovy    | 152 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q8.groovy    | 146 ++++---
 .../nereids_tpch_shape_sf500_p0/shape/q9.groovy    | 138 +++---
 93 files changed, 2742 insertions(+), 5417 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java
index fd587a42c2..43246b1e02 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostModelV1.java
@@ -173,10 +173,7 @@ class CostModelV1 extends PlanVisitor<Cost, PlanContext> {
 
         // replicate
         if (spec instanceof DistributionSpecReplicated) {
-            int beNumber = ConnectContext.get().getEnv().getClusterInfo().getAllBackendIds(true).size();
-            if (ConnectContext.get().getSessionVariable().getBeNumberForTest() != -1) {
-                beNumber = ConnectContext.get().getSessionVariable().getBeNumberForTest();
-            }
+            int beNumber = ConnectContext.get().getEnv().getClusterInfo().getBackendsNumber(true);
             int instanceNumber = ConnectContext.get().getSessionVariable().getParallelExecInstanceNum();
             beNumber = Math.max(1, beNumber);
             double memLimit = ConnectContext.get().getSessionVariable().getMaxExecMemByte();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java b/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
index 4d10bb82e9..e2d4811a4b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
@@ -33,6 +33,7 @@ import org.apache.doris.common.UserException;
 import org.apache.doris.common.io.CountingDataOutputStream;
 import org.apache.doris.common.util.NetUtils;
 import org.apache.doris.metric.MetricRepo;
+import org.apache.doris.qe.ConnectContext;
 import org.apache.doris.resource.Tag;
 import org.apache.doris.thrift.TNodeInfo;
 import org.apache.doris.thrift.TPaloNodesInfo;
@@ -356,6 +357,14 @@ public class SystemInfoService {
         return getAllBackendIds(false);
     }
 
+    public int getBackendsNumber(boolean needAlive) {
+        int beNumber = ConnectContext.get().getSessionVariable().getBeNumberForTest();
+        if (beNumber == -1) {
+            beNumber = getAllBackendIds(needAlive).size();
+        }
+        return beNumber;
+    }
+
     public List<Long> getAllBackendIds(boolean needAlive) {
         ImmutableMap<Long, Backend> idToBackend = idToBackendRef;
         List<Long> backendIds = Lists.newArrayList(idToBackend.keySet());
diff --git a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q2.out b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q2.out
index f3091de749..f109430d4a 100644
--- a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q2.out
+++ b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q2.out
@@ -7,15 +7,16 @@ PhysicalTopN
 --------filter((partsupp.ps_supplycost = min(ps_supplycost) OVER(PARTITION BY p_partkey)))
 ----------PhysicalWindow
 ------------PhysicalQuickSort
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](supplier.s_suppkey = partsupp.ps_suppkey)
-------------------hashJoin[INNER_JOIN](part.p_partkey = partsupp.ps_partkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[partsupp]
---------------------PhysicalProject
-----------------------filter((part.p_size = 15)(p_type like '%BRASS'))
-------------------------PhysicalOlapScan[part]
-------------------PhysicalDistribute
+--------------PhysicalDistribute
+----------------PhysicalProject
+------------------hashJoin[INNER_JOIN](supplier.s_suppkey = partsupp.ps_suppkey)
+--------------------PhysicalDistribute
+----------------------hashJoin[INNER_JOIN](part.p_partkey = partsupp.ps_partkey)
+------------------------PhysicalProject
+--------------------------PhysicalOlapScan[partsupp]
+------------------------PhysicalProject
+--------------------------filter((part.p_size = 15)(p_type like '%BRASS'))
+----------------------------PhysicalOlapScan[part]
 --------------------PhysicalProject
 ----------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
 ------------------------PhysicalOlapScan[supplier]
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q1.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q1.out
deleted file mode 100644
index 00a7cf50f8..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q1.out
+++ /dev/null
@@ -1,12 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------filter((lineitem.l_shipdate <= 1998-09-02))
-----------------PhysicalOlapScan[lineitem]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q10.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q10.out
deleted file mode 100644
index cf30f47eb7..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q10.out
+++ /dev/null
@@ -1,25 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalTopN
---PhysicalDistribute
-----PhysicalTopN
-------PhysicalProject
---------hashAgg[LOCAL]
-----------PhysicalProject
-------------hashJoin[INNER_JOIN](customer.c_nationkey = nation.n_nationkey)
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](customer.c_custkey = orders.o_custkey)
-------------------PhysicalProject
---------------------PhysicalOlapScan[customer]
-------------------PhysicalDistribute
---------------------hashJoin[INNER_JOIN](lineitem.l_orderkey = orders.o_orderkey)
-----------------------PhysicalProject
-------------------------filter((lineitem.l_returnflag = 'R'))
---------------------------PhysicalOlapScan[lineitem]
-----------------------PhysicalProject
-------------------------filter((orders.o_orderdate < 1994-01-01)(orders.o_orderdate >= 1993-10-01))
---------------------------PhysicalOlapScan[orders]
---------------PhysicalDistribute
-----------------PhysicalProject
-------------------PhysicalOlapScan[nation]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q11.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q11.out
deleted file mode 100644
index cf27cdd93f..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q11.out
+++ /dev/null
@@ -1,39 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------PhysicalProject
---------NestedLoopJoin[INNER_JOIN](cast(value as DOUBLE) > cast((sum((ps_supplycost * ps_availqty)) * 0.000002) as DOUBLE))
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[INNER_JOIN](partsupp.ps_suppkey = supplier.s_suppkey)
-----------------PhysicalProject
-------------------PhysicalOlapScan[partsupp]
-----------------PhysicalDistribute
-------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[supplier]
---------------------PhysicalDistribute
-----------------------PhysicalProject
-------------------------filter((nation.n_name = 'GERMANY'))
---------------------------PhysicalOlapScan[nation]
-----------PhysicalDistribute
-------------PhysicalAssertNumRows
---------------PhysicalProject
-----------------hashAgg[GLOBAL]
-------------------PhysicalDistribute
---------------------hashAgg[LOCAL]
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN](partsupp.ps_suppkey = supplier.s_suppkey)
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[partsupp]
---------------------------PhysicalDistribute
-----------------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
-------------------------------PhysicalProject
---------------------------------PhysicalOlapScan[supplier]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((nation.n_name = 'GERMANY'))
-------------------------------------PhysicalOlapScan[nation]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q12.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q12.out
deleted file mode 100644
index 6dd416cefa..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q12.out
+++ /dev/null
@@ -1,16 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[INNER_JOIN](orders.o_orderkey = lineitem.l_orderkey)
-----------------PhysicalProject
-------------------PhysicalOlapScan[orders]
-----------------PhysicalProject
-------------------filter(((lineitem.l_shipmode = 'MAIL') OR (lineitem.l_shipmode = 'SHIP'))(lineitem.l_shipdate < lineitem.l_commitdate)(lineitem.l_receiptdate < 1995-01-01)(lineitem.l_receiptdate >= 1994-01-01)(lineitem.l_commitdate < lineitem.l_receiptdate))
---------------------PhysicalOlapScan[lineitem]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q13.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q13.out
deleted file mode 100644
index d196ba817e..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q13.out
+++ /dev/null
@@ -1,19 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashAgg[LOCAL]
-----------------PhysicalProject
-------------------hashJoin[RIGHT_OUTER_JOIN](customer.c_custkey = orders.o_custkey)
---------------------PhysicalDistribute
-----------------------PhysicalProject
-------------------------filter(( not (o_comment like '%special%requests%')))
---------------------------PhysicalOlapScan[orders]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[customer]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q14.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q14.out
deleted file mode 100644
index 9ec9d4f3fa..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q14.out
+++ /dev/null
@@ -1,15 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalProject
---hashAgg[GLOBAL]
-----PhysicalDistribute
-------hashAgg[LOCAL]
---------PhysicalProject
-----------hashJoin[INNER_JOIN](lineitem.l_partkey = part.p_partkey)
-------------PhysicalProject
---------------PhysicalOlapScan[part]
-------------PhysicalDistribute
---------------PhysicalProject
-----------------filter((lineitem.l_shipdate < 1995-10-01)(lineitem.l_shipdate >= 1995-09-01))
-------------------PhysicalOlapScan[lineitem]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q15.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q15.out
deleted file mode 100644
index da9dd396be..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q15.out
+++ /dev/null
@@ -1,30 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------PhysicalProject
---------hashJoin[INNER_JOIN](supplier.s_suppkey = revenue0.supplier_no)
-----------PhysicalProject
-------------PhysicalOlapScan[supplier]
-----------PhysicalDistribute
-------------hashJoin[INNER_JOIN](revenue0.total_revenue = max(total_revenue))
---------------hashAgg[GLOBAL]
-----------------PhysicalDistribute
-------------------hashAgg[LOCAL]
---------------------PhysicalProject
-----------------------filter((lineitem.l_shipdate >= 1996-01-01)(lineitem.l_shipdate < 1996-04-01))
-------------------------PhysicalOlapScan[lineitem]
---------------PhysicalDistribute
-----------------PhysicalAssertNumRows
-------------------hashAgg[GLOBAL]
---------------------PhysicalDistribute
-----------------------hashAgg[LOCAL]
-------------------------PhysicalProject
---------------------------hashAgg[GLOBAL]
-----------------------------PhysicalDistribute
-------------------------------hashAgg[LOCAL]
---------------------------------PhysicalProject
-----------------------------------filter((lineitem.l_shipdate >= 1996-01-01)(lineitem.l_shipdate < 1996-04-01))
-------------------------------------PhysicalOlapScan[lineitem]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q16.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q16.out
deleted file mode 100644
index 3b28129f40..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q16.out
+++ /dev/null
@@ -1,22 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[DISTINCT_LOCAL]
---------hashAgg[GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[LOCAL]
---------------PhysicalProject
-----------------hashJoin[LEFT_ANTI_JOIN](partsupp.ps_suppkey = supplier.s_suppkey)
-------------------hashJoin[INNER_JOIN](part.p_partkey = partsupp.ps_partkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[partsupp]
---------------------PhysicalProject
-----------------------filter(( not (p_type like 'MEDIUM POLISHED%'))( not (p_brand = 'Brand#45'))p_size IN (3, 9, 14, 19, 23, 36, 45, 49))
-------------------------PhysicalOlapScan[part]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------filter((s_comment like '%Customer%Complaints%'))
-------------------------PhysicalOlapScan[supplier]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q17.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q17.out
deleted file mode 100644
index 90b6d8a190..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q17.out
+++ /dev/null
@@ -1,20 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalProject
---hashAgg[GLOBAL]
-----PhysicalDistribute
-------hashAgg[LOCAL]
---------PhysicalProject
-----------filter((cast(l_quantity as DECIMALV3(38, 5)) < (0.2 * avg(cast(l_quantity as DECIMALV3(17, 4))) OVER(PARTITION BY p_partkey))))
-------------PhysicalWindow
---------------PhysicalQuickSort
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN](part.p_partkey = lineitem.l_partkey)
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[lineitem]
-----------------------PhysicalDistribute
-------------------------PhysicalProject
---------------------------filter((part.p_container = 'MED BOX')(part.p_brand = 'Brand#23'))
-----------------------------PhysicalOlapScan[part]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q18.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q18.out
deleted file mode 100644
index e91c302aaa..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q18.out
+++ /dev/null
@@ -1,25 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalTopN
---PhysicalDistribute
-----PhysicalTopN
-------hashAgg[LOCAL]
---------PhysicalProject
-----------hashJoin[INNER_JOIN](orders.o_orderkey = lineitem.l_orderkey)
-------------PhysicalProject
---------------PhysicalOlapScan[lineitem]
-------------PhysicalDistribute
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](customer.c_custkey = orders.o_custkey)
-------------------PhysicalProject
---------------------PhysicalOlapScan[customer]
-------------------PhysicalDistribute
---------------------hashJoin[LEFT_SEMI_JOIN](orders.o_orderkey = lineitem.l_orderkey)
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[orders]
-----------------------PhysicalProject
-------------------------filter((sum(l_quantity) > 300.00))
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[lineitem]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q19.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q19.out
deleted file mode 100644
index 1b877ad328..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q19.out
+++ /dev/null
@@ -1,15 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-hashAgg[GLOBAL]
---PhysicalDistribute
-----hashAgg[LOCAL]
-------PhysicalProject
---------hashJoin[INNER_JOIN](part.p_partkey = lineitem.l_partkey)((((((part.p_brand = 'Brand#12') AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')) AND ((lineitem.l_quantity >= 1.00) AND (lineitem.l_quantity <= 11.00))) AND (part.p_size <= 5)) OR ((((part.p_brand = 'Brand#23') AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')) AND ((lineitem.l_quantity >= 10.00) AND (lineitem.l_quantity <= 20.00))) AND (part.p_size <= 10))) OR ((((part.p_brand = 'Brand#34') AN [...]
-----------PhysicalProject
-------------filter((lineitem.l_shipinstruct = 'DELIVER IN PERSON')((((lineitem.l_quantity >= 1.00) AND (lineitem.l_quantity <= 11.00)) OR ((lineitem.l_quantity >= 10.00) AND (lineitem.l_quantity <= 20.00))) OR ((lineitem.l_quantity >= 20.00) AND (lineitem.l_quantity <= 30.00)))((lineitem.l_shipmode = 'AIR') OR (lineitem.l_shipmode = 'AIR REG')))
---------------PhysicalOlapScan[lineitem]
-----------PhysicalDistribute
-------------PhysicalProject
---------------filter((((((part.p_brand = 'Brand#12') AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')) AND (part.p_size <= 5)) OR (((part.p_brand = 'Brand#23') AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')) AND (part.p_size <= 10))) OR (((part.p_brand = 'Brand#34') AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')) AND (part.p_size <= 15)))(part.p_size >= 1))
-----------------PhysicalOlapScan[part]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q2.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q2.out
deleted file mode 100644
index f3091de749..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q2.out
+++ /dev/null
@@ -1,30 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalTopN
---PhysicalDistribute
-----PhysicalTopN
-------PhysicalProject
---------filter((partsupp.ps_supplycost = min(ps_supplycost) OVER(PARTITION BY p_partkey)))
-----------PhysicalWindow
-------------PhysicalQuickSort
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](supplier.s_suppkey = partsupp.ps_suppkey)
-------------------hashJoin[INNER_JOIN](part.p_partkey = partsupp.ps_partkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[partsupp]
---------------------PhysicalProject
-----------------------filter((part.p_size = 15)(p_type like '%BRASS'))
-------------------------PhysicalOlapScan[part]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
-------------------------PhysicalOlapScan[supplier]
-------------------------PhysicalDistribute
---------------------------hashJoin[INNER_JOIN](nation.n_regionkey = region.r_regionkey)
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[nation]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((region.r_name = 'EUROPE'))
-----------------------------------PhysicalOlapScan[region]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q20.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q20.out
deleted file mode 100644
index 4142233ae3..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q20.out
+++ /dev/null
@@ -1,32 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------PhysicalProject
---------hashJoin[RIGHT_SEMI_JOIN](supplier.s_suppkey = partsupp.ps_suppkey)
-----------PhysicalDistribute
-------------PhysicalProject
---------------hashJoin[RIGHT_SEMI_JOIN](lineitem.l_partkey = partsupp.ps_partkey)(lineitem.l_suppkey = partsupp.ps_suppkey)(cast(ps_availqty as DECIMALV3(38, 3)) > (0.5 * sum(l_quantity)))
-----------------PhysicalProject
-------------------hashAgg[GLOBAL]
---------------------PhysicalDistribute
-----------------------hashAgg[LOCAL]
-------------------------PhysicalProject
---------------------------filter((lineitem.l_shipdate < 1995-01-01)(lineitem.l_shipdate >= 1994-01-01))
-----------------------------PhysicalOlapScan[lineitem]
-----------------PhysicalDistribute
-------------------hashJoin[LEFT_SEMI_JOIN](partsupp.ps_partkey = part.p_partkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[partsupp]
---------------------PhysicalProject
-----------------------filter((p_name like 'forest%'))
-------------------------PhysicalOlapScan[part]
-----------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
-------------PhysicalProject
---------------PhysicalOlapScan[supplier]
-------------PhysicalDistribute
---------------PhysicalProject
-----------------filter((nation.n_name = 'CANADA'))
-------------------PhysicalOlapScan[nation]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q21.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q21.out
deleted file mode 100644
index 1ebbb4a839..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q21.out
+++ /dev/null
@@ -1,33 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalTopN
---PhysicalDistribute
-----PhysicalTopN
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[RIGHT_SEMI_JOIN](l2.l_orderkey = l1.l_orderkey)( not (l_suppkey = l_suppkey))
-----------------PhysicalProject
-------------------PhysicalOlapScan[lineitem]
-----------------hashJoin[INNER_JOIN](orders.o_orderkey = l1.l_orderkey)
-------------------PhysicalProject
---------------------filter((orders.o_orderstatus = 'F'))
-----------------------PhysicalOlapScan[orders]
-------------------hashJoin[RIGHT_ANTI_JOIN](l3.l_orderkey = l1.l_orderkey)( not (l_suppkey = l_suppkey))
---------------------PhysicalProject
-----------------------filter((l3.l_receiptdate > l3.l_commitdate))
-------------------------PhysicalOlapScan[lineitem]
---------------------hashJoin[INNER_JOIN](supplier.s_suppkey = l1.l_suppkey)
-----------------------PhysicalProject
-------------------------filter((l1.l_receiptdate > l1.l_commitdate))
---------------------------PhysicalOlapScan[lineitem]
-----------------------PhysicalDistribute
-------------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[supplier]
---------------------------PhysicalDistribute
-----------------------------PhysicalProject
-------------------------------filter((nation.n_name = 'SAUDI ARABIA'))
---------------------------------PhysicalOlapScan[nation]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q22.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q22.out
deleted file mode 100644
index c41229b490..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q22.out
+++ /dev/null
@@ -1,26 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[RIGHT_ANTI_JOIN](orders.o_custkey = customer.c_custkey)
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------PhysicalOlapScan[orders]
-----------------NestedLoopJoin[INNER_JOIN](cast(c_acctbal as DECIMALV3(38, 4)) > avg(c_acctbal))
-------------------PhysicalProject
---------------------filter(substring(c_phone, 1, 2) IN ('13', '31', '23', '29', '30', '18', '17'))
-----------------------PhysicalOlapScan[customer]
-------------------PhysicalDistribute
---------------------PhysicalAssertNumRows
-----------------------hashAgg[GLOBAL]
-------------------------PhysicalDistribute
---------------------------hashAgg[LOCAL]
-----------------------------PhysicalProject
-------------------------------filter((customer.c_acctbal > 0.00)substring(c_phone, 1, 2) IN ('13', '31', '23', '29', '30', '18', '17'))
---------------------------------PhysicalOlapScan[customer]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q3.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q3.out
deleted file mode 100644
index aff6e8dcd1..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q3.out
+++ /dev/null
@@ -1,22 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalTopN
---PhysicalDistribute
-----PhysicalTopN
-------PhysicalProject
---------hashAgg[LOCAL]
-----------PhysicalProject
-------------hashJoin[INNER_JOIN](lineitem.l_orderkey = orders.o_orderkey)
---------------PhysicalProject
-----------------filter((lineitem.l_shipdate > 1995-03-15))
-------------------PhysicalOlapScan[lineitem]
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](customer.c_custkey = orders.o_custkey)
-------------------PhysicalProject
---------------------filter((orders.o_orderdate < 1995-03-15))
-----------------------PhysicalOlapScan[orders]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------filter((customer.c_mktsegment = 'BUILDING'))
-------------------------PhysicalOlapScan[customer]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q4.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q4.out
deleted file mode 100644
index 05c67b9b65..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q4.out
+++ /dev/null
@@ -1,17 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[RIGHT_SEMI_JOIN](lineitem.l_orderkey = orders.o_orderkey)
-----------------PhysicalProject
-------------------filter((lineitem.l_commitdate < lineitem.l_receiptdate))
---------------------PhysicalOlapScan[lineitem]
-----------------PhysicalProject
-------------------filter((orders.o_orderdate >= 1993-07-01)(orders.o_orderdate < 1993-10-01))
---------------------PhysicalOlapScan[orders]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q5.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q5.out
deleted file mode 100644
index f8211c8fa8..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q5.out
+++ /dev/null
@@ -1,35 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[INNER_JOIN](customer.c_custkey = orders.o_custkey)(customer.c_nationkey = supplier.s_nationkey)
-----------------PhysicalProject
-------------------PhysicalOlapScan[customer]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN](lineitem.l_orderkey = orders.o_orderkey)
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN](lineitem.l_suppkey = supplier.s_suppkey)
---------------------------PhysicalProject
-----------------------------PhysicalOlapScan[lineitem]
---------------------------PhysicalDistribute
-----------------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
-------------------------------PhysicalProject
---------------------------------PhysicalOlapScan[supplier]
-------------------------------PhysicalDistribute
---------------------------------hashJoin[INNER_JOIN](nation.n_regionkey = region.r_regionkey)
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[nation]
-----------------------------------PhysicalDistribute
-------------------------------------PhysicalProject
---------------------------------------filter((region.r_name = 'ASIA'))
-----------------------------------------PhysicalOlapScan[region]
-----------------------PhysicalProject
-------------------------filter((orders.o_orderdate < 1995-01-01)(orders.o_orderdate >= 1994-01-01))
---------------------------PhysicalOlapScan[orders]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q6.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q6.out
deleted file mode 100644
index da938bd9de..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q6.out
+++ /dev/null
@@ -1,9 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-hashAgg[GLOBAL]
---PhysicalDistribute
-----hashAgg[LOCAL]
-------PhysicalProject
---------filter((lineitem.l_shipdate >= 1994-01-01)(lineitem.l_discount <= 0.07)(lineitem.l_discount >= 0.05)(lineitem.l_quantity < 24.00)(lineitem.l_shipdate < 1995-01-01))
-----------PhysicalOlapScan[lineitem]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q7.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q7.out
deleted file mode 100644
index 8969786cfa..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q7.out
+++ /dev/null
@@ -1,36 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[INNER_JOIN](customer.c_custkey = orders.o_custkey)(customer.c_nationkey = n2.n_nationkey)
-----------------PhysicalProject
-------------------PhysicalOlapScan[customer]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN](orders.o_orderkey = lineitem.l_orderkey)
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[orders]
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN](supplier.s_suppkey = lineitem.l_suppkey)
---------------------------PhysicalProject
-----------------------------filter((lineitem.l_shipdate <= 1996-12-31)(lineitem.l_shipdate >= 1995-01-01))
-------------------------------PhysicalOlapScan[lineitem]
---------------------------PhysicalDistribute
-----------------------------hashJoin[INNER_JOIN](supplier.s_nationkey = n1.n_nationkey)
-------------------------------PhysicalProject
---------------------------------PhysicalOlapScan[supplier]
-------------------------------PhysicalDistribute
---------------------------------NestedLoopJoin[INNER_JOIN](((n1.n_name = 'FRANCE') AND (n2.n_name = 'GERMANY')) OR ((n1.n_name = 'GERMANY') AND (n2.n_name = 'FRANCE')))
-----------------------------------PhysicalProject
-------------------------------------filter(((n1.n_name = 'FRANCE') OR (n1.n_name = 'GERMANY')))
---------------------------------------PhysicalOlapScan[nation]
-----------------------------------PhysicalDistribute
-------------------------------------PhysicalProject
---------------------------------------filter(((n2.n_name = 'GERMANY') OR (n2.n_name = 'FRANCE')))
-----------------------------------------PhysicalOlapScan[nation]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q8.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q8.out
deleted file mode 100644
index cd339810e0..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q8.out
+++ /dev/null
@@ -1,48 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------PhysicalProject
---------hashAgg[GLOBAL]
-----------PhysicalDistribute
-------------hashAgg[LOCAL]
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](supplier.s_nationkey = n2.n_nationkey)
-------------------PhysicalProject
---------------------hashJoin[INNER_JOIN](supplier.s_suppkey = lineitem.l_suppkey)
-----------------------PhysicalProject
-------------------------PhysicalOlapScan[supplier]
-----------------------PhysicalDistribute
-------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN](n1.n_regionkey = region.r_regionkey)
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN](customer.c_nationkey = n1.n_nationkey)
---------------------------------PhysicalProject
-----------------------------------hashJoin[INNER_JOIN](orders.o_custkey = customer.c_custkey)
-------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[customer]
-------------------------------------PhysicalDistribute
---------------------------------------hashJoin[INNER_JOIN](lineitem.l_orderkey = orders.o_orderkey)
-----------------------------------------PhysicalProject
-------------------------------------------filter((orders.o_orderdate <= 1996-12-31)(orders.o_orderdate >= 1995-01-01))
---------------------------------------------PhysicalOlapScan[orders]
-----------------------------------------PhysicalProject
-------------------------------------------hashJoin[INNER_JOIN](part.p_partkey = lineitem.l_partkey)
---------------------------------------------PhysicalProject
-----------------------------------------------PhysicalOlapScan[lineitem]
---------------------------------------------PhysicalDistribute
-----------------------------------------------PhysicalProject
-------------------------------------------------filter((part.p_type = 'ECONOMY ANODIZED STEEL'))
---------------------------------------------------PhysicalOlapScan[part]
---------------------------------PhysicalDistribute
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[nation]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((region.r_name = 'AMERICA'))
-----------------------------------PhysicalOlapScan[region]
-------------------PhysicalDistribute
---------------------PhysicalProject
-----------------------PhysicalOlapScan[nation]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q9.out b/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q9.out
deleted file mode 100644
index eeed1b1e9c..0000000000
--- a/regression-test/data/nereids_tpch_shape_sf1_p0/shape/q9.out
+++ /dev/null
@@ -1,35 +0,0 @@
--- This file is automatically generated. You should know what you did if you want to edit this
--- !select --
-PhysicalQuickSort
---PhysicalDistribute
-----PhysicalQuickSort
-------hashAgg[GLOBAL]
---------PhysicalDistribute
-----------hashAgg[LOCAL]
-------------PhysicalProject
---------------hashJoin[INNER_JOIN](partsupp.ps_partkey = lineitem.l_partkey)(partsupp.ps_suppkey = lineitem.l_suppkey)
-----------------PhysicalProject
-------------------hashJoin[INNER_JOIN](orders.o_orderkey = lineitem.l_orderkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[orders]
---------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN](supplier.s_suppkey = lineitem.l_suppkey)
-------------------------PhysicalProject
---------------------------hashJoin[INNER_JOIN](part.p_partkey = lineitem.l_partkey)
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[lineitem]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------filter((p_name like '%green%'))
-----------------------------------PhysicalOlapScan[part]
-------------------------PhysicalDistribute
---------------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[supplier]
-----------------------------PhysicalDistribute
-------------------------------PhysicalProject
---------------------------------PhysicalOlapScan[nation]
-----------------PhysicalDistribute
-------------------PhysicalProject
---------------------PhysicalOlapScan[partsupp]
-
diff --git a/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q2.out b/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q2.out
index f3091de749..f109430d4a 100644
--- a/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q2.out
+++ b/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q2.out
@@ -7,15 +7,16 @@ PhysicalTopN
 --------filter((partsupp.ps_supplycost = min(ps_supplycost) OVER(PARTITION BY p_partkey)))
 ----------PhysicalWindow
 ------------PhysicalQuickSort
---------------PhysicalProject
-----------------hashJoin[INNER_JOIN](supplier.s_suppkey = partsupp.ps_suppkey)
-------------------hashJoin[INNER_JOIN](part.p_partkey = partsupp.ps_partkey)
---------------------PhysicalProject
-----------------------PhysicalOlapScan[partsupp]
---------------------PhysicalProject
-----------------------filter((part.p_size = 15)(p_type like '%BRASS'))
-------------------------PhysicalOlapScan[part]
-------------------PhysicalDistribute
+--------------PhysicalDistribute
+----------------PhysicalProject
+------------------hashJoin[INNER_JOIN](supplier.s_suppkey = partsupp.ps_suppkey)
+--------------------PhysicalDistribute
+----------------------hashJoin[INNER_JOIN](part.p_partkey = partsupp.ps_partkey)
+------------------------PhysicalProject
+--------------------------PhysicalOlapScan[partsupp]
+------------------------PhysicalProject
+--------------------------filter((part.p_size = 15)(p_type like '%BRASS'))
+----------------------------PhysicalOlapScan[part]
 --------------------PhysicalProject
 ----------------------hashJoin[INNER_JOIN](supplier.s_nationkey = nation.n_nationkey)
 ------------------------PhysicalOlapScan[supplier]
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q1.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q1.groovy
index 6148e2af08..d2f3aa11ab 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q1.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q1.groovy
@@ -1,59 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q1") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-
-    qt_select """
-    explain shape plan
-    select
-        l_returnflag,
-        l_linestatus,
-        sum(l_quantity) as sum_qty,
-        sum(l_extendedprice) as sum_base_price,
-        sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
-        sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
-        avg(l_quantity) as avg_qty,
-        avg(l_extendedprice) as avg_price,
-        avg(l_discount) as avg_disc,
-        count(*) as count_order
-    from
-        lineitem
-    where
-        l_shipdate <= date '1998-12-01' - interval '90' day
-    group by
-        l_returnflag,
-        l_linestatus
-    order by
-        l_returnflag,
-        l_linestatus;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q1") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+sql 'set be_number_for_test=3'
+    
+
+    qt_select """
+    explain shape plan
+    select
+        l_returnflag,
+        l_linestatus,
+        sum(l_quantity) as sum_qty,
+        sum(l_extendedprice) as sum_base_price,
+        sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
+        sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
+        avg(l_quantity) as avg_qty,
+        avg(l_extendedprice) as avg_price,
+        avg(l_discount) as avg_disc,
+        count(*) as count_order
+    from
+        lineitem
+    where
+        l_shipdate <= date '1998-12-01' - interval '90' day
+    group by
+        l_returnflag,
+        l_linestatus
+    order by
+        l_returnflag,
+        l_linestatus;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q10.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q10.groovy
index 72b0f3e8bb..f4101b5124 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q10.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q10.groovy
@@ -1,70 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q10") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    qt_select """
-    explain shape plan
-    select 
-        c_custkey,
-        c_name,
-        sum(l_extendedprice * (1 - l_discount)) as revenue,
-        c_acctbal,
-        n_name,
-        c_address,
-        c_phone,
-        c_comment
-    from
-        customer,
-        orders,
-        lineitem,
-        nation
-    where
-        c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and o_orderdate >= date '1993-10-01'
-        and o_orderdate < date '1993-10-01' + interval '3' month
-        and l_returnflag = 'R'
-        and c_nationkey = n_nationkey
-    group by
-        c_custkey,
-        c_name,
-        c_acctbal,
-        c_phone,
-        n_name,
-        c_address,
-        c_comment
-    order by
-        revenue desc
-    limit 20;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q10") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+sql 'set be_number_for_test=3'
+    qt_select """
+    explain shape plan
+    select 
+        c_custkey,
+        c_name,
+        sum(l_extendedprice * (1 - l_discount)) as revenue,
+        c_acctbal,
+        n_name,
+        c_address,
+        c_phone,
+        c_comment
+    from
+        customer,
+        orders,
+        lineitem,
+        nation
+    where
+        c_custkey = o_custkey
+        and l_orderkey = o_orderkey
+        and o_orderdate >= date '1993-10-01'
+        and o_orderdate < date '1993-10-01' + interval '3' month
+        and l_returnflag = 'R'
+        and c_nationkey = n_nationkey
+    group by
+        c_custkey,
+        c_name,
+        c_acctbal,
+        c_phone,
+        n_name,
+        c_address,
+        c_comment
+    order by
+        revenue desc
+    limit 20;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q11.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q11.groovy
index a60b8c9b86..d681e574cd 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q11.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q11.groovy
@@ -1,67 +1,63 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q11") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-
-    
-    qt_select """
-    explain shape plan
-    select  
-        ps_partkey,
-        sum(ps_supplycost * ps_availqty) as value
-    from
-        partsupp,
-        supplier,
-        nation
-    where
-        ps_suppkey = s_suppkey
-        and s_nationkey = n_nationkey
-        and n_name = 'GERMANY'
-    group by
-        ps_partkey having
-            sum(ps_supplycost * ps_availqty) > (
-                select
-                    sum(ps_supplycost * ps_availqty) * 0.000002
-                from
-                    partsupp,
-                    supplier,
-                    nation
-                where
-                    ps_suppkey = s_suppkey
-                    and s_nationkey = n_nationkey
-                    and n_name = 'GERMANY'
-            )
-    order by
-        value desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q11") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+sql 'set be_number_for_test=3'
+
+
+    
+    qt_select """
+    explain shape plan
+    select  
+        ps_partkey,
+        sum(ps_supplycost * ps_availqty) as value
+    from
+        partsupp,
+        supplier,
+        nation
+    where
+        ps_suppkey = s_suppkey
+        and s_nationkey = n_nationkey
+        and n_name = 'GERMANY'
+    group by
+        ps_partkey having
+            sum(ps_supplycost * ps_availqty) > (
+                select
+                    sum(ps_supplycost * ps_availqty) * 0.000002
+                from
+                    partsupp,
+                    supplier,
+                    nation
+                where
+                    ps_suppkey = s_suppkey
+                    and s_nationkey = n_nationkey
+                    and n_name = 'GERMANY'
+            )
+    order by
+        value desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q12.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q12.groovy
index f026f73628..2a6ca361ab 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q12.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q12.groovy
@@ -1,65 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q12") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    qt_select """
-    explain shape plan
-    select 
-        l_shipmode,
-        sum(case
-            when o_orderpriority = '1-URGENT'
-                or o_orderpriority = '2-HIGH'
-                then 1
-            else 0
-        end) as high_line_count,
-        sum(case
-            when o_orderpriority <> '1-URGENT'
-                and o_orderpriority <> '2-HIGH'
-                then 1
-            else 0
-        end) as low_line_count
-    from
-        orders,
-        lineitem
-    where
-        o_orderkey = l_orderkey
-        and l_shipmode in ('MAIL', 'SHIP')
-        and l_commitdate < l_receiptdate
-        and l_shipdate < l_commitdate
-        and l_receiptdate >= date '1994-01-01'
-        and l_receiptdate < date '1994-01-01' + interval '1' year
-    group by
-        l_shipmode
-    order by
-        l_shipmode;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q12") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+sql 'set be_number_for_test=3'
+    qt_select """
+    explain shape plan
+    select 
+        l_shipmode,
+        sum(case
+            when o_orderpriority = '1-URGENT'
+                or o_orderpriority = '2-HIGH'
+                then 1
+            else 0
+        end) as high_line_count,
+        sum(case
+            when o_orderpriority <> '1-URGENT'
+                and o_orderpriority <> '2-HIGH'
+                then 1
+            else 0
+        end) as low_line_count
+    from
+        orders,
+        lineitem
+    where
+        o_orderkey = l_orderkey
+        and l_shipmode in ('MAIL', 'SHIP')
+        and l_commitdate < l_receiptdate
+        and l_shipdate < l_commitdate
+        and l_receiptdate >= date '1994-01-01'
+        and l_receiptdate < date '1994-01-01' + interval '1' year
+    group by
+        l_shipmode
+    order by
+        l_shipmode;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q13.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q13.groovy
index 54b2645611..7462bbbe28 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q13.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q13.groovy
@@ -1,61 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q13") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    qt_select """
-    explain shape plan
-    select 
-        c_count,
-        count(*) as custdist
-    from
-        (
-            select
-                c_custkey,
-                count(o_orderkey) as c_count
-            from
-                customer left outer join orders on
-                    c_custkey = o_custkey
-                    and o_comment not like '%special%requests%'
-            group by
-                c_custkey
-        ) as c_orders
-    group by
-        c_count
-    order by
-        custdist desc,
-        c_count desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q13") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+
+sql 'set be_number_for_test=3'
+    qt_select """
+    explain shape plan
+    select 
+        c_count,
+        count(*) as custdist
+    from
+        (
+            select
+                c_custkey,
+                count(o_orderkey) as c_count
+            from
+                customer left outer join orders on
+                    c_custkey = o_custkey
+                    and o_comment not like '%special%requests%'
+            group by
+                c_custkey
+        ) as c_orders
+    group by
+        c_count
+    order by
+        custdist desc,
+        c_count desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q14.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q14.groovy
index 93c8f2d570..d46a2e1d79 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q14.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q14.groovy
@@ -1,51 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q14") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    qt_select """
-    explain shape plan
-    select 
-        100.00 * sum(case
-            when p_type like 'PROMO%'
-                then l_extendedprice * (1 - l_discount)
-            else 0
-        end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
-    from
-        lineitem,
-        part
-    where
-        l_partkey = p_partkey
-        and l_shipdate >= date '1995-09-01'
-        and l_shipdate < date '1995-09-01' + interval '1' month;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q14") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+sql 'set be_number_for_test=3'
+    qt_select """
+    explain shape plan
+    select 
+        100.00 * sum(case
+            when p_type like 'PROMO%'
+                then l_extendedprice * (1 - l_discount)
+            else 0
+        end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
+    from
+        lineitem,
+        part
+    where
+        l_partkey = p_partkey
+        and l_shipdate >= date '1995-09-01'
+        and l_shipdate < date '1995-09-01' + interval '1' month;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q15.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q15.groovy
index f2259026e6..5e2c80533c 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q15.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q15.groovy
@@ -1,61 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q15") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        s_suppkey,
-        s_name,
-        s_address,
-        s_phone,
-        total_revenue
-    from
-        supplier,
-        revenue0
-    where
-        s_suppkey = supplier_no
-        and total_revenue = (
-            select
-                max(total_revenue)
-            from
-                revenue0
-        )
-    order by
-        s_suppkey;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q15") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        s_suppkey,
+        s_name,
+        s_address,
+        s_phone,
+        total_revenue
+    from
+        supplier,
+        revenue0
+    where
+        s_suppkey = supplier_no
+        and total_revenue = (
+            select
+                max(total_revenue)
+            from
+                revenue0
+        )
+    order by
+        s_suppkey;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q16.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q16.groovy
index 05d1fb9200..85a237891d 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q16.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q16.groovy
@@ -1,72 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q16") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        p_brand,
-        p_type,
-        p_size,
-        count(distinct ps_suppkey) as supplier_cnt
-    from
-        partsupp,
-        part
-    where
-        p_partkey = ps_partkey
-        and p_brand <> 'Brand#45'
-        and p_type not like 'MEDIUM POLISHED%'
-        and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
-        and ps_suppkey not in (
-            select
-                s_suppkey
-            from
-                supplier
-            where
-                s_comment like '%Customer%Complaints%'
-        )
-    group by
-        p_brand,
-        p_type,
-        p_size
-    order by
-        supplier_cnt desc,
-        p_brand,
-        p_type,
-        p_size;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q16") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        p_brand,
+        p_type,
+        p_size,
+        count(distinct ps_suppkey) as supplier_cnt
+    from
+        partsupp,
+        part
+    where
+        p_partkey = ps_partkey
+        and p_brand <> 'Brand#45'
+        and p_type not like 'MEDIUM POLISHED%'
+        and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
+        and ps_suppkey not in (
+            select
+                s_suppkey
+            from
+                supplier
+            where
+                s_comment like '%Customer%Complaints%'
+        )
+    group by
+        p_brand,
+        p_type,
+        p_size
+    order by
+        supplier_cnt desc,
+        p_brand,
+        p_type,
+        p_size;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q17.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q17.groovy
index 9036a55125..6cb3aa3564 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q17.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q17.groovy
@@ -1,59 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q17") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select
-        sum(l_extendedprice) / 7.0 as avg_yearly
-    from
-        lineitem,
-        part
-    where
-        p_partkey = l_partkey
-        and p_brand = 'Brand#23'
-        and p_container = 'MED BOX'
-        and l_quantity < (
-            select
-                0.2 * avg(l_quantity)
-            from
-                lineitem
-            where
-                l_partkey = p_partkey
-        );
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q17") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select
+        sum(l_extendedprice) / 7.0 as avg_yearly
+    from
+        lineitem,
+        part
+    where
+        p_partkey = l_partkey
+        and p_brand = 'Brand#23'
+        and p_container = 'MED BOX'
+        and l_quantity < (
+            select
+                0.2 * avg(l_quantity)
+            from
+                lineitem
+            where
+                l_partkey = p_partkey
+        );
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q18.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q18.groovy
index 869c24d6ca..0f0ab18fbf 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q18.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q18.groovy
@@ -1,75 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q18") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-    c_name,
-            c_custkey,
-            o_orderkey,
-            o_orderdate,
-            o_totalprice,
-            sum(l_quantity)
-    from
-            customer,
-            orders,
-            lineitem
-    where
-            o_orderkey  in  (
-                    select
-                            l_orderkey
-                    from
-                            lineitem
-                    group  by
-                            l_orderkey  having
-                                    sum(l_quantity)  >  300
-            )
-            and  c_custkey  =  o_custkey
-            and  o_orderkey  =  l_orderkey
-    group  by
-            c_name,
-            c_custkey,
-            o_orderkey,
-            o_orderdate,
-            o_totalprice
-    order  by
-            o_totalprice  desc,
-            o_orderdate
-    limit  100;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q18") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+    c_name,
+            c_custkey,
+            o_orderkey,
+            o_orderdate,
+            o_totalprice,
+            sum(l_quantity)
+    from
+            customer,
+            orders,
+            lineitem
+    where
+            o_orderkey  in  (
+                    select
+                            l_orderkey
+                    from
+                            lineitem
+                    group  by
+                            l_orderkey  having
+                                    sum(l_quantity)  >  300
+            )
+            and  c_custkey  =  o_custkey
+            and  o_orderkey  =  l_orderkey
+    group  by
+            c_name,
+            c_custkey,
+            o_orderkey,
+            o_orderdate,
+            o_totalprice
+    order  by
+            o_totalprice  desc,
+            o_orderdate
+    limit  100;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q19.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q19.groovy
index f5bf47cde7..c08f50defa 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q19.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q19.groovy
@@ -1,79 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q19") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select
-                sum(l_extendedprice* (1 - l_discount)) as revenue
-        from
-                lineitem,
-                part
-        where
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#12'
-                and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
-                and l_quantity >= 1 and l_quantity <= 1 + 10
-                and p_size between 1 and 5
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        )
-        or
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#23'
-                and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
-                and l_quantity >= 10 and l_quantity <= 10 + 10
-                and p_size between 1 and 10
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        )
-        or
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#34'
-                and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
-                and l_quantity >= 20 and l_quantity <= 20 + 10
-                and p_size between 1 and 15
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        );
-    
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q19") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select
+                sum(l_extendedprice* (1 - l_discount)) as revenue
+        from
+                lineitem,
+                part
+        where
+        (
+                p_partkey = l_partkey
+                and p_brand = 'Brand#12'
+                and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
+                and l_quantity >= 1 and l_quantity <= 1 + 10
+                and p_size between 1 and 5
+                and l_shipmode in ('AIR', 'AIR REG')
+                and l_shipinstruct = 'DELIVER IN PERSON'
+        )
+        or
+        (
+                p_partkey = l_partkey
+                and p_brand = 'Brand#23'
+                and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
+                and l_quantity >= 10 and l_quantity <= 10 + 10
+                and p_size between 1 and 10
+                and l_shipmode in ('AIR', 'AIR REG')
+                and l_shipinstruct = 'DELIVER IN PERSON'
+        )
+        or
+        (
+                p_partkey = l_partkey
+                and p_brand = 'Brand#34'
+                and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
+                and l_quantity >= 20 and l_quantity <= 20 + 10
+                and p_size between 1 and 15
+                and l_shipmode in ('AIR', 'AIR REG')
+                and l_shipinstruct = 'DELIVER IN PERSON'
+        );
+    
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q2.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q2.groovy
index 2ae79b790b..67f4f81b1d 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q2.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q2.groovy
@@ -30,11 +30,7 @@ suite("q2") {
 
 
 
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
+sql 'set be_number_for_test=3'
     
     qt_select """
     explain shape plan
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q20.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q20.groovy
index 2844dcbf49..831761d391 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q20.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q20.groovy
@@ -1,80 +1,76 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q20") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select 
-        s_name,
-        s_address
-        from
-        supplier,
-        nation
-        where
-        s_suppkey in (
-                select
-                ps_suppkey
-                from
-                partsupp
-                where
-                ps_partkey in (
-                        select
-                        p_partkey
-                        from
-                        part
-                        where
-                        p_name like 'forest%'
-                )
-                and ps_availqty > (
-                        select
-                        0.5 * sum(l_quantity)
-                        from
-                        lineitem
-                        where
-                        l_partkey = ps_partkey
-                        and l_suppkey = ps_suppkey
-                        and l_shipdate >= date '1994-01-01'
-                        and l_shipdate < date '1994-01-01' + interval '1' year
-                )
-        )
-        and s_nationkey = n_nationkey
-        and n_name = 'CANADA'
-        order by
-        s_name;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q20") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select 
+        s_name,
+        s_address
+        from
+        supplier,
+        nation
+        where
+        s_suppkey in (
+                select
+                ps_suppkey
+                from
+                partsupp
+                where
+                ps_partkey in (
+                        select
+                        p_partkey
+                        from
+                        part
+                        where
+                        p_name like 'forest%'
+                )
+                and ps_availqty > (
+                        select
+                        0.5 * sum(l_quantity)
+                        from
+                        lineitem
+                        where
+                        l_partkey = ps_partkey
+                        and l_suppkey = ps_suppkey
+                        and l_shipdate >= date '1994-01-01'
+                        and l_shipdate < date '1994-01-01' + interval '1' year
+                )
+        )
+        and s_nationkey = n_nationkey
+        and n_name = 'CANADA'
+        order by
+        s_name;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q21.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q21.groovy
index 135effeb5a..3cd8e20304 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q21.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q21.groovy
@@ -1,82 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q21") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select
-                s_name,
-                count(*) as numwait
-        from
-                supplier,
-                lineitem l1,
-                orders,
-                nation
-        where
-        s_suppkey = l1.l_suppkey
-        and o_orderkey = l1.l_orderkey
-        and o_orderstatus = 'F'
-        and l1.l_receiptdate > l1.l_commitdate
-        and exists (
-                select
-                *
-                from
-                lineitem l2
-                where
-                l2.l_orderkey = l1.l_orderkey
-                and l2.l_suppkey <> l1.l_suppkey
-        )
-        and not exists (
-                select
-                *
-                from
-                lineitem l3
-                where
-                l3.l_orderkey = l1.l_orderkey
-                and l3.l_suppkey <> l1.l_suppkey
-                and l3.l_receiptdate > l3.l_commitdate
-        )
-        and s_nationkey = n_nationkey
-        and n_name = 'SAUDI ARABIA'
-        group by
-        s_name
-        order by
-        numwait desc,
-        s_name
-        limit 100;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q21") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select
+                s_name,
+                count(*) as numwait
+        from
+                supplier,
+                lineitem l1,
+                orders,
+                nation
+        where
+        s_suppkey = l1.l_suppkey
+        and o_orderkey = l1.l_orderkey
+        and o_orderstatus = 'F'
+        and l1.l_receiptdate > l1.l_commitdate
+        and exists (
+                select
+                *
+                from
+                lineitem l2
+                where
+                l2.l_orderkey = l1.l_orderkey
+                and l2.l_suppkey <> l1.l_suppkey
+        )
+        and not exists (
+                select
+                *
+                from
+                lineitem l3
+                where
+                l3.l_orderkey = l1.l_orderkey
+                and l3.l_suppkey <> l1.l_suppkey
+                and l3.l_receiptdate > l3.l_commitdate
+        )
+        and s_nationkey = n_nationkey
+        and n_name = 'SAUDI ARABIA'
+        group by
+        s_name
+        order by
+        numwait desc,
+        s_name
+        limit 100;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q22.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q22.groovy
index 0077bc586e..6f3e4d7aa4 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q22.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q22.groovy
@@ -1,79 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q22") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select 
-        cntrycode,
-        count(*) as numcust,
-        sum(c_acctbal) as totacctbal
-    from
-        (
-            select
-                substring(c_phone, 1, 2) as cntrycode,
-                c_acctbal
-            from
-                customer
-            where
-                substring(c_phone, 1, 2) in
-                    ('13', '31', '23', '29', '30', '18', '17')
-                and c_acctbal > (
-                    select
-                        avg(c_acctbal)
-                    from
-                        customer
-                    where
-                        c_acctbal > 0.00
-                        and substring(c_phone, 1, 2) in
-                            ('13', '31', '23', '29', '30', '18', '17')
-                )
-                and not exists (
-                    select
-                        *
-                    from
-                        orders
-                    where
-                        o_custkey = c_custkey
-                )
-        ) as custsale
-    group by
-        cntrycode
-    order by
-        cntrycode;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q22") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select 
+        cntrycode,
+        count(*) as numcust,
+        sum(c_acctbal) as totacctbal
+    from
+        (
+            select
+                substring(c_phone, 1, 2) as cntrycode,
+                c_acctbal
+            from
+                customer
+            where
+                substring(c_phone, 1, 2) in
+                    ('13', '31', '23', '29', '30', '18', '17')
+                and c_acctbal > (
+                    select
+                        avg(c_acctbal)
+                    from
+                        customer
+                    where
+                        c_acctbal > 0.00
+                        and substring(c_phone, 1, 2) in
+                            ('13', '31', '23', '29', '30', '18', '17')
+                )
+                and not exists (
+                    select
+                        *
+                    from
+                        orders
+                    where
+                        o_custkey = c_custkey
+                )
+        ) as custsale
+    group by
+        cntrycode
+    order by
+        cntrycode;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q3.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q3.groovy
index 817e24170e..97104534c7 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q3.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q3.groovy
@@ -1,66 +1,62 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q3") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    // db = "tpch"
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select  
-        l_orderkey,
-        sum(l_extendedprice * (1 - l_discount)) as revenue,
-        o_orderdate,
-        o_shippriority
-    from
-        customer,
-        orders,
-        lineitem
-    where
-        c_mktsegment = 'BUILDING'
-        and c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and o_orderdate < date '1995-03-15'
-        and l_shipdate > date '1995-03-15'
-    group by
-        l_orderkey,
-        o_orderdate,
-        o_shippriority
-    order by
-        revenue desc,
-        o_orderdate
-    limit 10;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q3") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    // db = "tpch"
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select  
+        l_orderkey,
+        sum(l_extendedprice * (1 - l_discount)) as revenue,
+        o_orderdate,
+        o_shippriority
+    from
+        customer,
+        orders,
+        lineitem
+    where
+        c_mktsegment = 'BUILDING'
+        and c_custkey = o_custkey
+        and l_orderkey = o_orderkey
+        and o_orderdate < date '1995-03-15'
+        and l_shipdate > date '1995-03-15'
+    group by
+        l_orderkey,
+        o_orderdate,
+        o_shippriority
+    order by
+        revenue desc,
+        o_orderdate
+    limit 10;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q4.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q4.groovy
index ef98fd5dc7..7b13b47df9 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q4.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q4.groovy
@@ -1,61 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q4") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }   
-
-
-
-    
-    qt_select """
-    explain shape plan
-    select  
-        o_orderpriority,
-        count(*) as order_count
-    from
-        orders
-    where
-        o_orderdate >= date '1993-07-01'
-        and o_orderdate < date '1993-07-01' + interval '3' month
-        and exists (
-            select
-                *
-            from
-                lineitem
-            where
-                l_orderkey = o_orderkey
-                and l_commitdate < l_receiptdate
-        )
-    group by
-        o_orderpriority
-    order by
-        o_orderpriority;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q4") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+sql 'set be_number_for_test=3'   
+
+
+
+    
+    qt_select """
+    explain shape plan
+    select  
+        o_orderpriority,
+        count(*) as order_count
+    from
+        orders
+    where
+        o_orderdate >= date '1993-07-01'
+        and o_orderdate < date '1993-07-01' + interval '3' month
+        and exists (
+            select
+                *
+            from
+                lineitem
+            where
+                l_orderkey = o_orderkey
+                and l_commitdate < l_receiptdate
+        )
+    group by
+        o_orderpriority
+    order by
+        o_orderpriority;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q5.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q5.groovy
index 53be64b070..0a9c786326 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q5.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q5.groovy
@@ -1,66 +1,62 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q5") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        n_name,
-        sum(l_extendedprice * (1 - l_discount)) as revenue
-    from
-        customer,
-        orders,
-        lineitem,
-        supplier,
-        nation,
-        region
-    where
-        c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and l_suppkey = s_suppkey
-        and c_nationkey = s_nationkey
-        and s_nationkey = n_nationkey
-        and n_regionkey = r_regionkey
-        and r_name = 'ASIA'
-        and o_orderdate >= date '1994-01-01'
-        and o_orderdate < date '1994-01-01' + interval '1' year
-    group by
-        n_name
-    order by
-        revenue desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q5") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        n_name,
+        sum(l_extendedprice * (1 - l_discount)) as revenue
+    from
+        customer,
+        orders,
+        lineitem,
+        supplier,
+        nation,
+        region
+    where
+        c_custkey = o_custkey
+        and l_orderkey = o_orderkey
+        and l_suppkey = s_suppkey
+        and c_nationkey = s_nationkey
+        and s_nationkey = n_nationkey
+        and n_regionkey = r_regionkey
+        and r_name = 'ASIA'
+        and o_orderdate >= date '1994-01-01'
+        and o_orderdate < date '1994-01-01' + interval '1' year
+    group by
+        n_name
+    order by
+        revenue desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q6.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q6.groovy
index cf9620f532..43b7a36b8c 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q6.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q6.groovy
@@ -1,51 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q6") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        sum(l_extendedprice * l_discount) as revenue
-    from
-        lineitem
-    where
-        l_shipdate >= date '1994-01-01'
-        and l_shipdate < date '1994-01-01' + interval '1' year
-        and l_discount between .06 - 0.01 and .06 + 0.01
-        and l_quantity < 24;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q6") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        sum(l_extendedprice * l_discount) as revenue
+    from
+        lineitem
+    where
+        l_shipdate >= date '1994-01-01'
+        and l_shipdate < date '1994-01-01' + interval '1' year
+        and l_discount between .06 - 0.01 and .06 + 0.01
+        and l_quantity < 24;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q7.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q7.groovy
index 9339aae5ff..44def54304 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q7.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q7.groovy
@@ -1,81 +1,77 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q7") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        supp_nation,
-        cust_nation,
-        l_year,
-        sum(volume) as revenue
-    from
-        (
-            select
-                n1.n_name as supp_nation,
-                n2.n_name as cust_nation,
-                extract(year from l_shipdate) as l_year,
-                l_extendedprice * (1 - l_discount) as volume
-            from
-                supplier,
-                lineitem,
-                orders,
-                customer,
-                nation n1,
-                nation n2
-            where
-                s_suppkey = l_suppkey
-                and o_orderkey = l_orderkey
-                and c_custkey = o_custkey
-                and s_nationkey = n1.n_nationkey
-                and c_nationkey = n2.n_nationkey
-                and (
-                    (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
-                    or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
-                )
-                and l_shipdate between date '1995-01-01' and date '1996-12-31'
-        ) as shipping
-    group by
-        supp_nation,
-        cust_nation,
-        l_year
-    order by
-        supp_nation,
-        cust_nation,
-        l_year;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q7") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        supp_nation,
+        cust_nation,
+        l_year,
+        sum(volume) as revenue
+    from
+        (
+            select
+                n1.n_name as supp_nation,
+                n2.n_name as cust_nation,
+                extract(year from l_shipdate) as l_year,
+                l_extendedprice * (1 - l_discount) as volume
+            from
+                supplier,
+                lineitem,
+                orders,
+                customer,
+                nation n1,
+                nation n2
+            where
+                s_suppkey = l_suppkey
+                and o_orderkey = l_orderkey
+                and c_custkey = o_custkey
+                and s_nationkey = n1.n_nationkey
+                and c_nationkey = n2.n_nationkey
+                and (
+                    (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
+                    or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
+                )
+                and l_shipdate between date '1995-01-01' and date '1996-12-31'
+        ) as shipping
+    group by
+        supp_nation,
+        cust_nation,
+        l_year
+    order by
+        supp_nation,
+        cust_nation,
+        l_year;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q8.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q8.groovy
index 22242d2344..ed92d555ab 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q8.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q8.groovy
@@ -1,79 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q8") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        o_year,
-        sum(case
-            when nation = 'BRAZIL' then volume
-            else 0
-        end) / sum(volume) as mkt_share
-    from
-        (
-            select
-                extract(year from o_orderdate) as o_year,
-                l_extendedprice * (1 - l_discount) as volume,
-                n2.n_name as nation
-            from
-                part,
-                supplier,
-                lineitem,
-                orders,
-                customer,
-                nation n1,
-                nation n2,
-                region
-            where
-                p_partkey = l_partkey
-                and s_suppkey = l_suppkey
-                and l_orderkey = o_orderkey
-                and o_custkey = c_custkey
-                and c_nationkey = n1.n_nationkey
-                and n1.n_regionkey = r_regionkey
-                and r_name = 'AMERICA'
-                and s_nationkey = n2.n_nationkey
-                and o_orderdate between date '1995-01-01' and date '1996-12-31'
-                and p_type = 'ECONOMY ANODIZED STEEL'
-        ) as all_nations
-    group by
-        o_year
-    order by
-        o_year;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q8") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        o_year,
+        sum(case
+            when nation = 'BRAZIL' then volume
+            else 0
+        end) / sum(volume) as mkt_share
+    from
+        (
+            select
+                extract(year from o_orderdate) as o_year,
+                l_extendedprice * (1 - l_discount) as volume,
+                n2.n_name as nation
+            from
+                part,
+                supplier,
+                lineitem,
+                orders,
+                customer,
+                nation n1,
+                nation n2,
+                region
+            where
+                p_partkey = l_partkey
+                and s_suppkey = l_suppkey
+                and l_orderkey = o_orderkey
+                and o_custkey = c_custkey
+                and c_nationkey = n1.n_nationkey
+                and n1.n_regionkey = r_regionkey
+                and r_name = 'AMERICA'
+                and s_nationkey = n2.n_nationkey
+                and o_orderdate between date '1995-01-01' and date '1996-12-31'
+                and p_type = 'ECONOMY ANODIZED STEEL'
+        ) as all_nations
+    group by
+        o_year
+    order by
+        o_year;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q9.groovy b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q9.groovy
index 98637ccc63..44e968ed18 100644
--- a/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q9.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf1000_p0/shape/q9.groovy
@@ -1,74 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q9") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G'
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        nation,
-        o_year,
-        sum(amount) as sum_profit
-    from
-        (
-            select
-                n_name as nation,
-                extract(year from o_orderdate) as o_year,
-                l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
-            from
-                part,
-                supplier,
-                lineitem,
-                partsupp,
-                orders,
-                nation
-            where
-                s_suppkey = l_suppkey
-                and ps_suppkey = l_suppkey
-                and ps_partkey = l_partkey
-                and p_partkey = l_partkey
-                and o_orderkey = l_orderkey
-                and s_nationkey = n_nationkey
-                and p_name like '%green%'
-        ) as profit
-    group by
-        nation,
-        o_year
-    order by
-        nation,
-        o_year desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q9") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G'
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        nation,
+        o_year,
+        sum(amount) as sum_profit
+    from
+        (
+            select
+                n_name as nation,
+                extract(year from o_orderdate) as o_year,
+                l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
+            from
+                part,
+                supplier,
+                lineitem,
+                partsupp,
+                orders,
+                nation
+            where
+                s_suppkey = l_suppkey
+                and ps_suppkey = l_suppkey
+                and ps_partkey = l_partkey
+                and p_partkey = l_partkey
+                and o_orderkey = l_orderkey
+                and s_nationkey = n_nationkey
+                and p_name like '%green%'
+        ) as profit
+    group by
+        nation,
+        o_year
+    order by
+        nation,
+        o_year desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/load.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/load.groovy
deleted file mode 100644
index 1ddd23a60c..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/load.groovy
+++ /dev/null
@@ -1,467 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-suite("load") {
-    String database = context.config.getDbNameByFile(context.file)
-    sql "drop database if exists ${database}"
-    sql "create database ${database}"
-    sql "use ${database}"
-    sql """
-    drop table if exists lineitem;
-    """
-    sql """
-    CREATE TABLE lineitem (
-        l_shipdate    DATEV2 NOT NULL,
-        l_orderkey    bigint NOT NULL,
-        l_linenumber  int not null,
-        l_partkey     int NOT NULL,
-        l_suppkey     int not null,
-        l_quantity    decimal(15, 2) NOT NULL,
-        l_extendedprice  decimal(15, 2) NOT NULL,
-        l_discount    decimal(15, 2) NOT NULL,
-        l_tax         decimal(15, 2) NOT NULL,
-        l_returnflag  VARCHAR(1) NOT NULL,
-        l_linestatus  VARCHAR(1) NOT NULL,
-        l_commitdate  DATEV2 NOT NULL,
-        l_receiptdate DATEV2 NOT NULL,
-        l_shipinstruct VARCHAR(25) NOT NULL,
-        l_shipmode     VARCHAR(10) NOT NULL,
-        l_comment      VARCHAR(44) NOT NULL
-    )ENGINE=OLAP
-    DUPLICATE KEY(`l_shipdate`, `l_orderkey`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96
-    PROPERTIES (
-        "replication_num" = "1",
-        "colocate_with" = "lineitem_orders"
-    );
-    """
-
-    sql """
-    drop table if exists orders;
-    """
-
-    sql '''
-    CREATE TABLE orders  (
-        o_orderkey       bigint NOT NULL,
-        o_orderdate      DATEV2 NOT NULL,
-        o_custkey        int NOT NULL,
-        o_orderstatus    VARCHAR(1) NOT NULL,
-        o_totalprice     decimal(15, 2) NOT NULL,
-        o_orderpriority  VARCHAR(15) NOT NULL,
-        o_clerk          VARCHAR(15) NOT NULL,
-        o_shippriority   int NOT NULL,
-        o_comment        VARCHAR(79) NOT NULL
-    )ENGINE=OLAP
-    DUPLICATE KEY(`o_orderkey`, `o_orderdate`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96
-    PROPERTIES (
-        "replication_num" = "1",
-        "colocate_with" = "lineitem_orders"
-    ); '''
-
-    sql '''
-    drop table if exists partsupp;
-    '''
-
-    sql '''
-    CREATE TABLE partsupp (
-        ps_partkey          int NOT NULL,
-        ps_suppkey     int NOT NULL,
-        ps_availqty    int NOT NULL,
-        ps_supplycost  decimal(15, 2)  NOT NULL,
-        ps_comment     VARCHAR(199) NOT NULL
-    )ENGINE=OLAP
-    DUPLICATE KEY(`ps_partkey`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`ps_partkey`) BUCKETS 24
-    PROPERTIES (
-        "replication_num" = "1",
-        "colocate_with" = "part_partsupp"
-    );
-    '''
-
-    sql '''
-    drop table if exists part;
-    '''
-
-    sql '''
-    CREATE TABLE part (
-        p_partkey          int NOT NULL,
-        p_name        VARCHAR(55) NOT NULL,
-        p_mfgr        VARCHAR(25) NOT NULL,
-        p_brand       VARCHAR(10) NOT NULL,
-        p_type        VARCHAR(25) NOT NULL,
-        p_size        int NOT NULL,
-        p_container   VARCHAR(10) NOT NULL,
-        p_retailprice decimal(15, 2) NOT NULL,
-        p_comment     VARCHAR(23) NOT NULL
-    )ENGINE=OLAP
-    DUPLICATE KEY(`p_partkey`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`p_partkey`) BUCKETS 24
-    PROPERTIES (
-        "replication_num" = "1",
-        "colocate_with" = "part_partsupp"
-    );
-    '''
-
-    sql '''
-    drop table if exists customer;
-    '''
-
-    sql '''
-    CREATE TABLE customer (
-        c_custkey     int NOT NULL,
-        c_name        VARCHAR(25) NOT NULL,
-        c_address     VARCHAR(40) NOT NULL,
-        c_nationkey   int NOT NULL,
-        c_phone       VARCHAR(15) NOT NULL,
-        c_acctbal     decimal(15, 2)   NOT NULL,
-        c_mktsegment  VARCHAR(10) NOT NULL,
-        c_comment     VARCHAR(117) NOT NULL
-    )ENGINE=OLAP
-    DUPLICATE KEY(`c_custkey`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`c_custkey`) BUCKETS 24
-    PROPERTIES (
-        "replication_num" = "1"
-    );
-    '''
-
-    sql '''
-    drop table if exists supplier
-    '''
-    
-    sql '''
-    CREATE TABLE supplier (
-        s_suppkey       int NOT NULL,
-        s_name        VARCHAR(25) NOT NULL,
-        s_address     VARCHAR(40) NOT NULL,
-        s_nationkey   int NOT NULL,
-        s_phone       VARCHAR(15) NOT NULL,
-        s_acctbal     decimal(15, 2) NOT NULL,
-        s_comment     VARCHAR(101) NOT NULL
-    )ENGINE=OLAP
-    DUPLICATE KEY(`s_suppkey`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`s_suppkey`) BUCKETS 12
-    PROPERTIES (
-        "replication_num" = "1"
-    );
-    '''
-
-    sql '''
-    drop table if exists nation;
-    '''
-
-    sql '''
-    CREATE TABLE `nation` (
-    `n_nationkey` int(11) NOT NULL,
-    `n_name`      varchar(25) NOT NULL,
-    `n_regionkey` int(11) NOT NULL,
-    `n_comment`   varchar(152) NULL
-    ) ENGINE=OLAP
-    DUPLICATE KEY(`N_NATIONKEY`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`N_NATIONKEY`) BUCKETS 1
-    PROPERTIES (
-        "replication_num" = "1"
-    );
-    '''
-    
-    sql '''
-    drop table if exists region;
-    '''
-    
-    sql '''
-    CREATE TABLE region  (
-        r_regionkey      int NOT NULL,
-        r_name       VARCHAR(25) NOT NULL,
-        r_comment    VARCHAR(152)
-    )ENGINE=OLAP
-    DUPLICATE KEY(`r_regionkey`)
-    COMMENT "OLAP"
-    DISTRIBUTED BY HASH(`r_regionkey`) BUCKETS 1
-    PROPERTIES (
-        "replication_num" = "1"
-    );
-    '''
-    
-    sql '''
-    drop view if exists revenue0;
-    '''
-    
-    sql '''
-    create view revenue0 (supplier_no, total_revenue) as
-    select
-        l_suppkey,
-        sum(l_extendedprice * (1 - l_discount))
-    from
-        lineitem
-    where
-        l_shipdate >= date '1996-01-01'
-        and l_shipdate < date '1996-01-01' + interval '3' month
-    group by
-        l_suppkey;
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_receiptdate set stats ('ndv'='2567', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='1992-01-04', 'max_value'='1998-12-31', 'row_count'='6001215')
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_returnflag set stats ('ndv'='3', 'avg_size'='1', 'max_size'='1', 'num_nulls'='0', 'min_value'='A', 'max_value'='R', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_tax set stats ('ndv'='9', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='0', 'max_value'='0.08', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_shipmode set stats ('ndv'='7', 'avg_size'='4', 'max_size'='7', 'num_nulls'='0', 'min_value'='AIR', 'max_value'='TRUCK', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_suppkey set stats ('ndv'='9990', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_shipdate set stats ('ndv'='2549', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='1992-01-02', 'max_value'='1998-12-01', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_commitdate set stats ('ndv'='2485', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='1992-01-31', 'max_value'='1998-10-31', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_partkey set stats ('ndv'='196099', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='6001215');
-    '''
-
-    sql '''
-    alter table lineitem modify column l_orderkey set stats ('ndv'='1500000', 'avg_size'='8', 'max_size'='8', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_quantity set stats ('ndv'='50', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_linestatus set stats ('ndv'='2', 'avg_size'='1', 'max_size'='1', 'num_nulls'='0', 'min_value'='F', 'max_value'='o', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_comment set stats ('ndv'='4619207', 'avg_size'='26', 'max_size'='43', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_extendedprice set stats ('ndv'='929697', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_linenumber set stats ('ndv'='7', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='7', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_discount set stats ('ndv'='11', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='0', 'max_value'='0.1', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table lineitem modify column l_shipinstruct set stats ('ndv'='4', 'avg_size'='12', 'max_size'='17', 'num_nulls'='0', 'min_value'='COLLECT COD', 'max_value'='TAKE BACK RETURN', 'row_count'='6001215');
-    '''
-    
-    sql '''
-    alter table partsupp modify column ps_suppkey set stats ('ndv'='10009', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='800000');
-    '''
-    
-    sql '''
-    alter table partsupp modify column ps_availqty set stats ('ndv'='10008', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='9999', 'row_count'='800000');
-    '''
-    
-    sql '''
-    alter table partsupp modify column ps_comment set stats ('ndv'='794782', 'avg_size'='123.6', 'max_size'='198', 'num_nulls'='0', 'min_value'='Tiresias according to the quiet courts sleep against the ironic', 'max_value'='zzle. unusual decoys detec', 'row_count'='800000');
-    '''
-    
-    sql '''
-    alter table partsupp modify column ps_partkey set stats ('ndv'='196099', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='200000', 'row_count'='800000');
-    '''
-    
-    sql '''
-    alter table partsupp modify column ps_supplycost set stats ('ndv'='100274', 'avg_size'='16.0', 'max_size'='16', 'num_nulls'='0', 'min_value'='1', 'max_value'='1000', 'row_count'='800000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_comment set stats ('ndv'='10039', 'avg_size'='62.56950', 'max_size'='100', 'num_nulls'='0', 'min_value'='about the blithely express foxes. bli', 'max_value'='zzle furiously. bold accounts haggle fu', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_phone set stats ('ndv'='10021', 'avg_size'='15.0', 'max_size'='15', 'num_nulls'='0', 'min_value'='10-102-116-6785', 'max_value'='34-998-900-4911', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_nationkey set stats ('ndv'='25', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='0', 'max_value'='24', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_name set stats ('ndv'='10002', 'avg_size'='18.0', 'max_size'='18', 'num_nulls'='0', 'min_value'='Supplier#000000001', 'max_value'='Supplier#000010000', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_acctbal set stats ('ndv'='9954', 'avg_size'='16.0', 'max_size'='16', 'num_nulls'='0', 'min_value'='-998.22', 'max_value'='9999.72', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_address set stats ('ndv'='9888', 'avg_size'='24.9771', 'max_size'='40', 'num_nulls'='0', 'min_value'='   9aW1wwnBJJPnCx,n', 'max_value'='zzfDhdtZcvmVzA8rNFU,Yctj1zBN', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table supplier modify column s_suppkey set stats ('ndv'='10000', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='10000', 'row_count'='10000');
-    '''
-    
-    sql '''
-    alter table part modify column p_partkey set stats ('ndv'='200000', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='200000', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_container set stats ('ndv'='40', 'avg_size'='7.57', 'max_size'='10', 'num_nulls'='0', 'min_value'='JUMBO BAG', 'max_value'='WRAP PKG', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_name set stats ('ndv'='200000', 'avg_size'='32.0', 'max_size'='50', 'num_nulls'='0', 'min_value'='almond antique blue royal burnished', 'max_value'='yellow white seashell lavender black', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_comment set stats ('ndv'='133106', 'avg_size'='13', 'max_size'='22', 'num_nulls'='0', 'min_value'='Tire', 'max_value'='zzle. quickly si', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_brand set stats ('ndv'='25', 'avg_size'='22', 'max_size'='22', 'num_nulls'='0', 'min_value'='Brand#11', 'max_value'='Brand#55', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_retailprice set stats ('ndv'='21096', 'avg_size'='16.0', 'max_size'='16', 'num_nulls'='0', 'min_value'='901', 'max_value'='2098.99', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_type set stats ('ndv'='150', 'avg_size'='20', 'max_size'='25', 'num_nulls'='0', 'min_value'='ECONOMY ANODIZED BRASSe', 'max_value'='STANDARD POLISHED TIN ', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_size set stats ('ndv'='50', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='50', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table part modify column p_mfgr set stats ('ndv'='5', 'avg_size'='14', 'max_size'='14', 'num_nulls'='0', 'min_value'='Manufacturer#1', 'max_value'='Manufacturer#5', 'row_count'='200000');
-    '''
-    
-    sql '''
-    alter table region modify column r_regionkey set stats ('ndv'='5', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='0', 'max_value'='4', 'row_count'='5');
-    '''
-    
-    sql '''
-    alter table region modify column r_name set stats ('ndv'='5', 'avg_size'='14', 'max_size'='14', 'num_nulls'='0', 'min_value'='AFRICA', 'max_value'='MIDDLE EAST', 'row_count'='5');
-    '''
-    
-    sql '''
-    alter table region modify column r_comment set stats ('ndv'='5', 'avg_size'='14', 'max_size'='14', 'num_nulls'='0', 'min_value'='AFRICA', 'max_value'='MIDDLE EAST', 'row_count'='5');
-    '''
-    
-    sql '''
-    alter table nation modify column n_nationkey set stats ('ndv'='25', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='0', 'max_value'='24', 'row_count'='25');
-    '''
-    
-    sql '''
-    alter table nation modify column n_regionkey set stats ('ndv'='5', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='0', 'max_value'='4', 'row_count'='25');
-    '''
-    
-    sql '''
-    alter table nation modify column n_name set stats ('ndv'='25', 'avg_size'='14', 'max_size'='14', 'num_nulls'='0', 'min_value'='ALGERIA', 'max_value'='VIETNAM', 'row_count'='25');
-    '''
-    
-    sql '''
-    alter table nation modify column n_comment set stats ('ndv'='25', 'avg_size'='14', 'max_size'='14', 'num_nulls'='0', 'min_value'='ALGERIA', 'max_value'='VIETNAM', 'row_count'='25');
-    '''
-    
-    sql '''
-    alter table customer modify column c_custkey set stats ('ndv'='150000', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='150000', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_acctbal set stats ('ndv'='142496', 'avg_size'='16', 'max_size'='16', 'num_nulls'='0', 'min_value'='-999.99', 'max_value'='9999.99', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_phone set stats ('ndv'='150000', 'avg_size'='15', 'max_size'='15', 'num_nulls'='0', 'min_value'='10-100-106-1617', 'max_value'='34-999-618-6881', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_mktsegment set stats ('ndv'='5', 'avg_size'='8.9', 'max_size'='10', 'num_nulls'='0', 'min_value'='AUTOMOBILE', 'max_value'='MACHINERY', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_address set stats ('ndv'='150000', 'avg_size'='25', 'max_size'='40', 'num_nulls'='0', 'min_value'='   2uZwVhQvwA', 'max_value'='zzxGktzXTMKS1BxZlgQ9nqQ', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_nationkey set stats ('ndv'='25', 'avg_size'='4', 'max_size'='4', 'num_nulls'='0', 'min_value'='0', 'max_value'='24', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_name set stats ('ndv'='150000', 'avg_size'='25', 'max_size'='25', 'num_nulls'='0', 'min_value'='Customer#000000001', 'max_value'='Customer#000150000', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table customer modify column c_comment set stats ('ndv'='150000', 'avg_size'='72', 'max_size'='116', 'num_nulls'='0', 'min_value'=' Tiresias according to the sly', 'max_value'='zzle. blithely regu0', 'row_count'='150000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_orderstatus set stats ('ndv'='3', 'avg_size'='1.0', 'max_size'='1', 'num_nulls'='0', 'min_value'='F', 'max_value'='P', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_clerk set stats ('ndv'='988', 'avg_size'='15.0', 'max_size'='15', 'num_nulls'='0', 'min_value'='Clerk#000000001', 'max_value'='Clerk#000001000', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_orderdate set stats ('ndv'='2417', 'avg_size'='16.0', 'max_size'='16', 'num_nulls'='0', 'min_value'='1992-01-01', 'max_value'='1998-08-02', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_shippriority set stats ('ndv'='1', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='0', 'max_value'='0', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_custkey set stats ('ndv'='99149', 'avg_size'='4.0', 'max_size'='4', 'num_nulls'='0', 'min_value'='1', 'max_value'='149999', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_totalprice set stats ('ndv'='1462416', 'avg_size'='16.0', 'max_size'='16', 'num_nulls'='0', 'min_value'='857.71', 'max_value'='555285.16', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_orderkey set stats ('ndv'='1500000', 'avg_size'='8.0', 'max_size'='8', 'num_nulls'='0', 'min_value'='1', 'max_value'='6000000', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_comment set stats ('ndv'='1465415', 'avg_size'='48.51387', 'max_size'='78', 'num_nulls'='0', 'min_value'='Tiresias about the blithely ironic a', 'max_value'='zzle? furiously ironic instructions among the unusual t ', 'row_count'='1500000');
-    '''
-    
-    sql '''
-    alter table orders modify column o_orderpriority set stats ('ndv'='5', 'avg_size'='8.4', 'max_size'='15', 'num_nulls'='0', 'min_value'='1-URGENT', 'max_value'='5-LOW', 'row_count'='1500000');
-    '''
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q1.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q1.groovy
deleted file mode 100644
index c8ff628b89..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q1.groovy
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q1") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        return;
-    }
-    qt_select """
-    explain shape plan
-    select
-        l_returnflag,
-        l_linestatus,
-        sum(l_quantity) as sum_qty,
-        sum(l_extendedprice) as sum_base_price,
-        sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
-        sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
-        avg(l_quantity) as avg_qty,
-        avg(l_extendedprice) as avg_price,
-        avg(l_discount) as avg_disc,
-        count(*) as count_order
-    from
-        lineitem
-    where
-        l_shipdate <= date '1998-12-01' - interval '90' day
-    group by
-        l_returnflag,
-        l_linestatus
-    order by
-        l_returnflag,
-        l_linestatus;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q10.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q10.groovy
deleted file mode 100644
index a0b1a5e0df..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q10.groovy
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q10") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        c_custkey,
-        c_name,
-        sum(l_extendedprice * (1 - l_discount)) as revenue,
-        c_acctbal,
-        n_name,
-        c_address,
-        c_phone,
-        c_comment
-    from
-        customer,
-        orders,
-        lineitem,
-        nation
-    where
-        c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and o_orderdate >= date '1993-10-01'
-        and o_orderdate < date '1993-10-01' + interval '3' month
-        and l_returnflag = 'R'
-        and c_nationkey = n_nationkey
-    group by
-        c_custkey,
-        c_name,
-        c_acctbal,
-        c_phone,
-        n_name,
-        c_address,
-        c_comment
-    order by
-        revenue desc
-    limit 20;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q11.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q11.groovy
deleted file mode 100644
index 735f5a93c5..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q11.groovy
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q11") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select  
-        ps_partkey,
-        sum(ps_supplycost * ps_availqty) as value
-    from
-        partsupp,
-        supplier,
-        nation
-    where
-        ps_suppkey = s_suppkey
-        and s_nationkey = n_nationkey
-        and n_name = 'GERMANY'
-    group by
-        ps_partkey having
-            sum(ps_supplycost * ps_availqty) > (
-                select
-                    sum(ps_supplycost * ps_availqty) * 0.000002
-                from
-                    partsupp,
-                    supplier,
-                    nation
-                where
-                    ps_suppkey = s_suppkey
-                    and s_nationkey = n_nationkey
-                    and n_name = 'GERMANY'
-            )
-    order by
-        value desc;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q12.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q12.groovy
deleted file mode 100644
index 8926ab6fa8..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q12.groovy
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q12") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        l_shipmode,
-        sum(case
-            when o_orderpriority = '1-URGENT'
-                or o_orderpriority = '2-HIGH'
-                then 1
-            else 0
-        end) as high_line_count,
-        sum(case
-            when o_orderpriority <> '1-URGENT'
-                and o_orderpriority <> '2-HIGH'
-                then 1
-            else 0
-        end) as low_line_count
-    from
-        orders,
-        lineitem
-    where
-        o_orderkey = l_orderkey
-        and l_shipmode in ('MAIL', 'SHIP')
-        and l_commitdate < l_receiptdate
-        and l_shipdate < l_commitdate
-        and l_receiptdate >= date '1994-01-01'
-        and l_receiptdate < date '1994-01-01' + interval '1' year
-    group by
-        l_shipmode
-    order by
-        l_shipmode;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q13.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q13.groovy
deleted file mode 100644
index bc2554b86f..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q13.groovy
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q13") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        c_count,
-        count(*) as custdist
-    from
-        (
-            select
-                c_custkey,
-                count(o_orderkey) as c_count
-            from
-                customer left outer join orders on
-                    c_custkey = o_custkey
-                    and o_comment not like '%special%requests%'
-            group by
-                c_custkey
-        ) as c_orders
-    group by
-        c_count
-    order by
-        custdist desc,
-        c_count desc;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q14.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q14.groovy
deleted file mode 100644
index d70b63d06e..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q14.groovy
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q14") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        100.00 * sum(case
-            when p_type like 'PROMO%'
-                then l_extendedprice * (1 - l_discount)
-            else 0
-        end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
-    from
-        lineitem,
-        part
-    where
-        l_partkey = p_partkey
-        and l_shipdate >= date '1995-09-01'
-        and l_shipdate < date '1995-09-01' + interval '1' month;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q15.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q15.groovy
deleted file mode 100644
index 4749d570b0..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q15.groovy
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q15") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        s_suppkey,
-        s_name,
-        s_address,
-        s_phone,
-        total_revenue
-    from
-        supplier,
-        revenue0
-    where
-        s_suppkey = supplier_no
-        and total_revenue = (
-            select
-                max(total_revenue)
-            from
-                revenue0
-        )
-    order by
-        s_suppkey;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q16.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q16.groovy
deleted file mode 100644
index 1e114b55c5..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q16.groovy
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q16") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        p_brand,
-        p_type,
-        p_size,
-        count(distinct ps_suppkey) as supplier_cnt
-    from
-        partsupp,
-        part
-    where
-        p_partkey = ps_partkey
-        and p_brand <> 'Brand#45'
-        and p_type not like 'MEDIUM POLISHED%'
-        and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
-        and ps_suppkey not in (
-            select
-                s_suppkey
-            from
-                supplier
-            where
-                s_comment like '%Customer%Complaints%'
-        )
-    group by
-        p_brand,
-        p_type,
-        p_size
-    order by
-        supplier_cnt desc,
-        p_brand,
-        p_type,
-        p_size;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q17.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q17.groovy
deleted file mode 100644
index 50cb1f52ed..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q17.groovy
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q17") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select
-        sum(l_extendedprice) / 7.0 as avg_yearly
-    from
-        lineitem,
-        part
-    where
-        p_partkey = l_partkey
-        and p_brand = 'Brand#23'
-        and p_container = 'MED BOX'
-        and l_quantity < (
-            select
-                0.2 * avg(l_quantity)
-            from
-                lineitem
-            where
-                l_partkey = p_partkey
-        );
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q18.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q18.groovy
deleted file mode 100644
index 6ed14189e9..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q18.groovy
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q18") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-    c_name,
-            c_custkey,
-            o_orderkey,
-            o_orderdate,
-            o_totalprice,
-            sum(l_quantity)
-    from
-            customer,
-            orders,
-            lineitem
-    where
-            o_orderkey  in  (
-                    select
-                            l_orderkey
-                    from
-                            lineitem
-                    group  by
-                            l_orderkey  having
-                                    sum(l_quantity)  >  300
-            )
-            and  c_custkey  =  o_custkey
-            and  o_orderkey  =  l_orderkey
-    group  by
-            c_name,
-            c_custkey,
-            o_orderkey,
-            o_orderdate,
-            o_totalprice
-    order  by
-            o_totalprice  desc,
-            o_orderdate
-    limit  100;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q19.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q19.groovy
deleted file mode 100644
index 726ff7167f..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q19.groovy
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q19") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select
-                sum(l_extendedprice* (1 - l_discount)) as revenue
-        from
-                lineitem,
-                part
-        where
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#12'
-                and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
-                and l_quantity >= 1 and l_quantity <= 1 + 10
-                and p_size between 1 and 5
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        )
-        or
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#23'
-                and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
-                and l_quantity >= 10 and l_quantity <= 10 + 10
-                and p_size between 1 and 10
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        )
-        or
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#34'
-                and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
-                and l_quantity >= 20 and l_quantity <= 20 + 10
-                and p_size between 1 and 15
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        );
-    
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q2.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q2.groovy
deleted file mode 100644
index a987cb06aa..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q2.groovy
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q2") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        s_acctbal,
-        s_name,
-        n_name,
-        p_partkey,
-        p_mfgr,
-        s_address,
-        s_phone,
-        s_comment
-    from
-        part,
-        supplier,
-        partsupp,
-        nation,
-        region
-    where
-        p_partkey = ps_partkey
-        and s_suppkey = ps_suppkey
-        and p_size = 15
-        and p_type like '%BRASS'
-        and s_nationkey = n_nationkey
-        and n_regionkey = r_regionkey
-        and r_name = 'EUROPE'
-        and ps_supplycost = (
-            select
-                min(ps_supplycost)
-            from
-                partsupp,
-                supplier,
-                nation,
-                region
-            where
-                p_partkey = ps_partkey
-                and s_suppkey = ps_suppkey
-                and s_nationkey = n_nationkey
-                and n_regionkey = r_regionkey
-                and r_name = 'EUROPE'
-        )
-    order by
-        s_acctbal desc,
-        n_name,
-        s_name,
-        p_partkey
-    limit 100;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q20.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q20.groovy
deleted file mode 100644
index 4d93560cc8..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q20.groovy
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q20") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select 
-        s_name,
-        s_address
-        from
-        supplier,
-        nation
-        where
-        s_suppkey in (
-                select
-                ps_suppkey
-                from
-                partsupp
-                where
-                ps_partkey in (
-                        select
-                        p_partkey
-                        from
-                        part
-                        where
-                        p_name like 'forest%'
-                )
-                and ps_availqty > (
-                        select
-                        0.5 * sum(l_quantity)
-                        from
-                        lineitem
-                        where
-                        l_partkey = ps_partkey
-                        and l_suppkey = ps_suppkey
-                        and l_shipdate >= date '1994-01-01'
-                        and l_shipdate < date '1994-01-01' + interval '1' year
-                )
-        )
-        and s_nationkey = n_nationkey
-        and n_name = 'CANADA'
-        order by
-        s_name;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q21.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q21.groovy
deleted file mode 100644
index 4ff1fbb411..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q21.groovy
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q21") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select
-                s_name,
-                count(*) as numwait
-        from
-                supplier,
-                lineitem l1,
-                orders,
-                nation
-        where
-        s_suppkey = l1.l_suppkey
-        and o_orderkey = l1.l_orderkey
-        and o_orderstatus = 'F'
-        and l1.l_receiptdate > l1.l_commitdate
-        and exists (
-                select
-                *
-                from
-                lineitem l2
-                where
-                l2.l_orderkey = l1.l_orderkey
-                and l2.l_suppkey <> l1.l_suppkey
-        )
-        and not exists (
-                select
-                *
-                from
-                lineitem l3
-                where
-                l3.l_orderkey = l1.l_orderkey
-                and l3.l_suppkey <> l1.l_suppkey
-                and l3.l_receiptdate > l3.l_commitdate
-        )
-        and s_nationkey = n_nationkey
-        and n_name = 'SAUDI ARABIA'
-        group by
-        s_name
-        order by
-        numwait desc,
-        s_name
-        limit 100;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q22.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q22.groovy
deleted file mode 100644
index 734bb4bb02..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q22.groovy
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q22") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select 
-        cntrycode,
-        count(*) as numcust,
-        sum(c_acctbal) as totacctbal
-    from
-        (
-            select
-                substring(c_phone, 1, 2) as cntrycode,
-                c_acctbal
-            from
-                customer
-            where
-                substring(c_phone, 1, 2) in
-                    ('13', '31', '23', '29', '30', '18', '17')
-                and c_acctbal > (
-                    select
-                        avg(c_acctbal)
-                    from
-                        customer
-                    where
-                        c_acctbal > 0.00
-                        and substring(c_phone, 1, 2) in
-                            ('13', '31', '23', '29', '30', '18', '17')
-                )
-                and not exists (
-                    select
-                        *
-                    from
-                        orders
-                    where
-                        o_custkey = c_custkey
-                )
-        ) as custsale
-    group by
-        cntrycode
-    order by
-        cntrycode;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q3.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q3.groovy
deleted file mode 100644
index 8964734f53..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q3.groovy
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q3") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    // db = "tpch"
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select  
-        l_orderkey,
-        sum(l_extendedprice * (1 - l_discount)) as revenue,
-        o_orderdate,
-        o_shippriority
-    from
-        customer,
-        orders,
-        lineitem
-    where
-        c_mktsegment = 'BUILDING'
-        and c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and o_orderdate < date '1995-03-15'
-        and l_shipdate > date '1995-03-15'
-    group by
-        l_orderkey,
-        o_orderdate,
-        o_shippriority
-    order by
-        revenue desc,
-        o_orderdate
-    limit 10;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q4.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q4.groovy
deleted file mode 100644
index 0a16300b91..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q4.groovy
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q4") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select  
-        o_orderpriority,
-        count(*) as order_count
-    from
-        orders
-    where
-        o_orderdate >= date '1993-07-01'
-        and o_orderdate < date '1993-07-01' + interval '3' month
-        and exists (
-            select
-                *
-            from
-                lineitem
-            where
-                l_orderkey = o_orderkey
-                and l_commitdate < l_receiptdate
-        )
-    group by
-        o_orderpriority
-    order by
-        o_orderpriority;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q5.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q5.groovy
deleted file mode 100644
index 11cc405653..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q5.groovy
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q5") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    
-    qt_select """
-    explain shape plan
-    select 
-        n_name,
-        sum(l_extendedprice * (1 - l_discount)) as revenue
-    from
-        customer,
-        orders,
-        lineitem,
-        supplier,
-        nation,
-        region
-    where
-        c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and l_suppkey = s_suppkey
-        and c_nationkey = s_nationkey
-        and s_nationkey = n_nationkey
-        and n_regionkey = r_regionkey
-        and r_name = 'ASIA'
-        and o_orderdate >= date '1994-01-01'
-        and o_orderdate < date '1994-01-01' + interval '1' year
-    group by
-        n_name
-    order by
-        revenue desc;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q6.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q6.groovy
deleted file mode 100644
index fd55371b7b..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q6.groovy
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q6") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    
-    qt_select """
-    explain shape plan
-    select 
-        sum(l_extendedprice * l_discount) as revenue
-    from
-        lineitem
-    where
-        l_shipdate >= date '1994-01-01'
-        and l_shipdate < date '1994-01-01' + interval '1' year
-        and l_discount between .06 - 0.01 and .06 + 0.01
-        and l_quantity < 24;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q7.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q7.groovy
deleted file mode 100644
index 498bbf813e..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q7.groovy
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q7") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    
-    qt_select """
-    explain shape plan
-    select 
-        supp_nation,
-        cust_nation,
-        l_year,
-        sum(volume) as revenue
-    from
-        (
-            select
-                n1.n_name as supp_nation,
-                n2.n_name as cust_nation,
-                extract(year from l_shipdate) as l_year,
-                l_extendedprice * (1 - l_discount) as volume
-            from
-                supplier,
-                lineitem,
-                orders,
-                customer,
-                nation n1,
-                nation n2
-            where
-                s_suppkey = l_suppkey
-                and o_orderkey = l_orderkey
-                and c_custkey = o_custkey
-                and s_nationkey = n1.n_nationkey
-                and c_nationkey = n2.n_nationkey
-                and (
-                    (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
-                    or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
-                )
-                and l_shipdate between date '1995-01-01' and date '1996-12-31'
-        ) as shipping
-    group by
-        supp_nation,
-        cust_nation,
-        l_year
-    order by
-        supp_nation,
-        cust_nation,
-        l_year;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q8.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q8.groovy
deleted file mode 100644
index 0aa58cfff0..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q8.groovy
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q8") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        o_year,
-        sum(case
-            when nation = 'BRAZIL' then volume
-            else 0
-        end) / sum(volume) as mkt_share
-    from
-        (
-            select
-                extract(year from o_orderdate) as o_year,
-                l_extendedprice * (1 - l_discount) as volume,
-                n2.n_name as nation
-            from
-                part,
-                supplier,
-                lineitem,
-                orders,
-                customer,
-                nation n1,
-                nation n2,
-                region
-            where
-                p_partkey = l_partkey
-                and s_suppkey = l_suppkey
-                and l_orderkey = o_orderkey
-                and o_custkey = c_custkey
-                and c_nationkey = n1.n_nationkey
-                and n1.n_regionkey = r_regionkey
-                and r_name = 'AMERICA'
-                and s_nationkey = n2.n_nationkey
-                and o_orderdate between date '1995-01-01' and date '1996-12-31'
-                and p_type = 'ECONOMY ANODIZED STEEL'
-        ) as all_nations
-    group by
-        o_year
-    order by
-        o_year;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q9.groovy b/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q9.groovy
deleted file mode 100644
index 9ee28d15b2..0000000000
--- a/regression-test/suites/nereids_tpch_shape_sf1_p0/shape/q9.groovy
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q9") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        nation,
-        o_year,
-        sum(amount) as sum_profit
-    from
-        (
-            select
-                n_name as nation,
-                extract(year from o_orderdate) as o_year,
-                l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
-            from
-                part,
-                supplier,
-                lineitem,
-                partsupp,
-                orders,
-                nation
-            where
-                s_suppkey = l_suppkey
-                and ps_suppkey = l_suppkey
-                and ps_partkey = l_partkey
-                and p_partkey = l_partkey
-                and o_orderkey = l_orderkey
-                and s_nationkey = n_nationkey
-                and p_name like '%green%'
-        ) as profit
-    group by
-        nation,
-        o_year
-    order by
-        nation,
-        o_year desc;
-    """
-}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q1.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q1.groovy
index ba8e2c15ff..27fe9ac08f 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q1.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q1.groovy
@@ -1,60 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q1") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-
-    qt_select """
-    explain shape plan
-    select
-        l_returnflag,
-        l_linestatus,
-        sum(l_quantity) as sum_qty,
-        sum(l_extendedprice) as sum_base_price,
-        sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
-        sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
-        avg(l_quantity) as avg_qty,
-        avg(l_extendedprice) as avg_price,
-        avg(l_discount) as avg_disc,
-        count(*) as count_order
-    from
-        lineitem
-    where
-        l_shipdate <= date '1998-12-01' - interval '90' day
-    group by
-        l_returnflag,
-        l_linestatus
-    order by
-        l_returnflag,
-        l_linestatus;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q1") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+    
+sql 'set be_number_for_test=3'
+
+
+    qt_select """
+    explain shape plan
+    select
+        l_returnflag,
+        l_linestatus,
+        sum(l_quantity) as sum_qty,
+        sum(l_extendedprice) as sum_base_price,
+        sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
+        sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
+        avg(l_quantity) as avg_qty,
+        avg(l_extendedprice) as avg_price,
+        avg(l_discount) as avg_disc,
+        count(*) as count_order
+    from
+        lineitem
+    where
+        l_shipdate <= date '1998-12-01' - interval '90' day
+    group by
+        l_returnflag,
+        l_linestatus
+    order by
+        l_returnflag,
+        l_linestatus;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q10.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q10.groovy
index 06e91aabb8..408312e626 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q10.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q10.groovy
@@ -1,74 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q10") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        c_custkey,
-        c_name,
-        sum(l_extendedprice * (1 - l_discount)) as revenue,
-        c_acctbal,
-        n_name,
-        c_address,
-        c_phone,
-        c_comment
-    from
-        customer,
-        orders,
-        lineitem,
-        nation
-    where
-        c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and o_orderdate >= date '1993-10-01'
-        and o_orderdate < date '1993-10-01' + interval '3' month
-        and l_returnflag = 'R'
-        and c_nationkey = n_nationkey
-    group by
-        c_custkey,
-        c_name,
-        c_acctbal,
-        c_phone,
-        n_name,
-        c_address,
-        c_comment
-    order by
-        revenue desc
-    limit 20;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q10") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        c_custkey,
+        c_name,
+        sum(l_extendedprice * (1 - l_discount)) as revenue,
+        c_acctbal,
+        n_name,
+        c_address,
+        c_phone,
+        c_comment
+    from
+        customer,
+        orders,
+        lineitem,
+        nation
+    where
+        c_custkey = o_custkey
+        and l_orderkey = o_orderkey
+        and o_orderdate >= date '1993-10-01'
+        and o_orderdate < date '1993-10-01' + interval '3' month
+        and l_returnflag = 'R'
+        and c_nationkey = n_nationkey
+    group by
+        c_custkey,
+        c_name,
+        c_acctbal,
+        c_phone,
+        n_name,
+        c_address,
+        c_comment
+    order by
+        revenue desc
+    limit 20;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q11.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q11.groovy
index a6781cbf4e..9820445dfa 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q11.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q11.groovy
@@ -1,69 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q11") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select  
-        ps_partkey,
-        sum(ps_supplycost * ps_availqty) as value
-    from
-        partsupp,
-        supplier,
-        nation
-    where
-        ps_suppkey = s_suppkey
-        and s_nationkey = n_nationkey
-        and n_name = 'GERMANY'
-    group by
-        ps_partkey having
-            sum(ps_supplycost * ps_availqty) > (
-                select
-                    sum(ps_supplycost * ps_availqty) * 0.000002
-                from
-                    partsupp,
-                    supplier,
-                    nation
-                where
-                    ps_suppkey = s_suppkey
-                    and s_nationkey = n_nationkey
-                    and n_name = 'GERMANY'
-            )
-    order by
-        value desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q11") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select  
+        ps_partkey,
+        sum(ps_supplycost * ps_availqty) as value
+    from
+        partsupp,
+        supplier,
+        nation
+    where
+        ps_suppkey = s_suppkey
+        and s_nationkey = n_nationkey
+        and n_name = 'GERMANY'
+    group by
+        ps_partkey having
+            sum(ps_supplycost * ps_availqty) > (
+                select
+                    sum(ps_supplycost * ps_availqty) * 0.000002
+                from
+                    partsupp,
+                    supplier,
+                    nation
+                where
+                    ps_suppkey = s_suppkey
+                    and s_nationkey = n_nationkey
+                    and n_name = 'GERMANY'
+            )
+    order by
+        value desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q12.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q12.groovy
index d6c4996b4e..c0ff16a269 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q12.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q12.groovy
@@ -1,70 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q12") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        l_shipmode,
-        sum(case
-            when o_orderpriority = '1-URGENT'
-                or o_orderpriority = '2-HIGH'
-                then 1
-            else 0
-        end) as high_line_count,
-        sum(case
-            when o_orderpriority <> '1-URGENT'
-                and o_orderpriority <> '2-HIGH'
-                then 1
-            else 0
-        end) as low_line_count
-    from
-        orders,
-        lineitem
-    where
-        o_orderkey = l_orderkey
-        and l_shipmode in ('MAIL', 'SHIP')
-        and l_commitdate < l_receiptdate
-        and l_shipdate < l_commitdate
-        and l_receiptdate >= date '1994-01-01'
-        and l_receiptdate < date '1994-01-01' + interval '1' year
-    group by
-        l_shipmode
-    order by
-        l_shipmode;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q12") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        l_shipmode,
+        sum(case
+            when o_orderpriority = '1-URGENT'
+                or o_orderpriority = '2-HIGH'
+                then 1
+            else 0
+        end) as high_line_count,
+        sum(case
+            when o_orderpriority <> '1-URGENT'
+                and o_orderpriority <> '2-HIGH'
+                then 1
+            else 0
+        end) as low_line_count
+    from
+        orders,
+        lineitem
+    where
+        o_orderkey = l_orderkey
+        and l_shipmode in ('MAIL', 'SHIP')
+        and l_commitdate < l_receiptdate
+        and l_shipdate < l_commitdate
+        and l_receiptdate >= date '1994-01-01'
+        and l_receiptdate < date '1994-01-01' + interval '1' year
+    group by
+        l_shipmode
+    order by
+        l_shipmode;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q13.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q13.groovy
index 0400905aeb..ab6e68aaea 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q13.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q13.groovy
@@ -1,59 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q13") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-   
-    qt_select """
-    explain shape plan
-    select 
-        c_count,
-        count(*) as custdist
-    from
-        (
-            select
-                c_custkey,
-                count(o_orderkey) as c_count
-            from
-                customer left outer join orders on
-                    c_custkey = o_custkey
-                    and o_comment not like '%special%requests%'
-            group by
-                c_custkey
-        ) as c_orders
-    group by
-        c_count
-    order by
-        custdist desc,
-        c_count desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q13") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+    
+sql 'set be_number_for_test=3'
+   
+    qt_select """
+    explain shape plan
+    select 
+        c_count,
+        count(*) as custdist
+    from
+        (
+            select
+                c_custkey,
+                count(o_orderkey) as c_count
+            from
+                customer left outer join orders on
+                    c_custkey = o_custkey
+                    and o_comment not like '%special%requests%'
+            group by
+                c_custkey
+        ) as c_orders
+    group by
+        c_count
+    order by
+        custdist desc,
+        c_count desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q14.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q14.groovy
index a3cd7561ff..8d052771dd 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q14.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q14.groovy
@@ -1,52 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q14") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        100.00 * sum(case
-            when p_type like 'PROMO%'
-                then l_extendedprice * (1 - l_discount)
-            else 0
-        end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
-    from
-        lineitem,
-        part
-    where
-        l_partkey = p_partkey
-        and l_shipdate >= date '1995-09-01'
-        and l_shipdate < date '1995-09-01' + interval '1' month;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q14") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        100.00 * sum(case
+            when p_type like 'PROMO%'
+                then l_extendedprice * (1 - l_discount)
+            else 0
+        end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
+    from
+        lineitem,
+        part
+    where
+        l_partkey = p_partkey
+        and l_shipdate >= date '1995-09-01'
+        and l_shipdate < date '1995-09-01' + interval '1' month;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q15.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q15.groovy
index 51c9c8f240..dfc5e4917b 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q15.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q15.groovy
@@ -1,61 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q15") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        s_suppkey,
-        s_name,
-        s_address,
-        s_phone,
-        total_revenue
-    from
-        supplier,
-        revenue0
-    where
-        s_suppkey = supplier_no
-        and total_revenue = (
-            select
-                max(total_revenue)
-            from
-                revenue0
-        )
-    order by
-        s_suppkey;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q15") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        s_suppkey,
+        s_name,
+        s_address,
+        s_phone,
+        total_revenue
+    from
+        supplier,
+        revenue0
+    where
+        s_suppkey = supplier_no
+        and total_revenue = (
+            select
+                max(total_revenue)
+            from
+                revenue0
+        )
+    order by
+        s_suppkey;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q16.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q16.groovy
index 7035e0b58b..12cbb7c236 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q16.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q16.groovy
@@ -1,72 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q16") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-        p_brand,
-        p_type,
-        p_size,
-        count(distinct ps_suppkey) as supplier_cnt
-    from
-        partsupp,
-        part
-    where
-        p_partkey = ps_partkey
-        and p_brand <> 'Brand#45'
-        and p_type not like 'MEDIUM POLISHED%'
-        and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
-        and ps_suppkey not in (
-            select
-                s_suppkey
-            from
-                supplier
-            where
-                s_comment like '%Customer%Complaints%'
-        )
-    group by
-        p_brand,
-        p_type,
-        p_size
-    order by
-        supplier_cnt desc,
-        p_brand,
-        p_type,
-        p_size;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q16") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+        p_brand,
+        p_type,
+        p_size,
+        count(distinct ps_suppkey) as supplier_cnt
+    from
+        partsupp,
+        part
+    where
+        p_partkey = ps_partkey
+        and p_brand <> 'Brand#45'
+        and p_type not like 'MEDIUM POLISHED%'
+        and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
+        and ps_suppkey not in (
+            select
+                s_suppkey
+            from
+                supplier
+            where
+                s_comment like '%Customer%Complaints%'
+        )
+    group by
+        p_brand,
+        p_type,
+        p_size
+    order by
+        supplier_cnt desc,
+        p_brand,
+        p_type,
+        p_size;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q17.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q17.groovy
index 0a1c061441..075b5186a8 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q17.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q17.groovy
@@ -1,59 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q17") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select
-        sum(l_extendedprice) / 7.0 as avg_yearly
-    from
-        lineitem,
-        part
-    where
-        p_partkey = l_partkey
-        and p_brand = 'Brand#23'
-        and p_container = 'MED BOX'
-        and l_quantity < (
-            select
-                0.2 * avg(l_quantity)
-            from
-                lineitem
-            where
-                l_partkey = p_partkey
-        );
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q17") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select
+        sum(l_extendedprice) / 7.0 as avg_yearly
+    from
+        lineitem,
+        part
+    where
+        p_partkey = l_partkey
+        and p_brand = 'Brand#23'
+        and p_container = 'MED BOX'
+        and l_quantity < (
+            select
+                0.2 * avg(l_quantity)
+            from
+                lineitem
+            where
+                l_partkey = p_partkey
+        );
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q18.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q18.groovy
index 2e13db34b3..dc7bae3584 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q18.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q18.groovy
@@ -1,75 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q18") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-    select 
-    c_name,
-            c_custkey,
-            o_orderkey,
-            o_orderdate,
-            o_totalprice,
-            sum(l_quantity)
-    from
-            customer,
-            orders,
-            lineitem
-    where
-            o_orderkey  in  (
-                    select
-                            l_orderkey
-                    from
-                            lineitem
-                    group  by
-                            l_orderkey  having
-                                    sum(l_quantity)  >  300
-            )
-            and  c_custkey  =  o_custkey
-            and  o_orderkey  =  l_orderkey
-    group  by
-            c_name,
-            c_custkey,
-            o_orderkey,
-            o_orderdate,
-            o_totalprice
-    order  by
-            o_totalprice  desc,
-            o_orderdate
-    limit  100;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q18") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+    select 
+    c_name,
+            c_custkey,
+            o_orderkey,
+            o_orderdate,
+            o_totalprice,
+            sum(l_quantity)
+    from
+            customer,
+            orders,
+            lineitem
+    where
+            o_orderkey  in  (
+                    select
+                            l_orderkey
+                    from
+                            lineitem
+                    group  by
+                            l_orderkey  having
+                                    sum(l_quantity)  >  300
+            )
+            and  c_custkey  =  o_custkey
+            and  o_orderkey  =  l_orderkey
+    group  by
+            c_name,
+            c_custkey,
+            o_orderkey,
+            o_orderdate,
+            o_totalprice
+    order  by
+            o_totalprice  desc,
+            o_orderdate
+    limit  100;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q19.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q19.groovy
index ab624fa467..800352e269 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q19.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q19.groovy
@@ -1,79 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q19") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select
-                sum(l_extendedprice* (1 - l_discount)) as revenue
-        from
-                lineitem,
-                part
-        where
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#12'
-                and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
-                and l_quantity >= 1 and l_quantity <= 1 + 10
-                and p_size between 1 and 5
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        )
-        or
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#23'
-                and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
-                and l_quantity >= 10 and l_quantity <= 10 + 10
-                and p_size between 1 and 10
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        )
-        or
-        (
-                p_partkey = l_partkey
-                and p_brand = 'Brand#34'
-                and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
-                and l_quantity >= 20 and l_quantity <= 20 + 10
-                and p_size between 1 and 15
-                and l_shipmode in ('AIR', 'AIR REG')
-                and l_shipinstruct = 'DELIVER IN PERSON'
-        );
-    
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q19") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select
+                sum(l_extendedprice* (1 - l_discount)) as revenue
+        from
+                lineitem,
+                part
+        where
+        (
+                p_partkey = l_partkey
+                and p_brand = 'Brand#12'
+                and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
+                and l_quantity >= 1 and l_quantity <= 1 + 10
+                and p_size between 1 and 5
+                and l_shipmode in ('AIR', 'AIR REG')
+                and l_shipinstruct = 'DELIVER IN PERSON'
+        )
+        or
+        (
+                p_partkey = l_partkey
+                and p_brand = 'Brand#23'
+                and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
+                and l_quantity >= 10 and l_quantity <= 10 + 10
+                and p_size between 1 and 10
+                and l_shipmode in ('AIR', 'AIR REG')
+                and l_shipinstruct = 'DELIVER IN PERSON'
+        )
+        or
+        (
+                p_partkey = l_partkey
+                and p_brand = 'Brand#34'
+                and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
+                and l_quantity >= 20 and l_quantity <= 20 + 10
+                and p_size between 1 and 15
+                and l_shipmode in ('AIR', 'AIR REG')
+                and l_shipinstruct = 'DELIVER IN PERSON'
+        );
+    
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q2.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q2.groovy
index 3f53b17d53..088cd1b04a 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q2.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q2.groovy
@@ -30,11 +30,7 @@ suite("q2") {
 
 
     
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
+sql 'set be_number_for_test=3'
 
 
     qt_select """
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q20.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q20.groovy
index 8f045343cc..1a1f70c2dc 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q20.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q20.groovy
@@ -1,80 +1,76 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q20") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select 
-        s_name,
-        s_address
-        from
-        supplier,
-        nation
-        where
-        s_suppkey in (
-                select
-                ps_suppkey
-                from
-                partsupp
-                where
-                ps_partkey in (
-                        select
-                        p_partkey
-                        from
-                        part
-                        where
-                        p_name like 'forest%'
-                )
-                and ps_availqty > (
-                        select
-                        0.5 * sum(l_quantity)
-                        from
-                        lineitem
-                        where
-                        l_partkey = ps_partkey
-                        and l_suppkey = ps_suppkey
-                        and l_shipdate >= date '1994-01-01'
-                        and l_shipdate < date '1994-01-01' + interval '1' year
-                )
-        )
-        and s_nationkey = n_nationkey
-        and n_name = 'CANADA'
-        order by
-        s_name;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q20") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select 
+        s_name,
+        s_address
+        from
+        supplier,
+        nation
+        where
+        s_suppkey in (
+                select
+                ps_suppkey
+                from
+                partsupp
+                where
+                ps_partkey in (
+                        select
+                        p_partkey
+                        from
+                        part
+                        where
+                        p_name like 'forest%'
+                )
+                and ps_availqty > (
+                        select
+                        0.5 * sum(l_quantity)
+                        from
+                        lineitem
+                        where
+                        l_partkey = ps_partkey
+                        and l_suppkey = ps_suppkey
+                        and l_shipdate >= date '1994-01-01'
+                        and l_shipdate < date '1994-01-01' + interval '1' year
+                )
+        )
+        and s_nationkey = n_nationkey
+        and n_name = 'CANADA'
+        order by
+        s_name;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q21.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q21.groovy
index c5995655d2..b150b32013 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q21.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q21.groovy
@@ -1,82 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q21") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select
-                s_name,
-                count(*) as numwait
-        from
-                supplier,
-                lineitem l1,
-                orders,
-                nation
-        where
-        s_suppkey = l1.l_suppkey
-        and o_orderkey = l1.l_orderkey
-        and o_orderstatus = 'F'
-        and l1.l_receiptdate > l1.l_commitdate
-        and exists (
-                select
-                *
-                from
-                lineitem l2
-                where
-                l2.l_orderkey = l1.l_orderkey
-                and l2.l_suppkey <> l1.l_suppkey
-        )
-        and not exists (
-                select
-                *
-                from
-                lineitem l3
-                where
-                l3.l_orderkey = l1.l_orderkey
-                and l3.l_suppkey <> l1.l_suppkey
-                and l3.l_receiptdate > l3.l_commitdate
-        )
-        and s_nationkey = n_nationkey
-        and n_name = 'SAUDI ARABIA'
-        group by
-        s_name
-        order by
-        numwait desc,
-        s_name
-        limit 100;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q21") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select
+                s_name,
+                count(*) as numwait
+        from
+                supplier,
+                lineitem l1,
+                orders,
+                nation
+        where
+        s_suppkey = l1.l_suppkey
+        and o_orderkey = l1.l_orderkey
+        and o_orderstatus = 'F'
+        and l1.l_receiptdate > l1.l_commitdate
+        and exists (
+                select
+                *
+                from
+                lineitem l2
+                where
+                l2.l_orderkey = l1.l_orderkey
+                and l2.l_suppkey <> l1.l_suppkey
+        )
+        and not exists (
+                select
+                *
+                from
+                lineitem l3
+                where
+                l3.l_orderkey = l1.l_orderkey
+                and l3.l_suppkey <> l1.l_suppkey
+                and l3.l_receiptdate > l3.l_commitdate
+        )
+        and s_nationkey = n_nationkey
+        and n_name = 'SAUDI ARABIA'
+        group by
+        s_name
+        order by
+        numwait desc,
+        s_name
+        limit 100;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q22.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q22.groovy
index 61c4f5edf9..37e89e871f 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q22.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q22.groovy
@@ -1,79 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q22") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-    
-    qt_select """
-    explain shape plan
-        select 
-        cntrycode,
-        count(*) as numcust,
-        sum(c_acctbal) as totacctbal
-    from
-        (
-            select
-                substring(c_phone, 1, 2) as cntrycode,
-                c_acctbal
-            from
-                customer
-            where
-                substring(c_phone, 1, 2) in
-                    ('13', '31', '23', '29', '30', '18', '17')
-                and c_acctbal > (
-                    select
-                        avg(c_acctbal)
-                    from
-                        customer
-                    where
-                        c_acctbal > 0.00
-                        and substring(c_phone, 1, 2) in
-                            ('13', '31', '23', '29', '30', '18', '17')
-                )
-                and not exists (
-                    select
-                        *
-                    from
-                        orders
-                    where
-                        o_custkey = c_custkey
-                )
-        ) as custsale
-    group by
-        cntrycode
-    order by
-        cntrycode;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q22") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+sql 'set be_number_for_test=3'
+    
+    qt_select """
+    explain shape plan
+        select 
+        cntrycode,
+        count(*) as numcust,
+        sum(c_acctbal) as totacctbal
+    from
+        (
+            select
+                substring(c_phone, 1, 2) as cntrycode,
+                c_acctbal
+            from
+                customer
+            where
+                substring(c_phone, 1, 2) in
+                    ('13', '31', '23', '29', '30', '18', '17')
+                and c_acctbal > (
+                    select
+                        avg(c_acctbal)
+                    from
+                        customer
+                    where
+                        c_acctbal > 0.00
+                        and substring(c_phone, 1, 2) in
+                            ('13', '31', '23', '29', '30', '18', '17')
+                )
+                and not exists (
+                    select
+                        *
+                    from
+                        orders
+                    where
+                        o_custkey = c_custkey
+                )
+        ) as custsale
+    group by
+        cntrycode
+    order by
+        cntrycode;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q3.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q3.groovy
index df679dd4ac..9485dded9d 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q3.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q3.groovy
@@ -1,69 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q3") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    // db = "tpch"
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-
-        
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-
-    qt_select """
-    explain shape plan
-    select  
-        l_orderkey,
-        sum(l_extendedprice * (1 - l_discount)) as revenue,
-        o_orderdate,
-        o_shippriority
-    from
-        customer,
-        orders,
-        lineitem
-    where
-        c_mktsegment = 'BUILDING'
-        and c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and o_orderdate < date '1995-03-15'
-        and l_shipdate > date '1995-03-15'
-    group by
-        l_orderkey,
-        o_orderdate,
-        o_shippriority
-    order by
-        revenue desc,
-        o_orderdate
-    limit 10;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q3") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    // db = "tpch"
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+
+        
+sql 'set be_number_for_test=3'
+
+
+    qt_select """
+    explain shape plan
+    select  
+        l_orderkey,
+        sum(l_extendedprice * (1 - l_discount)) as revenue,
+        o_orderdate,
+        o_shippriority
+    from
+        customer,
+        orders,
+        lineitem
+    where
+        c_mktsegment = 'BUILDING'
+        and c_custkey = o_custkey
+        and l_orderkey = o_orderkey
+        and o_orderdate < date '1995-03-15'
+        and l_shipdate > date '1995-03-15'
+    group by
+        l_orderkey,
+        o_orderdate,
+        o_shippriority
+    order by
+        revenue desc,
+        o_orderdate
+    limit 10;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q4.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q4.groovy
index b799c684b6..3b24cfad87 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q4.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q4.groovy
@@ -1,65 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q4") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-
-
-    
-        
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-
-    qt_select """
-    explain shape plan
-    select  
-        o_orderpriority,
-        count(*) as order_count
-    from
-        orders
-    where
-        o_orderdate >= date '1993-07-01'
-        and o_orderdate < date '1993-07-01' + interval '3' month
-        and exists (
-            select
-                *
-            from
-                lineitem
-            where
-                l_orderkey = o_orderkey
-                and l_commitdate < l_receiptdate
-        )
-    group by
-        o_orderpriority
-    order by
-        o_orderpriority;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q4") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+
+
+    
+        
+sql 'set be_number_for_test=3'
+
+
+    qt_select """
+    explain shape plan
+    select  
+        o_orderpriority,
+        count(*) as order_count
+    from
+        orders
+    where
+        o_orderdate >= date '1993-07-01'
+        and o_orderdate < date '1993-07-01' + interval '3' month
+        and exists (
+            select
+                *
+            from
+                lineitem
+            where
+                l_orderkey = o_orderkey
+                and l_commitdate < l_receiptdate
+        )
+    group by
+        o_orderpriority
+    order by
+        o_orderpriority;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q5.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q5.groovy
index 4c1f11df7d..2c6b6b1b0c 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q5.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q5.groovy
@@ -1,63 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q5") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-        
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        n_name,
-        sum(l_extendedprice * (1 - l_discount)) as revenue
-    from
-        customer,
-        orders,
-        lineitem,
-        supplier,
-        nation,
-        region
-    where
-        c_custkey = o_custkey
-        and l_orderkey = o_orderkey
-        and l_suppkey = s_suppkey
-        and c_nationkey = s_nationkey
-        and s_nationkey = n_nationkey
-        and n_regionkey = r_regionkey
-        and r_name = 'ASIA'
-        and o_orderdate >= date '1994-01-01'
-        and o_orderdate < date '1994-01-01' + interval '1' year
-    group by
-        n_name
-    order by
-        revenue desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q5") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+        
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        n_name,
+        sum(l_extendedprice * (1 - l_discount)) as revenue
+    from
+        customer,
+        orders,
+        lineitem,
+        supplier,
+        nation,
+        region
+    where
+        c_custkey = o_custkey
+        and l_orderkey = o_orderkey
+        and l_suppkey = s_suppkey
+        and c_nationkey = s_nationkey
+        and s_nationkey = n_nationkey
+        and n_regionkey = r_regionkey
+        and r_name = 'ASIA'
+        and o_orderdate >= date '1994-01-01'
+        and o_orderdate < date '1994-01-01' + interval '1' year
+    group by
+        n_name
+    order by
+        revenue desc;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q6.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q6.groovy
index 197044b152..e217da7d0b 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q6.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q6.groovy
@@ -1,48 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q6") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set global exec_mem_limit = 21G'
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        sum(l_extendedprice * l_discount) as revenue
-    from
-        lineitem
-    where
-        l_shipdate >= date '1994-01-01'
-        and l_shipdate < date '1994-01-01' + interval '1' year
-        and l_discount between .06 - 0.01 and .06 + 0.01
-        and l_quantity < 24;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q6") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set global exec_mem_limit = 21G'
+    sql 'SET enable_pipeline_engine = true'
+
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        sum(l_extendedprice * l_discount) as revenue
+    from
+        lineitem
+    where
+        l_shipdate >= date '1994-01-01'
+        and l_shipdate < date '1994-01-01' + interval '1' year
+        and l_discount between .06 - 0.01 and .06 + 0.01
+        and l_quantity < 24;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q7.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q7.groovy
index 3bdab06070..8de4955cf3 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q7.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q7.groovy
@@ -1,78 +1,74 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q7") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-  
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        supp_nation,
-        cust_nation,
-        l_year,
-        sum(volume) as revenue
-    from
-        (
-            select
-                n1.n_name as supp_nation,
-                n2.n_name as cust_nation,
-                extract(year from l_shipdate) as l_year,
-                l_extendedprice * (1 - l_discount) as volume
-            from
-                supplier,
-                lineitem,
-                orders,
-                customer,
-                nation n1,
-                nation n2
-            where
-                s_suppkey = l_suppkey
-                and o_orderkey = l_orderkey
-                and c_custkey = o_custkey
-                and s_nationkey = n1.n_nationkey
-                and c_nationkey = n2.n_nationkey
-                and (
-                    (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
-                    or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
-                )
-                and l_shipdate between date '1995-01-01' and date '1996-12-31'
-        ) as shipping
-    group by
-        supp_nation,
-        cust_nation,
-        l_year
-    order by
-        supp_nation,
-        cust_nation,
-        l_year;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q7") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+  
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        supp_nation,
+        cust_nation,
+        l_year,
+        sum(volume) as revenue
+    from
+        (
+            select
+                n1.n_name as supp_nation,
+                n2.n_name as cust_nation,
+                extract(year from l_shipdate) as l_year,
+                l_extendedprice * (1 - l_discount) as volume
+            from
+                supplier,
+                lineitem,
+                orders,
+                customer,
+                nation n1,
+                nation n2
+            where
+                s_suppkey = l_suppkey
+                and o_orderkey = l_orderkey
+                and c_custkey = o_custkey
+                and s_nationkey = n1.n_nationkey
+                and c_nationkey = n2.n_nationkey
+                and (
+                    (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
+                    or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
+                )
+                and l_shipdate between date '1995-01-01' and date '1996-12-31'
+        ) as shipping
+    group by
+        supp_nation,
+        cust_nation,
+        l_year
+    order by
+        supp_nation,
+        cust_nation,
+        l_year;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q8.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q8.groovy
index 99355e881b..fd259539a7 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q8.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q8.groovy
@@ -1,75 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q8") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        o_year,
-        sum(case
-            when nation = 'BRAZIL' then volume
-            else 0
-        end) / sum(volume) as mkt_share
-    from
-        (
-            select
-                extract(year from o_orderdate) as o_year,
-                l_extendedprice * (1 - l_discount) as volume,
-                n2.n_name as nation
-            from
-                part,
-                supplier,
-                lineitem,
-                orders,
-                customer,
-                nation n1,
-                nation n2,
-                region
-            where
-                p_partkey = l_partkey
-                and s_suppkey = l_suppkey
-                and l_orderkey = o_orderkey
-                and o_custkey = c_custkey
-                and c_nationkey = n1.n_nationkey
-                and n1.n_regionkey = r_regionkey
-                and r_name = 'AMERICA'
-                and s_nationkey = n2.n_nationkey
-                and o_orderdate between date '1995-01-01' and date '1996-12-31'
-                and p_type = 'ECONOMY ANODIZED STEEL'
-        ) as all_nations
-    group by
-        o_year
-    order by
-        o_year;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q8") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        o_year,
+        sum(case
+            when nation = 'BRAZIL' then volume
+            else 0
+        end) / sum(volume) as mkt_share
+    from
+        (
+            select
+                extract(year from o_orderdate) as o_year,
+                l_extendedprice * (1 - l_discount) as volume,
+                n2.n_name as nation
+            from
+                part,
+                supplier,
+                lineitem,
+                orders,
+                customer,
+                nation n1,
+                nation n2,
+                region
+            where
+                p_partkey = l_partkey
+                and s_suppkey = l_suppkey
+                and l_orderkey = o_orderkey
+                and o_custkey = c_custkey
+                and c_nationkey = n1.n_nationkey
+                and n1.n_regionkey = r_regionkey
+                and r_name = 'AMERICA'
+                and s_nationkey = n2.n_nationkey
+                and o_orderdate between date '1995-01-01' and date '1996-12-31'
+                and p_type = 'ECONOMY ANODIZED STEEL'
+        ) as all_nations
+    group by
+        o_year
+    order by
+        o_year;
+    """
+}
diff --git a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q9.groovy b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q9.groovy
index 208d8cebe7..0d4f6207af 100644
--- a/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q9.groovy
+++ b/regression-test/suites/nereids_tpch_shape_sf500_p0/shape/q9.groovy
@@ -1,71 +1,67 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-suite("q9") {
-    String db = context.config.getDbNameByFile(new File(context.file.parent))
-    sql "use ${db}"
-    sql 'set enable_nereids_planner=true'
-    sql 'set enable_fallback_to_original_planner=false'
-    sql "set runtime_filter_mode='GLOBAL'"
-
-    sql 'set exec_mem_limit=21G' 
-    sql 'SET enable_pipeline_engine = true'
-
-    def result = sql "show backends;"
-    if (result.size() != 1) {
-        print("backends num: ${result.size()}");
-        return;
-    }
-
-    qt_select """
-    explain shape plan
-    select 
-        nation,
-        o_year,
-        sum(amount) as sum_profit
-    from
-        (
-            select
-                n_name as nation,
-                extract(year from o_orderdate) as o_year,
-                l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
-            from
-                part,
-                supplier,
-                lineitem,
-                partsupp,
-                orders,
-                nation
-            where
-                s_suppkey = l_suppkey
-                and ps_suppkey = l_suppkey
-                and ps_partkey = l_partkey
-                and p_partkey = l_partkey
-                and o_orderkey = l_orderkey
-                and s_nationkey = n_nationkey
-                and p_name like '%green%'
-        ) as profit
-    group by
-        nation,
-        o_year
-    order by
-        nation,
-        o_year desc;
-    """
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("q9") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql "set runtime_filter_mode='GLOBAL'"
+
+    sql 'set exec_mem_limit=21G' 
+    sql 'SET enable_pipeline_engine = true'
+
+sql 'set be_number_for_test=3'
+
+    qt_select """
+    explain shape plan
+    select 
+        nation,
+        o_year,
+        sum(amount) as sum_profit
+    from
+        (
+            select
+                n_name as nation,
+                extract(year from o_orderdate) as o_year,
+                l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
+            from
+                part,
+                supplier,
+                lineitem,
+                partsupp,
+                orders,
+                nation
+            where
+                s_suppkey = l_suppkey
+                and ps_suppkey = l_suppkey
+                and ps_partkey = l_partkey
+                and p_partkey = l_partkey
+                and o_orderkey = l_orderkey
+                and s_nationkey = n_nationkey
+                and p_name like '%green%'
+        ) as profit
+    group by
+        nation,
+        o_year
+    order by
+        nation,
+        o_year desc;
+    """
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 01/13: [opt](planner)(Nereids) add switch to determine if some unfixed functions will be folded on fe. (#20270)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 35f438ec74978baa37c578015aef3042096db73b
Author: mch_ucchi <41...@users.noreply.github.com>
AuthorDate: Fri Jun 9 18:18:56 2023 +0800

    [opt](planner)(Nereids) add switch to determine if some unfixed functions will be folded on fe. (#20270)
    
    add switch to determine if below functions could be folded on fe.
    - now()
    - current_date()
    - current_time()
    - unix_timestamp()
    - utc_timestamp()
    - uuid()
    - rand()
---
 .../apache/doris/analysis/ExpressionFunctions.java | 16 +++++++++++++++
 .../expression/rules/FoldConstantRuleOnFE.java     |  3 +++
 .../nereids/trees/expressions/Expression.java      |  5 -----
 .../trees/expressions/ExpressionEvaluator.java     |  2 +-
 .../doris/nereids/trees/expressions/Foldable.java  | 24 ----------------------
 .../expressions/functions/ExpressionTrait.java     |  4 ++++
 .../expressions/functions/Nondeterministic.java    | 10 ++++++++-
 .../expressions/functions/scalar/CurrentDate.java  |  3 +--
 .../expressions/functions/scalar/CurrentTime.java  |  3 +--
 .../functions/scalar/UnixTimestamp.java            | 11 +++++++++-
 .../java/org/apache/doris/qe/SessionVariable.java  | 13 ++++++++++++
 .../org/apache/doris/planner/QueryPlanTest.java    |  2 +-
 12 files changed, 59 insertions(+), 37 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java
index e39748b570..70f913e803 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java
@@ -31,6 +31,7 @@ import org.apache.doris.rewrite.FEFunctions;
 import com.google.common.base.Joiner;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import org.apache.logging.log4j.LogManager;
@@ -50,6 +51,15 @@ public enum ExpressionFunctions {
 
     private static final Logger LOG = LogManager.getLogger(ExpressionFunctions.class);
     private ImmutableMultimap<String, FEFunctionInvoker> functions;
+    private static final Set<String> unfixedFn = ImmutableSet.of(
+            "now",
+            "current_time",
+            "current_date",
+            "utc_timestamp",
+            "uuid",
+            "random",
+            "unix_timestamp"
+    );
 
     private ExpressionFunctions() {
         registerFunctions();
@@ -67,6 +77,12 @@ public enum ExpressionFunctions {
                 || constExpr instanceof FunctionCallExpr
                 || constExpr instanceof TimestampArithmeticExpr) {
             Function fn = constExpr.getFn();
+            if (ConnectContext.get() != null
+                    && ConnectContext.get().getSessionVariable() != null
+                    && !ConnectContext.get().getSessionVariable().isEnableFoldNondeterministicFn()
+                    && unfixedFn.contains(fn.getFunctionName().getFunction())) {
+                return constExpr;
+            }
 
             Preconditions.checkNotNull(fn, "Expr's fn can't be null.");
 
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java
index 55e86699a9..c427ea8ec9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java
@@ -327,6 +327,9 @@ public class FoldConstantRuleOnFE extends AbstractExpressionRewriteRule {
 
     @Override
     public Expression visitBoundFunction(BoundFunction boundFunction, ExpressionRewriteContext context) {
+        if (!boundFunction.foldable()) {
+            return boundFunction;
+        }
         boundFunction = rewriteChildren(boundFunction, context);
         Optional<Expression> checkedExpr = preProcess(boundFunction);
         if (checkedExpr.isPresent()) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java
index e58795e112..0d2772d768 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions;
 import org.apache.doris.nereids.analyzer.Unbound;
 import org.apache.doris.nereids.exceptions.AnalysisException;
 import org.apache.doris.nereids.trees.AbstractTreeNode;
-import org.apache.doris.nereids.trees.expressions.functions.BoundFunction;
 import org.apache.doris.nereids.trees.expressions.functions.ExpressionTrait;
 import org.apache.doris.nereids.trees.expressions.literal.Literal;
 import org.apache.doris.nereids.trees.expressions.literal.NullLiteral;
@@ -140,10 +139,6 @@ public abstract class Expression extends AbstractTreeNode<Expression> implements
      */
     public boolean isConstant() {
         if (this instanceof LeafExpression) {
-            if (this instanceof BoundFunction) {
-                BoundFunction function = ((BoundFunction) this);
-                return function instanceof Foldable;
-            }
             return this instanceof Literal;
         } else {
             return children().stream().allMatch(Expression::isConstant);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ExpressionEvaluator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ExpressionEvaluator.java
index b6b2441c99..0e7ef81cc4 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ExpressionEvaluator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ExpressionEvaluator.java
@@ -59,7 +59,7 @@ public enum ExpressionEvaluator {
      */
     public Expression eval(Expression expression) {
 
-        if (!expression.isConstant() || expression instanceof AggregateFunction) {
+        if (!(expression.isConstant() || expression.foldable()) || expression instanceof AggregateFunction) {
             return expression;
         }
 
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Foldable.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Foldable.java
deleted file mode 100644
index fae923dd86..0000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Foldable.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package org.apache.doris.nereids.trees.expressions;
-
-/**
- * specifically for bound function can be folded to constant.
- */
-public interface Foldable {
-}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExpressionTrait.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExpressionTrait.java
index 631a2922bc..f76e242dbb 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExpressionTrait.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/ExpressionTrait.java
@@ -72,4 +72,8 @@ public interface ExpressionTrait extends TreeNode<Expression> {
     default String toSql() throws UnboundException {
         throw new UnboundException("sql");
     }
+
+    default boolean foldable() {
+        return true;
+    }
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/Nondeterministic.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/Nondeterministic.java
index 8ad8149aea..8fd6335740 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/Nondeterministic.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/Nondeterministic.java
@@ -17,6 +17,8 @@
 
 package org.apache.doris.nereids.trees.expressions.functions;
 
+import org.apache.doris.qe.ConnectContext;
+
 /**
  * Nondeterministic functions.
  *
@@ -24,5 +26,11 @@ package org.apache.doris.nereids.trees.expressions.functions;
  *
  * note: no 'uuid' function currently.
  */
-public interface Nondeterministic {
+public interface Nondeterministic extends ExpressionTrait {
+    @Override
+    default boolean foldable() {
+        return ConnectContext.get() == null
+                || ConnectContext.get().getSessionVariable() == null
+                || ConnectContext.get().getSessionVariable().isEnableFoldNondeterministicFn();
+    }
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentDate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentDate.java
index d4bcfbee77..bca7ffd05c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentDate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentDate.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.expressions.functions.scalar;
 
 import org.apache.doris.catalog.FunctionSignature;
-import org.apache.doris.nereids.trees.expressions.Foldable;
 import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
 import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.functions.Nondeterministic;
@@ -34,7 +33,7 @@ import java.util.List;
  * ScalarFunction 'current_date'. This class is generated by GenerateFunction.
  */
 public class CurrentDate extends ScalarFunction
-        implements LeafExpression, ExplicitlyCastableSignature, Nondeterministic, AlwaysNotNullable, Foldable {
+        implements LeafExpression, ExplicitlyCastableSignature, Nondeterministic, AlwaysNotNullable {
 
     public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
             FunctionSignature.ret(DateType.INSTANCE).args()
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java
index 9bf190879b..2e09c36d85 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CurrentTime.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.expressions.functions.scalar;
 
 import org.apache.doris.catalog.FunctionSignature;
-import org.apache.doris.nereids.trees.expressions.Foldable;
 import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
 import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.functions.Nondeterministic;
@@ -34,7 +33,7 @@ import java.util.List;
  * ScalarFunction 'current_time'. This class is generated by GenerateFunction.
  */
 public class CurrentTime extends ScalarFunction
-        implements LeafExpression, ExplicitlyCastableSignature, Nondeterministic, AlwaysNotNullable, Foldable {
+        implements LeafExpression, ExplicitlyCastableSignature, Nondeterministic, AlwaysNotNullable {
 
     public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
             FunctionSignature.ret(TimeType.INSTANCE).args()
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java
index 2c33115d5b..20958dd45a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/UnixTimestamp.java
@@ -20,6 +20,7 @@ package org.apache.doris.nereids.trees.expressions.functions.scalar;
 import org.apache.doris.catalog.FunctionSignature;
 import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
+import org.apache.doris.nereids.trees.expressions.functions.Nondeterministic;
 import org.apache.doris.nereids.trees.expressions.functions.PropagateNullableOnDateLikeV2Args;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
 import org.apache.doris.nereids.types.DateTimeType;
@@ -39,7 +40,7 @@ import java.util.List;
  * ScalarFunction 'unix_timestamp'. This class is generated by GenerateFunction.
  */
 public class UnixTimestamp extends ScalarFunction
-        implements ExplicitlyCastableSignature, PropagateNullableOnDateLikeV2Args {
+        implements Nondeterministic, ExplicitlyCastableSignature, PropagateNullableOnDateLikeV2Args {
 
     private static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
             FunctionSignature.ret(IntegerType.INSTANCE).args(),
@@ -100,6 +101,14 @@ public class UnixTimestamp extends ScalarFunction
         }
     }
 
+    @Override
+    public boolean foldable() {
+        if (children.size() != 0) {
+            return true;
+        }
+        return Nondeterministic.super.foldable();
+    }
+
     @Override
     public List<FunctionSignature> getSignatures() {
         return SIGNATURES;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 3afbbaeb6d..34d24dfcc9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -240,6 +240,8 @@ public class SessionVariable implements Serializable, Writable {
 
     public static final String ENABLE_DPHYP_TRACE = "enable_dphyp_trace";
 
+    public static final String ENABLE_FOLD_NONDETERMINISTIC_FN = "enable_fold_nondeterministic_fn";
+
     public static final String ENABLE_RUNTIME_FILTER_PRUNE =
             "enable_runtime_filter_prune";
 
@@ -911,6 +913,9 @@ public class SessionVariable implements Serializable, Writable {
     @VariableMgr.VarAttr(name = ENABLE_MINIDUMP)
     public boolean enableMinidump = false;
 
+    @VariableMgr.VarAttr(name = ENABLE_FOLD_NONDETERMINISTIC_FN)
+    public boolean enableFoldNondeterministicFn = true;
+
     @VariableMgr.VarAttr(name = TRACE_NEREIDS)
     public boolean traceNereids = false;
 
@@ -1703,6 +1708,14 @@ public class SessionVariable implements Serializable, Writable {
         this.enablePartitionTopN = enablePartitionTopN;
     }
 
+    public boolean isEnableFoldNondeterministicFn() {
+        return enableFoldNondeterministicFn;
+    }
+
+    public void setEnableFoldNondeterministicFn(boolean enableFoldNondeterministicFn) {
+        this.enableFoldNondeterministicFn = enableFoldNondeterministicFn;
+    }
+
     public boolean isReturnObjectDataAsBinary() {
         return returnObjectDataAsBinary;
     }
diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index 79f2b50871..ac4373a490 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -855,7 +855,7 @@ public class QueryPlanTest extends TestWithFeService {
                 + "from test.test1 "
                 + "where time_col = case when date_format(now(),'%H%i')  < 123 then date_format(date_sub("
                 + "now(),2),'%Y%m%d') else date_format(date_sub(now(),1),'%Y%m%d') end";
-        Assert.assertTrue(!StringUtils.containsIgnoreCase(getSQLPlanOrErrorMsg("explain " + caseWhenSql),
+        Assert.assertFalse(StringUtils.containsIgnoreCase(getSQLPlanOrErrorMsg("explain " + caseWhenSql),
                 "CASE WHEN"));
 
         // test 1: case when then


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 06/13: [Improvement](column) reduce cache miss for data copy (#20583)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 46e2277a304399a2ff77a41adcd82c26bb1eae94
Author: Gabriel <ga...@gmail.com>
AuthorDate: Fri Jun 9 13:10:57 2023 +0800

    [Improvement](column) reduce cache miss for data copy (#20583)
---
 be/src/vec/columns/column.h              | 1 +
 be/src/vec/columns/column_decimal.h      | 3 +++
 be/src/vec/columns/column_string.cpp     | 3 +++
 be/src/vec/columns/column_string.h       | 5 +++++
 be/src/vec/columns/column_vector.cpp     | 6 ++++++
 be/src/vec/exec/join/vhash_join_node.cpp | 4 ++--
 6 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/columns/column.h b/be/src/vec/columns/column.h
index 8bf83b533c..00f1824b99 100644
--- a/be/src/vec/columns/column.h
+++ b/be/src/vec/columns/column.h
@@ -98,6 +98,7 @@ protected:
     using Offsets64 = PaddedPODArray<Offset64>;
 
 public:
+    static constexpr int PREFETCH_STEP = 64;
     // 32bit offsets for string
     using Offset = UInt32;
     using Offsets = PaddedPODArray<Offset>;
diff --git a/be/src/vec/columns/column_decimal.h b/be/src/vec/columns/column_decimal.h
index 26a9abde9a..f935c0c826 100644
--- a/be/src/vec/columns/column_decimal.h
+++ b/be/src/vec/columns/column_decimal.h
@@ -129,6 +129,9 @@ public:
         const T* src_data = reinterpret_cast<const T*>(src.get_raw_data().data);
 
         for (int i = 0; i < new_size; ++i) {
+            if (i + IColumn::PREFETCH_STEP < new_size) {
+                __builtin_prefetch(&src_data[indices_begin[i + IColumn::PREFETCH_STEP]], 0, 1);
+            }
             data[origin_size + i] = src_data[indices_begin[i]];
         }
     }
diff --git a/be/src/vec/columns/column_string.cpp b/be/src/vec/columns/column_string.cpp
index 66fec57787..81ee29a70f 100644
--- a/be/src/vec/columns/column_string.cpp
+++ b/be/src/vec/columns/column_string.cpp
@@ -113,6 +113,9 @@ void ColumnString::insert_indices_from(const IColumn& src, const int* indices_be
         if (*x == -1) {
             ColumnString::insert_default();
         } else {
+            if (x + IColumn::PREFETCH_STEP < indices_end) {
+                ColumnString::prefetch(src, *(x + IColumn::PREFETCH_STEP));
+            }
             ColumnString::insert_from(src, *x);
         }
     }
diff --git a/be/src/vec/columns/column_string.h b/be/src/vec/columns/column_string.h
index 06e8914907..66d0a77e5d 100644
--- a/be/src/vec/columns/column_string.h
+++ b/be/src/vec/columns/column_string.h
@@ -149,6 +149,11 @@ public:
         offsets.push_back(new_size);
     }
 
+    void prefetch(const IColumn& src_, size_t n) {
+        const ColumnString& src = assert_cast<const ColumnString&>(src_);
+        __builtin_prefetch(&src.chars[src.offsets[n - 1]], 0, 1);
+    }
+
     void insert_from(const IColumn& src_, size_t n) override {
         const ColumnString& src = assert_cast<const ColumnString&>(src_);
         const size_t size_to_append =
diff --git a/be/src/vec/columns/column_vector.cpp b/be/src/vec/columns/column_vector.cpp
index 388b436bc5..35534d95e7 100644
--- a/be/src/vec/columns/column_vector.cpp
+++ b/be/src/vec/columns/column_vector.cpp
@@ -376,12 +376,18 @@ void ColumnVector<T>::insert_indices_from(const IColumn& src, const int* indices
     if constexpr (std::is_same_v<T, UInt8>) {
         // nullmap : indices_begin[i] == -1 means is null at the here, set true here
         for (int i = 0; i < new_size; ++i) {
+            if (i + IColumn::PREFETCH_STEP < new_size) {
+                __builtin_prefetch(&src_data[indices_begin[i + IColumn::PREFETCH_STEP]], 0, 1);
+            }
             data[origin_size + i] = (indices_begin[i] == -1) +
                                     (indices_begin[i] != -1) * src_data[indices_begin[i]];
         }
     } else {
         // real data : indices_begin[i] == -1 what at is meaningless
         for (int i = 0; i < new_size; ++i) {
+            if (i + IColumn::PREFETCH_STEP < new_size) {
+                __builtin_prefetch(&src_data[indices_begin[i + IColumn::PREFETCH_STEP]], 0, 1);
+            }
             data[origin_size + i] = src_data[indices_begin[i]];
         }
     }
diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp
index c2b9d915ec..e47cda7d1d 100644
--- a/be/src/vec/exec/join/vhash_join_node.cpp
+++ b/be/src/vec/exec/join/vhash_join_node.cpp
@@ -469,6 +469,8 @@ Status HashJoinNode::prepare(RuntimeState* state) {
     _build_rows_counter = ADD_COUNTER(record_profile, "BuildRows", TUnit::UNIT);
     _build_side_compute_hash_timer = ADD_TIMER(record_profile, "BuildSideHashComputingTime");
     _build_runtime_filter_timer = ADD_TIMER(record_profile, "BuildRuntimeFilterTime");
+    _push_down_timer = ADD_TIMER(record_profile, "PublishRuntimeFilterTime");
+    _push_compute_timer = ADD_TIMER(record_profile, "PushDownComputeTime");
 
     // Probe phase
     auto probe_phase_profile = runtime_profile()->create_child("ProbePhase", true, true);
@@ -484,8 +486,6 @@ Status HashJoinNode::prepare(RuntimeState* state) {
     _open_timer = ADD_TIMER(runtime_profile(), "OpenTime");
     _allocate_resource_timer = ADD_TIMER(runtime_profile(), "AllocateResourceTime");
 
-    _push_down_timer = ADD_TIMER(runtime_profile(), "PublishRuntimeFilterTime");
-    _push_compute_timer = ADD_TIMER(runtime_profile(), "PushDownComputeTime");
     _build_buckets_counter = ADD_COUNTER(runtime_profile(), "BuildBuckets", TUnit::UNIT);
     _build_buckets_fill_counter = ADD_COUNTER(runtime_profile(), "FilledBuckets", TUnit::UNIT);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 10/13: [opt](Nereids) remove running in OptimizeGroup to avoid recompute on it parent (#20608)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 8ec410794a4d16f40320942a141d641031d498e4
Author: morrySnow <10...@users.noreply.github.com>
AuthorDate: Fri Jun 9 19:16:39 2023 +0800

    [opt](Nereids) remove running in OptimizeGroup to avoid recompute on it parent (#20608)
    
    we have some prunning path logical in cascades framework. However it do not work as we expected. if we do prunning on one Group, then maybe we need to do thousands of times optimization on its parent without any success result. This PR remove these prunning provisionally. We will add prunning back when we re-design it.
---
 .../nereids/jobs/cascades/OptimizeGroupJob.java    |  3 +-
 .../nereids_tpcds_shape_sf100_p0/shape/query33.out | 44 +++++++++++-----------
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
index 2bda4ce569..88200d227c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/OptimizeGroupJob.java
@@ -42,8 +42,7 @@ public class OptimizeGroupJob extends Job {
     @Override
     public void execute() {
         COUNTER_TRACER.log(CounterEvent.of(Memo.getStateId(), CounterType.JOB_EXECUTION, group, null, null));
-        if (group.getCostLowerBound() > context.getCostUpperBound()
-                || group.getLowestCostPlan(context.getRequiredProperties()).isPresent()) {
+        if (group.getLowestCostPlan(context.getRequiredProperties()).isPresent()) {
             return;
         }
         if (!group.isExplored()) {
diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out
index cd1a4d6dbb..559cbef994 100644
--- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out
+++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query33.out
@@ -8,32 +8,32 @@ PhysicalTopN
 ----------hashAgg[LOCAL]
 ------------PhysicalUnion
 --------------PhysicalProject
-----------------hashAgg[GLOBAL]
-------------------PhysicalDistribute
---------------------hashAgg[LOCAL]
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk)
---------------------------PhysicalProject
-----------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk)
-------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk)
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[store_sales]
+----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id)
+------------------hashAgg[GLOBAL]
+--------------------PhysicalDistribute
+----------------------hashAgg[LOCAL]
+------------------------PhysicalProject
+--------------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk)
+----------------------------PhysicalProject
+------------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk)
+--------------------------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk)
+----------------------------------PhysicalProject
+------------------------------------PhysicalOlapScan[store_sales]
+----------------------------------PhysicalDistribute
+------------------------------------PhysicalProject
+--------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002))
+----------------------------------------PhysicalOlapScan[date_dim]
 --------------------------------PhysicalDistribute
 ----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_moy = 1)(date_dim.d_year = 2002))
---------------------------------------PhysicalOlapScan[date_dim]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((customer_address.ca_gmt_offset = -5.00))
-------------------------------------PhysicalOlapScan[customer_address]
---------------------------PhysicalDistribute
-----------------------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id)
+------------------------------------filter((customer_address.ca_gmt_offset = -5.00))
+--------------------------------------PhysicalOlapScan[customer_address]
+----------------------------PhysicalDistribute
 ------------------------------PhysicalProject
 --------------------------------PhysicalOlapScan[item]
-------------------------------PhysicalDistribute
---------------------------------PhysicalProject
-----------------------------------filter((item.i_category = 'Home'))
-------------------------------------PhysicalOlapScan[item]
+------------------PhysicalDistribute
+--------------------PhysicalProject
+----------------------filter((item.i_category = 'Home'))
+------------------------PhysicalOlapScan[item]
 --------------PhysicalProject
 ----------------hashJoin[LEFT_SEMI_JOIN](item.i_manufact_id = item.i_manufact_id)
 ------------------hashAgg[GLOBAL]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 04/13: [enhancement](stats) Forbid unknown stats check for internal_column (#20535)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 2121aa64601804bd272ecf2ba0cbe0bc5a3595ff
Author: AKIRA <33...@users.noreply.github.com>
AuthorDate: Fri Jun 9 17:16:11 2023 +0900

    [enhancement](stats) Forbid unknown stats check for internal_column (#20535)
    
    Ignore internal columns when enable new optimizer and forbid unknown stats
---
 .../org/apache/doris/nereids/stats/StatsCalculator.java    | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java
index 77499198f2..34ed4c242e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java
@@ -17,6 +17,7 @@
 
 package org.apache.doris.nereids.stats;
 
+import org.apache.doris.catalog.Column;
 import org.apache.doris.catalog.Env;
 import org.apache.doris.catalog.OlapTable;
 import org.apache.doris.catalog.SchemaTable;
@@ -562,7 +563,7 @@ public class StatsCalculator extends DefaultPlanVisitor<Statistics, Void> {
                         .build();
             }
             if (cache.isUnKnown) {
-                if (forbidUnknownColStats && !ignoreUnknownColStatsCheck(table, slotReference)) {
+                if (forbidUnknownColStats && !ignoreUnknownColStatsCheck(table, slotReference.getColumn().get())) {
                     if (StatisticsUtil.statsTblAvailable()) {
                         throw new AnalysisException(String.format("Found unknown stats for column:%s.%s.\n"
                                 + "It may caused by:\n"
@@ -980,17 +981,16 @@ public class StatsCalculator extends DefaultPlanVisitor<Statistics, Void> {
         return groupExpression.childStatistics(1);
     }
 
-    private boolean ignoreUnknownColStatsCheck(TableIf tableIf, SlotReference slot) {
+    private boolean ignoreUnknownColStatsCheck(TableIf tableIf, Column c) {
         if (tableIf instanceof SchemaTable) {
             return true;
         }
         if (tableIf instanceof OlapTable) {
             OlapTable olapTable = (OlapTable) tableIf;
-            return StatisticConstants.STATISTICS_DB_BLACK_LIST.contains(olapTable.getQualifiedDbName());
-        }
-        if (slot.getColumn().isPresent() && slot.getColumn().get().isVisible()) {
-            return true;
+            if (StatisticConstants.STATISTICS_DB_BLACK_LIST.contains(olapTable.getQualifiedDbName())) {
+                return true;
+            }
         }
-        return false;
+        return !c.isVisible();
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 05/13: [improvement](exception-safe) create and prepare node/sink support exception safe (#20551)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 99615e31cbaf1fd8ca3df501c6bf9d800a50eb00
Author: Xinyi Zou <zo...@gmail.com>
AuthorDate: Fri Jun 9 21:06:59 2023 +0800

    [improvement](exception-safe) create and prepare node/sink support exception safe (#20551)
---
 be/src/common/exception.h                          | 22 ++++++++++
 be/src/exec/data_sink.cpp                          | 49 ++++++++--------------
 be/src/olap/rowset/segment_v2/page_io.cpp          |  2 +-
 be/src/pipeline/pipeline_fragment_context.cpp      |  2 +-
 be/src/runtime/plan_fragment_executor.cpp          | 13 +++---
 be/src/vec/core/block.cpp                          |  4 +-
 be/src/vec/data_types/data_type_decimal.cpp        | 11 +++--
 be/src/vec/data_types/data_type_time_v2.cpp        |  4 +-
 be/src/vec/exec/format/orc/vorc_reader.cpp         |  4 +-
 .../exec/format/parquet/vparquet_group_reader.cpp  |  4 +-
 be/src/vec/exec/scan/vfile_scanner.cpp             | 13 ++----
 be/src/vec/exec/vsort_node.cpp                     |  4 +-
 12 files changed, 70 insertions(+), 62 deletions(-)

diff --git a/be/src/common/exception.h b/be/src/common/exception.h
index 55eef571bc..3166d83844 100644
--- a/be/src/common/exception.h
+++ b/be/src/common/exception.h
@@ -92,3 +92,25 @@ inline std::string Exception::to_string() const {
             }                                                                                    \
         }                                                                                        \
     } while (0)
+
+#define RETURN_IF_ERROR_OR_CATCH_EXCEPTION(stmt)                                                 \
+    do {                                                                                         \
+        try {                                                                                    \
+            doris::enable_thread_catch_bad_alloc++;                                              \
+            Defer defer {[&]() { doris::enable_thread_catch_bad_alloc--; }};                     \
+            {                                                                                    \
+                Status _status_ = (stmt);                                                        \
+                if (UNLIKELY(!_status_.ok())) {                                                  \
+                    return _status_;                                                             \
+                }                                                                                \
+            }                                                                                    \
+        } catch (const doris::Exception& e) {                                                    \
+            if (e.code() == doris::ErrorCode::MEM_ALLOC_FAILED) {                                \
+                return Status::MemoryLimitExceeded(fmt::format(                                  \
+                        "PreCatch error code:{}, {}, __FILE__:{}, __LINE__:{}, __FUNCTION__:{}", \
+                        e.code(), e.to_string(), __FILE__, __LINE__, __PRETTY_FUNCTION__));      \
+            } else {                                                                             \
+                return Status::Error(e.code(), e.to_string());                                   \
+            }                                                                                    \
+        }                                                                                        \
+    } while (0)
diff --git a/be/src/exec/data_sink.cpp b/be/src/exec/data_sink.cpp
index b0d75067e0..c5d5446611 100644
--- a/be/src/exec/data_sink.cpp
+++ b/be/src/exec/data_sink.cpp
@@ -50,8 +50,6 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
                                   const TPlanFragmentExecParams& params,
                                   const RowDescriptor& row_desc, RuntimeState* state,
                                   std::unique_ptr<DataSink>* sink, DescriptorTbl& desc_tbl) {
-    DataSink* tmp_sink = nullptr;
-
     switch (thrift_sink.type) {
     case TDataSinkType::DATA_STREAM_SINK: {
         if (!thrift_sink.__isset.stream_sink) {
@@ -62,11 +60,10 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
                         ? params.send_query_statistics_with_every_batch
                         : false;
         // TODO: figure out good buffer size based on size of output row
-        tmp_sink = new vectorized::VDataStreamSender(
+        sink->reset(new vectorized::VDataStreamSender(
                 state, pool, params.sender_id, row_desc, thrift_sink.stream_sink,
-                params.destinations, 16 * 1024, send_query_statistics_with_every_batch);
+                params.destinations, 16 * 1024, send_query_statistics_with_every_batch));
         // RETURN_IF_ERROR(sender->prepare(state->obj_pool(), thrift_sink.stream_sink));
-        sink->reset(tmp_sink);
         break;
     }
     case TDataSinkType::RESULT_SINK: {
@@ -75,9 +72,8 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
         }
 
         // TODO: figure out good buffer size based on size of output row
-        tmp_sink = new doris::vectorized::VResultSink(row_desc, output_exprs,
-                                                      thrift_sink.result_sink, 4096);
-        sink->reset(tmp_sink);
+        sink->reset(new doris::vectorized::VResultSink(row_desc, output_exprs,
+                                                       thrift_sink.result_sink, 4096));
         break;
     }
     case TDataSinkType::RESULT_FILE_SINK: {
@@ -92,17 +88,15 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
                         : false;
         // Result file sink is not the top sink
         if (params.__isset.destinations && params.destinations.size() > 0) {
-            tmp_sink = new doris::vectorized::VResultFileSink(
+            sink->reset(new doris::vectorized::VResultFileSink(
                     pool, params.sender_id, row_desc, thrift_sink.result_file_sink,
                     params.destinations, 16 * 1024, send_query_statistics_with_every_batch,
-                    output_exprs, desc_tbl);
+                    output_exprs, desc_tbl));
         } else {
-            tmp_sink = new doris::vectorized::VResultFileSink(
+            sink->reset(new doris::vectorized::VResultFileSink(
                     pool, row_desc, thrift_sink.result_file_sink, 16 * 1024,
-                    send_query_statistics_with_every_batch, output_exprs);
+                    send_query_statistics_with_every_batch, output_exprs));
         }
-
-        sink->reset(tmp_sink);
         break;
     }
     case TDataSinkType::MEMORY_SCRATCH_SINK: {
@@ -110,8 +104,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
             return Status::InternalError("Missing data buffer sink.");
         }
 
-        tmp_sink = new vectorized::MemoryScratchSink(row_desc, output_exprs);
-        sink->reset(tmp_sink);
+        sink->reset(new vectorized::MemoryScratchSink(row_desc, output_exprs));
         break;
     }
     case TDataSinkType::MYSQL_TABLE_SINK: {
@@ -193,7 +186,6 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
                                   const size_t& local_param_idx, const RowDescriptor& row_desc,
                                   RuntimeState* state, std::unique_ptr<DataSink>* sink,
                                   DescriptorTbl& desc_tbl) {
-    DataSink* tmp_sink = nullptr;
     const auto& local_params = params.local_params[local_param_idx];
     switch (thrift_sink.type) {
     case TDataSinkType::DATA_STREAM_SINK: {
@@ -205,11 +197,10 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
                         ? params.send_query_statistics_with_every_batch
                         : false;
         // TODO: figure out good buffer size based on size of output row
-        tmp_sink = new vectorized::VDataStreamSender(
+        sink->reset(new vectorized::VDataStreamSender(
                 state, pool, local_params.sender_id, row_desc, thrift_sink.stream_sink,
-                params.destinations, 16 * 1024, send_query_statistics_with_every_batch);
+                params.destinations, 16 * 1024, send_query_statistics_with_every_batch));
         // RETURN_IF_ERROR(sender->prepare(state->obj_pool(), thrift_sink.stream_sink));
-        sink->reset(tmp_sink);
         break;
     }
     case TDataSinkType::RESULT_SINK: {
@@ -218,9 +209,8 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
         }
 
         // TODO: figure out good buffer size based on size of output row
-        tmp_sink = new doris::vectorized::VResultSink(row_desc, output_exprs,
-                                                      thrift_sink.result_sink, 4096);
-        sink->reset(tmp_sink);
+        sink->reset(new doris::vectorized::VResultSink(row_desc, output_exprs,
+                                                       thrift_sink.result_sink, 4096));
         break;
     }
     case TDataSinkType::RESULT_FILE_SINK: {
@@ -235,17 +225,15 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
                         : false;
         // Result file sink is not the top sink
         if (params.__isset.destinations && params.destinations.size() > 0) {
-            tmp_sink = new doris::vectorized::VResultFileSink(
+            sink->reset(new doris::vectorized::VResultFileSink(
                     pool, local_params.sender_id, row_desc, thrift_sink.result_file_sink,
                     params.destinations, 16 * 1024, send_query_statistics_with_every_batch,
-                    output_exprs, desc_tbl);
+                    output_exprs, desc_tbl));
         } else {
-            tmp_sink = new doris::vectorized::VResultFileSink(
+            sink->reset(new doris::vectorized::VResultFileSink(
                     pool, row_desc, thrift_sink.result_file_sink, 16 * 1024,
-                    send_query_statistics_with_every_batch, output_exprs);
+                    send_query_statistics_with_every_batch, output_exprs));
         }
-
-        sink->reset(tmp_sink);
         break;
     }
     case TDataSinkType::MEMORY_SCRATCH_SINK: {
@@ -253,8 +241,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
             return Status::InternalError("Missing data buffer sink.");
         }
 
-        tmp_sink = new vectorized::MemoryScratchSink(row_desc, output_exprs);
-        sink->reset(tmp_sink);
+        sink->reset(new vectorized::MemoryScratchSink(row_desc, output_exprs));
         break;
     }
     case TDataSinkType::MYSQL_TABLE_SINK: {
diff --git a/be/src/olap/rowset/segment_v2/page_io.cpp b/be/src/olap/rowset/segment_v2/page_io.cpp
index 2f27375fe5..3016542372 100644
--- a/be/src/olap/rowset/segment_v2/page_io.cpp
+++ b/be/src/olap/rowset/segment_v2/page_io.cpp
@@ -51,7 +51,7 @@ Status PageIO::compress_page_body(BlockCompressionCodec* codec, double min_space
     size_t uncompressed_size = Slice::compute_total_size(body);
     if (codec != nullptr && !codec->exceed_max_compress_len(uncompressed_size)) {
         faststring buf;
-        RETURN_IF_CATCH_EXCEPTION(RETURN_IF_ERROR(codec->compress(body, uncompressed_size, &buf)));
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(codec->compress(body, uncompressed_size, &buf));
         double space_saving = 1.0 - static_cast<double>(buf.size()) / uncompressed_size;
         // return compressed body only when it saves more than min_space_saving
         if (space_saving > 0 && space_saving >= min_space_saving) {
diff --git a/be/src/pipeline/pipeline_fragment_context.cpp b/be/src/pipeline/pipeline_fragment_context.cpp
index ebb30fe384..edf0dc20cd 100644
--- a/be/src/pipeline/pipeline_fragment_context.cpp
+++ b/be/src/pipeline/pipeline_fragment_context.cpp
@@ -309,7 +309,7 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re
     _runtime_state->set_num_per_fragment_instances(request.num_senders);
 
     if (request.fragment.__isset.output_sink) {
-        RETURN_IF_ERROR(DataSink::create_data_sink(
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(DataSink::create_data_sink(
                 _runtime_state->obj_pool(), request.fragment.output_sink,
                 request.fragment.output_exprs, request, idx, _root_plan->row_desc(),
                 _runtime_state.get(), &_sink, *desc_tbl));
diff --git a/be/src/runtime/plan_fragment_executor.cpp b/be/src/runtime/plan_fragment_executor.cpp
index 079719927b..49b1afdc50 100644
--- a/be/src/runtime/plan_fragment_executor.cpp
+++ b/be/src/runtime/plan_fragment_executor.cpp
@@ -160,8 +160,8 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request,
 
     // set up plan
     DCHECK(request.__isset.fragment);
-    RETURN_IF_ERROR(ExecNode::create_tree(_runtime_state.get(), obj_pool(), request.fragment.plan,
-                                          *desc_tbl, &_plan));
+    RETURN_IF_ERROR_OR_CATCH_EXCEPTION(ExecNode::create_tree(
+            _runtime_state.get(), obj_pool(), request.fragment.plan, *desc_tbl, &_plan));
 
     // set #senders of exchange nodes before calling Prepare()
     std::vector<ExecNode*> exch_nodes;
@@ -173,6 +173,7 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request,
         static_cast<doris::vectorized::VExchangeNode*>(exch_node)->set_num_senders(num_senders);
     }
 
+    // TODO Is it exception safe?
     RETURN_IF_ERROR(_plan->prepare(_runtime_state.get()));
     // set scan ranges
     std::vector<ExecNode*> scan_nodes;
@@ -211,10 +212,10 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request,
 
     // set up sink, if required
     if (request.fragment.__isset.output_sink) {
-        RETURN_IF_ERROR(DataSink::create_data_sink(obj_pool(), request.fragment.output_sink,
-                                                   request.fragment.output_exprs, params,
-                                                   row_desc(), runtime_state(), &_sink, *desc_tbl));
-        RETURN_IF_ERROR(_sink->prepare(runtime_state()));
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(DataSink::create_data_sink(
+                obj_pool(), request.fragment.output_sink, request.fragment.output_exprs, params,
+                row_desc(), runtime_state(), &_sink, *desc_tbl));
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_sink->prepare(runtime_state()));
 
         RuntimeProfile* sink_profile = _sink->profile();
         if (sink_profile != nullptr) {
diff --git a/be/src/vec/core/block.cpp b/be/src/vec/core/block.cpp
index 2422ca9b16..caa5d2acd5 100644
--- a/be/src/vec/core/block.cpp
+++ b/be/src/vec/core/block.cpp
@@ -828,8 +828,8 @@ Status Block::serialize(int be_exec_version, PBlock* pblock,
         RETURN_IF_ERROR(get_block_compression_codec(compression_type, &codec));
 
         faststring buf_compressed;
-        RETURN_IF_CATCH_EXCEPTION(RETURN_IF_ERROR(codec->compress(
-                Slice(column_values.data(), content_uncompressed_size), &buf_compressed)));
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(codec->compress(
+                Slice(column_values.data(), content_uncompressed_size), &buf_compressed));
         size_t compressed_size = buf_compressed.size();
         if (LIKELY(compressed_size < content_uncompressed_size)) {
             pblock->set_column_values(buf_compressed.data(), buf_compressed.size());
diff --git a/be/src/vec/data_types/data_type_decimal.cpp b/be/src/vec/data_types/data_type_decimal.cpp
index c3bafba8aa..cf31bd1e40 100644
--- a/be/src/vec/data_types/data_type_decimal.cpp
+++ b/be/src/vec/data_types/data_type_decimal.cpp
@@ -164,13 +164,16 @@ bool DataTypeDecimal<T>::parse_from_string(const std::string& str, T* res) const
 DataTypePtr create_decimal(UInt64 precision_value, UInt64 scale_value, bool use_v2) {
     if (precision_value < min_decimal_precision() ||
         precision_value > max_decimal_precision<Decimal128>()) {
-        LOG(WARNING) << "Wrong precision " << precision_value;
-        return nullptr;
+        throw doris::Exception(doris::ErrorCode::NOT_IMPLEMENTED_ERROR,
+                               "Wrong precision {}, min: {}, max: {}", precision_value,
+                               min_decimal_precision(), max_decimal_precision<Decimal128>());
     }
 
     if (static_cast<UInt64>(scale_value) > precision_value) {
-        LOG(WARNING) << "Negative scales and scales larger than precision are not supported";
-        return nullptr;
+        throw doris::Exception(doris::ErrorCode::NOT_IMPLEMENTED_ERROR,
+                               "Negative scales and scales larger than precision are not "
+                               "supported, scale_value: {}, precision_value: {}",
+                               scale_value, precision_value);
     }
 
     if (use_v2) {
diff --git a/be/src/vec/data_types/data_type_time_v2.cpp b/be/src/vec/data_types/data_type_time_v2.cpp
index 8baf8a6776..e5b537ca34 100644
--- a/be/src/vec/data_types/data_type_time_v2.cpp
+++ b/be/src/vec/data_types/data_type_time_v2.cpp
@@ -202,8 +202,8 @@ void DataTypeDateTimeV2::cast_to_date_v2(const UInt64 from, UInt32& to) {
 
 DataTypePtr create_datetimev2(UInt64 scale_value) {
     if (scale_value > 6) {
-        LOG(WARNING) << "Wrong scale " << scale_value;
-        return nullptr;
+        throw doris::Exception(doris::ErrorCode::NOT_IMPLEMENTED_ERROR, "scale_value > 6 {}",
+                               scale_value);
     }
     return std::make_shared<DataTypeDateTimeV2>(scale_value);
 }
diff --git a/be/src/vec/exec/format/orc/vorc_reader.cpp b/be/src/vec/exec/format/orc/vorc_reader.cpp
index 945cf09087..c3d80b6422 100644
--- a/be/src/vec/exec/format/orc/vorc_reader.cpp
+++ b/be/src/vec/exec/format/orc/vorc_reader.cpp
@@ -1302,8 +1302,8 @@ Status OrcReader::filter(orc::ColumnVectorBatch& data, uint16_t* sel, uint16_t s
     for (auto& conjunct : _lazy_read_ctx.conjuncts) {
         filter_conjuncts.push_back(conjunct);
     }
-    RETURN_IF_CATCH_EXCEPTION(RETURN_IF_ERROR(VExprContext::execute_conjuncts(
-            filter_conjuncts, nullptr, block, _filter.get(), &can_filter_all)));
+    RETURN_IF_ERROR_OR_CATCH_EXCEPTION(VExprContext::execute_conjuncts(
+            filter_conjuncts, nullptr, block, _filter.get(), &can_filter_all));
 
     if (_lazy_read_ctx.resize_first_column) {
         block->get_by_position(0).column->assume_mutable()->clear();
diff --git a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp
index b50dc1d0e0..06dd72eb7b 100644
--- a/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp
+++ b/be/src/vec/exec/format/parquet/vparquet_group_reader.cpp
@@ -785,8 +785,8 @@ Status RowGroupReader::_rewrite_dict_predicates() {
             // The following process may be tricky and time-consuming, but we have no other way.
             temp_block.get_by_position(0).column->assume_mutable()->resize(dict_value_column_size);
         }
-        RETURN_IF_CATCH_EXCEPTION(RETURN_IF_ERROR(VExprContext::execute_conjuncts_and_filter_block(
-                ctxs, nullptr, &temp_block, columns_to_filter, column_to_keep)));
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(VExprContext::execute_conjuncts_and_filter_block(
+                ctxs, nullptr, &temp_block, columns_to_filter, column_to_keep));
         if (dict_pos != 0) {
             // We have to clean the first column to insert right data.
             temp_block.get_by_position(0).column->assume_mutable()->clear();
diff --git a/be/src/vec/exec/scan/vfile_scanner.cpp b/be/src/vec/exec/scan/vfile_scanner.cpp
index b0faa7f799..43fe98ea04 100644
--- a/be/src/vec/exec/scan/vfile_scanner.cpp
+++ b/be/src/vec/exec/scan/vfile_scanner.cpp
@@ -309,16 +309,11 @@ Status VFileScanner::_init_src_block(Block* block) {
         auto it = _name_to_col_type.find(slot->col_name());
         if (it == _name_to_col_type.end() || _is_dynamic_schema) {
             // not exist in file, using type from _input_tuple_desc
-            data_type =
-                    DataTypeFactory::instance().create_data_type(slot->type(), slot->is_nullable());
+            RETURN_IF_CATCH_EXCEPTION(data_type = DataTypeFactory::instance().create_data_type(
+                                              slot->type(), slot->is_nullable()));
         } else {
-            data_type = DataTypeFactory::instance().create_data_type(it->second, true);
-        }
-        if (data_type == nullptr) {
-            return Status::NotSupported("Not support data type {} for column {}",
-                                        it == _name_to_col_type.end() ? slot->type().debug_string()
-                                                                      : it->second.debug_string(),
-                                        slot->col_name());
+            RETURN_IF_CATCH_EXCEPTION(
+                    data_type = DataTypeFactory::instance().create_data_type(it->second, true));
         }
         MutableColumnPtr data_column = data_type->create_column();
         _src_block.insert(
diff --git a/be/src/vec/exec/vsort_node.cpp b/be/src/vec/exec/vsort_node.cpp
index 05b94b733a..b7ad692413 100644
--- a/be/src/vec/exec/vsort_node.cpp
+++ b/be/src/vec/exec/vsort_node.cpp
@@ -179,7 +179,7 @@ Status VSortNode::open(RuntimeState* state) {
                                   ExecNode::get_next,
                           _children[0], std::placeholders::_1, std::placeholders::_2,
                           std::placeholders::_3)));
-        RETURN_IF_CATCH_EXCEPTION(RETURN_IF_ERROR(sink(state, upstream_block.get(), eos)));
+        RETURN_IF_ERROR_OR_CATCH_EXCEPTION(sink(state, upstream_block.get(), eos));
     } while (!eos);
 
     child(0)->close(state);
@@ -191,7 +191,7 @@ Status VSortNode::open(RuntimeState* state) {
 }
 
 Status VSortNode::pull(doris::RuntimeState* state, vectorized::Block* output_block, bool* eos) {
-    RETURN_IF_CATCH_EXCEPTION(RETURN_IF_ERROR(_sorter->get_next(state, output_block, eos)));
+    RETURN_IF_ERROR_OR_CATCH_EXCEPTION(_sorter->get_next(state, output_block, eos));
     reached_limit(output_block, eos);
     if (*eos) {
         _runtime_profile->add_info_string("Spilled", _sorter->is_spilled() ? "true" : "false");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 07/13: [performance](executor) remove repeated call within the loop in validate_column

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 0be67858585547eed3578b52c86f3b76a0e1f933
Author: Mryange <59...@users.noreply.github.com>
AuthorDate: Fri Jun 9 19:59:25 2023 +0800

     [performance](executor) remove repeated call within the loop in validate_column
---
 be/src/vec/sink/vtablet_sink.cpp | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/be/src/vec/sink/vtablet_sink.cpp b/be/src/vec/sink/vtablet_sink.cpp
index 7482cb18a2..1a60b7b71a 100644
--- a/be/src/vec/sink/vtablet_sink.cpp
+++ b/be/src/vec/sink/vtablet_sink.cpp
@@ -1689,7 +1689,8 @@ Status VOlapTableSink::_validate_column(RuntimeState* state, const TypeDescripto
         auto column_decimal = const_cast<vectorized::ColumnDecimal<vectorized::Decimal128>*>(
                 assert_cast<const vectorized::ColumnDecimal<vectorized::Decimal128>*>(
                         real_column_ptr.get()));
-
+        const auto& max_decimalv2 = _get_decimalv2_min_or_max<false>(type);
+        const auto& min_decimalv2 = _get_decimalv2_min_or_max<true>(type);
         for (size_t j = 0; j < column->size(); ++j) {
             auto row = rows ? (*rows)[j] : j;
             if (row == last_invalid_row) {
@@ -1710,8 +1711,6 @@ Status VOlapTableSink::_validate_column(RuntimeState* state, const TypeDescripto
                         invalid = true;
                     }
                 }
-                const auto& max_decimalv2 = _get_decimalv2_min_or_max<false>(type);
-                const auto& min_decimalv2 = _get_decimalv2_min_or_max<true>(type);
                 if (dec_val > max_decimalv2 || dec_val < min_decimalv2) {
                     fmt::format_to(error_msg, "{}", "decimal value is not valid for definition");
                     fmt::format_to(error_msg, ", value={}", dec_val.to_string());
@@ -1735,6 +1734,8 @@ Status VOlapTableSink::_validate_column(RuntimeState* state, const TypeDescripto
     auto column_decimal = const_cast<vectorized::ColumnDecimal<vectorized::ColumnDecimalType>*>(   \
             assert_cast<const vectorized::ColumnDecimal<vectorized::ColumnDecimalType>*>(          \
                     real_column_ptr.get()));                                                       \
+    const auto& max_decimal = _get_decimalv3_min_or_max<vectorized::DecimalType, false>(type);     \
+    const auto& min_decimal = _get_decimalv3_min_or_max<vectorized::DecimalType, true>(type);      \
     for (size_t j = 0; j < column->size(); ++j) {                                                  \
         auto row = rows ? (*rows)[j] : j;                                                          \
         if (row == last_invalid_row) {                                                             \
@@ -1743,10 +1744,6 @@ Status VOlapTableSink::_validate_column(RuntimeState* state, const TypeDescripto
         if (need_to_validate(j, row)) {                                                            \
             auto dec_val = column_decimal->get_data()[j];                                          \
             bool invalid = false;                                                                  \
-            const auto& max_decimal =                                                              \
-                    _get_decimalv3_min_or_max<vectorized::DecimalType, false>(type);               \
-            const auto& min_decimal =                                                              \
-                    _get_decimalv3_min_or_max<vectorized::DecimalType, true>(type);                \
             if (dec_val > max_decimal || dec_val < min_decimal) {                                  \
                 fmt::format_to(error_msg, "{}", "decimal value is not valid for definition");      \
                 fmt::format_to(error_msg, ", value={}", dec_val);                                  \


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 13/13: [enhancement](stats) ignore view by default when analyze whole DB #20630

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 237a4837e741499e77f6579df7f9cf6e5e3ec3ed
Author: AKIRA <33...@users.noreply.github.com>
AuthorDate: Fri Jun 9 15:13:54 2023 +0900

    [enhancement](stats) ignore view by default when analyze whole DB #20630
---
 .../src/main/java/org/apache/doris/statistics/AnalysisManager.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java
index a138a356d8..58c2e4aa7b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java
@@ -33,6 +33,7 @@ import org.apache.doris.catalog.Partition;
 import org.apache.doris.catalog.ScalarType;
 import org.apache.doris.catalog.TableIf;
 import org.apache.doris.catalog.TableIf.TableType;
+import org.apache.doris.catalog.View;
 import org.apache.doris.common.AnalysisException;
 import org.apache.doris.common.Config;
 import org.apache.doris.common.DdlException;
@@ -153,6 +154,9 @@ public class AnalysisManager extends Daemon {
         try {
             List<AnalyzeTblStmt> analyzeStmts = new ArrayList<>();
             for (TableIf table : tbls) {
+                if (table instanceof View) {
+                    continue;
+                }
                 TableName tableName = new TableName(analyzeDBStmt.getCtlIf().getName(), db.getFullName(),
                         table.getName());
                 AnalyzeTblStmt analyzeTblStmt = new AnalyzeTblStmt(analyzeDBStmt.getAnalyzeProperties(), tableName,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 09/13: [minor](Nereids) remove some invasive code of minidump in cascades framework (#20606)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit cbfaec4c9c5da0cb7431d3fbf9be5083ddb92ee0
Author: morrySnow <10...@users.noreply.github.com>
AuthorDate: Fri Jun 9 23:41:00 2023 +0800

    [minor](Nereids) remove some invasive code of  minidump in cascades framework (#20606)
---
 .../java/org/apache/doris/nereids/cost/Cost.java   | 14 +++++----
 .../apache/doris/nereids/cost/CostCalculator.java  | 16 ++++-------
 .../org/apache/doris/nereids/cost/CostWeight.java  |  9 ++----
 .../nereids/jobs/cascades/CostAndEnforcerJob.java  | 33 +++++++++-------------
 .../jobs/joinorder/hypergraph/GraphSimplifier.java |  4 +--
 .../apache/doris/nereids/memo/GroupExpression.java |  2 +-
 .../org/apache/doris/nereids/memo/MemoTest.java    |  2 +-
 7 files changed, 35 insertions(+), 45 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/Cost.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/Cost.java
index c0ec0b1956..18dfbad5e0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/Cost.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/Cost.java
@@ -17,6 +17,8 @@
 
 package org.apache.doris.nereids.cost;
 
+import org.apache.doris.qe.ConnectContext;
+
 /**
  * Cost encapsulate the real cost with double type.
  * We do this because we want to customize the operation of adding child cost
@@ -28,8 +30,8 @@ public interface Cost {
     /**
      * This is for calculating the cost in simplifier
      */
-    static Cost withRowCount(double rowCount, boolean enableNewCostModel) {
-        if (enableNewCostModel) {
+    static Cost withRowCount(double rowCount) {
+        if (ConnectContext.get().getSessionVariable().getEnableNewCostModel()) {
             return new CostV2(0, rowCount, 0);
         }
         return new CostV1(rowCount);
@@ -38,15 +40,15 @@ public interface Cost {
     /**
      * return zero cost
      */
-    static Cost zero(boolean enableNewCostModel) {
-        if (enableNewCostModel) {
+    static Cost zero() {
+        if (ConnectContext.get().getSessionVariable().getEnableNewCostModel()) {
             return CostV2.zero();
         }
         return CostV1.zero();
     }
 
-    static Cost infinite(boolean enableNewCostModel) {
-        if (enableNewCostModel) {
+    static Cost infinite() {
+        if (ConnectContext.get().getSessionVariable().getEnableNewCostModel()) {
             return CostV2.infinite();
         }
         return CostV1.infinite();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostCalculator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostCalculator.java
index b1e1570171..7d6125494f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostCalculator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostCalculator.java
@@ -23,6 +23,7 @@ import org.apache.doris.nereids.memo.GroupExpression;
 import org.apache.doris.nereids.properties.DistributionSpecReplicated;
 import org.apache.doris.nereids.properties.PhysicalProperties;
 import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.qe.ConnectContext;
 
 import java.util.List;
 
@@ -32,11 +33,6 @@ import java.util.List;
 @Developing
 //TODO: memory cost and network cost should be estimated by byte size.
 public class CostCalculator {
-    private static boolean enableNewCostModel = false;
-
-    public static void setEnableNewCostModel(boolean enableNewCostModel) {
-        CostCalculator.enableNewCostModel = enableNewCostModel;
-    }
 
     /**
      * Calculate cost for groupExpression
@@ -47,7 +43,7 @@ public class CostCalculator {
                 && childrenProperties.get(1).getDistributionSpec() instanceof DistributionSpecReplicated) {
             planContext.setBroadcastJoin();
         }
-        if (enableNewCostModel) {
+        if (ConnectContext.get().getSessionVariable().getEnableNewCostModel()) {
             CostModelV2 costModelV2 = new CostModelV2();
             return groupExpression.getPlan().accept(costModelV2, planContext);
         } else {
@@ -60,7 +56,7 @@ public class CostCalculator {
      * Calculate cost without groupExpression
      */
     public static Cost calculateCost(Plan plan, PlanContext planContext) {
-        if (enableNewCostModel) {
+        if (ConnectContext.get().getSessionVariable().getEnableNewCostModel()) {
             CostModelV2 costModel = new CostModelV2();
             return plan.accept(costModel, planContext);
         } else {
@@ -70,9 +66,9 @@ public class CostCalculator {
     }
 
     public static Cost addChildCost(Plan plan, Cost planCost, Cost childCost, int index) {
-        if (!enableNewCostModel) {
-            return CostModelV1.addChildCost(plan, planCost, childCost, index);
+        if (ConnectContext.get().getSessionVariable().getEnableNewCostModel()) {
+            return CostModelV2.addChildCost(plan, planCost, childCost, index);
         }
-        return CostModelV2.addChildCost(plan, planCost, childCost, index);
+        return CostModelV1.addChildCost(plan, planCost, childCost, index);
     }
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostWeight.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostWeight.java
index 5cd576ac28..a0bb8c7a87 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostWeight.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/cost/CostWeight.java
@@ -17,6 +17,8 @@
 
 package org.apache.doris.nereids.cost;
 
+import org.apache.doris.qe.ConnectContext;
+
 import com.google.common.base.Preconditions;
 
 /**
@@ -37,7 +39,6 @@ public class CostWeight {
     static final double NETWORK_WEIGHT = 1.5;
     static final double DELAY = 0.5;
 
-    static double nereidsCboPenaltyFactor = 0.7;
     final double cpuWeight;
     final double memoryWeight;
     final double networkWeight;
@@ -69,7 +70,7 @@ public class CostWeight {
 
     public static CostWeight get() {
         return new CostWeight(CPU_WEIGHT, MEMORY_WEIGHT, NETWORK_WEIGHT,
-            nereidsCboPenaltyFactor);
+                ConnectContext.get().getSessionVariable().getNereidsCboPenaltyFactor());
     }
 
     //TODO: add it in session variable
@@ -80,8 +81,4 @@ public class CostWeight {
     public double weightSum(double cpuCost, double ioCost, double netCost) {
         return cpuCost * cpuWeight + ioCost * ioWeight + netCost * networkWeight;
     }
-
-    public static void setNereidsCboPenaltyFactor(double nereidsCboPenaltyFactor) {
-        CostWeight.nereidsCboPenaltyFactor = nereidsCboPenaltyFactor;
-    }
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/CostAndEnforcerJob.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/CostAndEnforcerJob.java
index ff82addb25..b673bd6e87 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/CostAndEnforcerJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/CostAndEnforcerJob.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.jobs.cascades;
 import org.apache.doris.common.Pair;
 import org.apache.doris.nereids.cost.Cost;
 import org.apache.doris.nereids.cost.CostCalculator;
-import org.apache.doris.nereids.cost.CostWeight;
 import org.apache.doris.nereids.jobs.Job;
 import org.apache.doris.nereids.jobs.JobContext;
 import org.apache.doris.nereids.jobs.JobType;
@@ -47,6 +46,7 @@ import java.util.Optional;
  * Inspired by NoisePage and ORCA-Paper.
  */
 public class CostAndEnforcerJob extends Job implements Cloneable {
+
     private static final Logger LOG = LogManager.getLogger(CostAndEnforcerJob.class);
 
     // GroupExpression to optimize
@@ -110,10 +110,6 @@ public class CostAndEnforcerJob extends Job implements Cloneable {
      */
     @Override
     public void execute() {
-        CostCalculator.setEnableNewCostModel(
-                context.getCascadesContext().getConnectContext().getSessionVariable().getEnableNewCostModel());
-        CostWeight.setNereidsCboPenaltyFactor(
-                context.getCascadesContext().getConnectContext().getSessionVariable().getNereidsCboPenaltyFactor());
         if (groupExpression.isUnused()) {
             return;
         }
@@ -121,10 +117,8 @@ public class CostAndEnforcerJob extends Job implements Cloneable {
         countJobExecutionTimesOfGroupExpressions(groupExpression);
         // Do init logic of root plan/groupExpr of `subplan`, only run once per task.
         if (curChildIndex == -1) {
-            curNodeCost = Cost.zero(
-                    context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump());
-            curTotalCost = Cost.zero(
-                    context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump());
+            curNodeCost = Cost.zero();
+            curTotalCost = Cost.zero();
             curChildIndex = 0;
             // List<request property to children>
             // [ child item: [leftProperties, rightProperties]]
@@ -196,8 +190,7 @@ public class CostAndEnforcerJob extends Job implements Cloneable {
                         lowestCostExpr.getCostValueByProperties(requestChildProperty),
                         curChildIndex);
                 if (curTotalCost.getValue() > context.getCostUpperBound()) {
-                    curTotalCost = Cost.infinite(
-                            context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump());
+                    curTotalCost = Cost.infinite();
                 }
                 // the request child properties will be covered by the output properties
                 // that corresponding to the request properties. so if we run a costAndEnforceJob of the same
@@ -248,14 +241,18 @@ public class CostAndEnforcerJob extends Job implements Cloneable {
             // if we come here, mean that we have some error in stats calculator and should fix it.
             return false;
         }
+
         StatsCalculator statsCalculator = StatsCalculator.estimate(groupExpression,
                 context.getCascadesContext().getConnectContext().getSessionVariable().getForbidUnknownColStats(),
                 context.getCascadesContext().getConnectContext().getTotalColumnStatisticMap(),
                 context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump());
-        context.getCascadesContext().getConnectContext().getTotalColumnStatisticMap()
-                .putAll(statsCalculator.getTotalColumnStatisticMap());
-        context.getCascadesContext().getConnectContext().getTotalHistogramMap()
-                .putAll(statsCalculator.getTotalHistogramMap());
+        if (!context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump()
+                && context.getCascadesContext().getConnectContext().getSessionVariable().isEnableMinidump()) {
+            context.getCascadesContext().getConnectContext().getTotalColumnStatisticMap()
+                    .putAll(statsCalculator.getTotalColumnStatisticMap());
+            context.getCascadesContext().getConnectContext().getTotalHistogramMap()
+                    .putAll(statsCalculator.getTotalHistogramMap());
+        }
 
         // recompute cost after adjusting property
         curNodeCost = CostCalculator.calculateCost(groupExpression, requestChildrenProperties);
@@ -328,10 +325,8 @@ public class CostAndEnforcerJob extends Job implements Cloneable {
         lowestCostChildren.clear();
         prevChildIndex = -1;
         curChildIndex = 0;
-        curTotalCost = Cost.zero(
-                context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump());
-        curNodeCost = Cost.zero(
-                context.getCascadesContext().getConnectContext().getSessionVariable().isPlayNereidsDump());
+        curTotalCost = Cost.zero();
+        curNodeCost = Cost.zero();
     }
 
     /**
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/joinorder/hypergraph/GraphSimplifier.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/joinorder/hypergraph/GraphSimplifier.java
index adee7f662e..efe9896dd2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/joinorder/hypergraph/GraphSimplifier.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/joinorder/hypergraph/GraphSimplifier.java
@@ -82,7 +82,7 @@ public class GraphSimplifier {
         }
         for (Node node : graph.getNodes()) {
             cacheStats.put(node.getNodeMap(), node.getGroup().getStatistics());
-            cacheCost.put(node.getNodeMap(), Cost.withRowCount(node.getRowCount(), false));
+            cacheCost.put(node.getNodeMap(), Cost.withRowCount(node.getRowCount()));
         }
         circleDetector = new CircleDetector(edgeSize);
 
@@ -427,7 +427,7 @@ public class GraphSimplifier {
             Statistics leftStats, Statistics rightStats) {
         LogicalJoin join = edge.getJoin();
         PlanContext planContext = new PlanContext(stats, leftStats, rightStats);
-        Cost cost = Cost.zero(false);
+        Cost cost;
         if (JoinUtils.shouldNestedLoopJoin(join)) {
             PhysicalNestedLoopJoin nestedLoopJoin = new PhysicalNestedLoopJoin<>(
                     join.getJoinType(),
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
index 43f54ca494..b921c80000 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
@@ -77,7 +77,7 @@ public class GroupExpression {
     // After mergeGroup(), source Group was cleaned up, but it may be in the Job Stack. So use this to mark and skip it.
     private boolean isUnused = false;
 
-    private ObjectId id = StatementScopeIdGenerator.newObjectId();
+    private final ObjectId id = StatementScopeIdGenerator.newObjectId();
 
     public GroupExpression(Plan plan) {
         this(plan, Lists.newArrayList());
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/memo/MemoTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/memo/MemoTest.java
index 776b68fb10..43b1c48761 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/memo/MemoTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/memo/MemoTest.java
@@ -95,7 +95,7 @@ class MemoTest implements MemoPatternMatchSupported {
         FakePlan fakePlan = new FakePlan();
         GroupExpression srcParentExpression = new GroupExpression(fakePlan, Lists.newArrayList(srcGroup));
         Group srcParentGroup = new Group(new GroupId(0), srcParentExpression, new LogicalProperties(ArrayList::new));
-        srcParentGroup.setBestPlan(srcParentExpression, Cost.zero(false), PhysicalProperties.ANY);
+        srcParentGroup.setBestPlan(srcParentExpression, Cost.zero(), PhysicalProperties.ANY);
         GroupExpression dstParentExpression = new GroupExpression(fakePlan, Lists.newArrayList(dstGroup));
         Group dstParentGroup = new Group(new GroupId(1), dstParentExpression, new LogicalProperties(ArrayList::new));
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 08/13: [enhancement](index) Nereids support no need to read raw data for index column that only in filter conditions (#20605)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 4a33b956e620c969abbfccced21cf063ba3780e7
Author: YueW <45...@users.noreply.github.com>
AuthorDate: Fri Jun 9 21:54:48 2023 +0800

    [enhancement](index) Nereids support no need to read raw data for index column that only in filter conditions (#20605)
---
 be/src/olap/rowset/segment_v2/segment_iterator.cpp |  19 ++-
 be/src/olap/rowset/segment_v2/segment_iterator.h   |   1 +
 be/src/vec/exec/scan/new_olap_scan_node.cpp        |   3 -
 .../org/apache/doris/planner/OriginalPlanner.java  |  44 +------
 .../test_index_no_need_read_data.out               | 129 +++++++++++++++++++++
 .../test_index_no_need_read_data.groovy            |  88 ++++++++++++++
 6 files changed, 241 insertions(+), 43 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index 92717945b1..53d89e6395 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -250,6 +250,10 @@ Status SegmentIterator::init(const StorageReadOptions& opts) {
     if (_char_type_idx.empty() && _char_type_idx_no_0.empty()) {
         _vec_init_char_column_id();
     }
+
+    if (opts.output_columns != nullptr) {
+        _output_columns = *(opts.output_columns);
+    }
     return Status::OK();
 }
 
@@ -917,7 +921,20 @@ Status SegmentIterator::_apply_inverted_index_on_block_column_predicate(
 }
 
 bool SegmentIterator::_need_read_data(ColumnId cid) {
-    // TODO(xk) impl right logic
+    if (_output_columns.count(-1)) {
+        // if _output_columns contains -1, it means that the light
+        // weight schema change may not be enabled or other reasons
+        // caused the column unique_id not be set, to prevent errors
+        // occurring, return true here that column data needs to be read
+        return true;
+    }
+    int32_t unique_id = _opts.tablet_schema->column(cid).unique_id();
+    if (_need_read_data_indices.count(unique_id) > 0 && !_need_read_data_indices[unique_id] &&
+        _output_columns.count(unique_id) < 1) {
+        VLOG_DEBUG << "SegmentIterator no need read data for column: "
+                   << _opts.tablet_schema->column_by_uid(unique_id).name();
+        return false;
+    }
     return true;
 }
 
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.h b/be/src/olap/rowset/segment_v2/segment_iterator.h
index 899ee46e3a..93b8b398e7 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.h
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.h
@@ -431,6 +431,7 @@ private:
     std::vector<ColumnPredicate*> _filter_info_id;
     bool _record_rowids = false;
     int32_t _tablet_id = 0;
+    std::set<int32_t> _output_columns;
 };
 
 } // namespace segment_v2
diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp b/be/src/vec/exec/scan/new_olap_scan_node.cpp
index ac916bfcd1..740a57e793 100644
--- a/be/src/vec/exec/scan/new_olap_scan_node.cpp
+++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp
@@ -440,9 +440,6 @@ Status NewOlapScanNode::_init_scanners(std::list<VScannerSPtr>* scanners) {
 
     if (!_olap_scan_node.output_column_unique_ids.empty()) {
         for (auto uid : _olap_scan_node.output_column_unique_ids) {
-            if (uid < 0) {
-                continue;
-            }
             _maybe_read_column_ids.emplace(uid);
         }
     }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java b/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java
index 024ea0647b..1fbd140d45 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/OriginalPlanner.java
@@ -572,50 +572,16 @@ public class OriginalPlanner extends Planner {
      * column unique id for `A` and `B` will put into outputColumnUniqueIds.
      *
     */
+    // this opt will only work with nereidsPlanner
     private void pushOutColumnUniqueIdsToOlapScan(PlanFragment rootFragment, Analyzer analyzer) {
         Set<Integer> outputColumnUniqueIds = new HashSet<>();
-        ArrayList<Expr> outputExprs = rootFragment.getOutputExprs();
-        for (Expr expr : outputExprs) {
-            if (expr instanceof SlotRef) {
-                if (((SlotRef) expr).getColumn() != null) {
-                    outputColumnUniqueIds.add(((SlotRef) expr).getColumn().getUniqueId());
-                }
-            }
-        }
+        // add '-1' to avoid the optimization incorrect work with OriginalPlanner,
+        // because in the storage layer will skip this optimization if outputColumnUniqueIds contains '-1',
+        // to ensure the optimization only correct work with nereidsPlanner
+        outputColumnUniqueIds.add(-1);
 
         for (PlanFragment fragment : fragments) {
             PlanNode node = fragment.getPlanRoot();
-            PlanNode parent = null;
-            while (node.getChildren().size() != 0) {
-                for (PlanNode childNode : node.getChildren()) {
-                    List<SlotId> outputSlotIds = childNode.getOutputSlotIds();
-                    if (outputSlotIds != null) {
-                        for (SlotId sid : outputSlotIds) {
-                            SlotDescriptor slotDesc = analyzer.getSlotDesc(sid);
-                            outputColumnUniqueIds.add(slotDesc.getUniqueId());
-                        }
-                    }
-                }
-                // OlapScanNode is the last node.
-                // So, just get the two node and check if they are SortNode and OlapScan.
-                parent = node;
-                node = node.getChildren().get(0);
-            }
-
-            if (parent instanceof SortNode) {
-                SortNode sortNode = (SortNode) parent;
-                List<Expr> orderingExprs = sortNode.getSortInfo().getOrigOrderingExprs();
-                if (orderingExprs != null) {
-                    for (Expr expr : orderingExprs) {
-                        if (expr instanceof SlotRef) {
-                            if (((SlotRef) expr).getColumn() != null) {
-                                outputColumnUniqueIds.add(((SlotRef) expr).getColumn().getUniqueId());
-                            }
-                        }
-                    }
-                }
-            }
-
             if (!(node instanceof OlapScanNode)) {
                 continue;
             }
diff --git a/regression-test/data/inverted_index_p0/test_index_no_need_read_data.out b/regression-test/data/inverted_index_p0/test_index_no_need_read_data.out
new file mode 100644
index 0000000000..01a08f324d
--- /dev/null
+++ b/regression-test/data/inverted_index_p0/test_index_no_need_read_data.out
@@ -0,0 +1,129 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_nereids_0 --
+1	\N	addr qie3	yy	lj	100
+2	\N	hehe	\N	lala	200
+3	beijing	addr xuanwu	wugui	\N	300
+4	beijing	addr fengtai	fengtai1	fengtai2	\N
+5	beijing	addr chaoyang	wangjing	donghuqu	500
+6	shanghai	hehe	\N	haha	\N
+7	tengxun	qie	addr gg	lj	\N
+8	tengxun2	qie	\N	lj	800
+
+-- !select_nereids_1 --
+4
+
+-- !select_nereids_2 --
+3
+
+-- !select_nereids_3 --
+3
+
+-- !select_nereids_4 --
+3	beijing	addr xuanwu	wugui	\N	300
+4	beijing	addr fengtai	fengtai1	fengtai2	\N
+5	beijing	addr chaoyang	wangjing	donghuqu	500
+
+-- !select_nereids_5 --
+beijing	addr xuanwu	wugui
+beijing	addr fengtai	fengtai1
+beijing	addr chaoyang	wangjing
+
+-- !select_nereids_6 --
+hehe	\N
+qie	addr gg
+qie	\N
+
+-- !select_nereids_7 --
+hehe	\N
+qie	addr gg
+qie	\N
+
+-- !select_nereids_8 --
+SHANGHAI	\N
+TENGXUN	addr gg
+TENGXUN2	\N
+
+-- !select_nereids_9 --
+4	\N
+3	addr gg
+3	\N
+
+-- !select_nereids_10 --
+hehe	\N
+qie	addr gg
+qie	\N
+
+-- !select_nereids_11 --
+hehe	\N	SHANGHAI
+qie	addr gg	TENGXUN
+qie	\N	TENGXUN2
+
+-- !select_nereids_12 --
+300
+\N
+500
+
+-- !select_0 --
+1	\N	addr qie3	yy	lj	100
+2	\N	hehe	\N	lala	200
+3	beijing	addr xuanwu	wugui	\N	300
+4	beijing	addr fengtai	fengtai1	fengtai2	\N
+5	beijing	addr chaoyang	wangjing	donghuqu	500
+6	shanghai	hehe	\N	haha	\N
+7	tengxun	qie	addr gg	lj	\N
+8	tengxun2	qie	\N	lj	800
+
+-- !select_1 --
+4
+
+-- !select_2 --
+3
+
+-- !select_3 --
+3
+
+-- !select_4 --
+3	beijing	addr xuanwu	wugui	\N	300
+4	beijing	addr fengtai	fengtai1	fengtai2	\N
+5	beijing	addr chaoyang	wangjing	donghuqu	500
+
+-- !select_5 --
+beijing	addr xuanwu	wugui
+beijing	addr fengtai	fengtai1
+beijing	addr chaoyang	wangjing
+
+-- !select_6 --
+hehe	\N
+qie	addr gg
+qie	\N
+
+-- !select_7 --
+hehe	\N
+qie	addr gg
+qie	\N
+
+-- !select_8 --
+SHANGHAI	\N
+TENGXUN	addr gg
+TENGXUN2	\N
+
+-- !select_9 --
+4	\N
+3	addr gg
+3	\N
+
+-- !select_10 --
+hehe	\N
+qie	addr gg
+qie	\N
+
+-- !select_11 --
+hehe	\N	SHANGHAI
+qie	addr gg	TENGXUN
+qie	\N	TENGXUN2
+
+-- !select_12 --
+300
+\N
+500
+
diff --git a/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy b/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy
new file mode 100644
index 0000000000..e5bc37e2fd
--- /dev/null
+++ b/regression-test/suites/inverted_index_p0/test_index_no_need_read_data.groovy
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+suite("test_index_no_need_read_data", "inverted_index_select"){
+    def table1 = "test_index_no_need_read_data"
+
+    sql "drop table if exists ${table1}"
+
+    sql """
+       CREATE TABLE IF NOT EXISTS `${table1}` (
+      `id` int NULL COMMENT "",
+      `city` varchar(20) NULL COMMENT "",
+      `addr` varchar(20) NULL COMMENT "",
+      `name` varchar(20) NULL COMMENT "",
+      `compy` varchar(20) NULL COMMENT "",
+      `n` int NULL COMMENT "",
+      INDEX idx_city(city) USING INVERTED,
+      INDEX idx_addr(addr) USING INVERTED PROPERTIES("parser"="english"),
+      INDEX idx_n(n) USING INVERTED
+    ) ENGINE=OLAP
+    DUPLICATE KEY(`id`)
+    COMMENT "OLAP"
+    DISTRIBUTED BY HASH(`id`) BUCKETS 1
+    PROPERTIES (
+    "replication_allocation" = "tag.location.default: 1",
+    "in_memory" = "false",
+    "storage_format" = "V2"
+    )
+    """
+
+    sql """insert into ${table1} values
+            (1,null,'addr qie3','yy','lj',100),
+            (2,null,'hehe',null,'lala',200),
+            (3,'beijing','addr xuanwu','wugui',null,300),
+            (4,'beijing','addr fengtai','fengtai1','fengtai2',null),
+            (5,'beijing','addr chaoyang','wangjing','donghuqu',500),
+            (6,'shanghai','hehe',null,'haha',null),
+            (7,'tengxun','qie','addr gg','lj',null),
+            (8,'tengxun2','qie',null,'lj',800)
+    """
+
+    // case1: enable nereids planner
+    sql "set enable_nereids_planner = true"
+
+    qt_select_nereids_0 "SELECT * FROM ${table1} ORDER BY id"
+    qt_select_nereids_1 "SELECT count() FROM ${table1} WHERE n > 100"
+    qt_select_nereids_2 "SELECT count() FROM ${table1} WHERE city = 'beijing'"
+    qt_select_nereids_3 "SELECT count(*) FROM ${table1} WHERE city = 'beijing'"
+    qt_select_nereids_4 "SELECT * FROM ${table1} WHERE city = 'beijing' ORDER BY id"
+    qt_select_nereids_5 "SELECT city, addr, name FROM ${table1} WHERE city = 'beijing' ORDER BY id"
+    qt_select_nereids_6 "SELECT addr, name FROM ${table1} WHERE city > 'beijing' ORDER BY city"
+    qt_select_nereids_7 "SELECT addr, name FROM ${table1} WHERE city > 'beijing' ORDER BY id"
+    qt_select_nereids_8 "SELECT upper(city), name FROM ${table1} WHERE city != 'beijing' ORDER BY id"
+    qt_select_nereids_9 "SELECT length(addr), name FROM ${table1} WHERE city != 'beijing' ORDER BY id"
+    qt_select_nereids_10 "SELECT addr, name FROM ( SELECT * from ${table1} WHERE city != 'beijing' ORDER BY id) t"
+    qt_select_nereids_11 "SELECT addr, name, upper(city) FROM ( SELECT * from ${table1} WHERE city != 'beijing' ORDER BY id) t"
+    qt_select_nereids_12 "SELECT sum(n) FROM ${table1} WHERE city = 'beijing' group by id ORDER BY id"
+
+    // case2: disable nereids planner
+    sql "set enable_nereids_planner = false"
+    
+    qt_select_0 "SELECT * FROM ${table1} ORDER BY id"
+    qt_select_1 "SELECT count() FROM ${table1} WHERE n > 100"
+    qt_select_2 "SELECT count() FROM ${table1} WHERE city = 'beijing'"
+    qt_select_3 "SELECT count(*) FROM ${table1} WHERE city = 'beijing'"
+    qt_select_4 "SELECT * FROM ${table1} WHERE city = 'beijing' ORDER BY id"
+    qt_select_5 "SELECT city, addr, name FROM ${table1} WHERE city = 'beijing' ORDER BY id"
+    qt_select_6 "SELECT addr, name FROM ${table1} WHERE city > 'beijing' ORDER BY city"
+    qt_select_7 "SELECT addr, name FROM ${table1} WHERE city > 'beijing' ORDER BY id"
+    qt_select_8 "SELECT upper(city), name FROM ${table1} WHERE city != 'beijing' ORDER BY id"
+    qt_select_9 "SELECT length(addr), name FROM ${table1} WHERE city != 'beijing' ORDER BY id"
+    qt_select_10 "SELECT addr, name FROM ( SELECT * from ${table1} WHERE city != 'beijing' ORDER BY id) t"
+    qt_select_11 "SELECT addr, name, upper(city) FROM ( SELECT * from ${table1} WHERE city != 'beijing' ORDER BY id) t"
+    qt_select_12 "SELECT sum(n) FROM ${table1} WHERE city = 'beijing' group by id ORDER BY id"
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 12/13: [fix](memory) Fix runtime state default mem tracker (#20615)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit de0bbc3d3c9731e3ca4616a307232a4ea72e1981
Author: Xinyi Zou <zo...@gmail.com>
AuthorDate: Fri Jun 9 21:09:07 2023 +0800

    [fix](memory) Fix runtime state default mem tracker (#20615)
    
    start time: Wed 07 Jun 2023 06:50:14 PM CST
    *** Query id: e9000000e9-eb00000073 ***
    *** Aborted at 1686136356 (unix time) try "date -d @1686136356" if you are using GNU date ***
    *** Current BE git commitID: 5c33dd7a2c ***
    *** SIGSEGV address not mapped to object (@0x23000000235) received by PID 2131238 (TID 2132258 OR 0x7f708eff7700) from PID 565; stack trace: ***
     0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /mnt/hdd01/repo_center/doris_branch-2.0-beta/doris/be/src/common/signal_handler.h:413
     1# 0x00007F727BBE3090 in /lib/x86_64-linux-gnu/libc.so.6
     2# doris::AttachTask::AttachTask(doris::RuntimeState*) at /mnt/hdd01/repo_center/doris_branch-2.0-beta/doris/be/src/runtime/thread_context.cpp:43
     3# std::_Function_handler<void (doris::PTabletWriterAddBlockResult const&, bool), doris::stream_load::VNodeChannel::open_wait()::$_1>::_M_invoke(std::_Any_data const&, doris::PTabletWriterAddBlockResult const&, bool&&) at /var/local/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:291
     4# doris::stream_load::ReusableClosure<doris::PTabletWriterAddBlockResult>::Run() at /mnt/hdd01/repo_center/doris_branch-2.0-beta/doris/be/src/vec/sink/vtablet_sink.h:176
     5# brpc::Controller::EndRPC(brpc::Controller::CompletionInfo const&) in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
     6# brpc::Controller::OnVersionedRPCReturned(brpc::Controller::CompletionInfo const&, bool, int) in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
     7# brpc::policy::ProcessRpcResponse(brpc::InputMessageBase*) in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
     8# brpc::InputMessenger::InputMessageClosure::~InputMessageClosure() in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
     9# brpc::InputMessenger::OnNewMessages(brpc::Socket*) in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
    10# brpc::Socket::ProcessEvent(void*) in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
    11# bthread::TaskGroup::task_runner(long) in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
    12# bthread_make_fcontext in /root/20230607171843-doris-branch-2.0-beta-5c33dd7a/be/lib/doris_be
---
 be/src/olap/push_handler.cpp              |  6 +-----
 be/src/runtime/fold_constant_executor.cpp |  6 +-----
 be/src/runtime/runtime_state.cpp          | 12 +++++++++---
 be/src/runtime/runtime_state.h            |  6 +++---
 4 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp
index 2a7f1d2d5d..1fcb1abcdc 100644
--- a/be/src/olap/push_handler.cpp
+++ b/be/src/olap/push_handler.cpp
@@ -371,11 +371,7 @@ Status PushBrokerReader::init() {
         return Status::Error<PUSH_INIT_ERROR>();
     }
     _runtime_state->set_desc_tbl(desc_tbl);
-    status = _runtime_state->init_mem_trackers(dummy_id);
-    if (UNLIKELY(!status.ok())) {
-        LOG(WARNING) << "Failed to init mem trackers, msg: " << status;
-        return Status::Error<PUSH_INIT_ERROR>();
-    }
+    _runtime_state->init_mem_trackers(dummy_id, "PushBrokerReader");
     _runtime_profile = _runtime_state->runtime_profile();
     _runtime_profile->set_name("PushBrokerReader");
 
diff --git a/be/src/runtime/fold_constant_executor.cpp b/be/src/runtime/fold_constant_executor.cpp
index 5e8932ff01..2d89dbf254 100644
--- a/be/src/runtime/fold_constant_executor.cpp
+++ b/be/src/runtime/fold_constant_executor.cpp
@@ -148,11 +148,7 @@ Status FoldConstantExecutor::_init(const TQueryGlobals& query_globals,
         return status;
     }
     _runtime_state->set_desc_tbl(desc_tbl);
-    status = _runtime_state->init_mem_trackers(_query_id);
-    if (UNLIKELY(!status.ok())) {
-        LOG(WARNING) << "Failed to init mem trackers, msg: " << status;
-        return status;
-    }
+    _runtime_state->init_mem_trackers(_query_id, "FoldConstant");
 
     _runtime_profile = _runtime_state->runtime_profile();
     _runtime_profile->set_name("FoldConstantExpr");
diff --git a/be/src/runtime/runtime_state.cpp b/be/src/runtime/runtime_state.cpp
index e68e55aa72..18b3e9cc44 100644
--- a/be/src/runtime/runtime_state.cpp
+++ b/be/src/runtime/runtime_state.cpp
@@ -241,10 +241,16 @@ Status RuntimeState::init(const TUniqueId& fragment_instance_id, const TQueryOpt
     return Status::OK();
 }
 
-Status RuntimeState::init_mem_trackers(const TUniqueId& query_id) {
+void RuntimeState::init_mem_trackers(const TUniqueId& id, const std::string& name) {
     _query_mem_tracker = std::make_shared<MemTrackerLimiter>(
-            MemTrackerLimiter::Type::QUERY, fmt::format("TestQuery#Id={}", print_id(query_id)));
-    return Status::OK();
+            MemTrackerLimiter::Type::EXPERIMENTAL, fmt::format("{}#Id={}", name, print_id(id)));
+}
+
+std::shared_ptr<MemTrackerLimiter> RuntimeState::query_mem_tracker() const {
+    if (!_query_mem_tracker) {
+        return _exec_env->orphan_mem_tracker();
+    }
+    return _query_mem_tracker;
 }
 
 bool RuntimeState::log_error(const std::string& error) {
diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h
index 53382c925a..27f2d8e328 100644
--- a/be/src/runtime/runtime_state.h
+++ b/be/src/runtime/runtime_state.h
@@ -83,7 +83,7 @@ public:
                 const TQueryGlobals& query_globals, ExecEnv* exec_env);
 
     // for ut and non-query.
-    Status init_mem_trackers(const TUniqueId& query_id = TUniqueId());
+    void init_mem_trackers(const TUniqueId& id = TUniqueId(), const std::string& name = "unknown");
 
     const TQueryOptions& query_options() const { return _query_options; }
     int64_t scan_queue_mem_limit() const {
@@ -116,7 +116,7 @@ public:
     const TUniqueId& query_id() const { return _query_id; }
     const TUniqueId& fragment_instance_id() const { return _fragment_instance_id; }
     ExecEnv* exec_env() { return _exec_env; }
-    std::shared_ptr<MemTrackerLimiter> query_mem_tracker() { return _query_mem_tracker; }
+    std::shared_ptr<MemTrackerLimiter> query_mem_tracker() const;
 
     // Returns runtime state profile
     RuntimeProfile* runtime_profile() { return &_profile; }
@@ -418,7 +418,7 @@ private:
 
     static const int DEFAULT_BATCH_SIZE = 2048;
 
-    std::shared_ptr<MemTrackerLimiter> _query_mem_tracker;
+    std::shared_ptr<MemTrackerLimiter> _query_mem_tracker = nullptr;
 
     // put runtime state before _obj_pool, so that it will be deconstructed after
     // _obj_pool. Because some of object in _obj_pool will use profile when deconstructing.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 02/13: [fix](stats) set analysis job status to finished when be crashed by mistake (#20485)

Posted by kx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0-beta
in repository https://gitbox.apache.org/repos/asf/doris.git

commit c43dcb222e4bb8f060842e6833db8a133f2b84a7
Author: AKIRA <33...@users.noreply.github.com>
AuthorDate: Fri Jun 9 16:43:11 2023 +0900

    [fix](stats) set analysis job status to finished when be crashed by mistake (#20485)
    
    If BE crashed the error would be logged, and the analysis task would be mark as finished, which is incorrect.
    In this PR, update analysis task according to the query state
---
 .../doris/catalog/InternalSchemaInitializer.java       |  2 +-
 .../main/java/org/apache/doris/qe/StmtExecutor.java    | 10 ++++------
 .../org/apache/doris/statistics/AnalysisManager.java   | 16 +++++++++-------
 .../apache/doris/statistics/AnalysisTaskExecutor.java  |  2 +-
 .../apache/doris/statistics/AnalysisTaskWrapper.java   |  4 ++--
 .../org/apache/doris/statistics/ColumnStatistic.java   |  3 ++-
 .../org/apache/doris/statistics/OlapAnalysisTask.java  | 12 ++++++------
 .../doris/statistics/StatisticsAutoAnalyzer.java       |  1 -
 .../apache/doris/statistics/util/StatisticsUtil.java   |  4 +++-
 .../org/apache/doris/statistics/AnalysisJobTest.java   |  9 +++++++++
 .../doris/statistics/AnalysisTaskExecutorTest.java     | 18 ++++++++++++++++++
 11 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java
index c5a3197dee..04bbbe263a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java
@@ -147,7 +147,7 @@ public class InternalSchemaInitializer extends Thread {
         columnDefs.add(partId);
         columnDefs.add(new ColumnDef("count", TypeDef.create(PrimitiveType.BIGINT)));
         columnDefs.add(new ColumnDef("ndv", TypeDef.create(PrimitiveType.BIGINT)));
-        columnDefs.add(new ColumnDef("null_count", TypeDef.create(PrimitiveType.BIGINT)));
+        columnDefs.add(new ColumnDef("null_count", TypeDef.create(PrimitiveType.BIGINT), true));
         columnDefs.add(new ColumnDef("min", TypeDef.createVarchar(ScalarType.MAX_VARCHAR_LENGTH), true));
         columnDefs.add(new ColumnDef("max", TypeDef.createVarchar(ScalarType.MAX_VARCHAR_LENGTH), true));
         columnDefs.add(new ColumnDef("data_size_in_bytes", TypeDef.create(PrimitiveType.BIGINT)));
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index 021a179c46..9b0b8708aa 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -2421,8 +2421,7 @@ public class StmtExecutor {
                     analyze(context.getSessionVariable().toThrift());
                 }
             } catch (Exception e) {
-                LOG.warn("Internal SQL execution failed, SQL: {}", originStmt, e);
-                return resultRows;
+                throw new RuntimeException("Failed to execute internal SQL", e);
             }
             planner.getFragments();
             RowBatch batch;
@@ -2432,7 +2431,7 @@ public class StmtExecutor {
                 QeProcessorImpl.INSTANCE.registerQuery(context.queryId(),
                         new QeProcessorImpl.QueryInfo(context, originStmt.originStmt, coord));
             } catch (UserException e) {
-                LOG.warn(e.getMessage(), e);
+                throw new RuntimeException("Failed to execute internal SQL", e);
             }
 
             Span queryScheduleSpan = context.getTracer()
@@ -2441,7 +2440,7 @@ public class StmtExecutor {
                 coord.exec();
             } catch (Exception e) {
                 queryScheduleSpan.recordException(e);
-                LOG.warn("Unexpected exception when SQL running", e);
+                throw new RuntimeException("Failed to execute internal SQL", e);
             } finally {
                 queryScheduleSpan.end();
             }
@@ -2457,9 +2456,8 @@ public class StmtExecutor {
                     }
                 }
             } catch (Exception e) {
-                LOG.warn("Unexpected exception when SQL running", e);
                 fetchResultSpan.recordException(e);
-                return resultRows;
+                throw new RuntimeException("Failed to execute internal SQL", e);
             } finally {
                 fetchResultSpan.end();
             }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java
index d48eed9618..a138a356d8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java
@@ -234,10 +234,10 @@ public class AnalysisManager extends Daemon {
         Map<Long, BaseAnalysisTask> analysisTaskInfos = new HashMap<>();
         createTaskForEachColumns(jobInfo, analysisTaskInfos, false);
         createTaskForMVIdx(jobInfo, analysisTaskInfos, false);
-
-        persistAnalysisJob(jobInfo);
-        analysisJobIdToTaskMap.put(jobInfo.jobId, analysisTaskInfos);
-
+        if (!jobInfo.jobType.equals(JobType.SYSTEM)) {
+            persistAnalysisJob(jobInfo);
+            analysisJobIdToTaskMap.put(jobInfo.jobId, analysisTaskInfos);
+        }
         try {
             updateTableStats(jobInfo);
         } catch (Throwable e) {
@@ -502,7 +502,9 @@ public class AnalysisManager extends Daemon {
                 continue;
             }
             try {
-                logCreateAnalysisTask(analysisInfo);
+                if (!jobInfo.jobType.equals(JobType.SYSTEM)) {
+                    logCreateAnalysisTask(analysisInfo);
+                }
             } catch (Exception e) {
                 throw new DdlException("Failed to create analysis task", e);
             }
@@ -510,13 +512,13 @@ public class AnalysisManager extends Daemon {
     }
 
     private void logCreateAnalysisTask(AnalysisInfo analysisInfo) {
-        Env.getCurrentEnv().getEditLog().logCreateAnalysisTasks(analysisInfo);
         analysisTaskInfoMap.put(analysisInfo.taskId, analysisInfo);
+        Env.getCurrentEnv().getEditLog().logCreateAnalysisTasks(analysisInfo);
     }
 
     private void logCreateAnalysisJob(AnalysisInfo analysisJob) {
-        Env.getCurrentEnv().getEditLog().logCreateAnalysisJob(analysisJob);
         analysisJobInfoMap.put(analysisJob.jobId, analysisJob);
+        Env.getCurrentEnv().getEditLog().logCreateAnalysisJob(analysisJob);
     }
 
     private void createTaskForExternalTable(AnalysisInfo jobInfo,
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java
index 301d46644d..3f22d1ccf3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java
@@ -78,7 +78,7 @@ public class AnalysisTaskExecutor extends Thread {
                     long timeout = TimeUnit.MINUTES.toMillis(Config.analyze_task_timeout_in_minutes);
                     taskWrapper.get(timeout < 0 ? 0 : timeout, TimeUnit.MILLISECONDS);
                 } catch (Exception e) {
-                    taskWrapper.cancel();
+                    taskWrapper.cancel(e.getMessage());
                 }
             } catch (Throwable throwable) {
                 LOG.warn(throwable);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskWrapper.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskWrapper.java
index 4590e138f6..b2615e5d05 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskWrapper.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskWrapper.java
@@ -76,12 +76,12 @@ public class AnalysisTaskWrapper extends FutureTask<Void> {
         }
     }
 
-    public boolean cancel() {
+    public boolean cancel(String msg) {
         try {
             LOG.warn("{} cancelled, cost time:{}", task.toString(), System.currentTimeMillis() - startTime);
             task.cancel();
         } catch (Exception e) {
-            LOG.warn(String.format("Cancel job failed job info : %s", task.toString()));
+            LOG.warn(String.format("Cancel job failed job info : %s", msg));
         }
         return super.cancel(false);
     }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatistic.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatistic.java
index 9485ecf662..5735c01430 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatistic.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatistic.java
@@ -134,7 +134,8 @@ public class ColumnStatistic {
                 ndv = count;
             }
             columnStatisticBuilder.setNdv(ndv);
-            columnStatisticBuilder.setNumNulls(Double.parseDouble(resultRow.getColumnValue("null_count")));
+            String nullCount = resultRow.getColumnValue("null_count");
+            columnStatisticBuilder.setNumNulls(nullCount == null ? 0 : Double.parseDouble(nullCount));
             columnStatisticBuilder.setDataSize(Double
                     .parseDouble(resultRow.getColumnValue("data_size_in_bytes")));
             columnStatisticBuilder.setAvgSizeByte(columnStatisticBuilder.getDataSize()
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java
index a65553a838..4391d87f52 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java
@@ -20,8 +20,8 @@ package org.apache.doris.statistics;
 import org.apache.doris.catalog.Env;
 import org.apache.doris.catalog.Partition;
 import org.apache.doris.common.FeConstants;
-import org.apache.doris.qe.AutoCloseConnectContext;
-import org.apache.doris.qe.StmtExecutor;
+import org.apache.doris.qe.QueryState;
+import org.apache.doris.qe.QueryState.MysqlStateType;
 import org.apache.doris.statistics.util.StatisticsUtil;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -108,10 +108,10 @@ public class OlapAnalysisTask extends BaseAnalysisTask {
 
     @VisibleForTesting
     public void execSQL(String sql) throws Exception {
-        try (AutoCloseConnectContext r = StatisticsUtil.buildConnectContext()) {
-            r.connectContext.getSessionVariable().disableNereidsPlannerOnce();
-            this.stmtExecutor = new StmtExecutor(r.connectContext, sql);
-            this.stmtExecutor.execute();
+        QueryState queryState = StatisticsUtil.execUpdate(sql);
+        if (queryState.getStateType().equals(MysqlStateType.ERR)) {
+            throw new RuntimeException(String.format("Failed to analyze %s.%s.%s, error: %s",
+                    info.catalogName, info.dbName, info.colName, queryState.getErrorMessage()));
         }
     }
 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsAutoAnalyzer.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsAutoAnalyzer.java
index 8128d3a7d3..5120bd23ee 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsAutoAnalyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsAutoAnalyzer.java
@@ -39,7 +39,6 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
-
 public class StatisticsAutoAnalyzer extends MasterDaemon {
 
     private static final Logger LOG = LogManager.getLogger(StatisticsAutoAnalyzer.class);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
index 8f77df2748..2ee244fbe6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
@@ -47,6 +47,7 @@ import org.apache.doris.nereids.trees.expressions.literal.DateTimeLiteral;
 import org.apache.doris.nereids.trees.expressions.literal.VarcharLiteral;
 import org.apache.doris.qe.AutoCloseConnectContext;
 import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.QueryState;
 import org.apache.doris.qe.SessionVariable;
 import org.apache.doris.qe.StmtExecutor;
 import org.apache.doris.statistics.AnalysisInfo;
@@ -105,12 +106,13 @@ public class StatisticsUtil {
         }
     }
 
-    public static void execUpdate(String sql) throws Exception {
+    public static QueryState execUpdate(String sql) throws Exception {
         try (AutoCloseConnectContext r = StatisticsUtil.buildConnectContext()) {
             r.connectContext.getSessionVariable().disableNereidsPlannerOnce();
             StmtExecutor stmtExecutor = new StmtExecutor(r.connectContext, sql);
             r.connectContext.setExecutor(stmtExecutor);
             stmtExecutor.execute();
+            return r.connectContext.getState();
         }
     }
 
diff --git a/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisJobTest.java b/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisJobTest.java
index e8984cd209..86c3d63463 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisJobTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisJobTest.java
@@ -26,6 +26,7 @@ import org.apache.doris.statistics.AnalysisInfo.AnalysisMethod;
 import org.apache.doris.statistics.AnalysisInfo.AnalysisMode;
 import org.apache.doris.statistics.AnalysisInfo.AnalysisType;
 import org.apache.doris.statistics.AnalysisInfo.JobType;
+import org.apache.doris.statistics.util.InternalQueryResult.ResultRow;
 import org.apache.doris.statistics.util.StatisticsUtil;
 import org.apache.doris.utframe.TestWithFeService;
 
@@ -39,6 +40,7 @@ import org.junit.jupiter.api.Test;
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Set;
 
 public class AnalysisJobTest extends TestWithFeService {
@@ -80,6 +82,13 @@ public class AnalysisJobTest extends TestWithFeService {
             }
         };
 
+        new MockUp<StmtExecutor>() {
+            @Mock
+            public List<ResultRow> executeInternalQuery() {
+                return Collections.emptyList();
+            }
+        };
+
         new MockUp<ConnectContext>() {
 
             @Mock
diff --git a/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisTaskExecutorTest.java b/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisTaskExecutorTest.java
index c2b355067d..522a28d9c2 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisTaskExecutorTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/statistics/AnalysisTaskExecutorTest.java
@@ -19,11 +19,13 @@ package org.apache.doris.statistics;
 
 import org.apache.doris.catalog.InternalSchemaInitializer;
 import org.apache.doris.common.jmockit.Deencapsulation;
+import org.apache.doris.qe.StmtExecutor;
 import org.apache.doris.statistics.AnalysisInfo.AnalysisMethod;
 import org.apache.doris.statistics.AnalysisInfo.AnalysisMode;
 import org.apache.doris.statistics.AnalysisInfo.AnalysisType;
 import org.apache.doris.statistics.AnalysisInfo.JobType;
 import org.apache.doris.statistics.util.BlockingCounter;
+import org.apache.doris.statistics.util.InternalQueryResult.ResultRow;
 import org.apache.doris.utframe.TestWithFeService;
 
 import com.google.common.collect.Maps;
@@ -36,6 +38,7 @@ import org.junit.jupiter.api.Test;
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Set;
 import java.util.concurrent.BlockingQueue;
 
@@ -94,6 +97,21 @@ public class AnalysisTaskExecutorTest extends TestWithFeService {
 
     @Test
     public void testTaskExecution() throws Exception {
+
+        new MockUp<StmtExecutor>() {
+            @Mock
+            public List<ResultRow> executeInternalQuery() {
+                return Collections.emptyList();
+            }
+        };
+
+        new MockUp<OlapAnalysisTask>() {
+            @Mock
+            public void execSQL(String sql) throws Exception {
+
+            }
+        };
+
         AnalysisTaskExecutor analysisTaskExecutor = new AnalysisTaskExecutor(analysisTaskScheduler);
         HashMap<String, Set<String>> colToPartitions = Maps.newHashMap();
         colToPartitions.put("col1", Collections.singleton("t1"));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org