This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new fff1983f40 [fix](planner)use tupleId of agg node to get its unsigned
conjuncts (#21949)
fff1983f40 is described below
commit fff1983f40c172d01a5178779509a5aea8793000
Author: starocean999 <[email protected]>
AuthorDate: Wed Jul 19 00:46:49 2023 +0800
[fix](planner)use tupleId of agg node to get its unsigned conjuncts (#21949)
---
fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java | 3 ++-
regression-test/data/nereids_p0/test_filter_pushdown_set.out | 6 ++++++
regression-test/suites/nereids_p0/test_filter_pushdown_set.groovy | 3 +++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
index 33aa53412b..65cc119683 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
@@ -2420,7 +2420,8 @@ public class Analyzer {
// constant conjuncts should be push down to all leaf node except agg
node.
// (see getPredicatesBoundedByGroupbysSourceExpr method)
// so we need remove constant conjuncts when expr is not a leaf node.
- List<Expr> unassigned = getUnassignedConjuncts(node.getTblRefIds());
+ List<Expr> unassigned = getUnassignedConjuncts(
+ node instanceof AggregationNode ? node.getTupleIds() :
node.getTblRefIds());
if (!node.getChildren().isEmpty() && !(node instanceof
AggregationNode)) {
unassigned = unassigned.stream()
.filter(e -> !e.isConstant()).collect(Collectors.toList());
diff --git a/regression-test/data/nereids_p0/test_filter_pushdown_set.out
b/regression-test/data/nereids_p0/test_filter_pushdown_set.out
index ecf08434cc..42ecbc5ad8 100644
--- a/regression-test/data/nereids_p0/test_filter_pushdown_set.out
+++ b/regression-test/data/nereids_p0/test_filter_pushdown_set.out
@@ -2,3 +2,9 @@
-- !select1 --
1 2
+-- !select2 --
+1 2
+
+-- !select3 --
+1 2
+
diff --git a/regression-test/suites/nereids_p0/test_filter_pushdown_set.groovy
b/regression-test/suites/nereids_p0/test_filter_pushdown_set.groovy
index e97ed2c24a..03c1b25798 100644
--- a/regression-test/suites/nereids_p0/test_filter_pushdown_set.groovy
+++ b/regression-test/suites/nereids_p0/test_filter_pushdown_set.groovy
@@ -19,4 +19,7 @@
sql "SET enable_nereids_planner=true"
sql "SET enable_fallback_to_original_planner=false"
qt_select1 'select * from (select 1 as a, 2 as b union all select 3, 3) t
where a = 1;'
+ sql "SET enable_nereids_planner=false"
+ qt_select2 'select * from (select 1 as a, 2 as b union all select 3, 3) t
where a = 1;'
+ qt_select3 'select * from (select 1 as a, 2 as b union select 3, 3) t
where a = 1;'
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]