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

LogicalComparisonJoin represents a join that involves comparisons between the LHS and RHS. More...

Inheritance diagram for duckdb::LogicalComparisonJoin:
Collaboration diagram for duckdb::LogicalComparisonJoin:

Public Member Functions

 LogicalComparisonJoin (JoinType type, LogicalOperatorType logical_type=LogicalOperatorType::LOGICAL_COMPARISON_JOIN)
InsertionOrderPreservingMap< string > ParamsToString () const override
void Serialize (Serializer &serializer) const override
bool HasEquality (idx_t &range_count) const
Public Member Functions inherited from duckdb::LogicalJoin
 LogicalJoin (JoinType type, LogicalOperatorType logical_type=LogicalOperatorType::LOGICAL_JOIN)
bool HasProjectionMap () const override
vector< ColumnBinding > GetColumnBindings () override
vector< idx_t > GetTableIndex () const override
 Returns the set of table indexes of this operator.
string GetName () 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 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.
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< LogicalOperator > Deserialize (Deserializer &deserializer)
static unique_ptr< LogicalOperator > CreateJoin (ClientContext &context, JoinType type, JoinRefType ref_type, unique_ptr< LogicalOperator > left_child, unique_ptr< LogicalOperator > right_child, unique_ptr< Expression > condition)
static unique_ptr< LogicalOperator > CreateJoin (JoinType type, JoinRefType ref_type, unique_ptr< LogicalOperator > left_child, unique_ptr< LogicalOperator > right_child, vector< JoinCondition > conditions, vector< unique_ptr< Expression > > arbitrary_expressions)
 Create the join operator based on conditions and join type.
static void ExtractJoinConditions (ClientContext &context, JoinType type, JoinRefType ref_type, unique_ptr< LogicalOperator > &left_child, unique_ptr< LogicalOperator > &right_child, unique_ptr< Expression > condition, vector< JoinCondition > &conditions, vector< unique_ptr< Expression > > &arbitrary_expressions)
static void ExtractJoinConditions (ClientContext &context, JoinType type, JoinRefType ref_type, unique_ptr< LogicalOperator > &left_child, unique_ptr< LogicalOperator > &right_child, vector< unique_ptr< Expression > > &expressions, vector< JoinCondition > &conditions, vector< unique_ptr< Expression > > &arbitrary_expressions)
static void ExtractJoinConditions (ClientContext &context, JoinType type, JoinRefType ref_type, unique_ptr< LogicalOperator > &left_child, unique_ptr< LogicalOperator > &right_child, const unordered_set< idx_t > &left_bindings, const unordered_set< idx_t > &right_bindings, vector< unique_ptr< Expression > > &expressions, vector< JoinCondition > &conditions, vector< unique_ptr< Expression > > &arbitrary_expressions)
 Extract join conditions, pushing single-side filters to children when it's safe.
Static Public Member Functions inherited from duckdb::LogicalJoin
static void GetTableReferences (LogicalOperator &op, unordered_set< idx_t > &bindings)
 Gets the set of table references that are reachable from this node.
static void GetExpressionBindings (const Expression &expr, unordered_set< idx_t > &bindings)
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< JoinCondition > conditions
 The conditions of the join.
vector< LogicalType > mark_types
 Used for duplicate-eliminated MARK joins.
vector< unique_ptr< Expression > > duplicate_eliminated_columns
 The set of columns that will be duplicate eliminated from the LHS and pushed into the RHS.
bool delim_flipped = false
 If this is a DelimJoin, whether it has been flipped to de-duplicating the RHS instead.
bool convert_mark_to_semi = true
 (If join_type == MARK) can this comparison join be converted from a mark join to semi
unique_ptr< JoinFilterPushdownInfo > filter_pushdown
 Scans where we should push generated filters into (if any).
unique_ptr< Expression > predicate
 Filtering predicate from the ON clause with expressions that don't reference both sides.
Public Attributes inherited from duckdb::LogicalJoin
JoinType join_type
 The type of the join (INNER, OUTER, etc...).
idx_t mark_index {}
 Table index used to refer to the MARK column (in case of a MARK join).
vector< idx_t > left_projection_map
 The columns of the LHS that are output by the join.
vector< idx_t > right_projection_map
 The columns of the RHS that are output by the join.
vector< unique_ptr< BaseStatistics > > join_stats
 Join Keys statistics (optional).
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_INVALID
Static Public Attributes inherited from duckdb::LogicalJoin
static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_INVALID

Additional Inherited Members

Protected Member Functions inherited from duckdb::LogicalJoin
void ResolveTypes () override
 Resolve types for this specific operator.

Detailed Description

LogicalComparisonJoin represents a join that involves comparisons between the LHS and RHS.

Constructor & Destructor Documentation

◆ LogicalComparisonJoin()

duckdb::LogicalComparisonJoin::LogicalComparisonJoin ( JoinType type,
LogicalOperatorType logical_type = LogicalOperatorType::LOGICAL_COMPARISON_JOIN )
explicit
381507 : LogicalJoin(join_type, logical_type) {
381508}
JoinType join_type
The type of the join (INNER, OUTER, etc...).
Definition duckdb.cpp:147060

Member Function Documentation

◆ ParamsToString()

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

Reimplemented from duckdb::LogicalOperator.

381510 {
381511 InsertionOrderPreservingMap<string> result;
381512 result["Join Type"] = EnumUtil::ToChars(join_type);
381513
381514 string conditions_info;
381515 for (idx_t i = 0; i < conditions.size(); i++) {
381516 if (i > 0) {
381517 conditions_info += "\n";
381518 }
381519 auto &condition = conditions[i];
381520 auto expr =
381521 make_uniq<BoundComparisonExpression>(condition.comparison, condition.left->Copy(), condition.right->Copy());
381522 conditions_info += expr->ToString();
381523 }
381524 if (predicate) {
381525 if (!conditions.empty()) {
381526 conditions_info += "\n";
381527 }
381528 conditions_info += predicate->ToString();
381529 }
381530 result["Conditions"] = conditions_info;
381531 SetParamsEstimatedCardinality(result);
381532
381533 return result;
381534}
vector< JoinCondition > conditions
The conditions of the join.
Definition duckdb.cpp:147232
unique_ptr< Expression > predicate
Filtering predicate from the ON clause with expressions that don't reference both sides.
Definition duckdb.cpp:147244
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Serialize()

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

Reimplemented from duckdb::LogicalOperator.

416597 {
416598 LogicalOperator::Serialize(serializer);
416599 serializer.WriteProperty<JoinType>(200, "join_type", join_type);
416600 serializer.WritePropertyWithDefault<idx_t>(201, "mark_index", mark_index);
416601 serializer.WritePropertyWithDefault<vector<idx_t>>(202, "left_projection_map", left_projection_map);
416602 serializer.WritePropertyWithDefault<vector<idx_t>>(203, "right_projection_map", right_projection_map);
416603 serializer.WritePropertyWithDefault<vector<JoinCondition>>(204, "conditions", conditions);
416604 serializer.WritePropertyWithDefault<vector<LogicalType>>(205, "mark_types", mark_types);
416605 serializer.WritePropertyWithDefault<vector<unique_ptr<Expression>>>(206, "duplicate_eliminated_columns", duplicate_eliminated_columns);
416606 serializer.WritePropertyWithDefault<bool>(207, "delim_flipped", delim_flipped, false);
416607 serializer.WritePropertyWithDefault<unique_ptr<Expression>>(208, "predicate", predicate);
416608}
vector< LogicalType > mark_types
Used for duplicate-eliminated MARK joins.
Definition duckdb.cpp:147234
vector< unique_ptr< Expression > > duplicate_eliminated_columns
The set of columns that will be duplicate eliminated from the LHS and pushed into the RHS.
Definition duckdb.cpp:147236
bool delim_flipped
If this is a DelimJoin, whether it has been flipped to de-duplicating the RHS instead.
Definition duckdb.cpp:147238
idx_t mark_index
Table index used to refer to the MARK column (in case of a MARK join).
Definition duckdb.cpp:147062
vector< idx_t > right_projection_map
The columns of the RHS that are output by the join.
Definition duckdb.cpp:147066
vector< idx_t > left_projection_map
The columns of the LHS that are output by the join.
Definition duckdb.cpp:147064

