You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2024/07/02 11:37:08 UTC
(doris) branch master updated: [fix](Nereids) normalize aggregate should not push down lambda's param (#37109)
This is an automated email from the ASF dual-hosted git repository.
morrysnow 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 cce5d5b6a21 [fix](Nereids) normalize aggregate should not push down lambda's param (#37109)
cce5d5b6a21 is described below
commit cce5d5b6a216afab2ac9a20d3d753174c2a8e012
Author: morrySnow <10...@users.noreply.github.com>
AuthorDate: Tue Jul 2 19:36:59 2024 +0800
[fix](Nereids) normalize aggregate should not push down lambda's param (#37109)
ArrayItemSlot should not be inputSlot
---
.../java/org/apache/doris/nereids/trees/expressions/Expression.java | 4 +++-
.../normalize_aggregate/normalize_aggregate_test.out | 3 +++
.../normalize_aggregate/normalize_aggregate_test.groovy | 6 ++++--
3 files changed, 10 insertions(+), 3 deletions(-)
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 f6c7cbdb66a..d7f400955c0 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
@@ -23,6 +23,7 @@ import org.apache.doris.nereids.analyzer.Unbound;
import org.apache.doris.nereids.analyzer.UnboundVariable;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.AbstractTreeNode;
+import org.apache.doris.nereids.trees.expressions.ArrayItemReference.ArrayItemSlot;
import org.apache.doris.nereids.trees.expressions.functions.ExpressionTrait;
import org.apache.doris.nereids.trees.expressions.functions.Nondeterministic;
import org.apache.doris.nereids.trees.expressions.functions.agg.AggregateFunction;
@@ -67,7 +68,8 @@ public abstract class Expression extends AbstractTreeNode<Expression> implements
private final boolean inferred;
private final boolean hasUnbound;
private final boolean compareWidthAndDepth;
- private final Supplier<Set<Slot>> inputSlots = Suppliers.memoize(() -> collect(Slot.class::isInstance));
+ private final Supplier<Set<Slot>> inputSlots = Suppliers.memoize(
+ () -> collect(e -> e instanceof Slot && !(e instanceof ArrayItemSlot)));
protected Expression(Expression... children) {
super(children);
diff --git a/regression-test/data/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.out b/regression-test/data/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.out
index 860f5ff8f63..67487e816f1 100644
--- a/regression-test/data/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.out
+++ b/regression-test/data/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.out
@@ -4,3 +4,6 @@
-- !test_upper_project_projections_rewrite2 --
+-- !test_lambda --
+1
+
diff --git a/regression-test/suites/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.groovy b/regression-test/suites/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.groovy
index 1bf5e07c969..f7751a8bdf7 100644
--- a/regression-test/suites/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.groovy
+++ b/regression-test/suites/nereids_rules_p0/normalize_aggregate/normalize_aggregate_test.groovy
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
suite("normalize_aggregate") {
- sql "SET enable_nereids_planner=true"
- sql "SET enable_fallback_to_original_planner=false"
qt_test_upper_project_projections_rewrite """
SELECT DISTINCT + + ( ( + + 46 ) ) * 89 AS col0, COUNT( * ) + + - 72 + - - 87 - AVG ( ALL - 56 ) * COUNT( * ) + - CASE + 49 WHEN 6 * + 76 + - +
CAST( NULL AS SIGNED ) THEN NULL WHEN - COUNT( DISTINCT + + CAST( NULL AS SIGNED ) ) + 23 THEN NULL ELSE - + 43 * 32 - + 97 + - ( + 65 ) * + +
@@ -29,4 +27,8 @@ suite("normalize_aggregate") {
qt_test_upper_project_projections_rewrite2 """
SELECT - + AVG ( DISTINCT - col0 ) * - col0 FROM
normalize_aggregate_tab WHERE + - col0 IS NULL GROUP BY col0 HAVING NULL IS NULL;"""
+
+ qt_test_lambda """
+ select count(array_filter(i -> (i > 0.99), array(1, 2, 3)))
+ """
}
\ 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