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

Public Types

enum  JoinValue : uint8_t { NONE , LEFT , RIGHT , BOTH }

Public Member Functions

constexpr JoinSide (JoinValue val)
bool operator== (JoinSide a) const
bool operator!= (JoinSide a) const

Static Public Member Functions

static JoinSide CombineJoinSide (JoinSide left, JoinSide right)
static JoinSide GetJoinSide (idx_t table_binding, const unordered_set< idx_t > &left_bindings, const unordered_set< uint64_t > &right_bindings)
static JoinSide GetJoinSide (Expression &expression, const unordered_set< idx_t > &left_bindings, const unordered_set< idx_t > &right_bindings)
static JoinSide GetJoinSide (const unordered_set< idx_t > &bindings, const unordered_set< idx_t > &left_bindings, const unordered_set< idx_t > &right_bindings)

Private Attributes

JoinValue value

Member Enumeration Documentation

◆ JoinValue

enum duckdb::JoinSide::JoinValue : uint8_t
38073: uint8_t { NONE, LEFT, RIGHT, BOTH };
::uint8_t uint8_t

Constructor & Destructor Documentation

◆ JoinSide()

duckdb::JoinSide::JoinSide ( JoinValue val)
inlineconstexpr
38076 : value(val) { // NOLINT: Allow implicit conversion from `join_value`
38077 }

Member Function Documentation

◆ operator==()

bool duckdb::JoinSide::operator== ( JoinSide a) const
inline
38079 {
38080 return value == a.value;
38081 }

◆ operator!=()

bool duckdb::JoinSide::operator!= ( JoinSide a) const
inline
38082 {
38083 return value != a.value;
38084 }

◆ CombineJoinSide()

JoinSide duckdb::JoinSide::CombineJoinSide ( JoinSide left,
JoinSide right )
static
380380 {
380381 if (left == JoinSide::NONE) {
380382 return right;
380383 }
380384 if (right == JoinSide::NONE) {
380385 return left;
380386 }
380387 if (left != right) {
380388 return JoinSide::BOTH;
380389 }
380390 return left;
380391}

◆ GetJoinSide() [1/3]

JoinSide duckdb::JoinSide::GetJoinSide ( idx_t table_binding,
const unordered_set< idx_t > & left_bindings,
const unordered_set< uint64_t > & right_bindings )
static
380394 {
380395 if (left_bindings.find(table_binding) != left_bindings.end()) {
380396 // column references table on left side
380397 D_ASSERT(right_bindings.find(table_binding) == right_bindings.end());
380398 return JoinSide::LEFT;
380399 } else {
380400 // column references table on right side
380401 D_ASSERT(right_bindings.find(table_binding) != right_bindings.end());
380402 return JoinSide::RIGHT;
380403 }
380404}

◆ GetJoinSide() [2/3]

JoinSide duckdb::JoinSide::GetJoinSide ( Expression & expression,
const unordered_set< idx_t > & left_bindings,
const unordered_set< idx_t > & right_bindings )
static
380407 {
380408 if (expression.GetExpressionType() == ExpressionType::BOUND_COLUMN_REF) {
380409 auto &colref = expression.Cast<BoundColumnRefExpression>();
380410 if (colref.depth > 0) {
380411 throw NotImplementedException("Non-inner join on correlated columns not supported");
380412 }
380413 return GetJoinSide(colref.binding.table_index, left_bindings, right_bindings);
380414 }
380415 D_ASSERT(expression.GetExpressionType() != ExpressionType::BOUND_REF);
380416 if (expression.GetExpressionType() == ExpressionType::SUBQUERY) {
380417 D_ASSERT(expression.GetExpressionClass() == ExpressionClass::BOUND_SUBQUERY);
380418 auto &subquery = expression.Cast<BoundSubqueryExpression>();
380419 JoinSide side = JoinSide::NONE;
380420 for (auto &child : subquery.children) {
380421 auto child_side = GetJoinSide(*child, left_bindings, right_bindings);
380422 side = CombineJoinSide(side, child_side);
380423 }
380424 // correlated subquery, check the side of each of correlated columns in the subquery
380425 for (auto &corr : subquery.binder->correlated_columns) {
380426 if (corr.depth > 1) {
380427 // correlated column has depth > 1
380428 // it does not refer to any table in the current set of bindings
380429 return JoinSide::BOTH;
380430 }
380431 auto correlated_side = GetJoinSide(corr.binding.table_index, left_bindings, right_bindings);
380432 side = CombineJoinSide(side, correlated_side);
380433 }
380434 return side;
380435 }
380436 JoinSide join_side = JoinSide::NONE;
380437 ExpressionIterator::EnumerateChildren(expression, [&](Expression &child) {
380438 auto child_side = GetJoinSide(child, left_bindings, right_bindings);
380439 join_side = CombineJoinSide(child_side, join_side);
380440 });
380441 return join_side;
380442}
float corr

◆ GetJoinSide() [3/3]

JoinSide duckdb::JoinSide::GetJoinSide ( const unordered_set< idx_t > & bindings,
const unordered_set< idx_t > & left_bindings,
const unordered_set< idx_t > & right_bindings )
static
380445 {
380446 JoinSide side = JoinSide::NONE;
380447 for (auto binding : bindings) {
380448 side = CombineJoinSide(side, GetJoinSide(binding, left_bindings, right_bindings));
380449 }
380450 return side;
380451}

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