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

Represents a JOIN between two expressions. More...

Inheritance diagram for duckdb::JoinRef:
Collaboration diagram for duckdb::JoinRef:

Public Member Functions

 JoinRef (JoinRefType ref_type=JoinRefType::REGULAR)
string ToString () const override
 Convert the object to a string.
bool Equals (const TableRef &other_p) const override
unique_ptr< TableRef > Copy () override
void Serialize (Serializer &serializer) const override
 Deserializes a blob back into a JoinRef.
Public Member Functions inherited from duckdb::TableRef
 TableRef (TableReferenceType type)
void Print ()
void CopyProperties (TableRef &target) const
 Copy the properties of this table ref to the target.
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< TableRef > Deserialize (Deserializer &source)
Static Public Member Functions inherited from duckdb::TableRef
static bool Equals (const unique_ptr< TableRef > &left, const unique_ptr< TableRef > &right)
static unique_ptr< TableRef > Deserialize (Deserializer &deserializer)

Public Attributes

unique_ptr< TableRef > left
 The left hand side of the join.
unique_ptr< TableRef > right
 The right hand side of the join.
unique_ptr< ParsedExpression > condition
 The join condition.
JoinType type
 The join type.
JoinRefType ref_type
 Join condition type.
vector< string > using_columns
 The set of USING columns (if any).
vector< unique_ptr< ParsedExpression > > duplicate_eliminated_columns
 Duplicate eliminated columns (if any).
bool delim_flipped = false
 If we have duplicate eliminated columns if the delim is flipped.
bool is_implicit = false
 Whether or not this is an implicit cross join.
Public Attributes inherited from duckdb::TableRef
TableReferenceType type
string alias
unique_ptr< SampleOptions > sample
 Sample options (if any).
optional_idx query_location
 The location in the query (if any).
shared_ptr< ExternalDependency > external_dependency
 External dependencies of this table function.
vector< string > column_name_alias
 Aliases for the column names.

Static Public Attributes

static constexpr const TableReferenceType TYPE = TableReferenceType::JOIN
Static Public Attributes inherited from duckdb::TableRef
static constexpr const TableReferenceType TYPE = TableReferenceType::INVALID

Additional Inherited Members

Protected Member Functions inherited from duckdb::TableRef
string BaseToString (string result) const
string BaseToString (string result, const vector< string > &column_name_alias) const
string AliasToString (const vector< string > &column_name_alias) const
string SampleToString () const

Detailed Description

Represents a JOIN between two expressions.

Constructor & Destructor Documentation

◆ JoinRef()

duckdb::JoinRef::JoinRef ( JoinRefType ref_type = JoinRefType::REGULAR)
inlineexplicit
296570 : TableRef(TableReferenceType::JOIN), type(JoinType::INNER), ref_type(ref_type) {
296571 }
JoinType type
The join type.
Definition duckdb.cpp:296580
JoinRefType ref_type
Join condition type.
Definition duckdb.cpp:296582

Member Function Documentation

◆ ToString()

string duckdb::JoinRef::ToString ( ) const
overridevirtual

Convert the object to a string.

Implements duckdb::TableRef.

350513 {
350514 string result;
350515 result = left->ToString() + " ";
350516 switch (ref_type) {
350517 case JoinRefType::REGULAR:
350518 result += EnumUtil::ToString(type) + " JOIN ";
350519 break;
350520 case JoinRefType::NATURAL:
350521 result += "NATURAL ";
350522 result += EnumUtil::ToString(type) + " JOIN ";
350523 break;
350524 case JoinRefType::ASOF:
350525 result += "ASOF ";
350526 result += EnumUtil::ToString(type) + " JOIN ";
350527 break;
350528 case JoinRefType::CROSS:
350529 result += is_implicit ? ", " : "CROSS JOIN ";
350530 break;
350531 case JoinRefType::POSITIONAL:
350532 result += "POSITIONAL JOIN ";
350533 break;
350534 case JoinRefType::DEPENDENT:
350535 result += "DEPENDENT JOIN ";
350536 break;
350537 }
350538 result += right->ToString();
350539 if (condition) {
350540 D_ASSERT(using_columns.empty());
350541 result += " ON (";
350542 result += condition->ToString();
350543 result += ")";
350544 } else if (!using_columns.empty()) {
350545 result += " USING (";
350546 for (idx_t i = 0; i < using_columns.size(); i++) {
350547 if (i > 0) {
350548 result += ", ";
350549 }
350551 }
350552 result += ")";
350553 }
350554 return result;
350555}
unique_ptr< TableRef > right
The right hand side of the join.
Definition duckdb.cpp:296576
unique_ptr< ParsedExpression > condition
The join condition.
Definition duckdb.cpp:296578
vector< string > using_columns
The set of USING columns (if any).
Definition duckdb.cpp:296584
unique_ptr< TableRef > left
The left hand side of the join.
Definition duckdb.cpp:296574
bool is_implicit
Whether or not this is an implicit cross join.
Definition duckdb.cpp:296590
static string WriteOptionallyQuoted(const string &text, char quote='"', bool allow_caps = true, KeywordCategory category = KeywordCategory::KEYWORD_NONE)
Writes a string that is optionally quoted + escaped so it can be used as an identifier.
Definition duckdb.cpp:338034
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
Here is the call graph for this function:

