Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ public List<Rule> buildRules() {
);
})
.thenApply(ctx -> {
Set<Integer> enableNereidsRules = ctx.cascadesContext.getConnectContext()
.getSessionVariable().getEnableNereidsRules();
if (!enableNereidsRules.contains(RuleType.PUSH_DOWN_AGG_THROUGH_JOIN.type())) {
return null;
}
LogicalAggregate<LogicalJoin<Plan, Plan>> agg = ctx.root;
return pushAgg(agg, agg.child(), ImmutableList.of());
})
Expand All @@ -109,11 +104,6 @@ public List<Rule> buildRules() {
);
})
.thenApply(ctx -> {
Set<Integer> enableNereidsRules = ctx.cascadesContext.getConnectContext()
.getSessionVariable().getEnableNereidsRules();
if (!enableNereidsRules.contains(RuleType.PUSH_DOWN_AGG_THROUGH_JOIN.type())) {
return null;
}
LogicalAggregate<LogicalProject<LogicalJoin<Plan, Plan>>> agg = ctx.root;
return pushAgg(agg, agg.child().child(), agg.child().getProjects());
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ public List<Rule> buildRules() {
&& (f.children().isEmpty() || f.child(0) instanceof Slot)));
})
.thenApply(ctx -> {
Set<Integer> enableNereidsRules = ctx.cascadesContext.getConnectContext()
.getSessionVariable().getEnableNereidsRules();
if (!enableNereidsRules.contains(RuleType.PUSH_DOWN_AGG_THROUGH_JOIN_ONE_SIDE.type())) {
return null;
}
LogicalAggregate<LogicalJoin<Plan, Plan>> agg = ctx.root;
return pushMinMaxSumCount(agg, agg.child(), ImmutableList.of());
})
Expand All @@ -101,11 +96,6 @@ public List<Rule> buildRules() {
&& (f.children().isEmpty() || f.child(0) instanceof Slot));
})
.thenApply(ctx -> {
Set<Integer> enableNereidsRules = ctx.cascadesContext.getConnectContext()
.getSessionVariable().getEnableNereidsRules();
if (!enableNereidsRules.contains(RuleType.PUSH_DOWN_AGG_THROUGH_JOIN_ONE_SIDE.type())) {
return null;
}
LogicalAggregate<LogicalProject<LogicalJoin<Plan, Plan>>> agg = ctx.root;
return pushMinMaxSumCount(agg, agg.child().child(), agg.child().getProjects());
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.doris.nereids.rules.rewrite;

import org.apache.doris.nereids.jobs.JobContext;
import org.apache.doris.nereids.rules.RuleType;
import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.algebra.Relation;
import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
Expand All @@ -30,7 +29,6 @@

import com.google.common.collect.ImmutableList;

import java.util.Set;
import java.util.function.Function;

/**
Expand All @@ -39,11 +37,6 @@
public class PushDownDistinctThroughJoin extends DefaultPlanRewriter<JobContext> implements CustomRewriter {
@Override
public Plan rewriteRoot(Plan plan, JobContext context) {
Set<Integer> enableNereidsRules = context.getCascadesContext().getConnectContext()
.getSessionVariable().getEnableNereidsRules();
if (!enableNereidsRules.contains(RuleType.PUSH_DOWN_DISTINCT_THROUGH_JOIN.type())) {
return null;
}
return plan.accept(this, context);
}

Expand Down
46 changes: 28 additions & 18 deletions regression-test/data/nereids_rules_p0/eager_aggregate/basic.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,54 +40,64 @@ PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------filter((a.event_id = 'ad_click'))
----------PhysicalOlapScan[com_dd_library]
--------filter((cast(experiment_id as DOUBLE) = 37.0))
----------PhysicalOlapScan[shunt_log_com_dd_library]
--------hashAgg[LOCAL]
----------hashAgg[LOCAL]
------------filter((a.event_id = 'ad_click'))
--------------PhysicalOlapScan[com_dd_library]
--------hashAgg[LOCAL]
----------filter((cast(experiment_id as DOUBLE) = 37.0))
------------PhysicalOlapScan[shunt_log_com_dd_library]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed: use_push_down_agg_through_join
SyntaxError:

-- !with_hint_2 --
PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------PhysicalOlapScan[com_dd_library]
--------filter((cast(experiment_id as DOUBLE) = 73.0))
----------PhysicalOlapScan[shunt_log_com_dd_library]
--------hashAgg[LOCAL]
----------hashAgg[LOCAL]
------------PhysicalOlapScan[com_dd_library]
--------hashAgg[LOCAL]
----------filter((cast(experiment_id as DOUBLE) = 73.0))
------------PhysicalOlapScan[shunt_log_com_dd_library]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed: use_push_down_agg_through_join
SyntaxError:

-- !with_hint_3 --
PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------PhysicalOlapScan[com_dd_library]
--------hashAgg[LOCAL]
----------PhysicalOlapScan[com_dd_library]
--------filter((cast(experiment_id as DOUBLE) = 73.0))
----------PhysicalOlapScan[shunt_log_com_dd_library]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed: use_push_down_agg_through_join
SyntaxError:

-- !with_hint_4 --
PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------PhysicalOlapScan[com_dd_library]
--------PhysicalOlapScan[shunt_log_com_dd_library]
--------hashAgg[LOCAL]
----------hashAgg[LOCAL]
------------PhysicalOlapScan[com_dd_library]
--------hashAgg[LOCAL]
----------PhysicalOlapScan[shunt_log_com_dd_library]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed: use_push_down_agg_through_join
SyntaxError:

Original file line number Diff line number Diff line change
Expand Up @@ -40,54 +40,64 @@ PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------filter((a.event_id = 'ad_click'))
----------PhysicalOlapScan[com_dd_library_one_side]
--------filter((cast(experiment_id as DOUBLE) = 37.0))
----------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
--------hashAgg[LOCAL]
----------hashAgg[LOCAL]
------------filter((a.event_id = 'ad_click'))
--------------PhysicalOlapScan[com_dd_library_one_side]
--------hashAgg[LOCAL]
----------filter((cast(experiment_id as DOUBLE) = 37.0))
------------PhysicalOlapScan[shunt_log_com_dd_library_one_side]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed:
SyntaxError:

-- !with_hint_2 --
PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------PhysicalOlapScan[com_dd_library_one_side]
--------filter((cast(experiment_id as DOUBLE) = 73.0))
----------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
--------hashAgg[LOCAL]
----------hashAgg[LOCAL]
------------PhysicalOlapScan[com_dd_library_one_side]
--------hashAgg[LOCAL]
----------filter((cast(experiment_id as DOUBLE) = 73.0))
------------PhysicalOlapScan[shunt_log_com_dd_library_one_side]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed:
SyntaxError:

-- !with_hint_3 --
PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------PhysicalOlapScan[com_dd_library_one_side]
--------hashAgg[LOCAL]
----------PhysicalOlapScan[com_dd_library_one_side]
--------filter((cast(experiment_id as DOUBLE) = 73.0))
----------PhysicalOlapScan[shunt_log_com_dd_library_one_side]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed:
SyntaxError:

-- !with_hint_4 --
PhysicalResultSink
--hashAgg[GLOBAL]
----hashAgg[LOCAL]
------hashJoin[INNER_JOIN] hashCondition=((a.device_id = b.device_id)) otherCondition=()
--------PhysicalOlapScan[com_dd_library_one_side]
--------PhysicalOlapScan[shunt_log_com_dd_library_one_side]
--------hashAgg[LOCAL]
----------hashAgg[LOCAL]
------------PhysicalOlapScan[com_dd_library_one_side]
--------hashAgg[LOCAL]
----------PhysicalOlapScan[shunt_log_com_dd_library_one_side]

Hint log:
Used:
UnUsed: use_push_down_agg_through_join_one_side
Used: use_push_down_agg_through_join_one_side
UnUsed:
SyntaxError:

Loading