Class FindLimit0Visitor
java.lang.Object
org.apache.calcite.rel.RelShuttleImpl
org.apache.drill.exec.planner.sql.handlers.FindLimit0Visitor
- All Implemented Interfaces:
org.apache.calcite.rel.RelShuttle
public class FindLimit0Visitor
extends org.apache.calcite.rel.RelShuttleImpl
Visitor that will identify whether the root portion of the RelNode tree contains a limit 0 pattern. In this case, we
inform the planner settings that this plan should be run as a single node plan to reduce the overhead associated with
executing a schema-only query.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Reader for column names and types. -
Field Summary
Fields inherited from class org.apache.calcite.rel.RelShuttleImpl
stack
-
Method Summary
Modifier and TypeMethodDescriptionstatic DrillRel
static boolean
containsLimit0
(org.apache.calcite.rel.RelNode rel) Check if the root portion of the tree contains LIMIT(0).static DrillRel
getDirectScanRelIfFullySchemaed
(org.apache.calcite.rel.RelNode rel) If all field types of the given node arerecognized types
and honored by execution, then this method returns the tree: DrillDirectScanRel(field types).org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.logical.LogicalAggregate aggregate) org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.logical.LogicalIntersect intersect) org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.logical.LogicalJoin join) org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.logical.LogicalMinus minus) org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.logical.LogicalSort sort) org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.logical.LogicalUnion union) org.apache.calcite.rel.RelNode
visit
(org.apache.calcite.rel.RelNode other) Methods inherited from class org.apache.calcite.rel.RelShuttleImpl
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitChild, visitChildren
-
Method Details
-
getDirectScanRelIfFullySchemaed
If all field types of the given node arerecognized types
and honored by execution, then this method returns the tree: DrillDirectScanRel(field types). Otherwise, the method returns null.- Parameters:
rel
- calcite logical rel tree- Returns:
- drill logical rel tree
-
containsLimit0
public static boolean containsLimit0(org.apache.calcite.rel.RelNode rel) Check if the root portion of the tree contains LIMIT(0).- Parameters:
rel
- rel node tree- Returns:
- true if the root portion of the tree contains LIMIT(0)
-
addLimitOnTopOfLeafNodes
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalSort sort) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.RelNode other) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalAggregate aggregate) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalIntersect intersect) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalJoin join) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalMinus minus) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-
visit
public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalUnion union) - Specified by:
visit
in interfaceorg.apache.calcite.rel.RelShuttle
- Overrides:
visit
in classorg.apache.calcite.rel.RelShuttleImpl
-