[fix](Nereids) column pruning should prune map in cte consumer (#34079)

we save bi-map in cte consumer to get the maping between producer and consumer.
the consumer's output is decided by the map in it.
so, cte consumer should be output prunable, and should remove useless entry from map when do column pruning
This commit is contained in:
morrySnow
2024-04-26 12:37:08 +08:00
committed by yiguolei
parent b41a5339d3
commit b24ff9953d
73 changed files with 514 additions and 499 deletions

View File

@ -50,7 +50,6 @@ import org.apache.doris.nereids.rules.analysis.BindRelation.CustomTableResolver;
import org.apache.doris.nereids.rules.exploration.mv.MaterializationContext;
import org.apache.doris.nereids.trees.expressions.CTEId;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.SubqueryExpr;
import org.apache.doris.nereids.trees.plans.Plan;
@ -102,7 +101,7 @@ public class CascadesContext implements ScheduleContext {
private Optional<RootRewriteJobContext> currentRootRewriteJobContext;
// in optimize stage, the plan will storage in the memo
private Memo memo;
private StatementContext statementContext;
private final StatementContext statementContext;
private final CTEContext cteContext;
private final RuleSet ruleSet;
@ -616,16 +615,6 @@ public class CascadesContext implements ScheduleContext {
consumers.add(cteConsumer);
}
public void putCTEIdToProject(CTEId cteId, NamedExpression p) {
Set<NamedExpression> projects = this.statementContext.getCteIdToProjects()
.computeIfAbsent(cteId, k -> new HashSet<>());
projects.add(p);
}
public Set<NamedExpression> getProjectForProducer(CTEId cteId) {
return this.statementContext.getCteIdToProjects().get(cteId);
}
public Map<CTEId, Set<LogicalCTEConsumer>> getCteIdToConsumers() {
return this.statementContext.getCteIdToConsumers();
}
@ -639,17 +628,6 @@ public class CascadesContext implements ScheduleContext {
return this.statementContext.getConsumerIdToFilters();
}
public void markConsumerUnderProject(LogicalCTEConsumer cteConsumer) {
Set<RelationId> consumerIds = this.statementContext.getCteIdToConsumerUnderProjects()
.computeIfAbsent(cteConsumer.getCteId(), k -> new HashSet<>());
consumerIds.add(cteConsumer.getRelationId());
}
public boolean couldPruneColumnOnProducer(CTEId cteId) {
Set<RelationId> consumerIds = this.statementContext.getCteIdToConsumerUnderProjects().get(cteId);
return consumerIds.size() == this.statementContext.getCteIdToConsumers().get(cteId).size();
}
public void addCTEConsumerGroup(CTEId cteId, Group g, Map<Slot, Slot> producerSlotToConsumerSlot) {
List<Pair<Map<Slot, Slot>, Group>> consumerGroups =
this.statementContext.getCteIdToConsumerGroup().computeIfAbsent(cteId, k -> new ArrayList<>());
@ -746,7 +724,7 @@ public class CascadesContext implements ScheduleContext {
public static void printPlanProcess(List<PlanProcess> planProcesses) {
for (PlanProcess row : planProcesses) {
LOG.info("RULE: " + row.ruleName + "\nBEFORE:\n" + row.beforeShape + "\nafter:\n" + row.afterShape);
LOG.info("RULE: {}\nBEFORE:\n{}\nafter:\n{}", row.ruleName, row.beforeShape, row.afterShape);
}
}

View File

@ -27,7 +27,6 @@ import org.apache.doris.nereids.rules.analysis.ColumnAliasGenerator;
import org.apache.doris.nereids.trees.expressions.CTEId;
import org.apache.doris.nereids.trees.expressions.ExprId;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.SlotReference;
import org.apache.doris.nereids.trees.plans.ObjectId;
@ -54,7 +53,6 @@ import java.io.Closeable;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -103,9 +101,8 @@ public class StatementContext implements Closeable {
private final IdGenerator<CTEId> cteIdGenerator = CTEId.createGenerator();
private final Map<CTEId, Set<LogicalCTEConsumer>> cteIdToConsumers = new HashMap<>();
private final Map<CTEId, Set<NamedExpression>> cteIdToProjects = new HashMap<>();
private final Map<CTEId, Set<Slot>> cteIdToOutputIds = new HashMap<>();
private final Map<RelationId, Set<Expression>> consumerIdToFilters = new HashMap<>();
private final Map<CTEId, Set<RelationId>> cteIdToConsumerUnderProjects = new HashMap<>();
// Used to update consumer's stats
private final Map<CTEId, List<Pair<Map<Slot, Slot>, Group>>> cteIdToConsumerGroup = new HashMap<>();
private final Map<CTEId, LogicalPlan> rewrittenCteProducer = new HashMap<>();
@ -134,12 +131,13 @@ public class StatementContext implements Closeable {
private BitSet disableRules;
// table locks
private Stack<CloseableResource> plannerResources = new Stack<>();
private final Stack<CloseableResource> plannerResources = new Stack<>();
// for create view support in nereids
// key is the start and end position of the sql substring that needs to be replaced,
// and value is the new string used for replacement.
private TreeMap<Pair<Integer, Integer>, String> indexInSqlToString = new TreeMap<>(new Pair.PairComparator<>());
private final TreeMap<Pair<Integer, Integer>, String> indexInSqlToString
= new TreeMap<>(new Pair.PairComparator<>());
public StatementContext() {
this(ConnectContext.get(), null, 0);
@ -216,10 +214,6 @@ public class StatementContext implements Closeable {
return Optional.ofNullable(sqlCacheContext);
}
public int getMaxContinuousJoin() {
return joinCount;
}
public Set<SlotReference> getAllPathsSlots() {
Set<SlotReference> allSlotReferences = Sets.newHashSet();
for (Map<List<String>, SlotReference> slotReferenceMap : subColumnSlotRefMap.values()) {
@ -240,19 +234,16 @@ public class StatementContext implements Closeable {
* Add a slot ref attached with paths in context to avoid duplicated slot
*/
public void addPathSlotRef(Slot root, List<String> paths, SlotReference slotRef, Expression originalExpr) {
subColumnSlotRefMap.computeIfAbsent(root, k -> Maps.newTreeMap(new Comparator<List<String>>() {
@Override
public int compare(List<String> lst1, List<String> lst2) {
Iterator<String> it1 = lst1.iterator();
Iterator<String> it2 = lst2.iterator();
while (it1.hasNext() && it2.hasNext()) {
int result = it1.next().compareTo(it2.next());
if (result != 0) {
return result;
}
subColumnSlotRefMap.computeIfAbsent(root, k -> Maps.newTreeMap((lst1, lst2) -> {
Iterator<String> it1 = lst1.iterator();
Iterator<String> it2 = lst2.iterator();
while (it1.hasNext() && it2.hasNext()) {
int result = it1.next().compareTo(it2.next());
if (result != 0) {
return result;
}
return Integer.compare(lst1.size(), lst2.size());
}
return Integer.compare(lst1.size(), lst2.size());
}));
subColumnSlotRefMap.get(root).put(paths, slotRef);
subColumnOriginalExprMap.put(slotRef, originalExpr);
@ -349,18 +340,14 @@ public class StatementContext implements Closeable {
return cteIdToConsumers;
}
public Map<CTEId, Set<NamedExpression>> getCteIdToProjects() {
return cteIdToProjects;
public Map<CTEId, Set<Slot>> getCteIdToOutputIds() {
return cteIdToOutputIds;
}
public Map<RelationId, Set<Expression>> getConsumerIdToFilters() {
return consumerIdToFilters;
}
public Map<CTEId, Set<RelationId>> getCteIdToConsumerUnderProjects() {
return cteIdToConsumerUnderProjects;
}
public Map<CTEId, List<Pair<Map<Slot, Slot>, Group>>> getCteIdToConsumerGroup() {
return cteIdToConsumerGroup;
}

View File

@ -1119,9 +1119,13 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, Pla
// update expr to slot mapping
TupleDescriptor tupleDescriptor = null;
for (Slot producerSlot : cteProducer.getOutput()) {
Slot consumerSlot = cteConsumer.getProducerToConsumerSlotMap().get(producerSlot);
SlotRef slotRef = context.findSlotRef(producerSlot.getExprId());
tupleDescriptor = slotRef.getDesc().getParent();
Slot consumerSlot = cteConsumer.getProducerToConsumerSlotMap().get(producerSlot);
// consumerSlot could be null if we prune partial consumers' columns
if (consumerSlot == null) {
continue;
}
context.addExprIdSlotRefPair(consumerSlot.getExprId(), slotRef);
}
CTEScanNode cteScanNode = new CTEScanNode(tupleDescriptor);

View File

@ -43,8 +43,8 @@ import org.apache.doris.nereids.rules.rewrite.CheckDataTypes;
import org.apache.doris.nereids.rules.rewrite.CheckMatchExpression;
import org.apache.doris.nereids.rules.rewrite.CheckMultiDistinct;
import org.apache.doris.nereids.rules.rewrite.CheckPrivileges;
import org.apache.doris.nereids.rules.rewrite.CollectCteConsumerOutput;
import org.apache.doris.nereids.rules.rewrite.CollectFilterAboveConsumer;
import org.apache.doris.nereids.rules.rewrite.CollectProjectAboveConsumer;
import org.apache.doris.nereids.rules.rewrite.ColumnPruning;
import org.apache.doris.nereids.rules.rewrite.ConvertInnerOrCrossJoin;
import org.apache.doris.nereids.rules.rewrite.CountDistinctRewrite;
@ -417,7 +417,7 @@ public class Rewriter extends AbstractBatchJobExecutor {
topic("Push project and filter on cte consumer to cte producer",
topDown(
new CollectFilterAboveConsumer(),
new CollectProjectAboveConsumer()
new CollectCteConsumerOutput()
)
)
);

View File

@ -306,8 +306,7 @@ public enum RuleType {
COLLECT_FILTER(RuleTypeClass.REWRITE),
COLLECT_JOIN_CONSTRAINT(RuleTypeClass.REWRITE),
COLLECT_PROJECT_ABOVE_CTE_CONSUMER(RuleTypeClass.REWRITE),
COLLECT_PROJECT_ABOVE_FILTER_CTE_CONSUMER(RuleTypeClass.REWRITE),
COLLECT_CTE_CONSUMER_OUTPUT(RuleTypeClass.REWRITE),
LEADING_JOIN(RuleTypeClass.REWRITE),
REWRITE_SENTINEL(RuleTypeClass.REWRITE),

View File

@ -0,0 +1,41 @@
// 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.
package org.apache.doris.nereids.rules.rewrite;
import org.apache.doris.nereids.rules.Rule;
import org.apache.doris.nereids.rules.RuleType;
import org.apache.doris.nereids.trees.expressions.Slot;
import java.util.HashSet;
import java.util.Set;
/**
* Collect outputs of CTE Consumer.
*/
public class CollectCteConsumerOutput extends OneRewriteRuleFactory {
@Override
public Rule build() {
return logicalCTEConsumer().thenApply(ctx -> {
Set<Slot> producerOutputs = ctx.statementContext
.getCteIdToOutputIds().computeIfAbsent(ctx.root.getCteId(), k -> new HashSet<>());
producerOutputs.addAll(ctx.root.getProducerToConsumerOutputMap().keySet());
return null;
}).toRule(RuleType.COLLECT_CTE_CONSUMER_OUTPUT);
}
}

View File

@ -1,81 +0,0 @@
// 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.
package org.apache.doris.nereids.rules.rewrite;
import org.apache.doris.nereids.CascadesContext;
import org.apache.doris.nereids.rules.Rule;
import org.apache.doris.nereids.rules.RuleType;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.plans.logical.LogicalCTEConsumer;
import org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
import org.apache.doris.nereids.trees.plans.logical.LogicalProject;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* Collect Projects Above CTE Consumer.
*/
public class CollectProjectAboveConsumer implements RewriteRuleFactory {
@Override
public List<Rule> buildRules() {
return ImmutableList.of(RuleType.COLLECT_PROJECT_ABOVE_CTE_CONSUMER
.build(logicalProject(logicalCTEConsumer()).thenApply(ctx -> {
LogicalProject<LogicalCTEConsumer> project = ctx.root;
List<NamedExpression> namedExpressions = project.getProjects();
LogicalCTEConsumer cteConsumer = project.child();
collectProject(ctx.cascadesContext, namedExpressions, cteConsumer);
return ctx.root;
})),
RuleType.COLLECT_PROJECT_ABOVE_FILTER_CTE_CONSUMER
.build(logicalProject(logicalFilter(logicalCTEConsumer())).thenApply(ctx -> {
LogicalProject<LogicalFilter<LogicalCTEConsumer>> project = ctx.root;
LogicalFilter<LogicalCTEConsumer> filter = project.child();
Set<Slot> filterSlots = filter.getInputSlots();
List<NamedExpression> namedExpressions = new ArrayList<>(project.getProjects());
for (Slot slot : filterSlots) {
if (!project.getOutput().contains(slot)) {
namedExpressions.add(slot);
}
}
collectProject(ctx.cascadesContext, namedExpressions, filter.child());
return ctx.root;
}))
);
}
private static void collectProject(CascadesContext ctx,
List<NamedExpression> namedExpressions, LogicalCTEConsumer cteConsumer) {
for (Expression expr : namedExpressions) {
expr.foreach(node -> {
if (!(node instanceof Slot)) {
return;
}
Slot slot = cteConsumer.getProducerSlot((Slot) node);
ctx.putCTEIdToProject(cteConsumer.getCteId(), slot);
ctx.markConsumerUnderProject(cteConsumer);
});
}
}
}

View File

@ -29,6 +29,7 @@ import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.algebra.Aggregate;
import org.apache.doris.nereids.trees.plans.algebra.SetOperation.Qualifier;
import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
import org.apache.doris.nereids.trees.plans.logical.LogicalCTEConsumer;
import org.apache.doris.nereids.trees.plans.logical.LogicalCTEProducer;
import org.apache.doris.nereids.trees.plans.logical.LogicalExcept;
import org.apache.doris.nereids.trees.plans.logical.LogicalIntersect;
@ -200,13 +201,21 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
return pruneAggregate(repeat, context);
}
private Plan pruneAggregate(Aggregate agg, PruneContext context) {
@Override
public Plan visitLogicalCTEProducer(LogicalCTEProducer<? extends Plan> cteProducer, PruneContext context) {
return skipPruneThisAndFirstLevelChildren(cteProducer);
}
@Override
public Plan visitLogicalCTEConsumer(LogicalCTEConsumer cteConsumer, PruneContext context) {
return super.visitLogicalCTEConsumer(cteConsumer, context);
}
private Plan pruneAggregate(Aggregate<?> agg, PruneContext context) {
// first try to prune group by and aggregate functions
Aggregate prunedOutputAgg = pruneOutput(agg, agg.getOutputs(), agg::pruneOutputs, context);
Aggregate fillUpAggr = fillUpGroupByAndOutput(prunedOutputAgg);
return pruneChildren(fillUpAggr);
Aggregate<? extends Plan> prunedOutputAgg = pruneOutput(agg, agg.getOutputs(), agg::pruneOutputs, context);
Aggregate<?> fillUpAggregate = fillUpGroupByAndOutput(prunedOutputAgg);
return pruneChildren(fillUpAggregate);
}
private Plan skipPruneThisAndFirstLevelChildren(Plan plan) {
@ -217,7 +226,7 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
return pruneChildren(plan, requireAllOutputOfChildren.build());
}
private static Aggregate<Plan> fillUpGroupByAndOutput(Aggregate<Plan> prunedOutputAgg) {
private static Aggregate<? extends Plan> fillUpGroupByAndOutput(Aggregate<? extends Plan> prunedOutputAgg) {
List<Expression> groupBy = prunedOutputAgg.getGroupByExpressions();
List<NamedExpression> output = prunedOutputAgg.getOutputExpressions();
@ -239,12 +248,11 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
ImmutableList.Builder<Expression> newGroupByExprList
= ImmutableList.builderWithExpectedSize(newOutputList.size());
for (NamedExpression e : newOutputList) {
if (!(aggregateFunctions.contains(e)
|| (e instanceof Alias && aggregateFunctions.contains(e.child(0))))) {
if (!(e instanceof Alias && aggregateFunctions.contains(e.child(0)))) {
newGroupByExprList.add(e);
}
}
return ((LogicalAggregate<Plan>) prunedOutputAgg).withGroupByAndOutput(
return ((LogicalAggregate<? extends Plan>) prunedOutputAgg).withGroupByAndOutput(
newGroupByExprList.build(), newOutputList);
}
@ -371,11 +379,6 @@ public class ColumnPruning extends DefaultPlanRewriter<PruneContext> implements
return prunedChild;
}
@Override
public Plan visitLogicalCTEProducer(LogicalCTEProducer<? extends Plan> cteProducer, PruneContext context) {
return skipPruneThisAndFirstLevelChildren(cteProducer);
}
/** PruneContext */
public static class PruneContext {
public Set<Slot> requiredSlots;

View File

@ -26,6 +26,7 @@ import org.apache.doris.nereids.properties.PhysicalProperties;
import org.apache.doris.nereids.trees.expressions.CTEId;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.SlotReference;
import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.RelationId;
@ -41,7 +42,6 @@ import org.apache.doris.nereids.util.ExpressionUtils;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.apache.commons.collections.CollectionUtils;
import java.util.HashSet;
import java.util.List;
@ -109,10 +109,17 @@ public class RewriteCteChildren extends DefaultPlanRewriter<CascadesContext> imp
} else {
child = (LogicalPlan) cteProducer.child();
child = tryToConstructFilter(cascadesContext, cteProducer.getCteId(), child);
Set<NamedExpression> projects = cascadesContext.getProjectForProducer(cteProducer.getCteId());
if (CollectionUtils.isNotEmpty(projects)
&& cascadesContext.couldPruneColumnOnProducer(cteProducer.getCteId())) {
child = new LogicalProject<>(ImmutableList.copyOf(projects), child);
Set<Slot> producerOutputs = cascadesContext.getStatementContext()
.getCteIdToOutputIds().get(cteProducer.getCteId());
if (producerOutputs.size() < child.getOutput().size()) {
ImmutableList.Builder<NamedExpression> projectsBuilder
= ImmutableList.builderWithExpectedSize(producerOutputs.size());
for (Slot slot : child.getOutput()) {
if (producerOutputs.contains(slot)) {
projectsBuilder.add(slot);
}
}
child = new LogicalProject<>(projectsBuilder.build(), child);
child = pushPlanUnderAnchor(child);
}
CascadesContext rewrittenCtx = CascadesContext.newSubtreeContext(

View File

@ -20,6 +20,7 @@ package org.apache.doris.nereids.trees.plans.logical;
import org.apache.doris.nereids.memo.GroupExpression;
import org.apache.doris.nereids.properties.LogicalProperties;
import org.apache.doris.nereids.trees.expressions.CTEId;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.SlotReference;
import org.apache.doris.nereids.trees.expressions.StatementScopeIdGenerator;
@ -36,6 +37,7 @@ import com.google.common.collect.ImmutableList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Optional;
@ -43,7 +45,7 @@ import java.util.Optional;
* LogicalCTEConsumer
*/
//TODO: find cte producer and propagate its functional dependencies
public class LogicalCTEConsumer extends LogicalRelation implements BlockFuncDepsPropagation {
public class LogicalCTEConsumer extends LogicalRelation implements BlockFuncDepsPropagation, OutputPrunable {
private final String name;
private final CTEId cteId;
@ -145,6 +147,24 @@ public class LogicalCTEConsumer extends LogicalRelation implements BlockFuncDeps
return ImmutableList.copyOf(producerToConsumerOutputMap.values());
}
@Override
public Plan pruneOutputs(List<NamedExpression> prunedOutputs) {
Map<Slot, Slot> consumerToProducerOutputMap = new LinkedHashMap<>(this.consumerToProducerOutputMap.size());
Map<Slot, Slot> producerToConsumerOutputMap = new LinkedHashMap<>(this.consumerToProducerOutputMap.size());
for (Entry<Slot, Slot> consumerToProducerSlot : this.consumerToProducerOutputMap.entrySet()) {
if (prunedOutputs.contains(consumerToProducerSlot.getKey())) {
consumerToProducerOutputMap.put(consumerToProducerSlot.getKey(), consumerToProducerSlot.getValue());
producerToConsumerOutputMap.put(consumerToProducerSlot.getValue(), consumerToProducerSlot.getKey());
}
}
return withTwoMaps(consumerToProducerOutputMap, producerToConsumerOutputMap);
}
@Override
public List<NamedExpression> getOutputs() {
return (List) this.getOutput();
}
public CTEId getCteId() {
return cteId;
}

View File

@ -24,8 +24,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------hashAgg[LOCAL]
--------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((store.s_store_sk = ctr1.ctr_store_sk)) otherCondition=() build RFs:RF1 s_store_sk->[ctr_store_sk]
------------------PhysicalDistribute[DistributionSpecHash]

View File

@ -47,8 +47,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecGather]
------------------hashAgg[LOCAL]
--------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------PhysicalDistribute[DistributionSpecReplicated]
--------------PhysicalProject
----------------hashAgg[GLOBAL]

View File

@ -613,8 +613,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = cte.c11)) otherCondition=()
------------------------PhysicalOlapScan[t1]
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-- !sql5_2 --
PhysicalCteAnchor ( cteId=CTEId#0 )
@ -639,8 +638,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((t1.c1 = cte.c11)) otherCondition=()
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------PhysicalOlapScan[t1]

View File

@ -39,6 +39,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -59,8 +59,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[item_sk]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=()
@ -73,13 +72,11 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 7) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF6 ws_item_sk->[item_sk]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=()
@ -92,6 +89,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 7) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )

View File

@ -55,6 +55,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecGather]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -43,6 +43,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,44 +2,42 @@
-- !ds_shape_31 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
----------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
--------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------PhysicalProject
------------------------filter((ss.d_year = 1999) and d_qoy IN (1, 2, 3))
--------------------------PhysicalOlapScan[date_dim]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------PhysicalOlapScan[customer_address]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk]
--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[ws_bill_addr_sk]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
----------------------PhysicalProject
------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((ss.d_year = 1999) and d_qoy IN (1, 2, 3))
--------------------------filter((ws.d_year = 1999) and d_qoy IN (1, 2, 3))
----------------------------PhysicalOlapScan[date_dim]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[customer_address]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------PhysicalProject
--------hashAgg[GLOBAL]
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[ws_bill_addr_sk]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------PhysicalProject
----------------------------filter((ws.d_year = 1999) and d_qoy IN (1, 2, 3))
------------------------------PhysicalOlapScan[date_dim]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------PhysicalOlapScan[customer_address]
----PhysicalResultSink
------PhysicalQuickSort[MERGE_SORT]
--------PhysicalDistribute[DistributionSpecGather]

View File

@ -29,11 +29,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------PhysicalQuickSort[LOCAL_SORT]
----------hashJoin[INNER_JOIN] hashCondition=((inv1.i_item_sk = inv2.i_item_sk) and (inv1.w_warehouse_sk = inv2.w_warehouse_sk)) otherCondition=()
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv1.d_moy = 1))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv1.d_moy = 1))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv2.d_moy = 2))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv2.d_moy = 2))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -41,9 +41,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2000))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2000))
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -41,9 +41,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,17 +2,16 @@
-- !ds_shape_59 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------PhysicalProject
----------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------PhysicalOlapScan[store_sales] apply RFs: RF0
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------PhysicalOlapScan[date_dim]
------------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
----PhysicalTopN[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]

View File

@ -45,3 +45,4 @@ PhysicalResultSink
--------------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------------------------------------PhysicalProject
------------------------------------------------------PhysicalOlapScan[store]

View File

@ -44,6 +44,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -23,16 +23,14 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF5 RF6
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF5 RF6
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[web_returns] apply RFs: RF6
----------------------PhysicalProject
------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF7 ws_order_number->[ws_order_number,ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF3 web_site_sk->[ws_web_site_sk]
------------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_ship_date_sk]

View File

@ -69,11 +69,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalProject
--------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=()
----------------------PhysicalDistribute[DistributionSpecHash]
@ -88,9 +86,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -37,6 +37,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------hashAgg[LOCAL]
--------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -65,11 +65,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------------------PhysicalProject
----------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF3
------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------PhysicalProject
----------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
@ -84,11 +82,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------------------PhysicalProject
----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF4
------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------PhysicalProject
----------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))

View File

@ -52,6 +52,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecGather]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -39,8 +39,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------filter((customer_address.ca_state = 'IN'))

View File

@ -2,30 +2,30 @@
-- !ds_shape_31 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=()
------------------PhysicalProject
--------------------PhysicalOlapScan[store_sales] apply RFs: RF1
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------PhysicalOlapScan[customer_address]
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
----------------------PhysicalOlapScan[date_dim]
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------PhysicalOlapScan[date_dim]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------PhysicalProject
--------hashAgg[GLOBAL]
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[ws_sold_date_sk]
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[ws_sold_date_sk]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=()
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
@ -33,10 +33,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------PhysicalOlapScan[customer_address]
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
------------------------PhysicalOlapScan[date_dim]
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
----------------------PhysicalOlapScan[date_dim]
----PhysicalResultSink
------PhysicalQuickSort[MERGE_SORT]
--------PhysicalDistribute[DistributionSpecGather]

View File

@ -28,11 +28,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------PhysicalQuickSort[LOCAL_SORT]
----------hashJoin[INNER_JOIN] hashCondition=((inv1.i_item_sk = inv2.i_item_sk) and (inv1.w_warehouse_sk = inv2.w_warehouse_sk)) otherCondition=()
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv1.d_moy = 1))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv1.d_moy = 1))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv2.d_moy = 2))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv2.d_moy = 2))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -46,7 +46,6 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -46,7 +46,6 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,17 +2,16 @@
-- !ds_shape_59 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
--------------PhysicalProject
----------------PhysicalOlapScan[store_sales]
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------PhysicalOlapScan[store_sales]
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------PhysicalOlapScan[date_dim]
------------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
----PhysicalTopN[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]

