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:
java.lang.Cloneable
,RelOptNode
,RelNode
public final class LogicalCalc extends Calc
A relational expression which computes project expressions and also filters.This relational expression combines the functionality of
LogicalProject
andLogicalFilter
. It should be created in the later stages of optimization, by merging consecutiveLogicalProject
andLogicalFilter
nodes together.The following rules relate to
LogicalCalc
:FilterToCalcRule
creates this from aLogicalFilter
ProjectToCalcRule
creates this from aLogicalFilter
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
-
-
Constructor Summary
Constructors Constructor Description LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program)
Creates a LogicalCalc.LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program, java.util.List<RelCollation> collationList)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collectVariablesUsed(java.util.Set<CorrelationId> variableSet)
Collects variables known to be used by this expression or its descendants.LogicalCalc
copy(RelTraitSet traitSet, RelNode child, RexProgram program)
Creates a copy of thisCalc
.static LogicalCalc
create(RelNode input, RexProgram program)
-
Methods inherited from class org.apache.calcite.rel.core.Calc
accept, computeSelfCost, copy, copy, estimateRowCount, explainTerms, 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
accept, collectVariablesSet, computeDigest, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
-
-
-
Constructor Detail
-
LogicalCalc
public LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program)
Creates a LogicalCalc.
-
LogicalCalc
@Deprecated public LogicalCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexProgram program, java.util.List<RelCollation> collationList)
Deprecated.
-
-
Method Detail
-
create
public static LogicalCalc create(RelNode input, RexProgram program)
-
copy
public LogicalCalc copy(RelTraitSet traitSet, RelNode child, RexProgram program)
Description copied from class:Calc
Creates a copy of thisCalc
.- Specified by:
copy
in classCalc
- Parameters:
traitSet
- Traitschild
- Input relationprogram
- Calc program- Returns:
- New
Calc
if any parameter differs from the value of thisCalc
, or justthis
if all the parameters are the same - See Also:
Calc.copy(org.apache.calcite.plan.RelTraitSet, java.util.List)
-
collectVariablesUsed
public void collectVariablesUsed(java.util.Set<CorrelationId> variableSet)
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
-
-