Class GenericAggregateResultSet

    • Constructor Detail

      • GenericAggregateResultSet

        GenericAggregateResultSet​(NoPutResultSet s,
                                  int aggregateItem,
                                  Activation a,
                                  int ra,
                                  int resultSetNumber,
                                  double optimizerEstimatedRowCount,
                                  double optimizerEstimatedCost)
                           throws StandardException
        Constructor
        Parameters:
        a - activation
        ra - reference to a saved row allocator instance
        resultSetNumber - result set number
        optimizerEstimatedRowCount - optimizer estimated row count
        optimizerEstimatedCost - optimizer estimated cost
        Throws:
        StandardException - Thrown on error
    • Method Detail

      • getRowTemplate

        ExecIndexRow getRowTemplate()
        Get a template row of the right shape for sorting or returning results. The template is cached, so it may need to be cloned if callers use it for multiple purposes at the same time.
        Returns:
        a row template of the right shape for this result set
      • getSortAggregators

        protected final GenericAggregator[] getSortAggregators​(AggregatorInfoList list,
                                                               boolean eliminateDistincts,
                                                               LanguageConnectionContext lcc,
                                                               NoPutResultSet inputResultSet)
                                                        throws StandardException
        For each AggregatorInfo in the list, generate a GenericAggregator and stick it in an array of GenericAggregators.
        Parameters:
        list - the list of aggregators to set up
        eliminateDistincts - should distincts be ignored. Used to toss out distinct aggregates for a prelim sort.
        lcc - the lcc
        inputResultSet - the incoming result set
        Returns:
        the array of GenericAggregators
        Throws:
        StandardException - on error
      • finishAggregation

        protected final ExecIndexRow finishAggregation​(ExecIndexRow row)
                                                throws StandardException
        Finish the aggregation for the current row. Basically call finish() on each aggregator on this row. Called once per grouping on a vector aggregate or once per table on a scalar aggregate. If the input row is null, then rowAllocator is invoked to create a new row. That row is then initialized and used for the output of the aggregation.
        Parameters:
        row - the row to finish aggregation
        Returns:
        the result row. If the input row != null, then the result row == input row
        Throws:
        StandardException - Thrown on error
      • toXML

        public org.w3c.dom.Element toXML​(org.w3c.dom.Element parentNode,
                                         java.lang.String tag)
                                  throws java.lang.Exception
        Description copied from interface: ResultSet

        Produce an xml image of this ResultSet and its descendant ResultSets. Appends an element to the parentNode and returns the appended element.

        Specified by:
        toXML in interface ResultSet
        Overrides:
        toXML in class BasicNoPutResultSetImpl
        Parameters:
        parentNode - Node to put content into.
        tag - Element tag for content
        Returns:
        the content as an element with the given tag name
        Throws:
        java.lang.Exception