SortObserver
class AggregateSortObserver extends BasicSortObserver
Modifier and Type | Field | Description |
---|---|---|
private GenericAggregator[] |
aggsToInitialize |
|
private GenericAggregator[] |
aggsToProcess |
|
private int |
firstAggregatorColumn |
distinct, doClone
Constructor | Description |
---|---|
AggregateSortObserver(boolean doClone,
GenericAggregator[] aggsToProcess,
GenericAggregator[] aggsToInitialize,
ExecRow execRow) |
Simple constructor
|
Modifier and Type | Method | Description |
---|---|---|
DataValueDescriptor[] |
insertDuplicateKey(DataValueDescriptor[] insertRow,
DataValueDescriptor[] existingRow) |
Called prior to inserting a duplicate sort
key.
|
DataValueDescriptor[] |
insertNonDuplicateKey(DataValueDescriptor[] insertRow) |
Called prior to inserting a distinct sort
key.
|
addToFreeList, deferrable, deferred, getArrayClone, rememberDuplicate
private final GenericAggregator[] aggsToProcess
private final GenericAggregator[] aggsToInitialize
private int firstAggregatorColumn
public AggregateSortObserver(boolean doClone, GenericAggregator[] aggsToProcess, GenericAggregator[] aggsToInitialize, ExecRow execRow)
doClone
- If true, then rows that are retained
by the sorter will be cloned. This is needed
if language is reusing row wrappers.aggsToProcess
- the array of aggregates that
need to be accumulated/merged in the sorter.aggsToInitialize
- the array of aggregates that
need to be iniitialized as they are inserted
into the sorter. This may be different than
aggsToProcess in the case where some distinct
aggregates are dropped in the initial pass of
a two phase aggregation for scalar or vector
distinct aggregation. The initialization process
consists of replacing an empty UserValue with a new,
initialized aggregate of the appropriate type.
Note that for each row, only the first aggregate
in this list is checked to see whether initialization
is needed. If so, ALL aggregates are initialized;
otherwise, NO aggregates are initialized.execRow
- ExecRow to use as source of clone for store.public DataValueDescriptor[] insertNonDuplicateKey(DataValueDescriptor[] insertRow) throws StandardException
insertNonDuplicateKey
in interface SortObserver
insertNonDuplicateKey
in class BasicSortObserver
insertRow
- the current row that the sorter
is on the verge of retainingStandardException
- never thrownpublic DataValueDescriptor[] insertDuplicateKey(DataValueDescriptor[] insertRow, DataValueDescriptor[] existingRow) throws StandardException
insertDuplicateKey
in interface SortObserver
insertDuplicateKey
in class BasicSortObserver
insertRow
- the current row that the sorter
is on the verge of retaining. It is a duplicate
of existingRow.existingRow
- the row that is already in the
the sorter which is a duplicate of insertRowStandardException
- never thrownApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.