Package org.apache.calcite.rel.logical
Class LogicalCalc
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.core.Calc
org.apache.calcite.rel.logical.LogicalCalc
- All Implemented Interfaces:
Cloneable,RelOptNode,Hintable,RelNode
A relational expression which computes project expressions and also filters.
This relational expression combines the functionality of
LogicalProject and LogicalFilter.
It should be created in the later
stages of optimization, by merging consecutive LogicalProject and
LogicalFilter nodes together.
The following rules relate to LogicalCalc:
FilterToCalcRulecreates this from aLogicalFilterProjectToCalcRulecreates this from aLogicalProjectFilterCalcMergeRulemerges this with aLogicalFilterProjectCalcMergeRulemerges this with aLogicalProjectCalcMergeRulemerges twoLogicalCalcs
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context -
Field Summary
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsConstructorDescriptionLogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode child, RexProgram program) Creates a LogicalCalc.LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program) Deprecated.LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program, List<RelCollation> collationList) Deprecated.LogicalCalc(RelInput input) Creates a LogicalCalc by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept(RelShuttle shuttle) Accepts a visit from a shuttle.voidcollectVariablesUsed(Set<CorrelationId> variableSet) Collects variables known to be used by this expression or its descendants.copy(RelTraitSet traitSet, RelNode child, RexProgram program) Creates a copy of thisCalc.static LogicalCalccreate(RelNode input, RexProgram program) Returns a new relational expression with the specified hintshintList.Methods inherited from class org.apache.calcite.rel.core.Calc
accept, computeSelfCost, containsOver, copy, copy, estimateRowCount, explainTerms, getHints, getProgram, isValidMethods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, getInput, getInputs, replaceInputMethods inherited from class org.apache.calcite.rel.AbstractRelNode
collectVariablesSet, 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
attachHintsMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Constructor Details
-
LogicalCalc
public LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode child, RexProgram program) Creates a LogicalCalc. -
LogicalCalc
@Deprecated public LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program) Deprecated. -
LogicalCalc
Creates a LogicalCalc by parsing serialized output. -
LogicalCalc
@Deprecated public LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program, List<RelCollation> collationList) Deprecated.
-
-
Method Details
-
create
-
copy
Description copied from class:CalcCreates a copy of thisCalc. -
collectVariablesUsed
Description copied from interface:RelNodeCollects variables known to be used by this expression or its descendants. By default, no such information is available and must be derived by analyzing sub-expressions, but some optimizer implementations may insert special expressions which remember such information.- Specified by:
collectVariablesUsedin interfaceRelNode- Overrides:
collectVariablesUsedin classAbstractRelNode- Parameters:
variableSet- receives variables used
-
withHints
Description copied from interface:HintableReturns a new relational expression with the specified hintshintList.This method should be overridden by every logical node that supports hint. It is only for internal use during decorrelation.
Sub-class should return a new copy of the relational expression.
The default implementation returns the relational expression directly only because not every kind of relational expression supports hints.
- Returns:
- Relational expression with set up hints
-
accept
Description copied from interface:RelNodeAccepts a visit from a shuttle.- 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
-