| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/execution/column_binding_resolver.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/planner/logical_operator_visitor.hpp" |
| 12 | #include "duckdb/planner/column_binding_map.hpp" |
| 13 | #include "duckdb/common/vector.hpp" |
| 14 | |
| 15 | namespace duckdb { |
| 16 | |
| 17 | //! The ColumnBindingResolver resolves ColumnBindings into base tables |
| 18 | //! (table_index, column_index) into physical indices into the DataChunks that |
| 19 | //! are used within the execution engine |
| 20 | class ColumnBindingResolver : public LogicalOperatorVisitor { |
| 21 | public: |
| 22 | ColumnBindingResolver(); |
| 23 | |
| 24 | void VisitOperator(LogicalOperator &op) override; |
| 25 | static void Verify(LogicalOperator &op); |
| 26 | |
| 27 | protected: |
| 28 | vector<ColumnBinding> bindings; |
| 29 | |
| 30 | unique_ptr<Expression> VisitReplace(BoundColumnRefExpression &expr, unique_ptr<Expression> *expr_ptr) override; |
| 31 | static unordered_set<idx_t> VerifyInternal(LogicalOperator &op); |
| 32 | }; |
| 33 | } // namespace duckdb |
| 34 |