View File

@ -45,3 +45,4 @@ PhysicalResultSink
------------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------------PhysicalProject
----------------------------------------PhysicalOlapScan[store]

View File

@ -40,8 +40,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------hashAgg[LOCAL]
--------------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------filter((customer_address.ca_state = 'CA'))

View File

@ -21,8 +21,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF6 ws_order_number->[ws_order_number]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF5 web_site_sk->[ws_web_site_sk]
--------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF4 ca_address_sk->[ws_ship_addr_sk]
@ -31,8 +30,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------------------PhysicalProject
----------------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=()
------------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------------PhysicalProject
----------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------------PhysicalProject
----------------------------------------PhysicalOlapScan[web_returns] apply RFs: RF2

View File

@ -37,6 +37,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------hashAgg[LOCAL]
--------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -65,11 +65,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------------------PhysicalProject
----------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF3
------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------PhysicalProject
----------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
@ -84,11 +82,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------------------PhysicalProject
----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF4
------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------PhysicalProject
----------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))

View File

@ -52,6 +52,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecGather]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -39,8 +39,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------filter((customer_address.ca_state = 'IN'))

View File

@ -2,30 +2,30 @@
-- !ds_shape_31 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF1 d_date_sk->[ss_sold_date_sk]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF0 ca_address_sk->[ss_addr_sk]
------------------PhysicalProject
--------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------PhysicalOlapScan[customer_address]
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
----------------------PhysicalOlapScan[date_dim]
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------PhysicalOlapScan[date_dim]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------PhysicalProject
--------hashAgg[GLOBAL]
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[ws_sold_date_sk]
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF3 d_date_sk->[ws_sold_date_sk]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF2 ca_address_sk->[ws_bill_addr_sk]
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
@ -33,10 +33,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------PhysicalOlapScan[customer_address]
------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------PhysicalProject
----------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
------------------------PhysicalOlapScan[date_dim]
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
----------------------PhysicalOlapScan[date_dim]
----PhysicalResultSink
------PhysicalQuickSort[MERGE_SORT]
--------PhysicalDistribute[DistributionSpecGather]