◆ Deserialize()

unique_ptr< LogicalOperator > duckdb::LogicalComparisonJoin::Deserialize ( Deserializer & deserializer)
static
416610 {
416611 auto join_type = deserializer.ReadProperty<JoinType>(200, "join_type");
416612 auto result = duckdb::unique_ptr<LogicalComparisonJoin>(new LogicalComparisonJoin(join_type, deserializer.Get<LogicalOperatorType>()));
416613 deserializer.ReadPropertyWithDefault<idx_t>(201, "mark_index", result->mark_index);
416614 deserializer.ReadPropertyWithDefault<vector<idx_t>>(202, "left_projection_map", result->left_projection_map);
416615 deserializer.ReadPropertyWithDefault<vector<idx_t>>(203, "right_projection_map", result->right_projection_map);
416616 deserializer.ReadPropertyWithDefault<vector<JoinCondition>>(204, "conditions", result->conditions);
416617 deserializer.ReadPropertyWithDefault<vector<LogicalType>>(205, "mark_types", result->mark_types);
416618 deserializer.ReadPropertyWithDefault<vector<unique_ptr<Expression>>>(206, "duplicate_eliminated_columns", result->duplicate_eliminated_columns);
416619 deserializer.ReadPropertyWithExplicitDefault<bool>(207, "delim_flipped", result->delim_flipped, false);
416620 deserializer.ReadPropertyWithDefault<unique_ptr<Expression>>(208, "predicate", result->predicate);
416621 return std::move(result);
416622}

◆ CreateJoin() [1/2]

unique_ptr< LogicalOperator > duckdb::LogicalComparisonJoin::CreateJoin ( ClientContext & context,
JoinType type,
JoinRefType ref_type,
unique_ptr< LogicalOperator > left_child,
unique_ptr< LogicalOperator > right_child,
unique_ptr< Expression > condition )
static
374262 {
374263 vector<JoinCondition> conditions;
374264 vector<unique_ptr<Expression>> arbitrary_expressions;
374265 LogicalComparisonJoin::ExtractJoinConditions(context, type, reftype, left_child, right_child, std::move(condition),
374266 conditions, arbitrary_expressions);
374267 return LogicalComparisonJoin::CreateJoin(type, reftype, std::move(left_child), std::move(right_child),
374268 std::move(conditions), std::move(arbitrary_expressions));
374269}
LogicalOperatorType type
The type of the logical operator.
Definition duckdb.hpp:21260

◆ CreateJoin() [2/2]

unique_ptr< LogicalOperator > duckdb::LogicalComparisonJoin::CreateJoin ( JoinType type,
JoinRefType ref_type,
unique_ptr< LogicalOperator > left_child,
unique_ptr< LogicalOperator > right_child,
vector< JoinCondition > conditions,
vector< unique_ptr< Expression > > arbitrary_expressions )
static

Create the join operator based on conditions and join type.

