Package org.apache.calcite.rel
Class SingleRel
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
- All Implemented Interfaces:
Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
Aggregate
,Calc
,CassandraLimit
,Chi
,Collect
,ConverterImpl
,Delta
,EnumerableInterpreter
,EnumerableLimit
,Exchange
,Filter
,JdbcRules.JdbcCalc
,Match
,Project
,Sample
,Snapshot
,Sort
,SparkRules.SparkCalc
,Spool
,TableModify
,Uncollect
,Window
Abstract base class for relational expressions with a single input.
It is not required that single-input relational expressions use this class as a base class. However, default implementations of methods make life easier.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
SingleRel
(RelOptCluster cluster, RelTraitSet traits, RelNode input) Creates aSingleRel
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
childrenAccept
(RelVisitor visitor) Interacts with theRelVisitor
in avisitor pattern
to traverse the tree of relational expressions.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.getInput()
Returns an array of this relational expression's inputs.void
replaceInput
(int ordinalInParent, RelNode rel) Replaces theordinalInParent
th input.Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, 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.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
input
-
-
Constructor Details
-
SingleRel
Creates aSingleRel
.- Parameters:
cluster
- Cluster this relational expression belongs toinput
- Input relational expression
-
-
Method Details
-
getInput
-
getInputs
Description copied from interface:RelNode
Returns an array of this relational expression's inputs. If there are no inputs, returns an empty list, notnull
.- Specified by:
getInputs
in interfaceRelNode
- Specified by:
getInputs
in interfaceRelOptNode
- Overrides:
getInputs
in classAbstractRelNode
- Returns:
- Array of this relational expression's inputs
-
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
-
childrenAccept
Description copied from interface:RelNode
Interacts with theRelVisitor
in avisitor pattern
to traverse the tree of relational expressions.- Specified by:
childrenAccept
in interfaceRelNode
- Overrides:
childrenAccept
in classAbstractRelNode
- Parameters:
visitor
- Visitor that will traverse the tree of relational expressions
-
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
-
replaceInput
Description copied from interface:RelNode
Replaces theordinalInParent
th input. You must override this method if you overrideRelNode.getInputs()
.- Specified by:
replaceInput
in interfaceRelNode
- Overrides:
replaceInput
in classAbstractRelNode
- Parameters:
ordinalInParent
- Position of the child input, 0 is the firstrel
- New node that should be put at positionordinalInParent
-
deriveRowType
- Overrides:
deriveRowType
in classAbstractRelNode
-