View File

@ -28,11 +28,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------PhysicalQuickSort[LOCAL_SORT]
----------hashJoin[INNER_JOIN] hashCondition=((inv1.i_item_sk = inv2.i_item_sk) and (inv1.w_warehouse_sk = inv2.w_warehouse_sk)) otherCondition=()
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv1.d_moy = 1))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv1.d_moy = 1))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv2.d_moy = 2))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv2.d_moy = 2))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -46,7 +46,6 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -46,7 +46,6 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecHash]
----------------------PhysicalProject
------------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,17 +2,16 @@
-- !ds_shape_59 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------PhysicalProject
----------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------PhysicalOlapScan[store_sales] apply RFs: RF0
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------PhysicalOlapScan[date_dim]
------------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
----PhysicalTopN[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]

View File

@ -40,8 +40,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------hashAgg[LOCAL]
--------------------------PhysicalDistribute[DistributionSpecExecutionAny]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------filter((customer_address.ca_state = 'CA'))

View File

@ -21,8 +21,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF12 ws_order_number->[ws_order_number];RF13 ws_order_number->[ws_order_number]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF12 RF13
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF12 RF13
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF10 web_site_sk->[ws_web_site_sk];RF11 web_site_sk->[ws_web_site_sk]
--------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF8 ca_address_sk->[ws_ship_addr_sk];RF9 ca_address_sk->[ws_ship_addr_sk]
@ -31,8 +30,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------------------PhysicalProject
----------------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF2 wr_order_number->[ws_order_number];RF3 wr_order_number->[ws_order_number]
------------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------------PhysicalProject
----------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF2 RF3
--------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF2 RF3
------------------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------------------PhysicalProject
----------------------------------------PhysicalOlapScan[web_returns] apply RFs: RF4 RF5

