Package org.apache.calcite.plan.hep
Class HepRelVertex
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.plan.hep.HepRelVertex
-
- All Implemented Interfaces:
java.lang.Cloneable
,RelOptNode
,RelNode
public class HepRelVertex extends AbstractRelNode
HepRelVertex wraps a realRelNode
as a vertex in a DAG representing the entire query expression.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
Fields Modifier and Type Field Description private RelNode
currentRel
Wrapped rel currently chosen for implementation of expression.-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
-
Constructor Summary
Constructors Constructor Description HepRelVertex(RelNode rel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
computeDigest()
Computes the digest.RelOptCost
computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Returns the cost of this plan (not including children).RelNode
copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and inputs.protected RelDataType
deriveRowType()
double
estimateRowCount(RelMetadataQuery mq)
Returns an estimate of the number of rows this relational expression will return.void
explain(RelWriter pw)
Describes the inputs and attributes of this relational expression.RelNode
getCurrentRel()
(package private) void
replaceRel(RelNode newRel)
Replaces the implementation for this expression with a new one.-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, explainTerms, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toString
-
-
-
-
Field Detail
-
currentRel
private RelNode currentRel
Wrapped rel currently chosen for implementation of expression.
-
-
Constructor Detail
-
HepRelVertex
HepRelVertex(RelNode rel)
-
-
Method Detail
-
explain
public void explain(RelWriter pw)
Description copied from interface:RelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explain
, then call theRelWriterImpl.input(String, RelNode)
andRelWriterImpl.item(String, Object)
methods for each input and attribute.- Specified by:
explain
in interfaceRelNode
- Overrides:
explain
in classAbstractRelNode
- Parameters:
pw
- Plan writer
-
copy
public RelNode copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
Description copied from interface:RelNode
Creates a copy of this relational expression, perhaps changing traits and inputs.Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
- Specified by:
copy
in interfaceRelNode
- Overrides:
copy
in classAbstractRelNode
- Parameters:
traitSet
- Trait setinputs
- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
computeSelfCost
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Description copied from interface:RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about cost.- Specified by:
computeSelfCost
in interfaceRelNode
- Overrides:
computeSelfCost
in classAbstractRelNode
- Parameters:
planner
- Planner for cost calculationmq
- Metadata query- Returns:
- Cost of this plan (not including children)
-
estimateRowCount
public double estimateRowCount(RelMetadataQuery mq)
Description copied from interface:RelNode
Returns an estimate of the number of rows this relational expression will return.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about row count.- Specified by:
estimateRowCount
in interfaceRelNode
- Overrides:
estimateRowCount
in classAbstractRelNode
- Parameters:
mq
- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
deriveRowType
protected RelDataType deriveRowType()
- Overrides:
deriveRowType
in classAbstractRelNode
-
computeDigest
protected java.lang.String computeDigest()
Description copied from class:AbstractRelNode
Computes the digest. Does not modify this object.- Overrides:
computeDigest
in classAbstractRelNode
- Returns:
- Digest
-
replaceRel
void replaceRel(RelNode newRel)
Replaces the implementation for this expression with a new one.- Parameters:
newRel
- new expression
-
getCurrentRel
public RelNode getCurrentRel()
- Returns:
- current implementation chosen for this vertex
-
-