| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/planner/tableref/bound_joinref.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/planner/binder.hpp" |
| 12 | #include "duckdb/common/enums/join_type.hpp" |
| 13 | #include "duckdb/common/enums/joinref_type.hpp" |
| 14 | #include "duckdb/planner/bound_tableref.hpp" |
| 15 | #include "duckdb/planner/expression.hpp" |
| 16 | |
| 17 | namespace duckdb { |
| 18 | |
| 19 | //! Represents a join |
| 20 | class BoundJoinRef : public BoundTableRef { |
| 21 | public: |
| 22 | static constexpr const TableReferenceType TYPE = TableReferenceType::JOIN; |
| 23 | |
| 24 | public: |
| 25 | explicit BoundJoinRef(JoinRefType ref_type) |
| 26 | : BoundTableRef(TableReferenceType::JOIN), type(JoinType::INNER), ref_type(ref_type), lateral(false) { |
| 27 | } |
| 28 | |
| 29 | //! The binder used to bind the LHS of the join |
| 30 | shared_ptr<Binder> left_binder; |
| 31 | //! The binder used to bind the RHS of the join |
| 32 | shared_ptr<Binder> right_binder; |
| 33 | //! The left hand side of the join |
| 34 | unique_ptr<BoundTableRef> left; |
| 35 | //! The right hand side of the join |
| 36 | unique_ptr<BoundTableRef> right; |
| 37 | //! The join condition |
| 38 | unique_ptr<Expression> condition; |
| 39 | //! The join type |
| 40 | JoinType type; |
| 41 | //! Join condition type |
| 42 | JoinRefType ref_type; |
| 43 | //! Whether or not this is a lateral join |
| 44 | bool lateral; |
| 45 | //! The correlated columns of the right-side with the left-side |
| 46 | vector<CorrelatedColumnInfo> correlated_columns; |
| 47 | }; |
| 48 | } // namespace duckdb |
| 49 |