Class LogicalProject
- All Implemented Interfaces:
Cloneable,RelOptNode,Hintable,RelNode
Project not
targeted at any particular engine or calling convention.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.rel.core.Project
Project.FlagsNested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context -
Field Summary
Fields inherited from class org.apache.calcite.rel.core.Project
exps, hints, variablesSetFields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsConstructorDescriptionLogicalProject(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, List<? extends RexNode> projects, RelDataType rowType) Deprecated.LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, List<? extends RexNode> projects, RelDataType rowType, Set<CorrelationId> variablesSet) Creates a LogicalProject.LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, List<? extends RexNode> projects, RelDataType rowType) Deprecated.LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, List<? extends RexNode> projects, RelDataType rowType, int flags) Deprecated.LogicalProject(RelOptCluster cluster, RelNode input, List<RexNode> projects, @Nullable List<? extends @Nullable String> fieldNames, int flags) Deprecated.LogicalProject(RelInput input) Creates a LogicalProject by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept(RelShuttle shuttle) Accepts a visit from a shuttle.copy(RelTraitSet traitSet, RelNode input, List<RexNode> projects, RelDataType rowType) Copies a project.static LogicalProjectcreate(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, @Nullable List<? extends @Nullable String> fieldNames) Deprecated.static LogicalProjectcreate(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, @Nullable List<? extends @Nullable String> fieldNames, Set<CorrelationId> variablesSet) Creates a LogicalProject.static LogicalProjectDeprecated.Usecreate(RelNode, List, List, RelDataType, Set)insteadstatic LogicalProjectcreate(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, RelDataType rowType, Set<CorrelationId> variablesSet) Creates a LogicalProject, specifying row type rather than field names.booleandeepEquals(@Nullable Object obj) Equality check for RelNode digest.intCompute hash code for RelNode digest.Returns a new relational expression with the specified hintshintList.Methods inherited from class org.apache.calcite.rel.core.Project
accept, computeSelfCost, containsOver, copy, copy, deepEquals0, deepHashCode0, explainTerms, getAliasedProjects, getFlags, getHints, getMapping, getMapping, getNamedProjects, getPartialMapping, getPermutation, getPermutation, getProjects, getVariablesSet, isBoxed, isMapping, isValidMethods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInputMethods inherited from class org.apache.calcite.rel.AbstractRelNode
collectVariablesSet, collectVariablesUsed, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, 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
-
LogicalProject
public LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, List<? extends RexNode> projects, RelDataType rowType, Set<CorrelationId> variablesSet) Creates a LogicalProject.Use
create(org.apache.calcite.rel.RelNode, java.util.List<org.apache.calcite.rel.hint.RelHint>, java.util.List<? extends org.apache.calcite.rex.RexNode>, java.util.List<? extends java.lang.String>)unless you know what you're doing.- Parameters:
cluster- Cluster this relational expression belongs totraitSet- Traits of this relational expressionhints- Hints of this relational expressioninput- Input relational expressionprojects- List of expressions for the input columnsrowType- Output row typevariablesSet- Correlation variables set by this relational expression to be used by nested expressions
-
LogicalProject
@Deprecated public LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, List<? extends RexNode> projects, RelDataType rowType) Deprecated. -
LogicalProject
@Deprecated public LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, List<? extends RexNode> projects, RelDataType rowType) Deprecated. -
LogicalProject
@Deprecated public LogicalProject(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, List<? extends RexNode> projects, RelDataType rowType, int flags) Deprecated. -
LogicalProject
@Deprecated public LogicalProject(RelOptCluster cluster, RelNode input, List<RexNode> projects, @Nullable List<? extends @Nullable String> fieldNames, int flags) Deprecated. -
LogicalProject
Creates a LogicalProject by parsing serialized output.
-
-
Method Details
-
create
@Deprecated public static LogicalProject create(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, @Nullable List<? extends @Nullable String> fieldNames) Deprecated.Usecreate(RelNode, List, List, List, Set)insteadCreates a LogicalProject. -
create
public static LogicalProject create(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, @Nullable List<? extends @Nullable String> fieldNames, Set<CorrelationId> variablesSet) Creates a LogicalProject. -
create
@Deprecated public static LogicalProject create(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, RelDataType rowType) Deprecated.Usecreate(RelNode, List, List, RelDataType, Set)insteadCreates a LogicalProject, specifying row type rather than field names. -
create
public static LogicalProject create(RelNode input, List<RelHint> hints, List<? extends RexNode> projects, RelDataType rowType, Set<CorrelationId> variablesSet) Creates a LogicalProject, specifying row type rather than field names. -
copy
public LogicalProject copy(RelTraitSet traitSet, RelNode input, List<RexNode> projects, RelDataType rowType) Description copied from class:ProjectCopies a project. -
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
-
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
-
deepEquals
Description copied from class:AbstractRelNodeEquality check for RelNode digest.By default this method collects digest attributes from
AbstractRelNode.explainTerms(RelWriter), then compares each attribute pair. This should work well for most cases. If this method is a performance bottleneck for your project, or the default behavior can't handle your scenario properly, you can choose to override this method andAbstractRelNode.deepHashCode(). SeeLogicalJoinas an example.- Specified by:
deepEqualsin interfaceRelNode- Overrides:
deepEqualsin classAbstractRelNode- Returns:
- Whether the 2 RelNodes are equivalent or have the same digest.
- See Also:
-
deepHashCode
public int deepHashCode()Description copied from class:AbstractRelNodeCompute hash code for RelNode digest.- Specified by:
deepHashCodein interfaceRelNode- Overrides:
deepHashCodein classAbstractRelNode- See Also:
-
create(RelNode, List, List, List, Set)instead