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

LogicalDistinct filters duplicate entries from its child operator. More...

Inheritance diagram for duckdb::LogicalDistinct:
Collaboration diagram for duckdb::LogicalDistinct:

Public Member Functions

 LogicalDistinct (DistinctType distinct_type)
 LogicalDistinct (vector< unique_ptr< Expression > > targets, DistinctType distinct_type)
InsertionOrderPreservingMap< string > ParamsToString () const override
vector< ColumnBinding > GetColumnBindings () override
void Serialize (Serializer &serializer) const override
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 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 bool HasProjectionMap () const
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 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

DistinctType distinct_type
 Whether or not this is a DISTINCT or DISTINCT ON.
vector< unique_ptr< Expression > > distinct_targets
 The set of distinct targets.
unique_ptr< BoundOrderModifier > order_by
 The order by modifier (optional, only for distinct on).
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_DISTINCT

Protected Member Functions

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

Detailed Description

LogicalDistinct filters duplicate entries from its child operator.

Constructor & Destructor Documentation

◆ LogicalDistinct() [1/2]

duckdb::LogicalDistinct::LogicalDistinct ( DistinctType distinct_type)
explicit
382004 : LogicalOperator(LogicalOperatorType::LOGICAL_DISTINCT), distinct_type(distinct_type) {
382005}
DistinctType distinct_type
Whether or not this is a DISTINCT or DISTINCT ON.
Definition duckdb.cpp:203894

◆ LogicalDistinct() [2/2]

duckdb::LogicalDistinct::LogicalDistinct ( vector< unique_ptr< Expression > > targets,
DistinctType distinct_type )
explicit
382007 : LogicalOperator(LogicalOperatorType::LOGICAL_DISTINCT), distinct_type(distinct_type),
382008 distinct_targets(std::move(targets)) {
382009}
vector< unique_ptr< Expression > > distinct_targets
The set of distinct targets.
Definition duckdb.cpp:203896

Member Function Documentation

◆ ParamsToString()

InsertionOrderPreservingMap< string > duckdb::LogicalDistinct::ParamsToString ( ) const
overridevirtual

Reimplemented from duckdb::LogicalOperator.

382011 {
382012 auto result = LogicalOperator::ParamsToString();
382013 if (!distinct_targets.empty()) {
382014 result["Distinct Targets"] =
382016 [](const unique_ptr<Expression> &child) { return child->GetName(); });
382017 }
382018 SetParamsEstimatedCardinality(result);
382019 return result;
382020}
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497

◆ GetColumnBindings()

vector< ColumnBinding > duckdb::LogicalDistinct::GetColumnBindings ( )
inlineoverridevirtual

Reimplemented from duckdb::LogicalOperator.

203903 {
203904 return children[0]->GetColumnBindings();
203905 }
vector< unique_ptr< LogicalOperator > > children
The set of children of the operator.
Definition duckdb.hpp:21262

◆ Serialize()

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

Reimplemented from duckdb::LogicalOperator.

416711 {
416712 LogicalOperator::Serialize(serializer);
416713 serializer.WriteProperty<DistinctType>(200, "distinct_type", distinct_type);
416714 serializer.WritePropertyWithDefault<vector<unique_ptr<Expression>>>(201, "distinct_targets", distinct_targets);
416715 serializer.WritePropertyWithDefault<unique_ptr<BoundOrderModifier>>(202, "order_by", order_by);
416716}
unique_ptr< BoundOrderModifier > order_by
The order by modifier (optional, only for distinct on).
Definition duckdb.cpp:203898

◆ Deserialize()

unique_ptr< LogicalOperator > duckdb::LogicalDistinct::Deserialize ( Deserializer & deserializer)
static
416718 {
416719 auto distinct_type = deserializer.ReadProperty<DistinctType>(200, "distinct_type");
416720 auto distinct_targets = deserializer.ReadPropertyWithDefault<vector<unique_ptr<Expression>>>(201, "distinct_targets");
416721 auto result = duckdb::unique_ptr<LogicalDistinct>(new LogicalDistinct(std::move(distinct_targets), distinct_type));
416722 deserializer.ReadPropertyWithDefault<unique_ptr<BoundOrderModifier>>(202, "order_by", result->order_by);
416723 return std::move(result);
416724}

◆ ResolveTypes()

void duckdb::LogicalDistinct::ResolveTypes ( )
overrideprotectedvirtual

Resolve types for this specific operator.

Implements duckdb::LogicalOperator.

382022 {
382023 types = children[0]->types;
382024}
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: