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

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Reader for column names and types.
  • Field Summary

    Fields inherited from class org.apache.calcite.rel.RelShuttleImpl

    stack
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 are recognized 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getDirectScanRelIfFullySchemaed

      public static DrillRel getDirectScanRelIfFullySchemaed(org.apache.calcite.rel.RelNode rel)
      If all field types of the given node are recognized 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

      public static DrillRel addLimitOnTopOfLeafNodes(DrillRel rel)
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalSort sort)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.RelNode other)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalAggregate aggregate)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalIntersect intersect)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalJoin join)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalMinus minus)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl
    • visit

      public org.apache.calcite.rel.RelNode visit(org.apache.calcite.rel.logical.LogicalUnion union)
      Specified by:
      visit in interface org.apache.calcite.rel.RelShuttle
      Overrides:
      visit in class org.apache.calcite.rel.RelShuttleImpl