Package org.apache.calcite.plan
Class MaterializedViewSubstitutionVisitor
- java.lang.Object
-
- org.apache.calcite.plan.SubstitutionVisitor
-
- org.apache.calcite.plan.MaterializedViewSubstitutionVisitor
-
public class MaterializedViewSubstitutionVisitor extends SubstitutionVisitor
Extension toSubstitutionVisitor
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MaterializedViewSubstitutionVisitor.FilterToFilterUnifyRule1
Implementation ofSubstitutionVisitor.UnifyRule
that matches aMutableFilter
to aMutableFilter
where the condition of the target relation is weaker.private static class
MaterializedViewSubstitutionVisitor.FilterToProjectUnifyRule1
Implementation ofSubstitutionVisitor.UnifyRule
that matches aMutableFilter
to aMutableProject
on top of aMutableFilter
where the condition of the target relation is weaker.private static class
MaterializedViewSubstitutionVisitor.ProjectToProjectUnifyRule1
Implementation ofSubstitutionVisitor.UnifyRule
that matches aMutableProject
to aMutableProject
where the condition of the target relation is weaker.-
Nested classes/interfaces inherited from class org.apache.calcite.plan.SubstitutionVisitor
SubstitutionVisitor.AbstractUnifyRule, SubstitutionVisitor.FilterOnProjectRule, SubstitutionVisitor.MatchFailed, SubstitutionVisitor.Operand, SubstitutionVisitor.Replacement, SubstitutionVisitor.UnifyResult, SubstitutionVisitor.UnifyRule, SubstitutionVisitor.UnifyRuleCall
-
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.collect.ImmutableList<SubstitutionVisitor.UnifyRule>
EXTENDED_RULES
-
Fields inherited from class org.apache.calcite.plan.SubstitutionVisitor
DEFAULT_RULES, equivalents, queryLeaves, relBuilder, replacementMap, slots, targetLeaves
-
-
Constructor Summary
Constructors Constructor Description MaterializedViewSubstitutionVisitor(RelNode target_, RelNode query_)
MaterializedViewSubstitutionVisitor(RelNode target_, RelNode query_, RelBuilderFactory relBuilderFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<RelNode>
go(RelNode replacement_)
Returns a list of all possible rels that result from substituting the matched RelNode with the replacement RelNode within the query.private static java.util.List<RexNode>
transformRex(java.util.List<RexNode> nodes, java.util.List<RelDataTypeField> oldFields, java.util.List<RelDataTypeField> newFields)
private static RexNode
transformRex(RexNode node, java.util.List<RelDataTypeField> oldFields, java.util.List<RelDataTypeField> newFields)
-
Methods inherited from class org.apache.calcite.plan.SubstitutionVisitor
equalType, getRexShuttle, getRollup, go0, isWeaker, mayBeSatisfiable, permute, register, replace, splitFilter, unifyAggregates
-
-
-
-
Field Detail
-
EXTENDED_RULES
private static final com.google.common.collect.ImmutableList<SubstitutionVisitor.UnifyRule> EXTENDED_RULES
-
-
Constructor Detail
-
MaterializedViewSubstitutionVisitor
public MaterializedViewSubstitutionVisitor(RelNode target_, RelNode query_)
-
MaterializedViewSubstitutionVisitor
public MaterializedViewSubstitutionVisitor(RelNode target_, RelNode query_, RelBuilderFactory relBuilderFactory)
-
-
Method Detail
-
go
public java.util.List<RelNode> go(RelNode replacement_)
Description copied from class:SubstitutionVisitor
Returns a list of all possible rels that result from substituting the matched RelNode with the replacement RelNode within the query.For example, the substitution result of A join B, while A and B are both a qualified match for replacement R, is R join B, R join R, A join R.
- Overrides:
go
in classSubstitutionVisitor
-
transformRex
private static RexNode transformRex(RexNode node, java.util.List<RelDataTypeField> oldFields, java.util.List<RelDataTypeField> newFields)
-
transformRex
private static java.util.List<RexNode> transformRex(java.util.List<RexNode> nodes, java.util.List<RelDataTypeField> oldFields, java.util.List<RelDataTypeField> newFields)
-
-