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:
java.lang.Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
EnumerableTableFunctionScan
,LogicalTableFunctionScan
public abstract class TableFunctionScan extends AbstractRelNode
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:
LogicalTableFunctionScan
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.collect.ImmutableSet<RelColumnMapping>
columnMappings
private java.lang.reflect.Type
elementType
private com.google.common.collect.ImmutableList<RelNode>
inputs
private RexNode
rexCall
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TableFunctionScan(RelOptCluster cluster, RelTraitSet traits, java.util.List<RelNode> inputs, RexNode rexCall, java.lang.reflect.Type elementType, RelDataType rowType, java.util.Set<RelColumnMapping> columnMappings)
Creates aTableFunctionScan
.protected
TableFunctionScan(RelInput input)
Creates a TableFunctionScan by parsing serialized output.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RelNode
accept(RexShuttle shuttle)
Accepts a visit from a shuttle.TableFunctionScan
copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and inputs.abstract TableFunctionScan
copy(RelTraitSet traitSet, java.util.List<RelNode> inputs, RexNode rexCall, java.lang.reflect.Type elementType, RelDataType rowType, java.util.Set<RelColumnMapping> columnMappings)
Copies this relational expression, substituting traits and inputs.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.RexNode
getCall()
Returns function invocation expression.java.util.List<RexNode>
getChildExps()
Returns a list of this relational expression's child expressions.java.util.Set<RelColumnMapping>
getColumnMappings()
Returns set of mappings known for this table function, or null if unknown (not the same as empty!).java.lang.reflect.Type
getElementType()
Returns element type of the collection that will implement this table.java.util.List<RelNode>
getInputs()
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, computeDigest, computeSelfCost, computeSelfCost, deriveRowType, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
-
-
-
Field Detail
-
rexCall
private final RexNode rexCall
-
elementType
private final java.lang.reflect.Type elementType
-
inputs
private com.google.common.collect.ImmutableList<RelNode> inputs
-
columnMappings
protected final com.google.common.collect.ImmutableSet<RelColumnMapping> columnMappings
-
-
Constructor Detail
-
TableFunctionScan
protected TableFunctionScan(RelOptCluster cluster, RelTraitSet traits, java.util.List<RelNode> inputs, RexNode rexCall, java.lang.reflect.Type elementType, RelDataType rowType, java.util.Set<RelColumnMapping> columnMappings)
Creates aTableFunctionScan
.- Parameters:
cluster
- Cluster that this relational expression belongs toinputs
- 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(RelInput input)
Creates a TableFunctionScan by parsing serialized output.
-
-
Method Detail
-
copy
public final TableFunctionScan copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
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, java.util.List<RelNode> inputs, RexNode rexCall, java.lang.reflect.Type elementType, RelDataType rowType, java.util.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
public java.util.List<RelNode> 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
-
getChildExps
public java.util.List<RexNode> getChildExps()
Description copied from interface:RelNode
Returns a list of this relational expression's child expressions. (These are scalar expressions, and so do not include the relational inputs that are returned byRelNode.getInputs()
.The caller should treat the list as unmodifiable; typical implementations will return an immutable list. If there are no child expressions, returns an empty list, not
null
.- Specified by:
getChildExps
in interfaceRelNode
- Overrides:
getChildExps
in classAbstractRelNode
- Returns:
- List of this relational expression's child expressions
- See Also:
RelNode.accept(org.apache.calcite.rex.RexShuttle)
-
accept
public RelNode accept(RexShuttle shuttle)
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.- 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
public void replaceInput(int ordinalInParent, RelNode p)
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
public double estimateRowCount(RelMetadataQuery mq)
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
public RexNode 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
public RelWriter explainTerms(RelWriter pw)
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriterImpl.input(String, RelNode)
andRelWriterImpl.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
public java.util.Set<RelColumnMapping> 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
public java.lang.reflect.Type getElementType()
Returns element type of the collection that will implement this table.- Returns:
- element type of the collection that will implement this table
-
-