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

Public Member Functions

 WindowConstantAggregatorGlobalState (ClientContext &context, const WindowConstantAggregator &aggregator, idx_t count, const ValidityMask &partition_mask)
void Finalize (const FrameStats &stats)
Public Member Functions inherited from duckdb::WindowAggregatorGlobalState
 WindowAggregatorGlobalState (ClientContext &client, const WindowAggregator &aggregator_p, idx_t group_count)
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

vector< idx_t > partition_offsets
 Partition starts.
WindowAggregateStates statef
 Reused result state container for the window functions.
unique_ptr< Vector > results
 Aggregate results.
Public Attributes inherited from duckdb::WindowAggregatorGlobalState
ClientContext & client
 The client we are in.
ArenaAllocator allocator
 Global allocator.
const WindowAggregator & aggregator
 The aggregator data.
const AggregateObject aggr
 The aggregate function.
ValidityArray filter_mask
 The filtered rows in inputs.
mutex lock
 Lock for single threading.
std::atomic< idx_t > locals
 Count of local tasks.
std::atomic< idx_t > finalized
 Number of finalised states.
Public Attributes inherited from duckdb::GlobalSinkState
SinkFinalizeType state

Constructor & Destructor Documentation

◆ WindowConstantAggregatorGlobalState()

duckdb::WindowConstantAggregatorGlobalState::WindowConstantAggregatorGlobalState ( ClientContext & context,
const WindowConstantAggregator & aggregator,
idx_t count,
const ValidityMask & partition_mask )
254927 : WindowAggregatorGlobalState(client, aggregator, STANDARD_VECTOR_SIZE), statef(client, aggr) {
254928 // Locate the partition boundaries
254929 if (partition_mask.AllValid()) {
254930 partition_offsets.emplace_back(0);
254931 } else {
254932 idx_t entry_idx;
254933 idx_t shift;
254934 for (idx_t start = 0; start < group_count;) {
254935 partition_mask.GetEntryIndex(start, entry_idx, shift);
254936
254937 // If start is aligned with the start of a block,
254938 // and the block is blank, then skip forward one block.
254939 const auto block = partition_mask.GetValidityEntry(entry_idx);
254940 if (partition_mask.NoneValid(block) && !shift) {
254941 start += ValidityMask::BITS_PER_VALUE;
254942 continue;
254943 }
254944
254945 // Loop over the block
254946 for (; shift < ValidityMask::BITS_PER_VALUE && start < group_count; ++shift, ++start) {
254947 if (partition_mask.RowIsValid(block, shift)) {
254948 partition_offsets.emplace_back(start);
254949 }
254950 }
254951 }
254952 }
254953
254954 // Initialise the vector for caching the results
254955 results = make_uniq<Vector>(aggregator.result_type, partition_offsets.size());
254956
254957 // Initialise the final states
254958 statef.Initialize(partition_offsets.size());
254959
254960 // Add final guard
254961 partition_offsets.emplace_back(group_count);
254962}
ClientContext & client
The client we are in.
Definition duckdb.cpp:164054
const WindowAggregator & aggregator
The aggregator data.
Definition duckdb.cpp:164060
const AggregateObject aggr
The aggregate function.
Definition duckdb.cpp:164063
unique_ptr< Vector > results
Aggregate results.
Definition duckdb.cpp:254920
vector< idx_t > partition_offsets
Partition starts.
Definition duckdb.cpp:254916
WindowAggregateStates statef
Reused result state container for the window functions.
Definition duckdb.cpp:254918
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ ~WindowConstantAggregatorGlobalState()

duckdb::WindowConstantAggregatorGlobalState::~WindowConstantAggregatorGlobalState ( )
inlineoverride
254911 {
254912 statef.Destroy();
254913 }

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