255537 : WindowAggregatorGlobalState(
client,
aggregator, group_count),
stage(WindowDistinctSortStage::INIT),
255539
255540
255541
255542
255544 sort_types.emplace_back(LogicalType::UBIGINT);
255545
255546
255547 vector<BoundOrderByNode> orders;
255549 auto expr = make_uniq<BoundReferenceExpression>(type, orders.size());
255550 orders.emplace_back(OrderType::ASCENDING, OrderByNullType::NULLS_FIRST, std::move(expr));
255552 }
255553
255555 global_sink = sort->GetGlobalSinkState(
client);
255556
255557
255558
255559 auto &prev_idcs =
zipped_tree.Allocate(group_count);
255560
255561
255562
255563 for (
idx_t i = 0; i < group_count; ++i) {
255564 prev_idcs[i] = ZippedTuple(i + 1, i);
255565 }
255566
255567
255568
255569 idx_t internal_nodes = 0;
255571 for (
idx_t level_nr = 0; level_nr <
zipped_tree.tree.size(); ++level_nr) {
255572 internal_nodes +=
zipped_tree.tree[level_nr].first.size();
255574 }
255576
255578 for (
idx_t level_nr = 0; level_nr <
zipped_tree.tree.size(); ++level_nr) {
255579 auto &zipped_level =
zipped_tree.tree[level_nr].first;
255580 WindowDistinctSortTree::Elements level;
255581 WindowDistinctSortTree::Offsets cascades;
255582 level.resize(zipped_level.size());
255583 merge_sort_tree.tree.emplace_back(std::move(level), std::move(cascades));
255584 }
255585}
ClientContext & client
The client we are in.
Definition duckdb.cpp:164054
const WindowAggregator & aggregator
The aggregator data.
Definition duckdb.cpp:164060
const AggregateObject aggr
The aggregate function.
Definition duckdb.cpp:164063
vector< idx_t > sort_cols
Sorting operations.
Definition duckdb.cpp:255515
WindowDistinctSortTree merge_sort_tree
The merge sort tree for the aggregate.
Definition duckdb.cpp:255526
WindowAggregateStates levels_flat_native
The actual window segment tree: an array of aggregate states that represent all the intermediate node...
Definition duckdb.cpp:255529
MergeSortTree< ZippedTuple > zipped_tree
The MST with the distinct back pointers.
Definition duckdb.cpp:255524
vector< idx_t > levels_flat_start
For each level, the starting location in the levels_flat_native array.
Definition duckdb.cpp:255531
atomic< WindowDistinctSortStage > stage
Finalize stage.
Definition duckdb.cpp:255503
atomic< idx_t > tasks_completed
Tasks landed.
Definition duckdb.cpp:255509
vector< LogicalType > sort_types
The aggregate arguments + partition index.
Definition duckdb.cpp:255512
idx_t tasks_assigned
Tasks launched.
Definition duckdb.cpp:255507
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237