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

Public Member Functions

 WindowFirstValueExecutor (BoundWindowExpression &wexpr, WindowSharedExpressions &shared)
Public Member Functions inherited from duckdb::WindowValueExecutor
 WindowValueExecutor (BoundWindowExpression &wexpr, WindowSharedExpressions &shared)
void Finalize (ExecutionContext &context, CollectionPtr collection, OperatorSinkInput &sink) const override
unique_ptr< GlobalSinkState > GetGlobalState (ClientContext &client, const idx_t payload_count, const ValidityMask &partition_mask, const ValidityMask &order_mask) const override
unique_ptr< LocalSinkState > GetLocalState (ExecutionContext &context, const GlobalSinkState &gstate) const override
Public Member Functions inherited from duckdb::WindowExecutor
 WindowExecutor (BoundWindowExpression &wexpr, WindowSharedExpressions &shared)
virtual bool IgnoreNulls () const
virtual void Sink (ExecutionContext &context, DataChunk &sink_chunk, DataChunk &coll_chunk, const idx_t input_idx, OperatorSinkInput &sink) const
void Evaluate (ExecutionContext &context, idx_t row_idx, DataChunk &eval_chunk, Vector &result, OperatorSinkInput &sink) const

Protected Member Functions

void EvaluateInternal (ExecutionContext &context, DataChunk &eval_chunk, Vector &result, idx_t count, idx_t row_idx, OperatorSinkInput &sink) const override

Additional Inherited Members

Public Types inherited from duckdb::WindowExecutor
using CollectionPtr = optional_ptr<WindowCollection>
Public Attributes inherited from duckdb::WindowValueExecutor
column_t child_idx = DConstants::INVALID_INDEX
 The column index of the value column.
column_t nth_idx = DConstants::INVALID_INDEX
 The column index of the Nth column.
column_t offset_idx = DConstants::INVALID_INDEX
 The column index of the offset column.
column_t default_idx = DConstants::INVALID_INDEX
 The column index of the default value column.
vector< column_t > arg_order_idx
 The column indices of any ORDER BY argument expressions.
Public Attributes inherited from duckdb::WindowExecutor
const BoundWindowExpression & wexpr
column_t boundary_start_idx = DConstants::INVALID_INDEX
column_t boundary_end_idx = DConstants::INVALID_INDEX
optional_ptr< Expression > range_expr
column_t range_idx = DConstants::INVALID_INDEX

Constructor & Destructor Documentation

◆ WindowFirstValueExecutor()

duckdb::WindowFirstValueExecutor::WindowFirstValueExecutor ( BoundWindowExpression & wexpr,
WindowSharedExpressions & shared )
258812 : WindowValueExecutor(wexpr, shared) {
258813}

Member Function Documentation

◆ EvaluateInternal()

void duckdb::WindowFirstValueExecutor::EvaluateInternal ( ExecutionContext & context,
DataChunk & eval_chunk,
Vector & result,
idx_t count,
idx_t row_idx,
OperatorSinkInput & sink ) const
overrideprotectedvirtual

Implements duckdb::WindowExecutor.

258816 {
258817 auto &gvstate = sink.global_state.Cast<WindowValueGlobalState>();
258818 auto &lvstate = sink.local_state.Cast<WindowValueLocalState>();
258819 auto &cursor = *lvstate.cursor;
258820 auto &bounds = lvstate.bounds;
258821 auto &frames = lvstate.frames;
258822 auto &ignore_nulls = *gvstate.ignore_nulls;
258823 auto exclude_mode = gvstate.executor.wexpr.exclude_clause;
258824 WindowAggregator::EvaluateSubFrames(bounds, exclude_mode, count, row_idx, frames, [&](idx_t i) {
258825 if (gvstate.value_tree) {
258826 idx_t frame_width = 0;
258827 for (const auto &frame : frames) {
258828 frame_width += frame.end - frame.start;
258829 }
258830
258831 if (frame_width) {
258832 const auto first_idx = gvstate.value_tree->SelectNth(frames, 0);
258833 D_ASSERT(first_idx.second == 0);
258834 if (first_idx.first < cursor.Count()) {
258835 cursor.CopyCell(0, first_idx.first, result, i);
258836 } else {
258837 FlatVector::SetNull(result, i, true);
258838 }
258839 } else {
258840 FlatVector::SetNull(result, i, true);
258841 }
258842 return;
258843 }
258844
258845 for (const auto &frame : frames) {
258846 if (frame.start >= frame.end) {
258847 continue;
258848 }
258849
258850 // Same as NTH_VALUE(..., 1)
258851 idx_t n = 1;
258852 const auto first_idx = WindowBoundariesState::FindNextStart(ignore_nulls, frame.start, frame.end, n);
258853 if (!n) {
258854 cursor.CopyCell(0, first_idx, result, i);
258855 return;
258856 }
258857 }
258858
258859 // Didn't find one
258860 FlatVector::SetNull(result, i, true);
258861 });
258862}
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: