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::ExpressionExecutor Class Reference

ExpressionExecutor is responsible for executing a set of expressions and storing the result in a data chunk. More...

#include <duckdb.hpp>

Collaboration diagram for duckdb::ExpressionExecutor:

Public Member Functions

DUCKDB_API ExpressionExecutor (ClientContext &context)
 
DUCKDB_API ExpressionExecutor (ClientContext &context, const Expression *expression)
 
DUCKDB_API ExpressionExecutor (ClientContext &context, const Expression &expression)
 
DUCKDB_API ExpressionExecutor (ClientContext &context, const vector< unique_ptr< Expression > > &expressions)
 
 ExpressionExecutor (ExpressionExecutor &&)=delete
 
bool HasContext ()
 
ClientContextGetContext ()
 
AllocatorGetAllocator ()
 
DUCKDB_API void AddExpression (const Expression &expr)
 Add an expression to the set of to-be-executed expressions of the executor.
 
void ClearExpressions ()
 
DUCKDB_API void Execute (DataChunk *input, DataChunk &result)
 Execute the set of expressions with the given input chunk and store the result in the output chunk.
 
void Execute (DataChunk &input, DataChunk &result)
 
void Execute (DataChunk &result)
 
DUCKDB_API void ExecuteExpression (DataChunk &input, Vector &result)
 
DUCKDB_API void ExecuteExpression (Vector &result)
 
DUCKDB_API idx_t SelectExpression (DataChunk &input, SelectionVector &sel)
 
DUCKDB_API idx_t SelectExpression (DataChunk &input, SelectionVector &result_sel, optional_ptr< SelectionVector > current_sel, idx_t current_count)
 
DUCKDB_API idx_t SelectExpression (DataChunk &input, optional_ptr< SelectionVector > true_sel, optional_ptr< SelectionVector > false_sel, optional_ptr< SelectionVector > current_sel, idx_t current_count)
 
DUCKDB_API void ExecuteExpression (idx_t expr_idx, Vector &result)
 Execute the expression with index expr_idx and store the result in the result vector.
 
void SetChunk (DataChunk *chunk)
 
void SetChunk (DataChunk &chunk)
 
DUCKDB_API vector< unique_ptr< ExpressionExecutorState > > & GetStates ()
 

Static Public Member Functions

static DUCKDB_API Value EvaluateScalar (ClientContext &context, const Expression &expr, bool allow_unfoldable=false)
 Evaluate a scalar expression and fold it into a single value.
 
static DUCKDB_API bool TryEvaluateScalar (ClientContext &context, const Expression &expr, Value &result)
 Try to evaluate a scalar expression and fold it into a single value, returns false if an exception is thrown.
 
static unique_ptr< ExpressionStateInitializeState (const Expression &expr, ExpressionExecutorState &state)
 Initialize the state of a given expression.
 

Public Attributes

vector< const Expression * > expressions
 The expressions of the executor.
 
DataChunkchunk = nullptr
 

Protected Member Functions

void Initialize (const Expression &expr, ExpressionExecutorState &state)
 
void Execute (const Expression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundBetweenExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundCaseExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundCastExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundComparisonExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundConjunctionExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundConstantExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundFunctionExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundOperatorExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundParameterExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
void Execute (const BoundReferenceExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, Vector &result)
 
idx_t Select (const Expression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, SelectionVector *true_sel, SelectionVector *false_sel)
 
idx_t DefaultSelect (const Expression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, SelectionVector *true_sel, SelectionVector *false_sel)
 
idx_t Select (const BoundBetweenExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, SelectionVector *true_sel, SelectionVector *false_sel)
 
idx_t Select (const BoundComparisonExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, SelectionVector *true_sel, SelectionVector *false_sel)
 
idx_t Select (const BoundConjunctionExpression &expr, ExpressionState *state, const SelectionVector *sel, idx_t count, SelectionVector *true_sel, SelectionVector *false_sel)
 
void Verify (const Expression &expr, Vector &result, idx_t count)
 Verify that the output of a step in the ExpressionExecutor is correct.
 
void FillSwitch (Vector &vector, Vector &result, const SelectionVector &sel, sel_t count)
 

Static Protected Member Functions

static unique_ptr< ExpressionStateInitializeState (const BoundReferenceExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundBetweenExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundCaseExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundCastExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundComparisonExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundConjunctionExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundConstantExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundFunctionExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundOperatorExpression &expr, ExpressionExecutorState &state)
 
static unique_ptr< ExpressionStateInitializeState (const BoundParameterExpression &expr, ExpressionExecutorState &state)
 

Private Member Functions

DUCKDB_API ExpressionExecutor (const vector< unique_ptr< Expression > > &exprs)
 

Private Attributes

optional_ptr< ClientContextcontext
 Client context.
 
vector< unique_ptr< ExpressionExecutorState > > states
 The states of the expression executor; this holds any intermediates and temporary states of expressions.
 
DebugVectorVerification debug_vector_verification = DebugVectorVerification::NONE
 The vector verification (debug setting)
 

Friends

class BoundIndex
 

Detailed Description

ExpressionExecutor is responsible for executing a set of expressions and storing the result in a data chunk.

Member Function Documentation

◆ Execute() [1/2]

void duckdb::ExpressionExecutor::Execute ( DataChunk input,
DataChunk result 
)
inline
47195 {
47196 Execute(&input, result);
47197 }
DUCKDB_API void Execute(DataChunk *input, DataChunk &result)
Execute the set of expressions with the given input chunk and store the result in the output chunk.

◆ Execute() [2/2]

void duckdb::ExpressionExecutor::Execute ( DataChunk result)
inline
47198 {
47199 Execute(nullptr, result);
47200 }

◆ ExecuteExpression() [1/2]

DUCKDB_API void duckdb::ExpressionExecutor::ExecuteExpression ( DataChunk input,
Vector result 
)

Execute the ExpressionExecutor and put the result in the result vector; this should only be used for expression executors with a single expression

◆ ExecuteExpression() [2/2]

DUCKDB_API void duckdb::ExpressionExecutor::ExecuteExpression ( Vector result)

Execute the ExpressionExecutor and put the result in the result vector; this should only be used for expression executors with a single expression

◆ SelectExpression()

DUCKDB_API idx_t duckdb::ExpressionExecutor::SelectExpression ( DataChunk input,
SelectionVector sel 
)

Execute the ExpressionExecutor and generate a selection vector from all true values in the result; this should only be used with a single boolean expression

◆ SetChunk() [1/2]

void duckdb::ExpressionExecutor::SetChunk ( DataChunk chunk)
inline
47230 {
47231 this->chunk = chunk;
47232 }
DataChunk * chunk
Definition duckdb.hpp:47182

◆ SetChunk() [2/2]

void duckdb::ExpressionExecutor::SetChunk ( DataChunk chunk)
inline
47233 {
47234 SetChunk(&chunk);
47235 }

◆ Select()

idx_t duckdb::ExpressionExecutor::Select ( const Expression expr,
ExpressionState state,
const SelectionVector sel,
idx_t  count,
SelectionVector true_sel,
SelectionVector false_sel 
)
protected

Execute the (boolean-returning) expression and generate a selection vector with all entries that are "true" in the result

Member Data Documentation

◆ chunk

DataChunk* duckdb::ExpressionExecutor::chunk = nullptr

The data chunk of the current physical operator, used to resolve column references and determines the output cardinality


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