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::WindowIndexTreeLocalState Class Reference
Inheritance diagram for duckdb::WindowIndexTreeLocalState:
Collaboration diagram for duckdb::WindowIndexTreeLocalState:

Public Member Functions

 WindowIndexTreeLocalState (ExecutionContext &context, WindowIndexTree &index_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

WindowIndexTree & index_tree
 The index tree we are building.
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

◆ WindowIndexTreeLocalState()

duckdb::WindowIndexTreeLocalState::WindowIndexTreeLocalState ( ExecutionContext & context,
WindowIndexTree & index_tree )
256297 : WindowMergeSortTreeLocalState(context, index_tree), index_tree(index_tree) {
256298}
WindowIndexTree & index_tree
The index tree we are building.
Definition duckdb.cpp:256256

Member Function Documentation

◆ BuildLeaves()

void duckdb::WindowIndexTreeLocalState::BuildLeaves ( )
overridevirtual

Process sorted leaf data.

Implements duckdb::WindowMergeSortTreeLocalState.

256300 {
256301 auto &collection = *window_tree.sorted;
256302 if (!collection.Count()) {
256303 return;
256304 }
256305
256306 // Find our chunk range
256307 const auto block_begin = (build_task * collection.ChunkCount()) / window_tree.total_tasks;
256308 const auto block_end = ((build_task + 1) * collection.ChunkCount()) / window_tree.total_tasks;
256309
256310 // Scan the index column (the last one)
256311 vector<column_t> index_ids(1, window_tree.scan_cols.size() - 1);
256312 WindowCollectionChunkScanner scanner(collection, index_ids, block_begin);
256313 auto &payload_chunk = scanner.chunk;
256314
256315 idx_t row_idx = scanner.Scanned();
256316 for (auto block_curr = block_begin; block_curr < block_end; ++block_curr) {
256317 if (!scanner.Scan()) {
256318 break;
256319 }
256320 const auto count = payload_chunk.size();
256321 if (count == 0) {
256322 break;
256323 }
256324 auto &indices = payload_chunk.data[0];
256325 if (window_tree.mst32) {
256326 auto &sorted = window_tree.mst32->LowestLevel();
256327 auto data = FlatVector::GetData<int32_t>(indices);
256328 std::copy(data, data + count, sorted.data() + row_idx);
256329 } else {
256330 auto &sorted = window_tree.mst64->LowestLevel();
256331 auto data = FlatVector::GetData<int64_t>(indices);
256332 std::copy(data, data + count, sorted.data() + row_idx);
256333 }
256334 row_idx += count;
256335 }
256336}
WindowMergeSortTree & window_tree
The index tree we are building.
Definition duckdb.cpp:60181
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: