◆ WindowAggregateStates()
253512}
const AggregateObject aggr
A description of the aggregator.
Definition duckdb.cpp:253493
const idx_t state_size
The size of each state.
Definition duckdb.cpp:253495
ArenaAllocator allocator
The allocator to use.
Definition duckdb.cpp:253497
ClientContext & client
The context to use for memory etc.
Definition duckdb.cpp:253491
◆ ~WindowAggregateStates()
| duckdb::WindowAggregateStates::~WindowAggregateStates |
( |
| ) |
|
|
inline |
253464 {
253466 }
void Destroy()
Destroy the states.
Definition duckdb.cpp:253543
◆ GetCount()
| idx_t duckdb::WindowAggregateStates::GetCount |
( |
| ) |
const |
|
inline |
The number of states.
253469 {
253471 }
vector< data_t > states
Data pointer that contains the state data.
Definition duckdb.cpp:253499
◆ GetData()
| data_ptr_t * duckdb::WindowAggregateStates::GetData |
( |
| ) |
|
|
inline |
253472 {
253473 return FlatVector::GetData<data_ptr_t>(*
statef);
253474 }
unique_ptr< Vector > statef
Reused result state container for the window functions.
Definition duckdb.cpp:253501
◆ GetStatePtr() [1/2]
| data_ptr_t duckdb::WindowAggregateStates::GetStatePtr |
( |
idx_t | idx | ) |
|
|
inline |
◆ GetStatePtr() [2/2]
| const_data_ptr_t duckdb::WindowAggregateStates::GetStatePtr |
( |
idx_t | idx | ) |
const |
|
inline |
◆ Initialize()
| void duckdb::WindowAggregateStates::Initialize |
( |
idx_t | count | ) |
|
Initialise all the states.
253514 {
253515
253516 D_ASSERT(
states.empty());
253517
253519 auto state_ptr =
states.data();
253520
253521 statef = make_uniq<Vector>(LogicalType::POINTER, count);
253522 auto state_f_data = FlatVector::GetData<data_ptr_t>(*
statef);
253523
253525 state_f_data[i] = state_ptr;
253526 aggr.function.GetStateInitCallback()(
aggr.function, state_ptr);
253527 }
253528
253529
253530 statef->SetVectorType(VectorType::FLAT_VECTOR);
253531}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ Combine()
| void duckdb::WindowAggregateStates::Combine |
( |
WindowAggregateStates & | target | ) |
|
Combine the states into the target.
253533 {
253534 AggregateInputData aggr_input_data(
aggr.GetFunctionData(),
allocator, AggregateCombineType::ALLOW_DESTRUCTIVE);
253535 aggr.function.GetStateCombineCallback()(*
statef, *target.statef, aggr_input_data,
GetCount());
253536}
idx_t GetCount() const
The number of states.
Definition duckdb.cpp:253469
◆ Finalize()
| void duckdb::WindowAggregateStates::Finalize |
( |
Vector & | result | ) |
|
Finalize the states into an output vector.
253538 {
253539 AggregateInputData aggr_input_data(
aggr.GetFunctionData(),
allocator);
253540 aggr.function.GetStateFinalizeCallback()(*
statef, aggr_input_data, result,
GetCount(), 0);
253541}
◆ Destroy()
| void duckdb::WindowAggregateStates::Destroy |
( |
| ) |
|
Destroy the states.
253543 {
253545 return;
253546 }
253547
253548 AggregateInputData aggr_input_data(
aggr.GetFunctionData(),
allocator);
253549 if (
aggr.function.HasStateDestructorCallback()) {
253551 }
253552
253554}
The documentation for this struct was generated from the following file: