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

Public Member Functions

 WindowLeadLagGlobalState (ClientContext &client, const WindowValueExecutor &executor, const idx_t payload_count, const ValidityMask &partition_mask, const ValidityMask &order_mask)
Public Member Functions inherited from duckdb::WindowValueGlobalState
 WindowValueGlobalState (ClientContext &client, const WindowValueExecutor &executor, const idx_t payload_count, const ValidityMask &partition_mask, const ValidityMask &order_mask)
void Finalize (CollectionPtr collection)
Public Member Functions inherited from duckdb::WindowExecutorGlobalState
 WindowExecutorGlobalState (ClientContext &client, const WindowExecutor &executor, const idx_t payload_count, const ValidityMask &partition_mask, const ValidityMask &order_mask)
Public Member Functions inherited from duckdb::GlobalSinkState
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const
virtual idx_t MaxThreads (idx_t source_max_threads)
Public Member Functions inherited from duckdb::StateWithBlockableTasks
unique_lock< mutex > Lock ()
void PreventBlocking (const unique_lock< mutex > &guard)
bool BlockTask (const unique_lock< mutex > &guard, const InterruptState &interrupt_state)
 Add a task to 'blocked_tasks' before returning SourceResultType::BLOCKED (must hold the lock).
bool CanBlock (const unique_lock< mutex > &guard) const
bool UnblockTasks (const unique_lock< mutex > &guard)
 Unblock all tasks (must hold the lock).
SinkResultType BlockSink (const unique_lock< mutex > &guard, const InterruptState &interrupt_state)
SourceResultType BlockSource (const unique_lock< mutex > &guard, const InterruptState &interrupt_state)
void VerifyLock (const unique_lock< mutex > &guard) const

Public Attributes

bool use_framing = false
 Flag that we are using framing, even if we don't need the trees.
unique_ptr< WindowTokenTree > row_tree
 Merge sort tree to map partition offset to row number (algorithm from Section 4.5).
Public Attributes inherited from duckdb::WindowValueGlobalState
mutex lock
ValidityMask all_valid
optional_ptr< ValidityMask > ignore_nulls
const column_t child_idx
 Copy of the executor child_idx.
unique_ptr< WindowIndexTree > value_tree
 Merge sort tree to map unfiltered row number to value.
Public Attributes inherited from duckdb::WindowExecutorGlobalState
ClientContext & client
const WindowExecutor & executor
const idx_t payload_count
const ValidityMask & partition_mask
const ValidityMask & order_mask
vector< LogicalType > arg_types
Public Attributes inherited from duckdb::GlobalSinkState
SinkFinalizeType state

Additional Inherited Members

Public Types inherited from duckdb::WindowValueGlobalState
using WindowCollectionPtr = unique_ptr<WindowCollection>
Public Types inherited from duckdb::WindowExecutorGlobalState
using CollectionPtr = optional_ptr<WindowCollection>

Constructor & Destructor Documentation

◆ WindowLeadLagGlobalState()

duckdb::WindowLeadLagGlobalState::WindowLeadLagGlobalState ( ClientContext & client,
const WindowValueExecutor & executor,
const idx_t payload_count,
const ValidityMask & partition_mask,
const ValidityMask & order_mask )
inline
258566 : WindowValueGlobalState(client, executor, payload_count, partition_mask, order_mask) {
258567 if (value_tree) {
258568 use_framing = true;
258569
258570 // If the argument order is prefix of the partition ordering,
258571 // then we can just use the partition ordering.
258572 auto &wexpr = executor.wexpr;
258573 auto &arg_orders = executor.wexpr.arg_orders;
258574 const auto optimize = ClientConfig::GetConfig(client).enable_optimizer;
258575 if (!optimize || BoundWindowExpression::GetSharedOrders(wexpr.orders, arg_orders) != arg_orders.size()) {
258576 // "The ROW_NUMBER function can be computed by disambiguating duplicate elements based on their
258577 // position in the input data, such that two elements never compare as equal."
258578 // Note: If the user specifies an partial secondary sort, the disambiguation will use the
258579 // partition's row numbers, not the secondary sort's row numbers.
258580 row_tree = make_uniq<WindowTokenTree>(client, arg_orders, executor.arg_order_idx, payload_count, true);
258581 } else {
258582 // The value_tree is cheap to construct, so we just get rid of it if we now discover we don't need it.
258583 value_tree.reset();
258584 }
258585 }
258586 }
static idx_t GetSharedOrders(const vector< BoundOrderByNode > &lhs, const vector< BoundOrderByNode > &rhs)
The number of ordering clauses the functions share.
Definition duckdb.cpp:376957
bool use_framing
Flag that we are using framing, even if we don't need the trees.
Definition duckdb.cpp:258589
unique_ptr< WindowTokenTree > row_tree
Merge sort tree to map partition offset to row number (algorithm from Section 4.5).
Definition duckdb.cpp:258592
unique_ptr< WindowIndexTree > value_tree
Merge sort tree to map unfiltered row number to value.
Definition duckdb.cpp:258415

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