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
:
FilterToCalcRule
creates this from aLogicalFilter
ProjectToCalcRule
creates this from aLogicalProject
FilterCalcMergeRule
merges this with aLogicalFilter
ProjectCalcMergeRule
merges this with aLogicalProject
CalcMergeRule
merges twoLogicalCalc
s
-
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
ConstructorDescriptionLogicalCalc
(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.void
collectVariablesUsed
(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 LogicalCalc
create
(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, isValid
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, getInput, getInputs, replaceInput
Methods 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, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints
Methods 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:Calc
Creates a copy of thisCalc
. -
collectVariablesUsed
Description copied from interface:RelNode
Collects 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:
collectVariablesUsed
in interfaceRelNode
- Overrides:
collectVariablesUsed
in classAbstractRelNode
- Parameters:
variableSet
- receives variables used
-
withHints
Description copied from interface:Hintable
Returns 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:RelNode
Accepts a visit from a shuttle.- Specified by:
accept
in interfaceRelNode
- Overrides:
accept
in classAbstractRelNode
- Parameters:
shuttle
- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-