public abstract class Project extends SingleRel implements Hintable
LogicalProject| Modifier and Type | Class and Description |
|---|---|
static class |
Project.Flags
Deprecated.
|
RelNode.Context| Modifier and Type | Field and Description |
|---|---|
protected com.google.common.collect.ImmutableList<RexNode> |
exps |
protected com.google.common.collect.ImmutableList<RelHint> |
hints |
digest, id, rowType, traitSet| Modifier | Constructor and Description |
|---|---|
protected |
Project(RelInput input)
Creates a Project by parsing serialized output.
|
protected |
Project(RelOptCluster cluster,
RelTraitSet traits,
List<RelHint> hints,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates a Project.
|
protected |
Project(RelOptCluster cluster,
RelTraitSet traits,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Deprecated.
|
protected |
Project(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
RelNode |
accept(RexShuttle shuttle)
Accepts a visit from a shuttle.
|
@Nullable RelOptCost |
computeSelfCost(RelOptPlanner planner,
RelMetadataQuery mq)
Returns the cost of this plan (not including children).
|
boolean |
containsOver()
Returns whether this Project contains any windowed-aggregate functions.
|
RelNode |
copy(RelTraitSet traitSet,
List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and
inputs.
|
abstract Project |
copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType)
Copies a project.
|
Project |
copy(RelTraitSet traitSet,
RelNode input,
List<RexNode> projects,
RelDataType rowType,
int flags)
Deprecated.
|
protected boolean |
deepEquals0(@Nullable Object obj) |
protected int |
deepHashCode0() |
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
int |
getFlags()
Deprecated.
|
com.google.common.collect.ImmutableList<RelHint> |
getHints()
Returns the hints of this relational expressions as an immutable list.
|
Mappings.TargetMapping |
getMapping()
Returns a mapping, or null if this projection is not a mapping.
|
static Mappings.TargetMapping |
getMapping(int inputFieldCount,
List<? extends RexNode> projects)
Returns a mapping of a set of project expressions.
|
List<Pair<RexNode,String>> |
getNamedProjects()
Returns a list of (expression, name) pairs.
|
static Mappings.TargetMapping |
getPartialMapping(int inputFieldCount,
List<? extends RexNode> projects)
Returns a partial mapping of a set of project expressions.
|
@Nullable Permutation |
getPermutation()
Returns a permutation, if this projection is merely a permutation of its
input fields; otherwise null.
|
static @Nullable Permutation |
getPermutation(int inputFieldCount,
List<? extends RexNode> projects)
Returns a permutation, if this projection is merely a permutation of its
input fields; otherwise null.
|
List<RexNode> |
getProjects()
Returns the project expressions.
|
boolean |
isBoxed()
Deprecated.
|
boolean |
isMapping()
Checks whether this is a functional mapping.
|
boolean |
isValid(Litmus litmus,
@Nullable RelNode.Context context)
Returns whether this relational expression is valid.
|
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInputaccept, 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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitattachHints, withHintsexplain, fieldIsNullableprotected final com.google.common.collect.ImmutableList<RexNode> exps
protected final com.google.common.collect.ImmutableList<RelHint> hints
protected Project(RelOptCluster cluster, RelTraitSet traits, List<RelHint> hints, RelNode input, List<? extends RexNode> projects, RelDataType rowType)
cluster - Cluster that this relational expression belongs totraits - Traits of this relational expressionhints - Hints of this relation expressioninput - Input relational expressionprojects - List of expressions for the input columnsrowType - Output row type@Deprecated protected Project(RelOptCluster cluster, RelTraitSet traits, RelNode input, List<? extends RexNode> projects, RelDataType rowType)
@Deprecated protected Project(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, List<? extends RexNode> projects, RelDataType rowType, int flags)
protected Project(RelInput input)
public final RelNode copy(RelTraitSet traitSet, List<RelNode> inputs)
RelNodeSub-classes with other important attributes are encouraged to create variants of this method with more parameters.
copy in interface RelNodecopy in class AbstractRelNodetraitSet - Trait setinputs - Inputspublic abstract Project copy(RelTraitSet traitSet, RelNode input, List<RexNode> projects, RelDataType rowType)
traitSet - Traitsinput - Inputprojects - Project expressionsrowType - Output row typeProject if any parameter differs from the value of this
Project, or just this if all the parameters are
the samecopy(RelTraitSet, List)@Deprecated public Project copy(RelTraitSet traitSet, RelNode input, List<RexNode> projects, RelDataType rowType, int flags)
@Deprecated public boolean isBoxed()
public RelNode accept(RexShuttle shuttle)
RelNodeaccept in interface RelNodeaccept in class AbstractRelNodeshuttle - Shuttlepublic List<RexNode> getProjects()
public final List<Pair<RexNode,String>> getNamedProjects()
public com.google.common.collect.ImmutableList<RelHint> getHints()
Hintable@Deprecated public int getFlags()
public final boolean containsOver()
public boolean isValid(Litmus litmus, @Nullable RelNode.Context context)
RelNodeIf 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 AssertionError if it
is not valid.
isValid in interface RelNodeisValid in class AbstractRelNodelitmus - What to do if invalidcontext - Context for validity checkingpublic @Nullable RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
RelNodeNOTE 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.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNodeplanner - Planner for cost calculationmq - Metadata querypublic RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriter.input(String, RelNode)
and
RelWriter.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writer@API(since="1.24",
status=INTERNAL)
@EnsuresNonNullIf(expression="#1",
result=true)
protected boolean deepEquals0(@Nullable Object obj)
@API(since="1.24",
status=INTERNAL)
protected int deepHashCode0()
public Mappings.TargetMapping getMapping()
public static Mappings.TargetMapping getMapping(int inputFieldCount, List<? extends RexNode> projects)
The mapping is an inverse surjection.
Every target has a source field, but no
source has more than one target.
Thus you can safely call
Mappings.TargetMapping.getSourceOpt(int).
inputFieldCount - Number of input fieldsprojects - Project expressionspublic static Mappings.TargetMapping getPartialMapping(int inputFieldCount, List<? extends RexNode> projects)
The mapping is an inverse function. Every target has a source field, but a source might have 0, 1 or more targets. Project expressions that do not consist of a mapping are ignored.
inputFieldCount - Number of input fieldsprojects - Project expressionspublic @Nullable Permutation getPermutation()
public static @Nullable Permutation getPermutation(int inputFieldCount, List<? extends RexNode> projects)
public boolean isMapping()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.