public abstract class Values extends AbstractRelNode
RelNode.Context
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Predicate<? super Values> |
IS_EMPTY
Deprecated.
|
static java.util.function.Predicate<? super Values> |
IS_EMPTY_J |
static com.google.common.base.Predicate<? super Values> |
IS_NOT_EMPTY
Deprecated.
|
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) |
static boolean |
isEmpty(Values values)
Predicate, to be used when defining an operand of a
RelOptRule ,
that returns true if a Values contains zero tuples. |
static boolean |
isNotEmpty(Values values)
Predicate, to be used when defining an operand of a
RelOptRule ,
that returns true if a Values contains one or more tuples. |
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, toString
public static final java.util.function.Predicate<? super Values> IS_EMPTY_J
@Deprecated public static final com.google.common.base.Predicate<? super Values> IS_EMPTY
@Deprecated public static final com.google.common.base.Predicate<? super Values> IS_NOT_EMPTY
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 static boolean isEmpty(Values values)
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 boolean isNotEmpty(Values values)
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 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 AbstractRelNode
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
RelNode
NOTE 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 RelNode
computeSelfCost
in class AbstractRelNode
planner
- Planner for cost calculationmq
- Metadata querypublic double estimateRowCount(RelMetadataQuery mq)
RelNode
NOTE 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 RelNode
estimateRowCount
in class AbstractRelNode
mq
- Metadata querypublic RelWriter explainTerms(RelWriter pw)
AbstractRelNode
super.explainTerms
, then call the
RelWriter.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms
in class AbstractRelNode
pw
- Plan writerCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.