Class Values
- All Implemented Interfaces:
Cloneable
,RelOptNode
,Hintable
,RelNode
- Direct Known Subclasses:
Bindables.BindableValues
,EnumerableValues
,JdbcRules.JdbcValues
,LogicalValues
,SparkRules.SparkValues
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.google.common.collect.ImmutableList<RelHint>
static final com.google.common.base.Predicate<? super Values>
Deprecated.static final com.google.common.base.Predicate<? super Values>
Deprecated.final com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>>
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
Values
(RelOptCluster cluster, List<RelHint> hints, RelDataType rowType, com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples, RelTraitSet traits) Creates a new Values.protected
Values
(RelOptCluster cluster, RelDataType rowType, com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples, RelTraitSet traits) Creates a new Values.protected
Creates a Values by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescription@Nullable RelOptCost
computeSelfCost
(RelOptPlanner planner, RelMetadataQuery mq) Returns the cost of this plan (not including children).protected RelDataType
double
Returns an estimate of the number of rows this relational expression will return.Describes the inputs and attributes of this relational expression.com.google.common.collect.ImmutableList<RelHint>
getHints()
Returns the hints of this relational expressions as an immutable list.com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>>
Returns the rows of literals represented by this Values relational expression.com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>>
static boolean
Predicate, to be used when defining an operand of aRelOptRule
, that returns true if a Values contains zero tuples.static boolean
isNotEmpty
(Values values) Predicate, to be used when defining an operand of aRelOptRule
, that returns true if a Values contains one or more tuples.static boolean
isSingleValue
(Values values) Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, copy, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHints
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
IS_EMPTY_J
-
hints
-
IS_EMPTY
Deprecated. -
IS_NOT_EMPTY
Deprecated. -
tuples
public final com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples
-
-
Constructor Details
-
Values
protected Values(RelOptCluster cluster, List<RelHint> hints, RelDataType rowType, com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples, RelTraitSet traits) Creates a new Values.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.
- Parameters:
cluster
- Cluster that this relational expression belongs tohints
- Hints for this noderowType
- 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 rowType
-
Values
protected Values(RelOptCluster cluster, RelDataType rowType, com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> tuples, RelTraitSet traits) Creates a new Values.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.
- Parameters:
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 rowType
-
Values
Creates a Values by parsing serialized output.
-
-
Method Details
-
isEmpty
Predicate, to be used when defining an operand of aRelOptRule
, 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.
-
isNotEmpty
Predicate, to be used when defining an operand of aRelOptRule
, 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.
-
isSingleValue
-
getTuples
public com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> getTuples(RelInput input) -
getTuples
public com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<RexLiteral>> getTuples()Returns the rows of literals represented by this Values relational expression. -
deriveRowType
- Overrides:
deriveRowType
in classAbstractRelNode
-
computeSelfCost
Description copied from interface:RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.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.- Specified by:
computeSelfCost
in interfaceRelNode
- Overrides:
computeSelfCost
in classAbstractRelNode
- Parameters:
planner
- Planner for cost calculationmq
- Metadata query- Returns:
- Cost of this plan (not including children)
-
estimateRowCount
Description copied from interface:RelNode
Returns an estimate of the number of rows this relational expression will return.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.- Specified by:
estimateRowCount
in interfaceRelNode
- Overrides:
estimateRowCount
in classAbstractRelNode
- Parameters:
mq
- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
explainTerms
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriter.input(String, RelNode)
andRelWriter.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classAbstractRelNode
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
getHints
Description copied from interface:Hintable
Returns the hints of this relational expressions as an immutable list.
-