Interface MinMaxByNState
- All Superinterfaces:
AccumulatorState
- All Known Subinterfaces:
MaxByNState,MinByNState
- All Known Implementing Classes:
MinMaxByNStateFactory.GroupedMinMaxByNState,MinMaxByNStateFactory.SingleMinMaxByNState
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ValueBlock keyBlock, int keyPosition, ValueBlock valueBlock, int valuePosition) Adds the value to this state.voidinitialize(long n) Initialize the state if not already initialized.voidmerge(MinMaxByNState other) Merge with the specified state.voidpopAll(BlockBuilder out) Writes all values to the supplied block builder as an array entry.voidserialize(BlockBuilder out) Write this state to the specified block builder.Methods inherited from interface io.trino.spi.function.AccumulatorState
copy, getEstimatedSize
-
Method Details
-
initialize
void initialize(long n) Initialize the state if not already initialized. Only the first call is processed and all subsequent calls are ignored. -
add
Adds the value to this state. -
merge
Merge with the specified state. The supplied state should not be used after this method is called, because the internal details of the state may be reused in this state. -
popAll
Writes all values to the supplied block builder as an array entry. After this method is called, the current state will be empty. -
serialize
Write this state to the specified block builder.
-