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::LogicalMergeInto Class Reference
Inheritance diagram for duckdb::LogicalMergeInto:
Collaboration diagram for duckdb::LogicalMergeInto:

Public Member Functions

 LogicalMergeInto (TableCatalogEntry &table)
void Serialize (Serializer &serializer) const override
idx_t EstimateCardinality (ClientContext &context) override
vector< idx_t > GetTableIndex () const override
 Returns the set of table indexes of this operator.
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
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

TableCatalogEntry & table
 The base table to merge into.
idx_t table_index
 projection index
vector< unique_ptr< Expression > > bound_defaults
idx_t row_id_start
optional_idx source_marker
vector< unique_ptr< BoundConstraint > > bound_constraints
 Bound constraints.
bool return_chunk = false
 Whether or not to return the input data.
map< MergeActionCondition, vector< unique_ptr< BoundMergeIntoAction > > > actions
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_MERGE_INTO

Protected Member Functions

vector< ColumnBinding > GetColumnBindings () override
void ResolveTypes () override
 Resolve types for this specific operator.

Private Member Functions

 LogicalMergeInto (ClientContext &context, const unique_ptr< CreateInfo > &table_info)

Constructor & Destructor Documentation

◆ LogicalMergeInto() [1/2]

duckdb::LogicalMergeInto::LogicalMergeInto ( TableCatalogEntry & table)
explicit
382779 : LogicalOperator(LogicalOperatorType::LOGICAL_MERGE_INTO), table(table) {
382780}
TableCatalogEntry & table
The base table to merge into.
Definition duckdb.cpp:205121

◆ LogicalMergeInto() [2/2]

duckdb::LogicalMergeInto::LogicalMergeInto ( ClientContext & context,
const unique_ptr< CreateInfo > & table_info )
private
382783 : LogicalOperator(LogicalOperatorType::LOGICAL_MERGE_INTO),
382784 table(Catalog::GetEntry<TableCatalogEntry>(context, table_info->catalog, table_info->schema,
382785 table_info->Cast<CreateTableInfo>().table)) {
382786 auto binder = Binder::CreateBinder(context);
382787 bound_constraints = binder->BindConstraints(table);
382788}
DUCKDB_API optional_ptr< CatalogEntry > GetEntry(ClientContext &context, const string &schema, const EntryLookupInfo &lookup_info, OnEntryNotFound if_not_found)
Gets the "schema.name" entry of the specified type, if entry does not exist behavior depends on OnEnt...
Definition duckdb.cpp:8156
vector< unique_ptr< BoundConstraint > > bound_constraints
Bound constraints.
Definition duckdb.cpp:205128

Member Function Documentation

◆ Serialize()

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

Reimplemented from duckdb::LogicalOperator.

416885 {
416886 LogicalOperator::Serialize(serializer);
416887 serializer.WritePropertyWithDefault<unique_ptr<CreateInfo>>(200, "table_info", table.GetInfo());
416888 serializer.WritePropertyWithDefault<idx_t>(201, "table_index", table_index);
416889 serializer.WritePropertyWithDefault<vector<unique_ptr<Expression>>>(202, "bound_defaults", bound_defaults);
416890 serializer.WritePropertyWithDefault<idx_t>(203, "row_id_start", row_id_start);
416891 serializer.WriteProperty<optional_idx>(204, "source_marker", source_marker);
416892 serializer.WritePropertyWithDefault<map<MergeActionCondition, vector<unique_ptr<BoundMergeIntoAction>>>>(205, "actions", actions);
416893 serializer.WritePropertyWithDefault<bool>(206, "return_chunk", return_chunk);
416894}
bool return_chunk
Whether or not to return the input data.
Definition duckdb.cpp:205130
idx_t table_index
projection index
Definition duckdb.cpp:205123
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Deserialize()

unique_ptr< LogicalOperator > duckdb::LogicalMergeInto::Deserialize ( Deserializer & deserializer)
static
416896 {
416897 auto table_info = deserializer.ReadPropertyWithDefault<unique_ptr<CreateInfo>>(200, "table_info");
416898 auto result = duckdb::unique_ptr<LogicalMergeInto>(new LogicalMergeInto(deserializer.Get<ClientContext &>(), table_info));
416899 deserializer.ReadPropertyWithDefault<idx_t>(201, "table_index", result->table_index);
416900 deserializer.ReadPropertyWithDefault<vector<unique_ptr<Expression>>>(202, "bound_defaults", result->bound_defaults);
416901 deserializer.ReadPropertyWithDefault<idx_t>(203, "row_id_start", result->row_id_start);
416902 deserializer.ReadProperty<optional_idx>(204, "source_marker", result->source_marker);
416903 deserializer.ReadPropertyWithDefault<map<MergeActionCondition, vector<unique_ptr<BoundMergeIntoAction>>>>(205, "actions", result->actions);
416904 deserializer.ReadPropertyWithDefault<bool>(206, "return_chunk", result->return_chunk);
416905 return std::move(result);
416906}

◆ EstimateCardinality()

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

Reimplemented from duckdb::LogicalOperator.

382790 {
382791 return return_chunk ? LogicalOperator::EstimateCardinality(context) : 1;
382792}

◆ GetTableIndex()

vector< idx_t > duckdb::LogicalMergeInto::GetTableIndex ( ) const
overridevirtual

Returns the set of table indexes of this operator.

Reimplemented from duckdb::LogicalOperator.

382794 {
382795 return vector<idx_t> {table_index};
382796}

◆ GetColumnBindings()

vector< ColumnBinding > duckdb::LogicalMergeInto::GetColumnBindings ( )
overrideprotectedvirtual

Reimplemented from duckdb::LogicalOperator.

382798 {
382799 if (return_chunk) {
382800 return GenerateColumnBindings(table_index, table.GetTypes().size() + 1);
382801 }
382802 return {ColumnBinding(0, 0)};
382803}

◆ ResolveTypes()

void duckdb::LogicalMergeInto::ResolveTypes ( )
overrideprotectedvirtual

Resolve types for this specific operator.

Implements duckdb::LogicalOperator.

382805 {
382806 if (return_chunk) {
382807 types = table.GetTypes();
382808 types.push_back(LogicalType::VARCHAR);
382809 } else {
382810 types.emplace_back(LogicalType::BIGINT);
382811 }
382812}
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: