This is an automated email from the ASF dual-hosted git repository.
englefly 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 a539e22625f [fix](nereids) Create Runtime filter even if equal.right
is not in aliasTransferMap (#46406)
a539e22625f is described below
commit a539e22625f5801b1ac3ece42b7910a51b9d7e4f
Author: minghong <[email protected]>
AuthorDate: Mon Jan 6 09:41:36 2025 +0800
[fix](nereids) Create Runtime filter even if equal.right is not in
aliasTransferMap (#46406)
### What problem does this PR solve?
fix a bug introduced by #40815
---
.../processor/post/RuntimeFilterGenerator.java | 4 --
.../data/nereids_p0/runtime_filter/check_rf.out | 16 +++++++
.../nereids_p0/runtime_filter/check_rf.groovy | 51 ++++++++++++++++++++++
3 files changed, 67 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
index 3cff9dfd001..c7e8ae01fcd 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
@@ -275,10 +275,6 @@ public class RuntimeFilterGenerator extends
PlanPostProcessor {
continue;
}
long buildSideNdv = getBuildSideNdv(join, equalTo);
- Pair<PhysicalRelation, Slot> pair =
ctx.getAliasTransferMap().get(equalTo.right());
- if (pair == null) {
- continue;
- }
if (equalTo.left().getInputSlots().size() == 1) {
RuntimeFilterPushDownVisitor.PushDownContext
pushDownContext =
RuntimeFilterPushDownVisitor.PushDownContext.createPushDownContextForHashJoin(
diff --git a/regression-test/data/nereids_p0/runtime_filter/check_rf.out
b/regression-test/data/nereids_p0/runtime_filter/check_rf.out
new file mode 100644
index 00000000000..48ffb4af70e
--- /dev/null
+++ b/regression-test/data/nereids_p0/runtime_filter/check_rf.out
@@ -0,0 +1,16 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !1 --
+PhysicalResultSink
+--PhysicalDistribute[DistributionSpecGather]
+----PhysicalProject
+------hashJoin[INNER_JOIN broadcast] hashCondition=((t1.id = t2.maxId))
otherCondition=() build RFs:RF0 maxId->[id]
+--------PhysicalProject
+----------PhysicalOlapScan[t1] apply RFs: RF0
+--------PhysicalProject
+----------hashAgg[GLOBAL]
+------------PhysicalDistribute[DistributionSpecHash]
+--------------hashAgg[LOCAL]
+----------------PhysicalProject
+------------------filter((t1.id < 100))
+--------------------PhysicalOlapScan[t1]
+
diff --git a/regression-test/suites/nereids_p0/runtime_filter/check_rf.groovy
b/regression-test/suites/nereids_p0/runtime_filter/check_rf.groovy
new file mode 100644
index 00000000000..489d6ce15cf
--- /dev/null
+++ b/regression-test/suites/nereids_p0/runtime_filter/check_rf.groovy
@@ -0,0 +1,51 @@
+// 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("check_rf") {
+ sql """
+ drop table if exists t1;
+ set disable_join_reorder=true;
+ set enable_parallel_result_sink=false;
+ set runtime_filter_type=2;
+ """
+ sql """
+ CREATE TABLE IF NOT EXISTS t1 (
+ `app_name` VARCHAR(64) NULL COMMENT '标识',
+ `event_id` VARCHAR(128) NULL COMMENT '标识',
+ `decision` VARCHAR(32) NULL COMMENT '枚举值',
+ `time` DATETIME NULL COMMENT '查询时间',
+ `id` int NOT NULL COMMENT 'od'
+ )
+ DISTRIBUTED BY HASH(event_id)
+ BUCKETS 3 PROPERTIES ("replication_num" = "1");
+ """
+
+ sql """
+ insert into t1 values
+ ('aa', 'bc', 'cc', '2024-07-03 01:15:30', 1),
+ ('ab', 'bc', 'cc', '2024-07-03 01:15:30', 2),
+ ('ac', 'bc', 'cc', '2024-07-03 01:15:30', 3),
+ ('ad', 'bc', 'cc', '2024-07-03 01:15:30', 4);
+ """
+
+ // even if equalTo.right is not in aliasTransferMap, generate the rf
+ qt_1 """
+ explain shape plan
+ select t1.app_name
+ from t1 join (select max(id) as maxId from t1 where id < 100 group by
app_name) t2 on t1.id = t2.maxId;
+ """
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]