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

LogicalFilter represents a filter operation (e.g. WHERE or HAVING clause). More...

Inheritance diagram for duckdb::LogicalFilter:
Collaboration diagram for duckdb::LogicalFilter:

Public Member Functions

 LogicalFilter (unique_ptr< Expression > expression)
vector< ColumnBinding > GetColumnBindings () override
bool HasProjectionMap () const override
void Serialize (Serializer &serializer) const override
bool SplitPredicates ()
Public Member Functions inherited from duckdb::LogicalOperator
 LogicalOperator (LogicalOperatorType type)
 LogicalOperator (LogicalOperatorType type, vector< unique_ptr< Expression > > expressions)
virtual idx_t GetRootIndex ()
void PrintColumnBindings ()
void ResolveOperatorTypes ()
 Resolve the types of the logical operator and its children.
virtual string GetName () const
virtual InsertionOrderPreservingMap< string > ParamsToString () const
virtual string ToString (ExplainFormat format=ExplainFormat::DEFAULT) const
DUCKDB_API void Print ()
virtual void Verify (ClientContext &context)
 Debug method: verify that the integrity of expressions & child nodes are maintained.
void AddChild (unique_ptr< LogicalOperator > child)
virtual idx_t EstimateCardinality (ClientContext &context)
void SetEstimatedCardinality (idx_t _estimated_cardinality)
void SetParamsEstimatedCardinality (InsertionOrderPreservingMap< string > &result) const
virtual unique_ptr< LogicalOperator > Copy (ClientContext &context) const
virtual bool RequireOptimizer () const
virtual bool SupportSerialization () const
 Allows LogicalOperators to opt out of serialization.
virtual vector< idx_t > GetTableIndex () const
 Returns the set of table indexes of this operator.
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< LogicalOperator > Deserialize (Deserializer &deserializer)
static bool SplitPredicates (vector< unique_ptr< Expression > > &expressions)
Static Public Member Functions inherited from duckdb::LogicalOperator
static string ColumnBindingsToString (const vector< ColumnBinding > &bindings)
static vector< ColumnBinding > GenerateColumnBindings (idx_t table_idx, idx_t column_count)
static vector< LogicalType > MapTypes (const vector< LogicalType > &types, const vector< idx_t > &projection_map)
static vector< ColumnBinding > MapBindings (const vector< ColumnBinding > &types, const vector< idx_t > &projection_map)
static unique_ptr< LogicalOperator > Deserialize (Deserializer &deserializer)

Public Attributes

vector< idx_t > projection_map
Public Attributes inherited from duckdb::LogicalOperator
LogicalOperatorType type
 The type of the logical operator.
vector< unique_ptr< LogicalOperator > > children
 The set of children of the operator.
vector< unique_ptr< Expression > > expressions
 The set of expressions contained within the operator, if any.
vector< LogicalType > types
 The types returned by this logical operator. Set by calling LogicalOperator::ResolveTypes.
idx_t estimated_cardinality
 Estimated Cardinality.
bool has_estimated_cardinality

Static Public Attributes

static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_FILTER

Protected Member Functions

void ResolveTypes () override
 Resolve types for this specific operator.

Detailed Description

LogicalFilter represents a filter operation (e.g. WHERE or HAVING clause).

Constructor & Destructor Documentation

◆ LogicalFilter() [1/2]

duckdb::LogicalFilter::LogicalFilter ( unique_ptr< Expression > expression)
explicit
382165 : LogicalOperator(LogicalOperatorType::LOGICAL_FILTER) {
382166 expressions.push_back(std::move(expression));
382167 SplitPredicates(expressions);
382168}
vector< unique_ptr< Expression > > expressions
The set of expressions contained within the operator, if any.
Definition duckdb.hpp:21264

◆ LogicalFilter() [2/2]

duckdb::LogicalFilter::LogicalFilter ( )
382170 : LogicalOperator(LogicalOperatorType::LOGICAL_FILTER) {
382171}

Member Function Documentation

◆ GetColumnBindings()

vector< ColumnBinding > duckdb::LogicalFilter::GetColumnBindings ( )
overridevirtual

Reimplemented from duckdb::LogicalOperator.

382177 {
382178 return MapBindings(children[0]->GetColumnBindings(), projection_map);
382179}
vector< unique_ptr< LogicalOperator > > children
The set of children of the operator.
Definition duckdb.hpp:21262

◆ HasProjectionMap()

bool duckdb::LogicalFilter::HasProjectionMap ( ) const
inlineoverridevirtual

Reimplemented from duckdb::LogicalOperator.

204528 {
204529 return !projection_map.empty();
204530 }

◆ Serialize()

void duckdb::LogicalFilter::Serialize ( Serializer & serializer) const
overridevirtual

Reimplemented from duckdb::LogicalOperator.

416795 {
416796 LogicalOperator::Serialize(serializer);
416797 serializer.WritePropertyWithDefault<vector<unique_ptr<Expression>>>(200, "expressions", expressions);
416798 serializer.WritePropertyWithDefault<vector<idx_t>>(201, "projection_map", projection_map);
416799}

◆ Deserialize()

unique_ptr< LogicalOperator > duckdb::LogicalFilter::Deserialize ( Deserializer & deserializer)
static
416801 {
416802 auto result = duckdb::unique_ptr<LogicalFilter>(new LogicalFilter());
416803 deserializer.ReadPropertyWithDefault<vector<unique_ptr<Expression>>>(200, "expressions", result->expressions);
416804 deserializer.ReadPropertyWithDefault<vector<idx_t>>(201, "projection_map", result->projection_map);
416805 return std::move(result);
416806}

◆ SplitPredicates() [1/2]

bool duckdb::LogicalFilter::SplitPredicates ( )
inline
204535 {
204536 return SplitPredicates(expressions);
204537 }

◆ SplitPredicates() [2/2]

bool duckdb::LogicalFilter::SplitPredicates ( vector< unique_ptr< Expression > > & expressions)
static

Splits up the predicates of the LogicalFilter into a set of predicates separated by AND Returns whether or not any splits were made

382184 {
382185 bool found_conjunction = false;
382186 for (idx_t i = 0; i < expressions.size(); i++) {
382187 if (expressions[i]->GetExpressionType() == ExpressionType::CONJUNCTION_AND) {
382188 auto &conjunction = expressions[i]->Cast<BoundConjunctionExpression>();
382189 found_conjunction = true;
382190 // AND expression, append the other children
382191 for (idx_t k = 1; k < conjunction.children.size(); k++) {
382192 expressions.push_back(std::move(conjunction.children[k]));
382193 }
382194 // replace this expression with the first child of the conjunction
382195 expressions[i] = std::move(conjunction.children[0]);
382196 // we move back by one so the right child is checked again
382197 // in case it is an AND expression as well
382198 i--;
382199 }
382200 }
382201 return found_conjunction;
382202}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ ResolveTypes()

void duckdb::LogicalFilter::ResolveTypes ( )
overrideprotectedvirtual

Resolve types for this specific operator.

Implements duckdb::LogicalOperator.

382173 {
382174 types = MapTypes(children[0]->types, projection_map);
382175}
vector< LogicalType > types
The types returned by this logical operator. Set by calling LogicalOperator::ResolveTypes.
Definition duckdb.hpp:21266

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