public abstract class Project extends SingleRel
LogicalProject| Modifier and Type | Class and Description |
|---|---|
static class |
Project.Flags
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
protected com.google.common.collect.ImmutableList<RexNode> |
exps |
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,
RelNode input,
List<? extends RexNode> projects,
RelDataType rowType)
Creates a Project.
|
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.
|
RelOptCost |
computeSelfCost(RelOptPlanner planner)
Returns the cost of this plan (not including children).
|
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.
|
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
List<RexNode> |
getChildExps()
Returns a list of this relational expression's child expressions.
|
int |
getFlags()
Deprecated.
|
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.
|
Permutation |
getPermutation()
Returns a permutation, if this projection is merely a permutation of its
input fields; otherwise null.
|
static 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(boolean fail)
Returns whether this relational expression is valid.
|
childrenAccept, deriveRowType, getInput, getInputs, getRows, replaceInputaccept, collectVariablesSet, collectVariablesUsed, computeDigest, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, metadata, onRegister, recomputeDigest, register, sole, toStringprotected final com.google.common.collect.ImmutableList<RexNode> exps
protected Project(RelOptCluster cluster, RelTraitSet traits, RelNode input, List<? extends RexNode> projects, RelDataType rowType)
cluster - Cluster that this relational expression belongs totraits - Traits of this relational expressioninput - Input relational expressionprojects - List of expressions for the input columnsrowType - Output row type@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 List<RexNode> getChildExps()
RelNodeRelNode.getInputs().
The caller should treat the list as unmodifiable; typical
implementations will return an immutable list. If there are no
child expressions, returns an empty list, not null.
getChildExps in interface RelNodegetChildExps in class AbstractRelNodeRelNode.accept(org.apache.calcite.rex.RexShuttle)public RelNode accept(RexShuttle shuttle)
RelNodeaccept in interface RelNodeaccept in class AbstractRelNodeshuttle - Shuttlepublic List<RexNode> getProjects()
public final List<Pair<RexNode,String>> getNamedProjects()
@Deprecated public int getFlags()
public boolean isValid(boolean fail)
RelNodeIf assertions are enabled, this method is typically called with
fail = true, as follows:
This signals that the method can throw anassert rel.isValid(true)
AssertionError if it is
not valid.isValid in interface RelNodeisValid in class AbstractRelNodefail - Whether to fail if invalidpublic RelOptCost computeSelfCost(RelOptPlanner planner)
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 calculationpublic RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriterImpl.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writerpublic 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
a source field may appear as zero, one, or more target fields.
Thus you can safely call
Mappings.TargetMapping.getTarget(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 Permutation getPermutation()
public static Permutation getPermutation(int inputFieldCount, List<? extends RexNode> projects)
public boolean isMapping()
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.