public abstract class Values extends AbstractRelNode
RelNode.Context| Modifier and Type | Field and Description |
|---|---|
private static com.google.common.base.Function<com.google.common.collect.ImmutableList<RexLiteral>,Object> |
F
Lambda that helps render tuples as strings.
|
static com.google.common.base.Predicate<? super Values> |
IS_EMPTY
Predicate, to be used when defining an operand of a
RelOptRule,
that returns true if a Values contains zero tuples. |
static com.google.common.base.Predicate<? super Values> |
IS_NOT_EMPTY
Predicate, to be used when defining an operand of a
RelOptRule,
that returns true if a Values contains one or more tuples. |
com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> |
tuples |
digest, id, rowType, traitSet| Modifier | Constructor and Description |
|---|---|
|
Values(RelInput input)
Creates a Values by parsing serialized output.
|
protected |
Values(RelOptCluster cluster,
RelDataType rowType,
com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples,
RelTraitSet traits)
Creates a new Values.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
assertRowType()
Returns true if all tuples match rowType; otherwise, assert on
mismatch.
|
RelOptCost |
computeSelfCost(RelOptPlanner planner,
RelMetadataQuery mq)
Returns the cost of this plan (not including children).
|
protected RelDataType |
deriveRowType() |
double |
estimateRowCount(RelMetadataQuery mq)
Returns an estimate of the number of rows this relational expression will
return.
|
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> |
getTuples()
Returns the rows of literals represented by this Values relational
expression.
|
com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> |
getTuples(RelInput input) |
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, copy, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toStringprivate static final com.google.common.base.Function<com.google.common.collect.ImmutableList<RexLiteral>,Object> F
public static final com.google.common.base.Predicate<? super Values> IS_EMPTY
RelOptRule,
that returns true if a Values contains zero tuples.
This is the conventional way to represent an empty relational expression. There are several rules that recognize empty relational expressions and prune away that section of the tree.
public static final com.google.common.base.Predicate<? super Values> IS_NOT_EMPTY
RelOptRule,
that returns true if a Values contains one or more tuples.
This is the conventional way to represent an empty relational expression. There are several rules that recognize empty relational expressions and prune away that section of the tree.
public final com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples
protected Values(RelOptCluster cluster, RelDataType rowType, com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples, RelTraitSet traits)
Note that tuples passed in become owned by this rel (without a deep copy), so caller must not modify them after this call, otherwise bad things will happen.
cluster - Cluster that this relational expression belongs torowType - Row type for tuples produced by this reltuples - 2-dimensional array of tuple values to be produced; outer
list contains tuples; each inner list is one tuple; all
tuples must be of same length, conforming to rowTypepublic Values(RelInput input)
public com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> getTuples(RelInput input)
public com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> getTuples()
private boolean assertRowType()
protected RelDataType deriveRowType()
deriveRowType in class AbstractRelNodepublic 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 double estimateRowCount(RelMetadataQuery mq)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode), which gives plugins a chance to
override the rel's default ideas about row count.
estimateRowCount in interface RelNodeestimateRowCount in class AbstractRelNodemq - Metadata querypublic 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 AbstractRelNodepw - Plan writerCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.