Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::WindowTokenTreeLocalState Class Reference
Inheritance diagram for duckdb::WindowTokenTreeLocalState:
Collaboration diagram for duckdb::WindowTokenTreeLocalState:

Public Member Functions

 WindowTokenTreeLocalState (ExecutionContext &context, WindowTokenTree &token_tree)
void BuildLeaves () override
 Process sorted leaf data.
Public Member Functions inherited from duckdb::WindowMergeSortTreeLocalState
 WindowMergeSortTreeLocalState (ExecutionContext &context, WindowMergeSortTree &index_tree)
void Sink (ExecutionContext &context, DataChunk &chunk, const idx_t row_idx, optional_ptr< SelectionVector > filter_sel, idx_t filtered, InterruptState &interrupt)
 Add a chunk to the local sort.
void Finalize (ExecutionContext &context, InterruptState &interrupt)
 Sort the data.
Public Member Functions inherited from duckdb::LocalSinkState
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

WindowTokenTree & token_tree
Public Attributes inherited from duckdb::WindowMergeSortTreeLocalState
WindowMergeSortTree & window_tree
 The index tree we are building.
optional_ptr< LocalSinkState > local_sink
 Thread-local sorting data.
DataChunk sort_chunk
 Buffer for the sort data.
WindowMergeSortStage build_stage = WindowMergeSortStage::INIT
 Build stage.
idx_t build_task
 Build task number.
Public Attributes inherited from duckdb::LocalSinkState
SourcePartitionInfo partition_info
 Source partition info.

Constructor & Destructor Documentation

◆ WindowTokenTreeLocalState()

duckdb::WindowTokenTreeLocalState::WindowTokenTreeLocalState ( ExecutionContext & context,
WindowTokenTree & token_tree )
inline
258228 : WindowMergeSortTreeLocalState(context, token_tree), token_tree(token_tree) {
258229 }

Member Function Documentation

◆ BuildLeaves()

void duckdb::WindowTokenTreeLocalState::BuildLeaves ( )
overridevirtual

Process sorted leaf data.

Implements duckdb::WindowMergeSortTreeLocalState.

258236 {
258237 // Find our chunk range
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 // First block, so set up initial delta
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 // Same as previous - token delta is 0
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 // Different value - token delta is 1
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

The documentation for this class was generated from the following file: