From 4f08aa7a4df8e4d6c232dc80a30b2364a1b1b4e0 Mon Sep 17 00:00:00 2001 From: englefly Date: Thu, 14 Sep 2023 18:34:46 +0800 Subject: [PATCH] fix rf --- .../plans/physical/PhysicalHashJoin.java | 19 +------------------ .../trees/plans/physical/PhysicalTopN.java | 12 ++++++++++++ .../trees/plans/physical/PhysicalWindow.java | 11 +++++++++++ .../postprocess/RuntimeFilterTest.java | 14 ++++++++++++++ post_build.sh | 7 +++++++ 5 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 post_build.sh diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java index 466b345e6f746d..057ae30c800b22 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java @@ -255,24 +255,7 @@ public boolean pushDownRuntimeFilter(CascadesContext context, IdGenerator { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalTopN.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalTopN.java index 4c24a03b789357..588cb820db8dc5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalTopN.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalTopN.java @@ -17,10 +17,13 @@ package org.apache.doris.nereids.trees.plans.physical; +import org.apache.doris.common.IdGenerator; +import org.apache.doris.nereids.CascadesContext; import org.apache.doris.nereids.memo.GroupExpression; import org.apache.doris.nereids.properties.LogicalProperties; import org.apache.doris.nereids.properties.OrderKey; import org.apache.doris.nereids.properties.PhysicalProperties; +import org.apache.doris.nereids.trees.expressions.Expression; import org.apache.doris.nereids.trees.expressions.Slot; import org.apache.doris.nereids.trees.plans.Plan; import org.apache.doris.nereids.trees.plans.PlanType; @@ -28,9 +31,11 @@ import org.apache.doris.nereids.trees.plans.algebra.TopN; import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor; import org.apache.doris.nereids.util.Utils; +import org.apache.doris.planner.RuntimeFilterId; import org.apache.doris.statistics.Statistics; import com.google.common.base.Preconditions; +import org.apache.doris.thrift.TRuntimeFilterType; import java.util.List; import java.util.Objects; @@ -169,4 +174,11 @@ public PhysicalTopN resetLogicalProperties() { null, physicalProperties, statistics, child()); } + public boolean pushDownRuntimeFilter(CascadesContext context, IdGenerator generator, + AbstractPhysicalJoin builderNode, + Expression src, Expression probeExpr, + TRuntimeFilterType type, long buildSideNdv, int exprOrder) { + return false; + } + } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalWindow.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalWindow.java index b1703f47496706..0bd19ea499b662 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalWindow.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalWindow.java @@ -17,6 +17,8 @@ package org.apache.doris.nereids.trees.plans.physical; +import org.apache.doris.common.IdGenerator; +import org.apache.doris.nereids.CascadesContext; import org.apache.doris.nereids.memo.GroupExpression; import org.apache.doris.nereids.properties.LogicalProperties; import org.apache.doris.nereids.properties.PhysicalProperties; @@ -31,10 +33,12 @@ import org.apache.doris.nereids.trees.plans.algebra.Window; import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor; import org.apache.doris.nereids.util.Utils; +import org.apache.doris.planner.RuntimeFilterId; import org.apache.doris.statistics.Statistics; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import org.apache.doris.thrift.TRuntimeFilterType; import java.util.List; import java.util.Objects; @@ -188,4 +192,11 @@ public PhysicalWindow resetLogicalProperties() { return new PhysicalWindow<>(windowFrameGroup, requireProperties, windowExpressions, groupExpression, null, physicalProperties, statistics, child()); } + + public boolean pushDownRuntimeFilter(CascadesContext context, IdGenerator generator, + AbstractPhysicalJoin builderNode, + Expression src, Expression probeExpr, + TRuntimeFilterType type, long buildSideNdv, int exprOrder) { + return false; + } } diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/postprocess/RuntimeFilterTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/postprocess/RuntimeFilterTest.java index fc08b0c35d71d6..966e4b28b61007 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/postprocess/RuntimeFilterTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/postprocess/RuntimeFilterTest.java @@ -255,4 +255,18 @@ private void checkRuntimeFilterExprs(List filters, List filters = getRuntimeFilters(sql).get(); + Assertions.assertEquals(0, filters.size()); + } + + @Test + public void testRuntimeFilterBlockByTopN() { + String sql = "SELECT * FROM (select lo_custkey from lineorder order by lo_custkey limit 10) t JOIN customer on lo_custkey = c_custkey"; + List filters = getRuntimeFilters(sql).get(); + Assertions.assertEquals(0, filters.size()); + } } diff --git a/post_build.sh b/post_build.sh new file mode 100644 index 00000000000000..7fb772f90eda1c --- /dev/null +++ b/post_build.sh @@ -0,0 +1,7 @@ + +cp -r fe/fe-core/target/generated-sources/annotations/* fe/fe-core/target/generated-sources +cp -r fe/fe-core/target/generated-sources/cup/* fe/fe-core/target/generated-sources +rm -rf fe/fe-core/target/generated-sources/cup/* +rm -rf fe/fe-core/target/generated-sources/annotations/* +cp output/fe/lib/help-resource.zip fe/target/classes/ +cp output/fe/lib/help-resource.zip fe/fe-core/target/classes/