Class ReplaceWindowFuncCallsWithCRVisitor

java.lang.Object
org.apache.derby.impl.sql.compile.ReplaceWindowFuncCallsWithCRVisitor
All Implemented Interfaces:
Visitor

class ReplaceWindowFuncCallsWithCRVisitor extends Object implements Visitor
Replace all window function calls with result columns.
  • Field Details

    • rcl

      private ResultColumnList rcl
    • skipOverClass

      private Class<?> skipOverClass
    • tableNumber

      private int tableNumber
  • Constructor Details

    • ReplaceWindowFuncCallsWithCRVisitor

      ReplaceWindowFuncCallsWithCRVisitor(ResultColumnList rcl, int tableNumber, Class<?> skipOverClass)
      Replace all window function calls with column references. Add the reference to the RCL. Delegates most work to WindowFunctionNode.replaceCallsWithColumnReferences(rcl, tableNumber).
      Parameters:
      rcl - the result column list
      tableNumber - The tableNumber for the new CRs
      skipOverClass - Don't go past this
  • Method Details

    • visit

      public Visitable visit(Visitable node) throws StandardException
      Don't do anything unless we have a window function node node. Visitor override.
      Specified by:
      visit in interface Visitor
      Parameters:
      node - the node to process
      Returns:
      a query tree node. Often times this is the same node that was passed in, but Visitors that replace nodes with other nodes will use this to return the new replacement node.
      Throws:
      StandardException - may be throw an error as needed by the visitor (i.e. may be a normal error if a particular node is found, e.g. if checking a group by, we don't expect to find any ColumnReferences that aren't under an AggregateNode -- the easiest thing to do is just throw an error when we find the questionable node).
      See Also:
    • skipChildren

      public boolean skipChildren(Visitable node)
      Don't visit children under the skipOverClass node, if it isn't null. Visitor override.
      Specified by:
      skipChildren in interface Visitor
      Parameters:
      node - the node to process
      Returns:
      true/false
      See Also:
    • visitChildrenFirst

      public boolean visitChildrenFirst(Visitable node)
      Visitor override.
      Specified by:
      visitChildrenFirst in interface Visitor
      Parameters:
      node - the top node of a sub-tree about to be visited
      Returns:
      false
      See Also:
    • stopTraversal

      public boolean stopTraversal()
      Visitor override.
      Specified by:
      stopTraversal in interface Visitor
      Returns:
      false
      See Also: