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

LogicalOrder represents an ORDER BY clause, sorting the data. More...

Inheritance diagram for duckdb::LogicalOrder:
Collaboration diagram for duckdb::LogicalOrder:

Public Member Functions

 LogicalOrder (vector< BoundOrderByNode > orders)
vector< ColumnBinding > GetColumnBindings () override
bool HasProjectionMap () const override
void Serialize (Serializer &serializer) const override
InsertionOrderPreservingMap< string > ParamsToString () 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 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

vector< BoundOrderByNode > orders
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_ORDER_BY

Protected Member Functions

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

Detailed Description

LogicalOrder represents an ORDER BY clause, sorting the data.

Constructor & Destructor Documentation

◆ LogicalOrder()

duckdb::LogicalOrder::LogicalOrder ( vector< BoundOrderByNode > orders)
explicit
382820 : LogicalOperator(LogicalOperatorType::LOGICAL_ORDER_BY), orders(std::move(orders)) {
382821}

Member Function Documentation

◆ GetColumnBindings()

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

Reimplemented from duckdb::LogicalOperator.

382823 {
382824 auto child_bindings = children[0]->GetColumnBindings();
382825 if (!HasProjectionMap()) {
382826 return child_bindings;
382827 }
382828 return MapBindings(child_bindings, projection_map);
382829}
vector< unique_ptr< LogicalOperator > > children
The set of children of the operator.
Definition duckdb.hpp:21262

◆ HasProjectionMap()

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

Reimplemented from duckdb::LogicalOperator.

205309 {
205310 return !projection_map.empty();
205311 }

◆ Serialize()

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

Reimplemented from duckdb::LogicalOperator.

416908 {
416909 LogicalOperator::Serialize(serializer);
416910 serializer.WritePropertyWithDefault<vector<BoundOrderByNode>>(200, "orders", orders);
416911 serializer.WritePropertyWithDefault<vector<idx_t>>(201, "projections", projection_map);
416912}

◆ Deserialize()

unique_ptr< LogicalOperator > duckdb::LogicalOrder::Deserialize ( Deserializer & deserializer)
static
416914 {
416915 auto orders = deserializer.ReadPropertyWithDefault<vector<BoundOrderByNode>>(200, "orders");
416916 auto result = duckdb::unique_ptr<LogicalOrder>(new LogicalOrder(std::move(orders)));
416917 deserializer.ReadPropertyWithDefault<vector<idx_t>>(201, "projections", result->projection_map);
416918 return std::move(result);
416919}

◆ ParamsToString()

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

Reimplemented from duckdb::LogicalOperator.

382831 {
382832 InsertionOrderPreservingMap<string> result;
382833 string orders_info;
382834 for (idx_t i = 0; i < orders.size(); i++) {
382835 if (i > 0) {
382836 orders_info += "\n";
382837 }
382838 orders_info += orders[i].expression->GetName();
382839 }
382840 result["__order_by__"] = orders_info;
382841 SetParamsEstimatedCardinality(result);
382842 return result;
382843}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ ResolveTypes()

void duckdb::LogicalOrder::ResolveTypes ( )
overrideprotectedvirtual

Resolve types for this specific operator.

Implements duckdb::LogicalOperator.

382845 {
382846 const auto child_types = children[0]->types;
382847 if (!HasProjectionMap()) {
382848 types = child_types;
382849 } else {
382850 types = MapTypes(child_types, projection_map);
382851 }
382852}
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: