Skip to content

Commit

Permalink
rf
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Jan 3, 2025
1 parent c28c00a commit 3e5b8e5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,6 @@ public PhysicalPlan visitPhysicalHashJoin(PhysicalHashJoin<? extends Plan, ? ext
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(
Expand Down
50 changes: 50 additions & 0 deletions regression-test/suites/nereids_p0/runtime_filter/check_rf.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// 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;
"""
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 group by app_name) t2 on t1.id = t2.maxId;
"""

}

0 comments on commit 3e5b8e5

Please sign in to comment.