Package org.apache.calcite.rel.core
Class TableFunctionScan
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.core.TableFunctionScan
- All Implemented Interfaces:
Cloneable
,RelOptNode
,Hintable
,RelNode
- Direct Known Subclasses:
EnumerableTableFunctionScan
,LogicalTableFunctionScan
Relational expression that calls a table-valued function.
The function returns a result set. It can appear as a leaf in a query tree, or can be applied to relational inputs.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Modifier and TypeFieldDescriptionprotected final @Nullable com.google.common.collect.ImmutableSet<RelColumnMapping>
protected final com.google.common.collect.ImmutableList<RelHint>
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
TableFunctionScan
(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Creates aTableFunctionScan
.protected
TableFunctionScan
(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Creates aTableFunctionScan
.protected
TableFunctionScan
(RelInput input) Creates a TableFunctionScan by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(RexShuttle shuttle) Accepts a visit from a shuttle.final TableFunctionScan
copy
(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.abstract TableFunctionScan
copy
(RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Copies this relational expression, substituting traits and inputs.double
Returns an estimate of the number of rows this relational expression will return.Describes the inputs and attributes of this relational expression.getCall()
Returns function invocation expression.@Nullable Set<RelColumnMapping>
Returns set of mappings known for this table function, or null if unknown (not the same as empty!).@Nullable Type
Returns element type of the collection that will implement this table.com.google.common.collect.ImmutableList<RelHint>
getHints()
Returns the hints of this relational expressions as an immutable list.Returns an array of this relational expression's inputs.void
replaceInput
(int ordinalInParent, RelNode p) Replaces theordinalInParent
th input.Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, deepEquals, deepHashCode, deriveRowType, 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.hint.Hintable
attachHints, withHints
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
columnMappings
-
hints
-
-
Constructor Details
-
TableFunctionScan
protected TableFunctionScan(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Creates aTableFunctionScan
.- Parameters:
cluster
- Cluster that this relational expression belongs totraitSet
- Trait sethints
- hints of this node.inputs
- 0 or more relational inputsrexCall
- Function invocation expressionelementType
- Element type of the collection that will implement this tablerowType
- Row type produced by functioncolumnMappings
- Column mappings associated with this function
-
TableFunctionScan
protected TableFunctionScan(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Creates aTableFunctionScan
.- Parameters:
cluster
- Cluster that this relational expression belongs totraitSet
- Trait setinputs
- 0 or more relational inputsrexCall
- Function invocation expressionelementType
- Element type of the collection that will implement this tablerowType
- Row type produced by functioncolumnMappings
- Column mappings associated with this function
-
TableFunctionScan
Creates a TableFunctionScan by parsing serialized output.
-
-
Method Details
-
copy
Description copied from interface:RelNode
Creates a copy of this relational expression, perhaps changing traits and inputs.Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
- Specified by:
copy
in interfaceRelNode
- Overrides:
copy
in classAbstractRelNode
- Parameters:
traitSet
- Trait setinputs
- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
copy
public abstract TableFunctionScan copy(RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Copies this relational expression, substituting traits and inputs.- Parameters:
traitSet
- Traitsinputs
- 0 or more relational inputsrexCall
- Function invocation expressionelementType
- Element type of the collection that will implement this tablerowType
- Row type produced by functioncolumnMappings
- Column mappings associated with this function- Returns:
- Copy of this relational expression, substituting traits and inputs
-
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
-
accept
Description copied from interface:RelNode
Accepts a visit from a shuttle. If the shuttle updates expression, then a copy of the relation should be created. This new relation might have a different row-type.- Specified by:
accept
in interfaceRelNode
- Overrides:
accept
in classAbstractRelNode
- Parameters:
shuttle
- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
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 firstp
- New node that should be put at positionordinalInParent
-
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
-
getCall
Returns function invocation expression.Within this rexCall, instances of
RexInputRef
refer to entire inputRelNode
s rather than their fields.- Returns:
- function invocation expression
-
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
-
getColumnMappings
Returns set of mappings known for this table function, or null if unknown (not the same as empty!).- Returns:
- set of mappings known for this table function, or null if unknown (not the same as empty!)
-
getElementType
Returns element type of the collection that will implement this table.- Returns:
- element type of the collection that will implement this table
-
getHints
Description copied from interface:Hintable
Returns the hints of this relational expressions as an immutable list.
-