class RelSet
extends java.lang.Object
RelSet
is an equivalence-set of expressions; that is, a set of
expressions which have identical semantics. We are generally interested in
using the expression which has the lowest cost.
All of the expressions in an RelSet
have the same calling
convention.
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<AbstractConverter> |
abstractConverters
List of
AbstractConverter objects which have not yet been
satisfied. |
(package private) RelSet |
equivalentSet
Set to the superseding set when this is found to be equivalent to another
set.
|
(package private) int |
id |
(package private) boolean |
inMetadataQuery
Reentrancy flag.
|
private static org.slf4j.Logger |
LOGGER |
(package private) java.util.List<RelNode> |
parents
Relational expressions that have a subset in this set as a child.
|
(package private) RelNode |
rel |
(package private) java.util.List<RelNode> |
rels |
(package private) java.util.List<RelSubset> |
subsets |
(package private) java.util.Set<CorrelationId> |
variablesPropagated
Variables that are set by relational expressions in this set
and available for use by parent and child expressions.
|
(package private) java.util.Set<CorrelationId> |
variablesUsed
Variables that are used by relational expressions in this set.
|
Constructor and Description |
---|
RelSet(int id,
java.util.Set<CorrelationId> variablesPropagated,
java.util.Set<CorrelationId> variablesUsed) |
Modifier and Type | Method and Description |
---|---|
RelSubset |
add(RelNode rel)
Adds a relational expression to a set, with its results available under a
particular calling convention.
|
private void |
addAbstractConverters(VolcanoPlanner planner,
RelOptCluster cluster,
RelSubset subset,
boolean subsetToOthers) |
(package private) void |
addInternal(RelNode rel)
Adds an expression
rel to this set, without creating a
RelSubset . |
(package private) RelSubset |
getOrCreateSubset(RelOptCluster cluster,
RelTraitSet traits) |
java.util.List<RelNode> |
getParentRels()
|
java.util.List<RelNode> |
getRelsFromAllSubsets() |
RelSubset |
getSubset(RelTraitSet traits) |
(package private) void |
mergeWith(VolcanoPlanner planner,
RelSet otherSet)
Merges
otherSet into this RelSet. |
(package private) void |
obliterateRelNode(RelNode rel)
Removes all references to a specific
RelNode in both the subsets
and their parent relationships. |
private void |
postEquivalenceEvent(VolcanoPlanner planner,
RelNode rel) |
private static final org.slf4j.Logger LOGGER
final java.util.List<RelNode> rels
final java.util.List<RelNode> parents
final java.util.List<RelSubset> subsets
final java.util.List<AbstractConverter> abstractConverters
AbstractConverter
objects which have not yet been
satisfied.RelSet equivalentSet
RelNode rel
final java.util.Set<CorrelationId> variablesPropagated
final java.util.Set<CorrelationId> variablesUsed
final int id
boolean inMetadataQuery
RelSet(int id, java.util.Set<CorrelationId> variablesPropagated, java.util.Set<CorrelationId> variablesUsed)
public java.util.List<RelNode> getParentRels()
public java.util.List<RelNode> getRelsFromAllSubsets()
RelNode
s contained by any subset of this set
(does not include the subset objects themselves)public RelSubset getSubset(RelTraitSet traits)
void obliterateRelNode(RelNode rel)
RelNode
in both the subsets
and their parent relationships.public RelSubset add(RelNode rel)
private void addAbstractConverters(VolcanoPlanner planner, RelOptCluster cluster, RelSubset subset, boolean subsetToOthers)
RelSubset getOrCreateSubset(RelOptCluster cluster, RelTraitSet traits)
private void postEquivalenceEvent(VolcanoPlanner planner, RelNode rel)
void addInternal(RelNode rel)
rel
to this set, without creating a
RelSubset
. (Called only from
RelSubset.add(org.apache.calcite.rel.RelNode)
.rel
- Relational expressionvoid mergeWith(VolcanoPlanner planner, RelSet otherSet)
otherSet
into this RelSet.
One generally calls this method after discovering that two relational
expressions are equivalent, and hence the RelSet
s they
belong to are equivalent also.
After this method completes, otherSet
is obsolete, its
equivalentSet
member points to this RelSet, and this RelSet is
still alive.
planner
- PlannerotherSet
- RelSet which is equivalent to this oneCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.