374112 {
374113 auto is_asof = (ref_type == JoinRefType::ASOF);
374114
374115 // validate ASOF join conditions
374116 if (is_asof) {
374117 switch (type) {
374118 case JoinType::RIGHT:
374119 case JoinType::OUTER:
374120 // We can't (yet) support arbitrary predicates with some ASOF joins
374121 if (!arbitrary_expressions.empty()) {
374122 throw NotImplementedException("Unsupported ASOF JOIN type (%s) with arbitrary predicate",
374123 EnumUtil::ToChars(type));
374124 }
374125 break;
374126 case JoinType::SEMI:
374127 case JoinType::ANTI:
374128 // For these join types, we can use a regular join because the RHS match is not important
374129 // But we will verify the requirements of an ASOF.
374130 is_asof = false;
374131 ref_type = JoinRefType::REGULAR;
374132 break;
374133 default:
374134 break;
374135 }
374136
374137 idx_t asof_idx = conditions.size();
374138 for (size_t c = 0; c < conditions.size(); ++c) {
374139 auto &cond = conditions[c];
374140 switch (cond.comparison) {
374141 case ExpressionType::COMPARE_EQUAL:
374142 case ExpressionType::COMPARE_NOT_DISTINCT_FROM:
374143 break;
374144 case ExpressionType::COMPARE_GREATERTHANOREQUALTO:
374145 case ExpressionType::COMPARE_GREATERTHAN:
374146 case ExpressionType::COMPARE_LESSTHANOREQUALTO:
374147 case ExpressionType::COMPARE_LESSTHAN:
374148 if (asof_idx < conditions.size()) {
374149 throw BinderException("Multiple ASOF JOIN inequalities");
374150 }
374151 asof_idx = c;
374152 break;
374153 default:
374154 throw BinderException("Invalid ASOF JOIN comparison");
374155 }
374156 }
374157 if (asof_idx >= conditions.size()) {
374158 throw BinderException("Missing ASOF JOIN inequality");
374159 }
374160 }
374161
374162 // what type of join to create now?
374163 // Case 1: ASOF join - use comparison join
374164 if (is_asof) {
374165 auto asof_join = make_uniq<LogicalComparisonJoin>(type, LogicalOperatorType::LOGICAL_ASOF_JOIN);
374166 asof_join->conditions = std::move(conditions);
374167 asof_join->children.push_back(std::move(left_child));
374168 asof_join->children.push_back(std::move(right_child));
374169
374170 if (!arbitrary_expressions.empty()) {
374171 asof_join->predicate = std::move(arbitrary_expressions[0]);
374172 for (idx_t i = 1; i < arbitrary_expressions.size(); i++) {
374173 asof_join->predicate = make_uniq<BoundConjunctionExpression>(ExpressionType::CONJUNCTION_AND,
374174 std::move(asof_join->predicate),
374175 std::move(arbitrary_expressions[i]));
374176 }
374177 }
374178
374179 return std::move(asof_join);
374180 }
374181
374182 // Case 2: No join conditions - use any join
374183 if (conditions.empty()) {
374184 if (arbitrary_expressions.empty()) {
374185 arbitrary_expressions.push_back(make_uniq<BoundConstantExpression>(Value::BOOLEAN(true)));
374186 }
374187
374188 auto any_join = make_uniq<LogicalAnyJoin>(type);
374189 any_join->children.push_back(std::move(left_child));
374190 any_join->children.push_back(std::move(right_child));
374191
374192 any_join->condition = std::move(arbitrary_expressions[0]);
374193 for (idx_t i = 1; i < arbitrary_expressions.size(); i++) {
374194 any_join->condition = make_uniq<BoundConjunctionExpression>(
374195 ExpressionType::CONJUNCTION_AND, std::move(any_join->condition), std::move(arbitrary_expressions[i]));
374196 }
374197
374198 return std::move(any_join);
374199 }
374200
374201 // Case 3: Has join conditions and arbitrary expressions - decide based on join type
374202 if (!arbitrary_expressions.empty()) {
374203 // for inner join create comparison join + filter on top
374204 if (type == JoinType::INNER) {
374205 auto comp_join = make_uniq<LogicalComparisonJoin>(type, LogicalOperatorType::LOGICAL_COMPARISON_JOIN);
374206 comp_join->conditions = std::move(conditions);
374207 comp_join->children.push_back(std::move(left_child));
374208 comp_join->children.push_back(std::move(right_child));
374209
374210 auto filter = make_uniq<LogicalFilter>();
374211 for (auto &expr : arbitrary_expressions) {
374212 filter->expressions.push_back(std::move(expr));
374213 }
374214 filter->children.push_back(std::move(comp_join));
374215
374216 return std::move(filter);
374217 } else {
374218 auto any_join = make_uniq<LogicalAnyJoin>(type);
374219 any_join->children.push_back(std::move(left_child));
374220 any_join->children.push_back(std::move(right_child));
374221
374222 any_join->condition = JoinCondition::CreateExpression(std::move(conditions[0]));
374223 for (idx_t i = 1; i < conditions.size(); i++) {
374224 any_join->condition = make_uniq<BoundConjunctionExpression>(
374225 ExpressionType::CONJUNCTION_AND, std::move(any_join->condition),
374227 }
374228
374229 for (auto &expr : arbitrary_expressions) {
374230 any_join->condition = make_uniq<BoundConjunctionExpression>(
374231 ExpressionType::CONJUNCTION_AND, std::move(any_join->condition), std::move(expr));
374232 }
374233
374234 return std::move(any_join);
374235 }
374236 }
374237
374238 // Case 4: Has join conditions but not arbitrary expressions - use comparison join
374239 auto comp_join = make_uniq<LogicalComparisonJoin>(type, LogicalOperatorType::LOGICAL_COMPARISON_JOIN);
374240 comp_join->conditions = std::move(conditions);
374241 comp_join->children.push_back(std::move(left_child));
374242 comp_join->children.push_back(std::move(right_child));
374243
374244 return std::move(comp_join);
374245}
static DUCKDB_API Value BOOLEAN(bool value)
Create a boolean Value from a specified value.
Definition duckdb.cpp:132118
void filter(InputArray image, InputArray kernel, OutputArray output)
static unique_ptr< Expression > CreateExpression(JoinCondition cond)
Turns the JoinCondition into an expression; note that this destroys the JoinCondition as the expressi...
Definition duckdb.cpp:380359
Here is the call graph for this function:

◆ ExtractJoinConditions() [1/3]

void duckdb::LogicalComparisonJoin::ExtractJoinConditions ( ClientContext & context,
JoinType type,
JoinRefType ref_type,
unique_ptr< LogicalOperator > & left_child,
unique_ptr< LogicalOperator > & right_child,
unique_ptr< Expression > condition,
vector< JoinCondition > & conditions,
vector< unique_ptr< Expression > > & arbitrary_expressions )
static
374098 {
374099 // split the expressions by the AND clause
374100 vector<unique_ptr<Expression>> expressions;
374101 expressions.push_back(std::move(condition));
374102 LogicalFilter::SplitPredicates(expressions);
374103 return ExtractJoinConditions(context, type, ref_type, left_child, right_child, expressions, conditions,
374104 arbitrary_expressions);
374105}
vector< unique_ptr< Expression > > expressions
The set of expressions contained within the operator, if any.
Definition duckdb.hpp:21264

◆ ExtractJoinConditions() [2/3]

void duckdb::LogicalComparisonJoin::ExtractJoinConditions ( ClientContext & context,
JoinType type,
JoinRefType ref_type,
unique_ptr< LogicalOperator > & left_child,
unique_ptr< LogicalOperator > & right_child,
vector< unique_ptr< Expression > > & expressions,
vector< JoinCondition > & conditions,
vector< unique_ptr< Expression > > & arbitrary_expressions )
static
374086 {
374087 unordered_set<idx_t> left_bindings, right_bindings;
374088 LogicalJoin::GetTableReferences(*left_child, left_bindings);
374089 LogicalJoin::GetTableReferences(*right_child, right_bindings);
374090 return ExtractJoinConditions(context, type, ref_type, left_child, right_child, left_bindings, right_bindings,
374091 expressions, conditions, arbitrary_expressions);
374092}
static void GetTableReferences(LogicalOperator &op, unordered_set< idx_t > &bindings)
Gets the set of table references that are reachable from this node.
Definition duckdb.cpp:382702

◆ ExtractJoinConditions() [3/3]

void duckdb::LogicalComparisonJoin::ExtractJoinConditions ( ClientContext & context,
JoinType type,
JoinRefType ref_type,
unique_ptr< LogicalOperator > & left_child,
unique_ptr< LogicalOperator > & right_child,
const unordered_set< idx_t > & left_bindings,
const unordered_set< idx_t > & right_bindings,
vector< unique_ptr< Expression > > & expressions,
vector< JoinCondition > & conditions,
vector< unique_ptr< Expression > > & arbitrary_expressions )
static

Extract join conditions, pushing single-side filters to children when it's safe.

374052 {
374053 for (auto &expr : expressions) {
374054 auto side = JoinSide::GetJoinSide(*expr, left_bindings, right_bindings);
374055
374056 if (side == JoinSide::NONE) {
374057 if (CanEliminate(context, type, expr)) {
374058 continue;
374059 }
374060 } else if (side == JoinSide::LEFT) {
374061 if (CanPushToLeftChild(type)) {
374062 PushFilterToChild(left_child, expr);
374063 continue;
374064 }
374065 } else if (side == JoinSide::RIGHT) {
374066 if (CanPushToRightChild(type)) {
374067 PushFilterToChild(right_child, expr);
374068 continue;
374069 }
374070 } else if (side == JoinSide::BOTH) {
374071 if (IsComparisonExpression(*expr) && IsJoinTypeCondition(ref_type, expr->GetExpressionType()) &&
374072 CreateJoinCondition(*expr, left_bindings, right_bindings, conditions)) {
374073 continue;
374074 }
374075 }
374076
374077 arbitrary_expressions.push_back(std::move(expr));
374078 }
374079}
static void PushFilterToChild(unique_ptr< LogicalOperator > &child, unique_ptr< Expression > &expr)
Push a filter expression to a child operator.
Definition duckdb.cpp:373939
static bool IsJoinTypeCondition(const JoinRefType ref_type, const ExpressionType expr_type)
Only use conditions that are valid for the join ref type.
Definition duckdb.cpp:373985
static bool CanPushToLeftChild(JoinType type)
Definition duckdb.cpp:373904
static bool IsComparisonExpression(const Expression &expr)
Check an expression is a usable comparison expression.
Definition duckdb.cpp:374005
static bool CreateJoinCondition(Expression &expr, const unordered_set< idx_t > &left_bindings, const unordered_set< idx_t > &right_bindings, vector< JoinCondition > &conditions)
Create a JoinCondition from a comparison.
Definition duckdb.cpp:374022
static bool CanPushToRightChild(JoinType type)
Definition duckdb.cpp:373923
static bool CanEliminate(ClientContext &context, JoinType type, unique_ptr< Expression > &expr)
Check if a foldable expression evaluates to TRUE and can be eliminated.
Definition duckdb.cpp:373951
Here is the call graph for this function:

◆ HasEquality()

bool duckdb::LogicalComparisonJoin::HasEquality ( idx_t & range_count) const
381536 {
381537 bool result = false;
381538 for (size_t c = 0; c < conditions.size(); ++c) {
381539 auto &cond = conditions[c];
381540 switch (cond.comparison) {
381541 case ExpressionType::COMPARE_EQUAL:
381542 case ExpressionType::COMPARE_NOT_DISTINCT_FROM:
381543 result = true;
381544 break;
381545 case ExpressionType::COMPARE_LESSTHAN:
381546 case ExpressionType::COMPARE_GREATERTHAN:
381547 case ExpressionType::COMPARE_LESSTHANOREQUALTO:
381548 case ExpressionType::COMPARE_GREATERTHANOREQUALTO:
381549 ++range_count;
381550 break;
381551 case ExpressionType::COMPARE_NOTEQUAL:
381552 case ExpressionType::COMPARE_DISTINCT_FROM:
381553 break;
381554 default:
381555 throw NotImplementedException("Unimplemented comparison join");
381556 }
381557 }
381558 return result;
381559}

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