diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java index 344ff112bc..77c91131a2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java @@ -523,16 +523,8 @@ public final class AggregateInfo extends AggregateInfoBase { if (exprList.size() > 1) { continue; } - Expr expr = exprList.get(0); - if (!(expr instanceof SlotRef)) { - continue; - } - SlotRef slotRef = (SlotRef) expr; - Expr right = smap.get(slotRef); - if (right == null) { - continue; - } - slotDesc.setIsNullable(right.isNullable()); + Expr srcExpr = exprList.get(0).substitute(smap); + slotDesc.setIsNullable(srcExpr.isNullable() || slotDesc.getIsNullable()); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java index a319ef9534..8ac4ea1d9d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java @@ -452,15 +452,7 @@ public class HashJoinNode extends PlanNode { int leftNullableNumber = 0; int rightNullableNumber = 0; if (copyLeft) { - //cross join do not have OutputTblRefIds - List srcTupleIds = getChild(0) instanceof CrossJoinNode ? getChild(0).getOutputTupleIds() - : getChild(0).getOutputTblRefIds(); - for (TupleDescriptor leftTupleDesc : analyzer.getDescTbl().getTupleDesc(srcTupleIds)) { - // if the child is cross join node, the only way to get the correct nullable info of its output slots - // is to check if the output tuple ids are outer joined or not. - // then pass this nullable info to hash join node will be correct. - boolean needSetToNullable = - getChild(0) instanceof CrossJoinNode && analyzer.isOuterJoined(leftTupleDesc.getId()); + for (TupleDescriptor leftTupleDesc : analyzer.getDescTbl().getTupleDesc(getChild(0).getOutputTupleIds())) { for (SlotDescriptor leftSlotDesc : leftTupleDesc.getSlots()) { if (!isMaterailizedByChild(leftSlotDesc, getChild(0).getOutputSmap())) { continue; @@ -471,19 +463,13 @@ public class HashJoinNode extends PlanNode { outputSlotDesc.setIsNullable(true); leftNullableNumber++; } - if (needSetToNullable) { - outputSlotDesc.setIsNullable(true); - } srcTblRefToOutputTupleSmap.put(new SlotRef(leftSlotDesc), new SlotRef(outputSlotDesc)); } } } if (copyRight) { - List srcTupleIds = getChild(1) instanceof CrossJoinNode ? getChild(1).getOutputTupleIds() - : getChild(1).getOutputTblRefIds(); - for (TupleDescriptor rightTupleDesc : analyzer.getDescTbl().getTupleDesc(srcTupleIds)) { - boolean needSetToNullable = - getChild(1) instanceof CrossJoinNode && analyzer.isOuterJoined(rightTupleDesc.getId()); + for (TupleDescriptor rightTupleDesc : + analyzer.getDescTbl().getTupleDesc(getChild(1).getOutputTupleIds())) { for (SlotDescriptor rightSlotDesc : rightTupleDesc.getSlots()) { if (!isMaterailizedByChild(rightSlotDesc, getChild(1).getOutputSmap())) { continue; @@ -494,9 +480,6 @@ public class HashJoinNode extends PlanNode { outputSlotDesc.setIsNullable(true); rightNullableNumber++; } - if (needSetToNullable) { - outputSlotDesc.setIsNullable(true); - } srcTblRefToOutputTupleSmap.put(new SlotRef(rightSlotDesc), new SlotRef(outputSlotDesc)); } } 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 1ec4641793..2e000d65f8 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 @@ -1645,15 +1645,15 @@ public class QueryPlanTest extends TestWithFeService { sql = "SELECT a.k1, b.k2 FROM (SELECT k1 from baseall) a LEFT OUTER JOIN (select k1, 999 as k2 from baseall) b ON (a.k1=b.k1)"; explainString = getSQLPlanOrErrorMsg("EXPLAIN " + sql); - Assert.assertTrue(explainString.contains("\n" + " ")); + Assert.assertTrue(explainString.contains("\n" + " 999")); sql = "SELECT a.k1, b.k2 FROM (SELECT 1 as k1 from baseall) a RIGHT OUTER JOIN (select k1, 999 as k2 from baseall) b ON (a.k1=b.k1)"; explainString = getSQLPlanOrErrorMsg("EXPLAIN " + sql); - Assert.assertTrue(explainString.contains("\n" + " ")); + Assert.assertTrue(explainString.contains("1\n" + " 999")); sql = "SELECT a.k1, b.k2 FROM (SELECT 1 as k1 from baseall) a FULL JOIN (select k1, 999 as k2 from baseall) b ON (a.k1=b.k1)"; explainString = getSQLPlanOrErrorMsg("EXPLAIN " + sql); - Assert.assertTrue(explainString.contains("\n" + " ")); + Assert.assertTrue(explainString.contains("1\n" + " 999")); } @Test diff --git a/regression-test/suites/correctness_p0/test_outer_join_with_grouping.groovy b/regression-test/suites/correctness_p0/test_outer_join_with_grouping.groovy new file mode 100644 index 0000000000..65e82a7608 --- /dev/null +++ b/regression-test/suites/correctness_p0/test_outer_join_with_grouping.groovy @@ -0,0 +1,162 @@ +// 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_outer_join_with_grouping") { + sql """ + drop table if exists table_a; + """ + + sql """ + drop table if exists table_b; + """ + + sql """ + CREATE TABLE `table_a` ( + `id` bigint(20) NOT NULL COMMENT '', + `moid` int(11) REPLACE_IF_NOT_NULL NULL COMMENT '', + `sid` int(11) REPLACE_IF_NOT_NULL NULL COMMENT '' + ) ENGINE=OLAP + AGGREGATE KEY(`id`) + COMMENT 'OLAP' + DISTRIBUTED BY HASH(`id`) BUCKETS 10 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2", + "disable_auto_compaction" = "false" + ); + """ + + sql """ + CREATE TABLE `table_b` ( + `id` bigint(20) NOT NULL COMMENT '', + `name` varchar(192) NOT NULL COMMENT '' + ) ENGINE=OLAP + AGGREGATE KEY(`id`, `name`) + COMMENT 'OLAP' + DISTRIBUTED BY HASH(`id`, `name`) BUCKETS 10 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2", + "disable_auto_compaction" = "false" + ); + """ + + sql """ + INSERT INTO table_a (id,moid,sid) VALUES + (2,8,9), + (3,5,7), + (6,3,6), + (8,3,6), + (1,6,1), + (4,3,7), + (7,3,2), + (9,3,9), + (5,6,4); + """ + + sql """ + INSERT INTO table_b (id,name) VALUES + (1,'e'), + (2,'b'), + (4,'b'), + (4,'c'), + (7,'d'), + (8,'c'), + (2,'a'), + (2,'c'), + (3,'e'), + (5,'e'), + (6,'a'), + (3,'d'), + (6,'b'), + (3,'a'), + (5,'b'), + (7,'a'), + (9,'c'), + (5,'c'), + (6,'e'), + (8,'e'), + (1,'d'), + (4,'a'), + (9,'e'), + (1,'b'), + (1,'c'), + (3,'b'), + (9,'b'), + (2,'d'), + (4,'d'), + (5,'a'), + (7,'b'), + (9,'a'), + (1,'a'), + (2,'e'), + (6,'d'), + (7,'c'), + (5,'d'), + (6,'c'), + (7,'e'), + (8,'a'), + (8,'b'), + (9,'d'); + """ + + sql """ + with tmp_view AS + (SELECT moid, + `name` + FROM table_a m + LEFT JOIN table_b s + ON s.id = m.sid), t6 AS + (SELECT moid, + GROUP_CONCAT(distinct `name`) nlist + FROM tmp_view + GROUP BY moid) + SELECT nlist + FROM tmp_view + INNER JOIN t6 + ON t6.moid=tmp_view.moid + ORDER BY nlist; + """ + + sql """ + with tmp_view AS + (SELECT moid, + `name` + FROM table_a m + LEFT JOIN table_b s + ON s.id = m.sid), t6 AS + (SELECT moid, + GROUP_CONCAT(distinct `name`) nlist + FROM tmp_view + GROUP BY moid) + SELECT nlist + FROM tmp_view + INNER JOIN t6 + ON TRUE + ORDER BY nlist; + """ + + sql """ + drop table if exists table_a; + """ + + sql """ + drop table if exists table_b; + """ +} diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q10.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q10.groovy index 603ae1b384..685f79a3a1 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q10.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q10.groovy @@ -61,9 +61,9 @@ suite("test_explain_tpch_sf_1_q10") { check { explainStr -> explainStr.contains("VTOP-N\n" + - " | order by: sum(`l_extendedprice` * (1 - `l_discount`)) DESC") && + " | order by: sum( * (1 - )) DESC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`l_extendedprice` * (1 - `l_discount`)))\n" + + " | output: sum( sum( * (1 - )))\n" + " | group by: `c_custkey`, `c_name`, `c_acctbal`, `c_phone`, `n_name`, `c_address`, `c_comment`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q11.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q11.groovy index 1ba53d61ff..d6fbde6903 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q11.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q11.groovy @@ -58,12 +58,12 @@ suite("test_explain_tpch_sf_1_q11") { explainStr.contains("VTOP-N\n" + " | order by: `\$a\$1`.`\$c\$2` DESC") && explainStr.contains("cross join:\n" + - " | predicates: sum(`ps_supplycost` * `ps_availqty`) > sum(`ps_supplycost` * `ps_availqty`) * 0.0001") && + " | predicates: sum( * ) > sum( * ) * 0.0001") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`ps_supplycost` * `ps_availqty`))\n" + + " | output: sum( sum( * ))\n" + " | group by: `ps_partkey`") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`ps_supplycost` * `ps_availqty`))\n" + + " | output: sum( sum( * ))\n" + " | group by: ") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | output: sum( * )\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q12.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q12.groovy index dc3f94438e..8c09cad070 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q12.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q12.groovy @@ -59,7 +59,7 @@ suite("test_explain_tpch_sf_1_q12") { explainStr.contains("VTOP-N\n" + " | order by: `l_shipmode` ASC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(CASE WHEN ((`o_orderpriority` = '1-URGENT' OR `o_orderpriority` = '2-HIGH') AND (`o_orderpriority` = '1-URGENT' OR `o_orderpriority` = '2-HIGH')) THEN 1 ELSE 0 END)), sum( sum(CASE WHEN `o_orderpriority` != '1-URGENT' AND `o_orderpriority` != '2-HIGH' THEN 1 ELSE 0 END))\n" + + " | output: sum( sum(CASE WHEN (( = '1-URGENT' OR = '2-HIGH') AND ( = '1-URGENT' OR = '2-HIGH')) THEN 1 ELSE 0 END)), sum( sum(CASE WHEN != '1-URGENT' AND != '2-HIGH' THEN 1 ELSE 0 END))\n" + " | group by: `l_shipmode`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q13.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q13.groovy index b03676e5a4..b8fae0ce91 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q13.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q13.groovy @@ -56,9 +56,9 @@ suite("test_explain_tpch_sf_1_q13") { explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + " | output: count(*)\n" + - " | group by: count(`o_orderkey`)") && + " | group by: count()") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: count( count(`o_orderkey`))\n" + + " | output: count( count())\n" + " | group by: `c_custkey`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q14.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q14.groovy index 2cd2957312..33c608c633 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q14.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q14.groovy @@ -41,7 +41,7 @@ suite("test_explain_tpch_sf_1_q14") { check { explainStr -> explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(CASE WHEN `p_type` LIKE 'PROMO%' THEN `l_extendedprice` * (1 - `l_discount`) ELSE 0 END)), sum( sum(`l_extendedprice` * (1 - `l_discount`)))\n" + + " | output: sum( sum(CASE WHEN LIKE 'PROMO%' THEN * (1 - ) ELSE 0 END)), sum( sum( * (1 - )))\n" + " | group by: ") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | output: sum(CASE WHEN LIKE 'PROMO%' THEN * (1 - ) ELSE 0 END), sum( * (1 - ))\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q15.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q15.groovy index 8c7902b852..d509ae5cad 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q15.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q15.groovy @@ -49,7 +49,7 @@ suite("test_explain_tpch_sf_1_q15") { explainStr.contains("VTOP-N\n" + " | order by: `s_suppkey` ASC") && explainStr.contains("join op: LEFT SEMI JOIN(BROADCAST)[The src data has been redistributed]\n" + - " | equal join conjunct: = max(`total_revenue`)") && + " | equal join conjunct: = max( sum(`l_extendedprice` * (1 - `l_discount`)))") && explainStr.contains("vec output tuple id: 12") && explainStr.contains("output slot ids: 34 35 36 37 39 \n" + " | hash output slot ids: 33 28 29 30 31 ") && @@ -62,7 +62,7 @@ suite("test_explain_tpch_sf_1_q15") { explainStr.contains("TABLE: supplier(supplier), PREAGGREGATION: ON\n" + " runtime filters: RF000[in_or_bloom] -> `s_suppkey`") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: max( max(`total_revenue`))\n" + + " | output: max( max( sum(`l_extendedprice` * (1 - `l_discount`))))\n" + " | group by: ") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | output: max( sum(`l_extendedprice` * (1 - `l_discount`)))\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q17.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q17.groovy index 4fedc4c2dc..e52f9e4148 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q17.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q17.groovy @@ -44,7 +44,7 @@ suite("test_explain_tpch_sf_1_q17") { check { explainStr -> explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`l_extendedprice`))\n" + + " | output: sum( sum())\n" + " | group by: ") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | output: sum()\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q18.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q18.groovy index 9a90454c5f..22804dd42e 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q18.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q18.groovy @@ -64,7 +64,7 @@ suite("test_explain_tpch_sf_1_q18") { explainStr.contains("VTOP-N\n" + " | order by: `o_totalprice` DESC, `o_orderdate` ASC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`l_quantity`))\n" + + " | output: sum( sum())\n" + " | group by: `c_name`, `c_custkey`, `o_orderkey`, `o_orderdate`, `o_totalprice`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q19.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q19.groovy index c88e549d17..95840584c7 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q19.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q19.groovy @@ -63,7 +63,7 @@ suite("test_explain_tpch_sf_1_q19") { check { explainStr -> explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`l_extendedprice` * (1 - `l_discount`)))\n" + + " | output: sum( sum( * (1 - )))\n" + " | group by: ") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | output: sum( * (1 - ))\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q2.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q2.groovy index f87692255c..23972ec9c7 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q2.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q2.groovy @@ -72,9 +72,9 @@ suite("test_explain_tpch_sf_1_q2") { explainStr.contains("VTOP-N\n" + " | order by: `s_acctbal` DESC, `n_name` ASC, `s_name` ASC, `p_partkey` ASC") && explainStr.contains("join op: LEFT SEMI JOIN(BROADCAST)[The src data has been redistributed]\n" + - " | equal join conjunct: = min(`ps_supplycost`)\n" + + " | equal join conjunct: = min()\n" + " | equal join conjunct: = `ps_partkey`\n" + - " | runtime filters: RF000[in_or_bloom] <- min(`ps_supplycost`), RF001[in_or_bloom] <- `ps_partkey`") && + " | runtime filters: RF000[in_or_bloom] <- min(), RF001[in_or_bloom] <- `ps_partkey`") && explainStr.contains("vec output tuple id: 19") && explainStr.contains("output slot ids: 121 122 125 126 127 128 129 132 \n" + " | hash output slot ids: 81 82 85 86 87 88 89 92 ") && @@ -105,7 +105,7 @@ suite("test_explain_tpch_sf_1_q2") { explainStr.contains("TABLE: partsupp(partsupp), PREAGGREGATION: ON\n" + " runtime filters: RF000[in_or_bloom] -> , RF004[in_or_bloom] -> , RF005[in_or_bloom] -> `ps_partkey`") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: min( min(`ps_supplycost`))\n" + + " | output: min( min())\n" + " | group by: `ps_partkey`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q22.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q22.groovy index fe40ca1b72..6fa5bc1bec 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q22.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q22.groovy @@ -65,7 +65,7 @@ suite("test_explain_tpch_sf_1_q22") { explainStr.contains("VTOP-N\n" + " | order by: `cntrycode` ASC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: count( count(*)), sum( sum(`c_acctbal`))\n" + + " | output: count( count(*)), sum( sum())\n" + " | group by: `cntrycode`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q3.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q3.groovy index ddb9a4b3ed..4fcacb5126 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q3.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q3.groovy @@ -52,9 +52,9 @@ suite("test_explain_tpch_sf_1_q3") { check { explainStr -> explainStr.contains("VTOP-N\n" + - " | order by: sum(`l_extendedprice` * (1 - `l_discount`)) DESC, `o_orderdate` ASC") && + " | order by: sum( * (1 - )) DESC, `o_orderdate` ASC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`l_extendedprice` * (1 - `l_discount`)))\n" + + " | output: sum( sum( * (1 - )))\n" + " | group by: `l_orderkey`, `o_orderdate`, `o_shippriority`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q5.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q5.groovy index c556af5837..4d6f2075f4 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q5.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q5.groovy @@ -53,9 +53,9 @@ suite("test_explain_tpch_sf_1_q5") { check { explainStr -> explainStr.contains("VTOP-N\n" + - " | order by: sum(`l_extendedprice` * (1 - `l_discount`)) DESC") && + " | order by: sum( * (1 - )) DESC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`l_extendedprice` * (1 - `l_discount`)))\n" + + " | output: sum( sum( * (1 - )))\n" + " | group by: `n_name`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q7.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q7.groovy index c35bbac807..147cbdeb65 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q7.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q7.groovy @@ -69,7 +69,7 @@ suite("test_explain_tpch_sf_1_q7") { explainStr.contains("VTOP-N\n" + " | order by: `supp_nation` ASC, `cust_nation` ASC, `l_year` ASC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`volume`))\n" + + " | output: sum( sum( * (1 - )))\n" + " | group by: `supp_nation`, `cust_nation`, `l_year`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q8.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q8.groovy index 3d3a9d36a9..6beb419375 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q8.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q8.groovy @@ -68,7 +68,7 @@ suite("test_explain_tpch_sf_1_q8") { explainStr.contains("VTOP-N\n" + " | order by: `o_year` ASC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(CASE WHEN `nation` = 'BRAZIL' THEN `volume` ELSE 0 END)), sum( sum(`volume`))\n" + + " | output: sum( sum(CASE WHEN = 'BRAZIL' THEN * (1 - ) ELSE 0 END)), sum( sum( * (1 - )))\n" + " | group by: `o_year`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" + diff --git a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q9.groovy b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q9.groovy index 6138f2c958..aac398cef4 100644 --- a/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q9.groovy +++ b/regression-test/suites/tpch_sf1_p1/tpch_sf1/explain/test_q9.groovy @@ -62,7 +62,7 @@ suite("test_explain_tpch_sf_1_q9") { explainStr.contains("VTOP-N\n" + " | order by: `nation` ASC, `o_year` DESC") && explainStr.contains("VAGGREGATE (merge finalize)\n" + - " | output: sum( sum(`amount`))\n" + + " | output: sum( sum( * (1 - ) - * ))\n" + " | group by: `nation`, `o_year`") && explainStr.contains("VAGGREGATE (update serialize)\n" + " | STREAMING\n" +