Class NormalizeResultSetNode

  • All Implemented Interfaces:
    Optimizable, Visitable

    class NormalizeResultSetNode
    extends SingleChildResultSetNode
    A NormalizeResultSetNode represents a normalization result set for any child result set that needs one. See non-javadoc comments for a walk-through of a couple sample code paths.
    • Field Detail

      • forUpdate

        private boolean forUpdate
        this indicates if the normalize is being performed for an Update statement or not. The row passed to update also has before values of the columns being updated-- we need not normalize these values.
    • Constructor Detail

      • NormalizeResultSetNode

        NormalizeResultSetNode​(ResultSetNode chldRes,
                               ResultColumnList targetResultColumnList,
                               java.util.Properties tableProperties,
                               boolean forUpdate,
                               ContextManager cm)
                        throws StandardException
        Constructor for a NormalizeResultSetNode. ColumnReferences must continue to point to the same ResultColumn, so that ResultColumn must percolate up to the new PRN. However, that ResultColumn will point to a new expression, a VirtualColumnNode, which points to the FromTable and the ResultColumn that is the source for the ColumnReference. (The new NRSN will have the original of the ResultColumnList and the ResultColumns from that list. The FromTable will get shallow copies of the ResultColumnList and its ResultColumns. ResultColumn.expression will remain at the FromTable, with the PRN getting a new VirtualColumnNode for each ResultColumn.expression.) This is useful for UNIONs, where we want to generate a DistinctNode above the UnionNode to eliminate the duplicates, because the type going into the sort has to agree with what the sort expects. (insert into t1 (smallintcol) values 1 union all values 2;
        Parameters:
        chldRes - The child ResultSetNode
        targetResultColumnList - The target resultColumnList from the InsertNode or UpdateNode. These will be the types used for the NormalizeResultSetNode.
        tableProperties - Properties list associated with the table
        forUpdate - tells us if the normalize operation is being performed on behalf of an update statement.
        cm - The context manager
        Throws:
        StandardException
    • Method Detail

      • setRefActionInfo

        void setRefActionInfo​(long fkIndexConglomId,
                              int[] fkColArray,
                              java.lang.String parentResultSetId,
                              boolean dependentScan)
        set the Information gathered from the parent table that is required to perform a referential action on dependent table.
        Overrides:
        setRefActionInfo in class QueryTreeNode
      • pushOrderByList

        void pushOrderByList​(OrderByList orderByList)
        Push the order by list down from InsertNode into its child result set so that the optimizer has all of the information that it needs to consider sort avoidance.
        Overrides:
        pushOrderByList in class ResultSetNode
        Parameters:
        orderByList - The order by list
      • pushOffsetFetchFirst

        void pushOffsetFetchFirst​(ValueNode offset,
                                  ValueNode fetchFirst,
                                  boolean hasJDBClimitClause)
        Push through the offset and fetch first parameters, if any, to the child result set.
        Overrides:
        pushOffsetFetchFirst in class ResultSetNode
        Parameters:
        offset - the OFFSET, if any
        fetchFirst - the OFFSET FIRST, if any
        hasJDBClimitClause - true if the clauses were added by (and have the semantics of) a JDBC limit clause