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
FieldsModifier 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
ConstructorsModifierConstructorDescriptionprotectedTableFunctionScan(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Creates aTableFunctionScan.protectedTableFunctionScan(RelOptCluster cluster, RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Creates aTableFunctionScan.protectedTableFunctionScan(RelInput input) Creates a TableFunctionScan by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept(RexShuttle shuttle) Accepts a visit from a shuttle.final TableFunctionScancopy(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.abstract TableFunctionScancopy(RelTraitSet traitSet, List<RelNode> inputs, RexNode rexCall, @Nullable Type elementType, RelDataType rowType, @Nullable Set<RelColumnMapping> columnMappings) Copies this relational expression, substituting traits and inputs.doubleReturns 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 TypeReturns 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.voidreplaceInput(int ordinalInParent, RelNode p) Replaces theordinalInParentth 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHintsMethods 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:RelNodeCreates 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:
copyin interfaceRelNode- Overrides:
copyin 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:RelNodeReturns an array of this relational expression's inputs. If there are no inputs, returns an empty list, notnull.- Specified by:
getInputsin interfaceRelNode- Specified by:
getInputsin interfaceRelOptNode- Overrides:
getInputsin classAbstractRelNode- Returns:
- Array of this relational expression's inputs
-
accept
Description copied from interface:RelNodeAccepts 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:
acceptin interfaceRelNode- Overrides:
acceptin 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:RelNodeReplaces theordinalInParentth input. You must override this method if you overrideRelNode.getInputs().- Specified by:
replaceInputin interfaceRelNode- Overrides:
replaceInputin 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:RelNodeReturns 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:
estimateRowCountin interfaceRelNode- Overrides:
estimateRowCountin 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
RexInputRefrefer to entire inputRelNodes rather than their fields.- Returns:
- function invocation expression
-
explainTerms
Description copied from class:AbstractRelNodeDescribes 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:
explainTermsin 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:HintableReturns the hints of this relational expressions as an immutable list.
-