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

LogicalTopN represents a comibination of ORDER BY and LIMIT clause, using Min/Max Heap. More...

Inheritance diagram for duckdb::LogicalTopN:
Collaboration diagram for duckdb::LogicalTopN:

Public Member Functions

 LogicalTopN (vector< BoundOrderByNode > orders, idx_t limit, idx_t offset)
vector< ColumnBinding > GetColumnBindings () override
void Serialize (Serializer &serializer) const override
idx_t EstimateCardinality (ClientContext &context) 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 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)
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

vector< BoundOrderByNode > orders
idx_t limit
 The maximum amount of elements to emit.
idx_t offset
 The offset from the start to begin emitting elements.
shared_ptr< DynamicFilterData > dynamic_filter
 Dynamic table filter (if any).
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_TOP_N

Protected Member Functions

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

Detailed Description

LogicalTopN represents a comibination of ORDER BY and LIMIT clause, using Min/Max Heap.

Constructor & Destructor Documentation

◆ LogicalTopN()

duckdb::LogicalTopN::LogicalTopN ( vector< BoundOrderByNode > orders,
idx_t limit,
idx_t offset )
383122 : LogicalOperator(LogicalOperatorType::LOGICAL_TOP_N), orders(std::move(orders)), limit(limit), offset(offset) {
383123}
idx_t offset
The offset from the start to begin emitting elements.
Definition duckdb.cpp:206288
idx_t limit
The maximum amount of elements to emit.
Definition duckdb.cpp:206286

◆ ~LogicalTopN()

duckdb::LogicalTopN::~LogicalTopN ( )
override
383125 {
383126}

Member Function Documentation

◆ GetColumnBindings()

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

Reimplemented from duckdb::LogicalOperator.

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

◆ Serialize()

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

Reimplemented from duckdb::LogicalOperator.

417044 {
417045 LogicalOperator::Serialize(serializer);
417046 serializer.WritePropertyWithDefault<vector<BoundOrderByNode>>(200, "orders", orders);
417047 serializer.WritePropertyWithDefault<idx_t>(201, "limit", limit);
417048 serializer.WritePropertyWithDefault<idx_t>(202, "offset", offset);
417049}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Deserialize()

unique_ptr< LogicalOperator > duckdb::LogicalTopN::Deserialize ( Deserializer & deserializer)
static
417051 {
417052 auto orders = deserializer.ReadPropertyWithDefault<vector<BoundOrderByNode>>(200, "orders");
417053 auto limit = deserializer.ReadPropertyWithDefault<idx_t>(201, "limit");
417054 auto offset = deserializer.ReadPropertyWithDefault<idx_t>(202, "offset");
417055 auto result = duckdb::unique_ptr<LogicalTopN>(new LogicalTopN(std::move(orders), limit, offset));
417056 return std::move(result);
417057}

◆ EstimateCardinality()

idx_t duckdb::LogicalTopN::EstimateCardinality ( ClientContext & context)
overridevirtual

Reimplemented from duckdb::LogicalOperator.

383128 {
383129 auto child_cardinality = LogicalOperator::EstimateCardinality(context);
383130 if (child_cardinality < limit) {
383131 return child_cardinality;
383132 }
383133 return limit;
383134}

◆ ResolveTypes()

void duckdb::LogicalTopN::ResolveTypes ( )
inlineoverrideprotectedvirtual

Resolve types for this specific operator.

Implements duckdb::LogicalOperator.

206303 {
206304 types = children[0]->types;
206305 }
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: