1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/optimizer/in_clause_rewriter.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/planner/logical_operator_visitor.hpp" |
12 | |
13 | namespace duckdb { |
14 | class ClientContext; |
15 | class Optimizer; |
16 | |
17 | class InClauseRewriter : public LogicalOperatorVisitor { |
18 | public: |
19 | explicit InClauseRewriter(ClientContext &context, Optimizer &optimizer) : context(context), optimizer(optimizer) { |
20 | } |
21 | |
22 | ClientContext &context; |
23 | Optimizer &optimizer; |
24 | unique_ptr<LogicalOperator> root; |
25 | |
26 | public: |
27 | unique_ptr<LogicalOperator> Rewrite(unique_ptr<LogicalOperator> op); |
28 | |
29 | unique_ptr<Expression> VisitReplace(BoundOperatorExpression &expr, unique_ptr<Expression> *expr_ptr) override; |
30 | }; |
31 | |
32 | } // namespace duckdb |
33 |