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 2022/12/07 12:14:21 UTC
[doris] branch master updated: [fix](nereids)translate is not null predicate mistake (#14866)
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 a3095e29d5 [fix](nereids)translate is not null predicate mistake (#14866)
a3095e29d5 is described below
commit a3095e29d53c3f9c3258b9b42f2adf05cb655cc9
Author: starocean999 <40...@users.noreply.github.com>
AuthorDate: Wed Dec 7 20:14:13 2022 +0800
[fix](nereids)translate is not null predicate mistake (#14866)
the 'is not null' predicate is not translated correctly in ExpressionTranslator
---
.../doris/nereids/glue/translator/ExpressionTranslator.java | 2 +-
.../data/bloom_filter_p0/test_bloom_filter_is_not_null.out | 10 ++++++++++
.../bloom_filter_p0/test_bloom_filter_is_not_null.groovy | 11 +++++++++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java
index 1863da7c7f..00069ff284 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java
@@ -172,7 +172,7 @@ public class ExpressionTranslator extends DefaultExpressionVisitor<Expr, PlanTra
} else if (not.child() instanceof InSubquery || not.child() instanceof Exists) {
return new BoolLiteral(true);
} else if (not.child() instanceof IsNull) {
- return new IsNullPredicate(not.child().accept(this, context), true);
+ return new IsNullPredicate(((IsNull) not.child()).child().accept(this, context), true);
} else {
return new CompoundPredicate(CompoundPredicate.Operator.NOT,
not.child(0).accept(this, context), null);
diff --git a/regression-test/data/bloom_filter_p0/test_bloom_filter_is_not_null.out b/regression-test/data/bloom_filter_p0/test_bloom_filter_is_not_null.out
index f578ece9b8..bb14d3d467 100644
--- a/regression-test/data/bloom_filter_p0/test_bloom_filter_is_not_null.out
+++ b/regression-test/data/bloom_filter_p0/test_bloom_filter_is_not_null.out
@@ -9,3 +9,13 @@ b
-- !select_null --
\N
+-- !select_all --
+\N
+b
+
+-- !select_not_null --
+b
+
+-- !select_null --
+\N
+
diff --git a/regression-test/suites/bloom_filter_p0/test_bloom_filter_is_not_null.groovy b/regression-test/suites/bloom_filter_p0/test_bloom_filter_is_not_null.groovy
index e29da1725e..c805138301 100644
--- a/regression-test/suites/bloom_filter_p0/test_bloom_filter_is_not_null.groovy
+++ b/regression-test/suites/bloom_filter_p0/test_bloom_filter_is_not_null.groovy
@@ -33,7 +33,18 @@ suite("test_bloom_filter_is_not_null") {
sql """INSERT INTO ${table_name} values (null), ('b')"""
+ sql 'set enable_nereids_planner=false'
qt_select_all """select * from ${table_name} order by a"""
qt_select_not_null """select * from ${table_name} WHERE a is not null"""
qt_select_null """select * from ${table_name} WHERE a is null"""
+
+ sql 'set enable_vectorized_engine=true'
+ sql 'set enable_nereids_planner=true'
+ sql 'set enable_fallback_to_original_planner=false'
+ qt_select_all """select * from ${table_name} order by a"""
+ qt_select_not_null """select * from ${table_name} WHERE a is not null"""
+ qt_select_null """select * from ${table_name} WHERE a is null"""
+
+ sql 'set enable_nereids_planner=false'
+ sql 'set enable_fallback_to_original_planner=true'
}
\ 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