Module first_last

Module first_last 

Source
Expand description

Defines the FIRST_VALUE/LAST_VALUE aggregations.

Structsยง

FirstPrimitiveGroupsAccumulator ๐Ÿ”’
FirstValue
FirstValueAccumulator
LastValue
LastValueAccumulator ๐Ÿ”’
TrivialFirstValueAccumulator
This accumulator is used when there is no ordering specified for the FIRST_VALUE aggregation. It simply returns the first value it sees according to the pre-existing ordering of the input data, and provides a fast path for this case without needing to maintain any ordering state.
TrivialLastValueAccumulator
This accumulator is used when there is no ordering specified for the LAST_VALUE aggregation. It simply updates the last value it sees according to the pre-existing ordering of the input data, and provides a fast path for this case without needing to maintain any ordering state.

Functionsยง

convert_to_sort_cols ๐Ÿ”’
Combines array refs and their corresponding orderings to construct SortColumns.
filter_states_according_to_is_set ๐Ÿ”’
Filters states according to the is_set flag at the last column and returns the resulting states.
first_value
Returns the first value in a group of values.
first_value_udaf
AggregateFunction that returns a AggregateUDF for FirstValue
last_value
Returns the last value in a group of values.
last_value_udaf
AggregateFunction that returns a AggregateUDF for LastValue
validate_is_set_flags ๐Ÿ”’
Validates that is_set flags do not contain NULL values.