◆ Equals()

bool duckdb::JoinRef::Equals ( const TableRef & other_p) const
overridevirtual

Reimplemented from duckdb::TableRef.

350557 {
350558 if (!TableRef::Equals(other_p)) {
350559 return false;
350560 }
350561 auto &other = other_p.Cast<JoinRef>();
350562 if (using_columns.size() != other.using_columns.size()) {
350563 return false;
350564 }
350565 for (idx_t i = 0; i < using_columns.size(); i++) {
350566 if (using_columns[i] != other.using_columns[i]) {
350567 return false;
350568 }
350569 }
350570 return left->Equals(*other.left) && right->Equals(*other.right) &&
350571 ParsedExpression::Equals(condition, other.condition) && type == other.type;
350572}
bool Equals(const BaseExpression &other) const override
Returns true if this expression is equal to another expression.
Definition duckdb.cpp:340462

◆ Copy()

unique_ptr< TableRef > duckdb::JoinRef::Copy ( )
overridevirtual

Implements duckdb::TableRef.

350574 {
350575 auto copy = make_uniq<JoinRef>(ref_type);
350576 copy->left = left->Copy();
350577 copy->right = right->Copy();
350578 if (condition) {
350579 copy->condition = condition->Copy();
350580 }
350581 copy->type = type;
350582 copy->ref_type = ref_type;
350583 copy->alias = alias;
350584 copy->using_columns = using_columns;
350585 copy->delim_flipped = delim_flipped;
350586 for (auto &col : duplicate_eliminated_columns) {
350587 copy->duplicate_eliminated_columns.emplace_back(col->Copy());
350588 }
350589 copy->is_implicit = is_implicit;
350590 return std::move(copy);
350591}
bool delim_flipped
If we have duplicate eliminated columns if the delim is flipped.
Definition duckdb.cpp:296588
vector< unique_ptr< ParsedExpression > > duplicate_eliminated_columns
Duplicate eliminated columns (if any).
Definition duckdb.cpp:296586

◆ Serialize()

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

Deserializes a blob back into a JoinRef.

Reimplemented from duckdb::TableRef.

419706 {
419707 TableRef::Serialize(serializer);
419708 serializer.WritePropertyWithDefault<unique_ptr<TableRef>>(200, "left", left);
419709 serializer.WritePropertyWithDefault<unique_ptr<TableRef>>(201, "right", right);
419710 serializer.WritePropertyWithDefault<unique_ptr<ParsedExpression>>(202, "condition", condition);
419711 serializer.WriteProperty<JoinType>(203, "join_type", type);
419712 serializer.WriteProperty<JoinRefType>(204, "ref_type", ref_type);
419713 serializer.WritePropertyWithDefault<vector<string>>(205, "using_columns", using_columns);
419714 serializer.WritePropertyWithDefault<bool>(206, "delim_flipped", delim_flipped);
419715 serializer.WritePropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(207, "duplicate_eliminated_columns", duplicate_eliminated_columns);
419716 if (serializer.ShouldSerialize(6)) {
419717 serializer.WritePropertyWithDefault<bool>(208, "is_implicit", is_implicit, true);
419718 }
419719}

◆ Deserialize()

unique_ptr< TableRef > duckdb::JoinRef::Deserialize ( Deserializer & source)
static
419721 {
419722 auto result = duckdb::unique_ptr<JoinRef>(new JoinRef());
419723 deserializer.ReadPropertyWithDefault<unique_ptr<TableRef>>(200, "left", result->left);
419724 deserializer.ReadPropertyWithDefault<unique_ptr<TableRef>>(201, "right", result->right);
419725 deserializer.ReadPropertyWithDefault<unique_ptr<ParsedExpression>>(202, "condition", result->condition);
419726 deserializer.ReadProperty<JoinType>(203, "join_type", result->type);
419727 deserializer.ReadProperty<JoinRefType>(204, "ref_type", result->ref_type);
419728 deserializer.ReadPropertyWithDefault<vector<string>>(205, "using_columns", result->using_columns);
419729 deserializer.ReadPropertyWithDefault<bool>(206, "delim_flipped", result->delim_flipped);
419730 deserializer.ReadPropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(207, "duplicate_eliminated_columns", result->duplicate_eliminated_columns);
419731 deserializer.ReadPropertyWithExplicitDefault<bool>(208, "is_implicit", result->is_implicit, true);
419732 return std::move(result);
419733}

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