1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/optimizer/rule/like_optimizations.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/optimizer/rule.hpp" |
12 | #include "duckdb/function/scalar/string_functions.hpp" |
13 | |
14 | namespace duckdb { |
15 | |
16 | // The Like Optimization rule rewrites LIKE to optimized scalar functions (e.g.: prefix, suffix, and contains) |
17 | class LikeOptimizationRule : public Rule { |
18 | public: |
19 | LikeOptimizationRule(ExpressionRewriter &rewriter); |
20 | |
21 | unique_ptr<Expression> Apply(LogicalOperator &op, vector<Expression *> &bindings, bool &changes_made) override; |
22 | |
23 | unique_ptr<Expression> ApplyRule(BoundFunctionExpression *expr, ScalarFunction function, string pattern); |
24 | }; |
25 | |
26 | } // namespace duckdb |
27 |