Process sorted leaf data.
258236 {
258237
258238 auto &collection = *token_tree.sorted;
258239 const auto block_begin = (
build_task * collection.ChunkCount()) / token_tree.total_tasks;
258240 const auto block_end = ((
build_task + 1) * collection.ChunkCount()) / token_tree.total_tasks;
258241
258242 auto &deltas = token_tree.deltas;
258243 if (!block_begin) {
258244
258245 deltas[0] = 0;
258246 }
258247
258248 const auto &scan_cols = token_tree.key_cols;
258249 const auto key_count = scan_cols.size();
258250 WindowDeltaScanner(collection, block_begin, block_end, scan_cols, key_count,
258251 [&](
const idx_t row_idx, DataChunk &prev, DataChunk &curr,
const idx_t ndistinct,
258252 SelectionVector &distinct, const SelectionVector &matching) {
258253
258254 const auto count = MinValue<idx_t>(prev.size(), curr.size());
258255 const auto nmatch = count - ndistinct;
258256 for (
idx_t j = 0; j < nmatch; ++j) {
258257 auto scan_idx = matching.get_index(j);
258258 deltas[scan_idx + row_idx] = 0;
258259 }
258260
258261
258262 for (
idx_t j = 0; j < ndistinct; ++j) {
258263 auto scan_idx = distinct.get_index(j);
258264 deltas[scan_idx + row_idx] = 1;
258265 }
258266 });
258267}
idx_t build_task
Build task number.
Definition duckdb.cpp:60189
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237