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

Public Member Functions

 WindowTokenTree (ClientContext &context, const vector< BoundOrderByNode > &orders, const vector< column_t > &order_idx, const idx_t count, bool unique=false)
 WindowTokenTree (ClientContext &context, const BoundOrderModifier &order_bys, const vector< column_t > &order_idx, const idx_t count, bool unique=false)
unique_ptr< LocalSinkState > GetLocalState (ExecutionContext &context) override
void Finished () override
 Thread-safe post-sort cleanup.
idx_t Rank (const idx_t lower, const idx_t upper, const idx_t row_idx) const
 Find the rank of the row within the range.
idx_t PeerEnd (const idx_t lower, const idx_t upper, const idx_t row_idx) const
 Find the next peer after the row and within the range.
Public Member Functions inherited from duckdb::WindowMergeSortTree
 WindowMergeSortTree (ClientContext &context, const vector< BoundOrderByNode > &orders, const vector< column_t > &order_idx, const idx_t count, bool unique=false)
optional_ptr< LocalSinkState > InitializeLocalSort (ExecutionContext &context) const
 Make a local sort for a thread.
bool TryPrepareSortStage (WindowMergeSortTreeLocalState &lstate)
 Sort state machine.
void Build ()
 Build the MST in parallel from the sorted data.

Public Attributes

vector< uint8_t > deltas
 Peer boundaries.
Public Attributes inherited from duckdb::WindowMergeSortTree
const vector< column_t > order_idx
 The column indices for sorting.
vector< LogicalType > scan_types
 The sorted data schema.
vector< idx_t > scan_cols
vector< idx_t > key_cols
 The sort key columns.
unique_ptr< Sort > sort
 The sort specification.
GlobalSortStatePtr global_sink
 The sorted data.
unique_ptr< ColumnDataCollection > sorted
 The resulting sorted data.
mutex lock
 Finalize guard.
vector< LocalSortStatePtr > local_sinks
 Local sort set.
atomic< WindowMergeSortStage > build_stage
 Finalize stage.
idx_t total_tasks = 0
 Tasks launched.
idx_t tasks_assigned = 0
 Tasks launched.
atomic< idx_t > tasks_completed
 Tasks landed.
unique_ptr< MergeSortTree32 > mst32
unique_ptr< MergeSortTree64 > mst64

Protected Member Functions

idx_t MeasurePayloadBlocks () override
 Find the starts of all the blocks.

Additional Inherited Members

Public Types inherited from duckdb::WindowMergeSortTree
using GlobalSortStatePtr = unique_ptr<GlobalSinkState>
using LocalSortStatePtr = unique_ptr<LocalSinkState>
using MergeSortTree32 = MergeSortTree<uint32_t, uint32_t>
using MergeSortTree64 = MergeSortTree<uint64_t, uint64_t>

Constructor & Destructor Documentation

◆ WindowTokenTree() [1/2]

duckdb::WindowTokenTree::WindowTokenTree ( ClientContext & context,
const vector< BoundOrderByNode > & orders,
const vector< column_t > & order_idx,
const idx_t count,
bool unique = false )
inline
256984 : WindowMergeSortTree(context, orders, order_idx, count, unique) {
256985 }
const vector< column_t > order_idx
The column indices for sorting.
Definition duckdb.cpp:60218

◆ WindowTokenTree() [2/2]

duckdb::WindowTokenTree::WindowTokenTree ( ClientContext & context,
const BoundOrderModifier & order_bys,
const vector< column_t > & order_idx,
const idx_t count,
bool unique = false )
inline
256988 : WindowTokenTree(context, order_bys.orders, order_idx, count, unique) {
256989 }

Member Function Documentation

◆ GetLocalState()

unique_ptr< LocalSinkState > duckdb::WindowTokenTree::GetLocalState ( ExecutionContext & context)
overridevirtual

Implements duckdb::WindowMergeSortTree.

258306 {
258307 return make_uniq<WindowTokenTreeLocalState>(context, *this);
258308}

◆ Finished()

void duckdb::WindowTokenTree::Finished ( )
overridevirtual

Thread-safe post-sort cleanup.

Reimplemented from duckdb::WindowMergeSortTree.

258310 {
258311 // Convert the deltas to tokens
258312 if (mst64) {
258313 BuildTokens(*this, mst64->LowestLevel());
258314 } else {
258315 BuildTokens(*this, mst32->LowestLevel());
258316 }
258317 /*
258318 for (const auto &d : deltas) {
258319 Printer::Print(StringUtil::Format("%lld", d));
258320 }
258321 */
258322 // Deallocate memory
258323 vector<uint8_t> empty;
258324 deltas.swap(empty);
258325
258327}
virtual void Finished()
Thread-safe post-sort cleanup.
Definition duckdb.cpp:256494
vector< uint8_t > deltas
Peer boundaries.
Definition duckdb.cpp:257003
Here is the call graph for this function:

◆ Rank()

idx_t duckdb::WindowTokenTree::Rank ( const idx_t lower,
const idx_t upper,
const idx_t row_idx ) const

Find the rank of the row within the range.

258339 {
258340 if (mst64) {
258341 return TokenRank(*mst64, lower, upper, row_idx);
258342 } else {
258343 return TokenRank(*mst32, lower, upper, row_idx);
258344 }
258345}

◆ PeerEnd()

idx_t duckdb::WindowTokenTree::PeerEnd ( const idx_t lower,
const idx_t upper,
const idx_t row_idx ) const

Find the next peer after the row and within the range.

258359 {
258360 if (mst64) {
258361 return NextPeer(*mst64, lower, upper, row_idx);
258362 } else {
258363 return NextPeer(*mst32, lower, upper, row_idx);
258364 }
258365}

◆ MeasurePayloadBlocks()

idx_t duckdb::WindowTokenTree::MeasurePayloadBlocks ( )
overrideprotectedvirtual

Find the starts of all the blocks.

Reimplemented from duckdb::WindowMergeSortTree.

258269 {
258270 const auto count = WindowMergeSortTree::MeasurePayloadBlocks();
258271
258272 deltas.resize(count);
258273
258274 return count;
258275}
virtual idx_t MeasurePayloadBlocks()
Definition duckdb.cpp:256479
Here is the call graph for this function:

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