Class WindowResultSetNode

All Implemented Interfaces:
Optimizable, Visitable

class WindowResultSetNode extends SingleChildResultSetNode
A WindowResultSetNode represents a result set for a window partitioning on a select. Modeled on the code in GroupByNode.
  • Field Details

  • Constructor Details

    • WindowResultSetNode

      WindowResultSetNode(ResultSetNode bottomPR, WindowDefinitionNode windowDef, List<WindowFunctionNode> windowFuncCalls, int nestingLevel, ContextManager cm) throws StandardException
      Constructor for a WindowResultSetNode.
      Parameters:
      bottomPR - The project restrict result set we want to wrap
      windowDef - The window definition
      windowFuncCalls - All window function calls in SELECT's select list and order by list.
      nestingLevel - Nesting level
      cm - The context manager
      Throws:
      StandardException - Thrown on error
  • Method Details

    • addNewPRNode

      private void addNewPRNode() throws StandardException
      Add a new PR node. Put the new PR under any sort.
      Throws:
      StandardException - standard error policy
    • colRefAlreadySeen

      private boolean colRefAlreadySeen(List<ValueNode> uniqueColRefs, ColumnReference cand) throws StandardException
      Parameters:
      uniqueColRefs - list of unique column references
      cand - the candidate to check is present in list
      Returns:
      true if an equivalent column reference to cand is already present in uniqueColRefs
      Throws:
      StandardException - standard error policy
    • addNewColumns

      private void addNewColumns() throws StandardException
      Substitute new result columns for window function calls and add the result columns to childResult's list of columns.
      Throws:
      StandardException - standard error policy
    • generate

      void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
      Description copied from class: QueryTreeNode
      Do the code generation for this node. This is a place-holder method - it should be over-ridden in the sub-classes.
      Overrides:
      generate in class QueryTreeNode
      Parameters:
      acb - The ActivationClassBuilder for the class being built
      mb - The method for the generated code to go into
      Throws:
      StandardException - Thrown on error
    • getParent

      final FromTable getParent()
      Returns:
      parent of this node, a PRN, used by SelectNode to retrieve new top result set node after window result set rewrite of result set tree.
    • printSubNodes

      public void printSubNodes(int depth)
      QueryTreeNode override
      Overrides:
      printSubNodes in class SingleChildResultSetNode
      Parameters:
      depth - The depth of this node in the tree
      See Also: