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::WindowSharedExpressions Struct Reference

A shared set of expressions. More...

Collaboration diagram for duckdb::WindowSharedExpressions:

Classes

struct  Shared

Public Member Functions

column_t RegisterCollection (const unique_ptr< Expression > &expr, bool build_validity)
 Register a shared collection expression.
column_t RegisterSink (const unique_ptr< Expression > &expr)
 Register a shared collection expression.
column_t RegisterEvaluate (const unique_ptr< Expression > &expr)
 Register a shared evaluation expression.
void PrepareCollection (ExpressionExecutor &exec, DataChunk &chunk)
 Prepare collection expressions.
void PrepareSink (ExpressionExecutor &exec, DataChunk &chunk)
 Prepare collection expressions.
void PrepareEvaluate (ExpressionExecutor &exec, DataChunk &chunk)
 Prepare collection expressions.

Static Public Member Functions

static column_t RegisterExpr (const unique_ptr< Expression > &expr, Shared &shared)
 Register a shared expression in a shared set.
static vector< optional_ptr< const Expression > > GetSortedExpressions (Shared &shared)
 Expression layout.
static void PrepareExecutors (Shared &shared, ExpressionExecutor &exec, DataChunk &chunk)
 Expression execution utility.

Public Attributes

Shared coll_shared
 Fully materialised shared expressions.
Shared sink_shared
 Sink shared expressions.
Shared eval_shared
 Evaluate shared expressions.
unordered_set< column_t > coll_validity
 Requested collection validity masks.

Detailed Description

A shared set of expressions.

Member Function Documentation

◆ RegisterExpr()

column_t duckdb::WindowSharedExpressions::RegisterExpr ( const unique_ptr< Expression > & expr,
Shared & shared )
static

Register a shared expression in a shared set.

258175 {
258176 auto pexpr = expr.get();
258177 if (!pexpr) {
258179 }
258180
258181 // We need to make separate columns for volatile arguments
258182 const auto is_volatile = expr->IsVolatile();
258183 auto i = shared.columns.find(*pexpr);
258184 if (i != shared.columns.end() && !is_volatile) {
258185 return i->second.front();
258186 }
258187
258188 // New column, find maximum column number
258189 column_t result = shared.size++;
258190 shared.columns[*pexpr].emplace_back(result);
258191
258192 return result;
258193}
idx_t column_t
Type used for column identifiers.
Definition duckdb.hpp:259
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117
Here is the caller graph for this function:

◆ RegisterCollection()

column_t duckdb::WindowSharedExpressions::RegisterCollection ( const unique_ptr< Expression > & expr,
bool build_validity )
inline

Register a shared collection expression.

164270 {
164271 auto result = RegisterExpr(expr, coll_shared);
164272 if (build_validity) {
164273 coll_validity.insert(result);
164274 }
164275 return result;
164276 }
Shared coll_shared
Fully materialised shared expressions.
Definition duckdb.cpp:164308
static column_t RegisterExpr(const unique_ptr< Expression > &expr, Shared &shared)
Register a shared expression in a shared set.
Definition duckdb.cpp:258175
unordered_set< column_t > coll_validity
Requested collection validity masks.
Definition duckdb.cpp:164314
Here is the call graph for this function:

◆ RegisterSink()

column_t duckdb::WindowSharedExpressions::RegisterSink ( const unique_ptr< Expression > & expr)
inline

Register a shared collection expression.

164278 {
164279 return RegisterExpr(expr, sink_shared);
164280 }
Shared sink_shared
Sink shared expressions.
Definition duckdb.cpp:164310
Here is the call graph for this function:

◆ RegisterEvaluate()

column_t duckdb::WindowSharedExpressions::RegisterEvaluate ( const unique_ptr< Expression > & expr)
inline

Register a shared evaluation expression.

164282 {
164283 return RegisterExpr(expr, eval_shared);
164284 }
Shared eval_shared
Evaluate shared expressions.
Definition duckdb.cpp:164312
Here is the call graph for this function:

◆ GetSortedExpressions()

vector< optional_ptr< const Expression > > duckdb::WindowSharedExpressions::GetSortedExpressions ( Shared & shared)
static

Expression layout.

258195 {
258196 vector<optional_ptr<const Expression>> sorted(shared.size);
258197 for (auto &col : shared.columns) {
258198 auto &expr = col.first.get();
258199 for (auto col_idx : col.second) {
258200 sorted[col_idx] = &expr;
258201 }
258202 }
258203
258204 return sorted;
258205}
Here is the caller graph for this function:

◆ PrepareExecutors()

void duckdb::WindowSharedExpressions::PrepareExecutors ( Shared & shared,
ExpressionExecutor & exec,
DataChunk & chunk )
static

Expression execution utility.

258206 {
258207 const auto sorted = GetSortedExpressions(shared);
258208 vector<LogicalType> types;
258209 for (auto expr : sorted) {
258210 exec.AddExpression(*expr);
258211 types.emplace_back(expr->return_type);
258212 }
258213
258214 if (!types.empty()) {
258215 chunk.Initialize(exec.GetAllocator(), types);
258216 }
258217}
DUCKDB_API void Initialize(ClientContext &context, const vector< LogicalType > &types, idx_t capacity=STANDARD_VECTOR_SIZE)
Definition duckdb.cpp:116791
static vector< optional_ptr< const Expression > > GetSortedExpressions(Shared &shared)
Expression layout.
Definition duckdb.cpp:258195
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareCollection()

void duckdb::WindowSharedExpressions::PrepareCollection ( ExpressionExecutor & exec,
DataChunk & chunk )
inline

Prepare collection expressions.

164293 {
164294 PrepareExecutors(coll_shared, exec, chunk);
164295 }
static void PrepareExecutors(Shared &shared, ExpressionExecutor &exec, DataChunk &chunk)
Expression execution utility.
Definition duckdb.cpp:258206
Here is the call graph for this function:

◆ PrepareSink()

void duckdb::WindowSharedExpressions::PrepareSink ( ExpressionExecutor & exec,
DataChunk & chunk )
inline

Prepare collection expressions.

164298 {
164299 PrepareExecutors(sink_shared, exec, chunk);
164300 }
Here is the call graph for this function:

◆ PrepareEvaluate()

void duckdb::WindowSharedExpressions::PrepareEvaluate ( ExpressionExecutor & exec,
DataChunk & chunk )
inline

Prepare collection expressions.

164303 {
164304 PrepareExecutors(eval_shared, exec, chunk);
164305 }
Here is the call graph for this function:

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