Package org.apache.calcite.interpreter
Class Bindables.BindableTableScan
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.core.TableScan
-
- org.apache.calcite.interpreter.Bindables.BindableTableScan
-
- All Implemented Interfaces:
java.lang.Cloneable
,BindableRel
,InterpretableRel
,RelOptNode
,RelNode
,ArrayBindable
,Bindable<java.lang.Object[]>
,Typed
- Enclosing class:
- Bindables
public static class Bindables.BindableTableScan extends TableScan implements BindableRel
Scan of a table that implementsScannableTable
and therefore can be converted into anEnumerable
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.interpreter.InterpretableRel
InterpretableRel.InterpreterImplementor
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
Fields Modifier and Type Field Description com.google.common.collect.ImmutableList<RexNode>
filters
ImmutableIntList
projects
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
-
Constructor Summary
Constructors Constructor Description BindableTableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table, com.google.common.collect.ImmutableList<RexNode> filters, ImmutableIntList projects)
Creates a BindableTableScan.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Enumerable<java.lang.Object[]>
bind(DataContext dataContext)
Executes this statement and returns an enumerable which will yield rows.static boolean
canHandle(RelOptTable table)
RelOptCost
computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Returns the cost of this plan (not including children).static Bindables.BindableTableScan
create(RelOptCluster cluster, RelOptTable relOptTable)
Creates a BindableTableScan.static Bindables.BindableTableScan
create(RelOptCluster cluster, RelOptTable relOptTable, java.util.List<RexNode> filters, java.util.List<java.lang.Integer> projects)
Creates a BindableTableScan.RelDataType
deriveRowType()
RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.java.lang.Class<java.lang.Object[]>
getElementType()
Gets the type of the element(s) that are returned in this collection.Node
implement(InterpretableRel.InterpreterImplementor implementor)
Creates an interpreter node to implement this relational expression.-
Methods inherited from class org.apache.calcite.rel.core.TableScan
accept, estimateRowCount, getCollationList, getTable, identity, identity, project
-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, copy, explain, getChildExps, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.rel.RelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput
-
Methods inherited from interface org.apache.calcite.plan.RelOptNode
getCluster, getDescription, getDigest, getId, getTraitSet
-
-
-
-
Field Detail
-
filters
public final com.google.common.collect.ImmutableList<RexNode> filters
-
projects
public final ImmutableIntList projects
-
-
Constructor Detail
-
BindableTableScan
BindableTableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table, com.google.common.collect.ImmutableList<RexNode> filters, ImmutableIntList projects)
Creates a BindableTableScan.Use
create(org.apache.calcite.plan.RelOptCluster, org.apache.calcite.plan.RelOptTable)
unless you know what you are doing.
-
-
Method Detail
-
create
public static Bindables.BindableTableScan create(RelOptCluster cluster, RelOptTable relOptTable)
Creates a BindableTableScan.
-
create
public static Bindables.BindableTableScan create(RelOptCluster cluster, RelOptTable relOptTable, java.util.List<RexNode> filters, java.util.List<java.lang.Integer> projects)
Creates a BindableTableScan.
-
deriveRowType
public RelDataType deriveRowType()
- Overrides:
deriveRowType
in classTableScan
-
getElementType
public java.lang.Class<java.lang.Object[]> getElementType()
Description copied from interface:Typed
Gets the type of the element(s) that are returned in this collection.- Specified by:
getElementType
in interfaceArrayBindable
- Specified by:
getElementType
in interfaceTyped
-
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 classTableScan
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
computeSelfCost
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
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 classTableScan
- Parameters:
planner
- Planner for cost calculationmq
- Metadata query- Returns:
- Cost of this plan (not including children)
-
canHandle
public static boolean canHandle(RelOptTable table)
-
bind
public Enumerable<java.lang.Object[]> bind(DataContext dataContext)
Description copied from interface:Bindable
Executes this statement and returns an enumerable which will yield rows. Theenvironment
parameter provides the values in the root of the environment (usually schemas).
-
implement
public Node implement(InterpretableRel.InterpreterImplementor implementor)
Description copied from interface:InterpretableRel
Creates an interpreter node to implement this relational expression.- Specified by:
implement
in interfaceInterpretableRel
-
-