public class TopNPrel extends SinglePrel implements OrderedRel, Prel
Modifier and Type | Field and Description |
---|---|
protected org.apache.calcite.rel.RelCollation |
collation |
protected int |
limit |
DRILL_PHYSICAL
Constructor and Description |
---|
TopNPrel(org.apache.calcite.plan.RelOptCluster cluster,
org.apache.calcite.plan.RelTraitSet traitSet,
org.apache.calcite.rel.RelNode child,
int limit,
org.apache.calcite.rel.RelCollation collation) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeDropped()
A method to return if this relational node can be dropped during optimization process.
|
org.apache.calcite.plan.RelOptCost |
computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner,
org.apache.calcite.rel.metadata.RelMetadataQuery mq)
Cost of doing Top-N is proportional to M log N where M is the total number of
input rows and N is the limit for Top-N.
|
org.apache.calcite.rel.RelNode |
copy(org.apache.calcite.plan.RelTraitSet traitSet,
List<org.apache.calcite.rel.RelNode> inputs) |
org.apache.calcite.rel.RelWriter |
explainTerms(org.apache.calcite.rel.RelWriter pw) |
org.apache.calcite.rel.RelCollation |
getCollation()
A method to return ordering columns of the result.
|
BatchSchema.SelectionVectorMode |
getEncoding()
A Prel's own SelectionVector mode - i.e whether it generates an SV2, SV4 or None
|
org.apache.calcite.rex.RexNode |
getFetch()
Fetch value represented in RexNode.
|
int |
getLimit() |
org.apache.calcite.rex.RexNode |
getOffset()
Offset value represented in RexNode.
|
PhysicalOperator |
getPhysicalOperator(PhysicalPlanCreator creator) |
BatchSchema.SelectionVectorMode[] |
getSupportedEncodings()
Supported 'encodings' of a Prel indicates what are the acceptable modes of SelectionVector
of its child Prel
|
Prel |
prepareForLateralUnnestPipeline(List<org.apache.calcite.rel.RelNode> children)
If the operator is in Lateral/Unnest pipeline, then it generates a new operator which knows how to process
the rows accordingly during execution.
|
accept, iterator, needsFinalColumnReordering
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInput
accept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, equals, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, hashCode, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
accept, needsFinalColumnReordering
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, 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
getCluster, getDescription, getDigest, getId, getTraitSet
forEach, iterator, spliterator
protected int limit
protected final org.apache.calcite.rel.RelCollation collation
public TopNPrel(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traitSet, org.apache.calcite.rel.RelNode child, int limit, org.apache.calcite.rel.RelCollation collation)
public org.apache.calcite.rel.RelNode copy(org.apache.calcite.plan.RelTraitSet traitSet, List<org.apache.calcite.rel.RelNode> inputs)
copy
in interface org.apache.calcite.rel.RelNode
copy
in class org.apache.calcite.rel.AbstractRelNode
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException
getPhysicalOperator
in interface Prel
IOException
public org.apache.calcite.rel.RelCollation getCollation()
OrderedRel
getCollation
in interface OrderedRel
public org.apache.calcite.rex.RexNode getOffset()
OrderedRel
getOffset
in interface OrderedRel
public org.apache.calcite.rex.RexNode getFetch()
OrderedRel
getFetch
in interface OrderedRel
public boolean canBeDropped()
OrderedRel
canBeDropped
in interface OrderedRel
public org.apache.calcite.plan.RelOptCost computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner, org.apache.calcite.rel.metadata.RelMetadataQuery mq)
computeSelfCost
in interface org.apache.calcite.rel.RelNode
computeSelfCost
in class org.apache.calcite.rel.AbstractRelNode
public org.apache.calcite.rel.RelWriter explainTerms(org.apache.calcite.rel.RelWriter pw)
explainTerms
in class org.apache.calcite.rel.SingleRel
public int getLimit()
public BatchSchema.SelectionVectorMode[] getSupportedEncodings()
Prel
getSupportedEncodings
in interface Prel
getSupportedEncodings
in class SinglePrel
public BatchSchema.SelectionVectorMode getEncoding()
Prel
getEncoding
in interface Prel
public Prel prepareForLateralUnnestPipeline(List<org.apache.calcite.rel.RelNode> children)
Prel
prepareForLateralUnnestPipeline
in interface Prel
Copyright © 1970 The Apache Software Foundation. All rights reserved.