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 Detail

      • parent

        FromTable parent
        The parent to the WindowResultSetNode. We generate a ProjectRestrict over the windowing node and parent is set to that node.
    • Constructor Detail

      • WindowResultSetNode

        WindowResultSetNode​(ResultSetNode bottomPR,
                            WindowDefinitionNode windowDef,
                            java.util.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 Detail

      • colRefAlreadySeen

        private boolean colRefAlreadySeen​(java.util.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
      • 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.