View File

@ -39,6 +39,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -59,8 +59,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[item_sk]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=()
@ -73,13 +72,11 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF6 ws_item_sk->[item_sk]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=()
@ -92,6 +89,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )

View File

@ -55,6 +55,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecGather]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -43,6 +43,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,44 +2,42 @@
-- !ds_shape_31 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=()
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
----------------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------PhysicalProject
------------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------------PhysicalOlapScan[date_dim]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------PhysicalOlapScan[customer_address]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=()
--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=()
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
----------------------PhysicalProject
------------------------PhysicalOlapScan[store_sales] apply RFs: RF0
------------------------PhysicalOlapScan[web_sales] apply RFs: RF2
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
----------------------------PhysicalOlapScan[date_dim]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[customer_address]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------PhysicalProject
--------hashAgg[GLOBAL]
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=()
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2
------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------PhysicalProject
----------------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
------------------------------PhysicalOlapScan[date_dim]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------PhysicalOlapScan[customer_address]
----PhysicalResultSink
------PhysicalQuickSort[MERGE_SORT]
--------PhysicalDistribute[DistributionSpecGather]

View File

@ -28,11 +28,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------PhysicalQuickSort[LOCAL_SORT]
----------hashJoin[INNER_JOIN] hashCondition=((inv1.i_item_sk = inv2.i_item_sk) and (inv1.w_warehouse_sk = inv2.w_warehouse_sk)) otherCondition=()
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv1.d_moy = 1))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv1.d_moy = 1))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv2.d_moy = 2))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv2.d_moy = 2))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -41,9 +41,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -42,9 +42,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,17 +2,16 @@
-- !ds_shape_59 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=()
--------------PhysicalProject
----------------PhysicalOlapScan[store_sales]
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------PhysicalOlapScan[store_sales]
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------PhysicalOlapScan[date_dim]
------------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
----PhysicalTopN[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]

View File

@ -45,3 +45,4 @@ PhysicalResultSink
--------------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------------------------------------PhysicalProject
------------------------------------------------------PhysicalOlapScan[store]

View File

@ -44,6 +44,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -23,16 +23,14 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=()
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[web_returns] apply RFs: RF6
----------------------PhysicalProject
------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF7 ws_order_number->[ws_order_number,ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF3 web_site_sk->[ws_web_site_sk]
------------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_ship_date_sk]

View File

@ -39,6 +39,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------PhysicalDistribute[DistributionSpecHash]
--------------------------hashAgg[LOCAL]
----------------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -59,8 +59,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((catalog_sales.cs_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF4 cs_item_sk->[item_sk]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF4
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((catalog_sales.cs_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=()
@ -73,13 +72,11 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------PhysicalProject
--------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((web_sales.ws_item_sk = frequent_ss_items.item_sk)) otherCondition=() build RFs:RF6 ws_item_sk->[item_sk]
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF6
----------------------PhysicalDistribute[DistributionSpecHash]
------------------------PhysicalProject
--------------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((web_sales.ws_bill_customer_sk = best_ss_customer.c_customer_sk)) otherCondition=()
@ -92,6 +89,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------------------------filter((date_dim.d_moy = 5) and (date_dim.d_year = 2000))
--------------------------------------PhysicalOlapScan[date_dim]
----------------------------PhysicalDistribute[DistributionSpecHash]
------------------------------PhysicalProject
--------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )
------------------------------PhysicalCteConsumer ( cteId=CTEId#2 )

View File

@ -55,6 +55,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalDistribute[DistributionSpecGather]
----------------------hashAgg[LOCAL]
------------------------PhysicalDistribute[DistributionSpecExecutionAny]
--------------------------PhysicalProject
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -43,6 +43,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,44 +2,42 @@
-- !ds_shape_31 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------------PhysicalProject
----------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
--------------------PhysicalDistribute[DistributionSpecReplicated]
----------------------PhysicalProject
------------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------------PhysicalOlapScan[date_dim]
--------------PhysicalDistribute[DistributionSpecHash]
----------------PhysicalProject
------------------PhysicalOlapScan[customer_address]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF1 ca_address_sk->[ss_addr_sk]
--------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[ws_bill_addr_sk]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------hashJoin[INNER_JOIN] hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
----------------------PhysicalProject
------------------------PhysicalOlapScan[store_sales] apply RFs: RF0 RF1
------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
----------------------PhysicalDistribute[DistributionSpecReplicated]
------------------------PhysicalProject
--------------------------filter((ss.d_year = 2000) and d_qoy IN (1, 2, 3))
--------------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
----------------------------PhysicalOlapScan[date_dim]
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalOlapScan[customer_address]
--PhysicalCteAnchor ( cteId=CTEId#1 )
----PhysicalCteProducer ( cteId=CTEId#1 )
------PhysicalProject
--------hashAgg[GLOBAL]
----------PhysicalDistribute[DistributionSpecHash]
------------hashAgg[LOCAL]
--------------PhysicalProject
----------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_bill_addr_sk = customer_address.ca_address_sk)) otherCondition=() build RFs:RF3 ca_address_sk->[ws_bill_addr_sk]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------hashJoin[INNER_JOIN] hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
------------------------PhysicalProject
--------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 RF3
------------------------PhysicalDistribute[DistributionSpecReplicated]
--------------------------PhysicalProject
----------------------------filter((ws.d_year = 2000) and d_qoy IN (1, 2, 3))
------------------------------PhysicalOlapScan[date_dim]
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------PhysicalOlapScan[customer_address]
----PhysicalResultSink
------PhysicalQuickSort[MERGE_SORT]
--------PhysicalDistribute[DistributionSpecGather]

View File

@ -28,11 +28,9 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------PhysicalQuickSort[LOCAL_SORT]
----------hashJoin[INNER_JOIN] hashCondition=((inv1.i_item_sk = inv2.i_item_sk) and (inv1.w_warehouse_sk = inv2.w_warehouse_sk)) otherCondition=()
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv1.d_moy = 1))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv1.d_moy = 1))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------PhysicalDistribute[DistributionSpecHash]
--------------PhysicalProject
----------------filter((inv2.d_moy = 2))
------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------filter((inv2.d_moy = 2))
----------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -41,9 +41,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 2001))
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -42,9 +42,8 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
--------------------PhysicalProject
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------PhysicalProject
----------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------filter((if((avg_monthly_sales > 0.0000), (cast(abs((sum_sales - cast(avg_monthly_sales as DECIMALV3(38, 2)))) as DECIMALV3(38, 10)) / avg_monthly_sales), NULL) > 0.100000) and (v2.avg_monthly_sales > 0.0000) and (v2.d_year = 1999))
----------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------PhysicalDistribute[DistributionSpecHash]
------------------PhysicalProject
--------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -2,17 +2,16 @@
-- !ds_shape_59 --
PhysicalCteAnchor ( cteId=CTEId#0 )
--PhysicalCteProducer ( cteId=CTEId#0 )
----PhysicalProject
------hashAgg[GLOBAL]
--------PhysicalDistribute[DistributionSpecHash]
----------hashAgg[LOCAL]
------------PhysicalProject
--------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
----hashAgg[GLOBAL]
------PhysicalDistribute[DistributionSpecHash]
--------hashAgg[LOCAL]
----------PhysicalProject
------------hashJoin[INNER_JOIN] hashCondition=((date_dim.d_date_sk = store_sales.ss_sold_date_sk)) otherCondition=() build RFs:RF0 d_date_sk->[ss_sold_date_sk]
--------------PhysicalProject
----------------PhysicalOlapScan[store_sales] apply RFs: RF0
--------------PhysicalDistribute[DistributionSpecReplicated]
----------------PhysicalProject
------------------PhysicalOlapScan[store_sales] apply RFs: RF0
----------------PhysicalDistribute[DistributionSpecReplicated]
------------------PhysicalProject
--------------------PhysicalOlapScan[date_dim]
------------------PhysicalOlapScan[date_dim]
--PhysicalResultSink
----PhysicalTopN[MERGE_SORT]
------PhysicalDistribute[DistributionSpecGather]

View File

@ -44,6 +44,5 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
------------------PhysicalDistribute[DistributionSpecHash]
--------------------hashAgg[LOCAL]
----------------------PhysicalDistribute[DistributionSpecExecutionAny]
------------------------PhysicalProject
--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
------------------------PhysicalCteConsumer ( cteId=CTEId#0 )

View File

@ -23,16 +23,14 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
----------------------PhysicalProject
------------------------hashJoin[INNER_JOIN] hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF10 wr_order_number->[ws_order_number];RF11 wr_order_number->[ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF10 RF11 RF12 RF13
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF10 RF11 RF12 RF13
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalOlapScan[web_returns] apply RFs: RF12 RF13
----------------------PhysicalProject
------------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() build RFs:RF14 ws_order_number->[ws_order_number,ws_order_number];RF15 ws_order_number->[ws_order_number,ws_order_number]
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------PhysicalProject
------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
--------------------------PhysicalDistribute[DistributionSpecHash]
----------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() build RFs:RF6 web_site_sk->[ws_web_site_sk];RF7 web_site_sk->[ws_web_site_sk]
------------------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() build RFs:RF4 d_date_sk->[ws_ship_date_sk];RF5 d_date_sk->[ws_ship_date_sk]

View File

@ -0,0 +1,143 @@
// 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("test_cte_column_pruning") {
sql "SET enable_nereids_planner=true"
sql "SET enable_pipeline_engine=true"
sql "SET enable_fallback_to_original_planner=false"
sql """drop table if exists t1"""
sql """drop table if exists t2"""
sql """drop table if exists t3"""
sql """drop table if exists t4"""
sql """
create table if not exists t1 (
c2 int ,
c1 int ,
c3 int ,
c4 int ,
pk int
)
distributed by hash(pk) buckets 10
properties("replication_num" = "1");
"""
sql """
create table if not exists t2 (
c1 int ,
c2 int ,
c3 int ,
c4 int ,
pk int
)
distributed by hash(pk) buckets 10
properties("replication_num" = "1");
"""
sql """
create table if not exists t3 (
c2 int ,
c1 int ,
c3 int ,
c4 int ,
pk int
)
distributed by hash(pk) buckets 10
properties("replication_num" = "1");
"""
sql """
create table if not exists t4 (
c1 int ,
c2 int ,
c3 int ,
c4 int ,
pk int
)
distributed by hash(pk) buckets 10
properties("replication_num" = "1");
"""
sql """
insert into t1(pk,c1,c2,c3,c4) values (0,7,2,3328056,7),(1,3,5,3,3045349),(2,2130015,0,7,-7116176),(3,4411710,1203314,1,2336164),(4,4,-8001461,0,8),(5,9,3,6,2),(6,-8088092,null,-7256698,-2025142),(7,8,2,5,1),(8,4,4953685,3,null),(9,-6662413,-3845449,4,2),(10,5315281,0,5,null),(11,9,3,7,7),(12,4341905,null,null,8),(13,3,6,5,1),(14,5,9,6541164,3),(15,1,-582319,1,9),(16,5533636,4,39841,0),(17,1,1,null,7),(18,742881,-1420303,6,1),(19,281430,6753011,3,2),(20,7,1,4,-31350),(21,-5663089,9,2278262,9),(22,6,0,2706409,3),(23,-3841713,9,3,9),(24,1,6,3,4059303),(25,0,1,-5700982,3),(26,5,0,6,1),(27,7,2,2,4),(28,6,-2140815,-8190613,6),(29,-8214516,4,3,6),(30,4393731,null,7,2),(31,-2524331,8,2,9),(32,5,1,7,3),(33,2,968001,-1718546,0),(34,9,2,null,-7682164),(35,5,-3302521,8,2),(36,2,1325975,null,2826927),(37,-6607898,null,4,8),(38,7,3,5284408,-265983),(39,1,null,2,-559197),(40,9,7,2,6),(41,-7193680,null,3,8),(42,-4800310,8,9,5),(43,0,8,0,-2429477),(44,-1007106,-7583038,9,2627388),(45,7,-6572230,4,-1789489),(46,8,4,null,7837867),(47,7,8,7,null),(48,8,-2618403,2723851,3),(49,1,3,1,0),(50,null,3241893,0,8),(51,1934849,-1353430,1,9),(52,5148268,6,null,1),(53,null,3922713,4,47559),(54,2038005,-7625242,null,-5606136),(55,4,449100,2108275,5147506),(56,5,5,4316929,null),(57,5049864,null,4,9),(58,null,7,2,9),(59,5,2,5,7),(60,9,9,5,-2774033),(61,4,0,6,1),(62,5,-7700238,6,3),(63,658183,-7933445,1,4),(64,8,8,-7019658,-7873828),(65,1,1,null,0),(66,1,2,9,7320481),(67,3,2099077,9,3),(68,-7120763,276954,0,4),(69,9,5,5170840,null),(70,null,6,220899,-5774478),(71,null,null,3,6),(72,7,2,8101877,null),(73,1,null,5,-5141920),(74,8,-7143195,0,6),(75,6,5,3388863,4),(76,6,6,-8015259,1),(77,5207959,-4325820,791546,7),(78,2,4411975,2,null),(79,9,2379417,8,3),(80,3,null,-6968517,-336360),(81,null,0,5,1),(82,3,0,6,-4536269),(83,2,7,0,7),(84,1,7,1,5),(85,3,3,7509217,2920951),(86,6,null,8,3),(87,9,8,8,5941004),(88,8023576,1036293,9,2),(89,5,3,1,5),(90,5,5,6,2170127),(91,null,1,7,null),(92,-5659717,4,null,6),(93,848413,9,-2742042,4980140),(94,1,9,467168,9),(95,6,6,4783371,-5096980),(96,3,2,4,3),(97,3,2,2,1),(98,8,0,-6734149,2),(99,4985816,3,null,8);
"""
sql """
insert into t2(pk,c1,c2,c3,c4) values (0,5,4,189864,-7663457),(1,7,null,6,1),(2,null,8,-3362640,9),(3,3,2,5,-2197130),(4,2,3,7160615,1),(5,null,-57834,420441,3),(6,0,null,2,2),(7,1,-3681539,3,4),(8,548866,3,0,5),(9,8,-2824887,0,3246956),(10,5,3,7,2),(11,8,8,6,8),(12,0,2,7,9),(13,8,6,null,null),(14,-4103729,4,5,8),(15,-3659292,2,7,5),(16,8,7,1,null),(17,2526018,4,8069607,5),(18,6,6,5,2802235),(19,9,0,6379201,null),(20,3,null,4,3),(21,0,8,-5506402,2),(22,6,4,3,1),(23,4,5225086,3,1),(24,-211796,2,0,null),(25,5,2,-4100572,7),(26,2345127,2,null,1),(27,8,2,4893754,2),(28,null,-5580446,4,0),(29,3,1,2,6);
"""
sql """
insert into t3(pk,c1,c2,c3,c4) values (0,3,2,6,-3164679),(1,-6216443,3437690,-288827,6),(2,4,-5352286,-1005469,4118240),(3,9,6795167,5,1616205),(4,8,-4659990,-4816829,6),(5,0,9,4,8),(6,-4454766,2,2510766,3),(7,7860071,-3434966,8,3),(8,null,0,2,1),(9,8031908,2,-6673194,-5981416),(10,5,6716310,8,2529959),(11,null,-3622116,1,-7891010),(12,null,3527222,7993802,null),(13,null,1,2,1),(14,2,8,7,7),(15,0,9,5,null),(16,7452083,null,-4620796,0),(17,9,9,null,6),(18,3,1,-1578776,5),(19,9,2532045,-3577349,null);
"""
sql """
insert into t4(pk,c1,c2,c3,c4) values (0,-4263513,null,null,6),(1,1,3,4,null),(2,2460936,6,5,6299003),(3,null,7,7107446,-2366754),(4,6247611,4785035,3,-8014875),(5,0,2,5249218,3),(6,null,253825,4,3),(7,null,2,9,-350785),(8,6,null,null,4),(9,1,3,1,3422691),(10,0,-6596165,1808018,3),(11,2,752342,null,1),(12,-5220927,2676278,9,7),(13,6025864,2,1,4),(14,7,4,4,9),(15,5,9,9,849881),(16,-4253076,null,-4404479,-6365351),(17,null,6,4240023,3),(18,7,1276495,7,6),(19,null,-4459040,178194,-6974337),(20,6,2498738,9,6),(21,8,-1047876,8,-3519551),(22,4477868,6,3,-7237985),(23,9,1,null,7),(24,null,2,-6996324,4),(25,2,2,-7965145,2),(26,5339549,6,null,4),(27,0,4,4,4),(28,null,6563965,-5816143,2),(29,4,7245227,3239886,1),(30,9,9,-8134757,0),(31,-1787881,7769609,8306001,null),(32,-1817246,1,3,-8163782),(33,7,4018844,0,4),(34,null,5,3,4),(35,8,-1698017,0,3024748),(36,2,7,5330073,3654557),(37,null,null,1,7),(38,6,9,0,2),(39,-3988946,-1465296,3,3),(40,4939439,null,null,3),(41,6,-7235968,1,0),(42,5141520,-7389145,8,1),(43,5,89342,1,0),(44,1,641063,9,4718353),(45,5,4,4,6),(46,2,6,4,4),(47,3,2,2,-7137584),(48,6735548,0,1,7),(49,6,4,7,-4864341);
"""
sql """
sync
"""
sql """
WITH tbl1 AS (
SELECT
tbl2.c1 AS c1,
tbl3.c2 AS c2,
tbl5.c4 AS c3,
tbl3.c1 AS c4
FROM
t1 AS tbl1
JOIN t2 AS tbl2 ON tbl1.c2 = tbl1.c4
RIGHT JOIN t1 AS tbl3 ON tbl3.c3 = tbl1.c3
INNER JOIN t3 AS tbl4 ON tbl3.c2 = tbl4.c3
INNER JOIN t4 AS tbl5 ON tbl5.c4 = tbl4.c2
AND tbl3.c3 = tbl3.c4
WHERE
(
tbl2.c4 = (0 + 9)
AND ((4 + 1) IS NULL)
)
ORDER BY
1,
2,
3,
4 DESC
LIMIT
6666 OFFSET 500
)
SELECT
tbl3.c4 AS c1,
tbl2.c4 AS c2,
tbl3.c3 AS c3,
tbl2.c2 AS c4
FROM
tbl1 AS tbl2
JOIN tbl1 AS tbl3 ON tbl3.c2 = tbl2.c2
WHERE
(
tbl2.c3 != tbl2.c3
AND ((2 + 0) IS NOT NULL)
)
ORDER BY
2,
4,
1,
3 ASC
LIMIT
6666 OFFSET 2;
"""
}