Interface VectorAggregator

    • Method Detail

      • aggregate

        void aggregate​(ByteBuffer buf,
                       int position,
                       int startRow,
                       int endRow)
        Aggregate a range of rows into a single aggregation slot. Implementations must not change the position, limit or mark of the given buffer
        Parameters:
        buf - byte buffer storing the byte array representation of the aggregate
        position - offset within the byte buffer at which the current aggregate value is stored
        startRow - first row of the range within the current batch to aggregate (inclusive)
        endRow - end row of the range (exclusive)
      • aggregate

        void aggregate​(ByteBuffer buf,
                       int numRows,
                       int[] positions,
                       @Nullable
                       int[] rows,
                       int positionOffset)
        Aggregate a list of rows ("rows") into a list of aggregation slots ("positions"). Implementations must not change the position, limit or mark of the given buffer
        Parameters:
        buf - byte buffer storing the byte array representation of the aggregate
        numRows - number of rows to aggregate
        positions - array of aggregate value positions within the buffer; must be at least as long as "numRows"
        rows - array of row numbers within the current row batch; must be at least as long as "numRows". If null, the aggregator will aggregate rows from 0 (inclusive) to numRows (exclusive).
        positionOffset - an offset to apply to each value from "positions"
      • close

        void close()
        Release any resources used by the aggregator. The aggregator may be reused after this call, by calling init(ByteBuffer, int) followed by other methods as normal. This call would be more properly named "reset", but we use the name "close" to improve compatibility with existing aggregator implementations in extensions.