Package org.apache.calcite.rel.core
Class Calc
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.core.Calc
- All Implemented Interfaces:
Cloneable,RelOptNode,Hintable,RelNode
- Direct Known Subclasses:
EnumerableCalc,LogicalCalc
Calc is an abstract base class for implementations of
LogicalCalc.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.collect.ImmutableList<RelHint>protected final RexProgramFields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCalc(RelOptCluster cluster, RelTraitSet traits, List<RelHint> hints, RelNode child, RexProgram program) Creates a Calc.protectedCalc(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexProgram program) Deprecated.protectedCalc(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexProgram program, List<RelCollation> collationList) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionaccept(RexShuttle shuttle) Accepts a visit from a shuttle.@Nullable RelOptCostcomputeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) Returns the cost of this plan (not including children).final booleanReturns whether this Calc contains any windowed-aggregate functions.final Calccopy(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.abstract Calccopy(RelTraitSet traitSet, RelNode child, RexProgram program) Creates a copy of thisCalc.copy(RelTraitSet traitSet, RelNode child, RexProgram program, List<RelCollation> collationList) Deprecated.doubleReturns an estimate of the number of rows this relational expression will return.Describes the inputs and attributes of this relational expression.com.google.common.collect.ImmutableList<RelHint>getHints()Returns the hints of this relational expressions as an immutable list.booleanisValid(Litmus litmus, @Nullable RelNode.Context context) Returns whether this relational expression is valid.Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, getInput, getInputs, replaceInputMethods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, metadata, onRegister, recomputeDigest, register, sole, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHintsMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
hints
-
program
-
-
Constructor Details
-
Calc
protected Calc(RelOptCluster cluster, RelTraitSet traits, List<RelHint> hints, RelNode child, RexProgram program) Creates a Calc.- Parameters:
cluster- Clustertraits- Traitshints- Hints of this relational expressionchild- Input relationprogram- Calc program
-
Calc
@Deprecated protected Calc(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexProgram program) Deprecated. -
Calc
@Deprecated protected Calc(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexProgram program, List<RelCollation> collationList) Deprecated.
-
-
Method Details
-
copy
Description copied from interface:RelNodeCreates 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:
copyin interfaceRelNode- Overrides:
copyin classAbstractRelNode- Parameters:
traitSet- Trait setinputs- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
copy
Creates a copy of thisCalc.- Parameters:
traitSet- Traitschild- Input relationprogram- Calc program- Returns:
- New
Calcif any parameter differs from the value of thisCalc, or justthisif all the parameters are the same - See Also:
-
copy
@Deprecated public Calc copy(RelTraitSet traitSet, RelNode child, RexProgram program, List<RelCollation> collationList) Deprecated. -
containsOver
public final boolean containsOver()Returns whether this Calc contains any windowed-aggregate functions. -
isValid
Description copied from interface:RelNodeReturns whether this relational expression is valid.If assertions are enabled, this method is typically called with
litmus=THROW, as follows:assert rel.isValid(Litmus.THROW)
This signals that the method can throw an
AssertionErrorif it is not valid.- Specified by:
isValidin interfaceRelNode- Overrides:
isValidin classAbstractRelNode- Parameters:
litmus- What to do if invalidcontext- Context for validity checking- Returns:
- Whether relational expression is valid
-
getProgram
-
getHints
Description copied from interface:HintableReturns the hints of this relational expressions as an immutable list. -
estimateRowCount
Description copied from interface:RelNodeReturns 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:
estimateRowCountin interfaceRelNode- Overrides:
estimateRowCountin classSingleRel- Parameters:
mq- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
computeSelfCost
Description copied from interface:RelNodeReturns 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:
computeSelfCostin interfaceRelNode- Overrides:
computeSelfCostin classAbstractRelNode- Parameters:
planner- Planner for cost calculationmq- Metadata query- Returns:
- Cost of this plan (not including children)
-
explainTerms
Description copied from class:AbstractRelNodeDescribes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms, then call theRelWriter.input(String, RelNode)andRelWriter.item(String, Object)methods for each input and attribute.- Overrides:
explainTermsin classSingleRel- Parameters:
pw- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
accept
Description copied from interface:RelNodeAccepts a visit from a shuttle. If the shuttle updates expression, then a copy of the relation should be created. This new relation might have a different row-type.- Specified by:
acceptin interfaceRelNode- Overrides:
acceptin classAbstractRelNode- Parameters:
shuttle- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-