1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/planner/expression/bound_function_expression.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/function/scalar_function.hpp" |
12 | #include "duckdb/planner/expression.hpp" |
13 | |
14 | namespace duckdb { |
15 | class ScalarFunctionCatalogEntry; |
16 | |
17 | //! Represents a function call that has been bound to a base function |
18 | class BoundFunctionExpression : public Expression { |
19 | public: |
20 | static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_FUNCTION; |
21 | |
22 | public: |
23 | BoundFunctionExpression(LogicalType return_type, ScalarFunction bound_function, |
24 | vector<unique_ptr<Expression>> arguments, unique_ptr<FunctionData> bind_info, |
25 | bool is_operator = false); |
26 | |
27 | //! The bound function expression |
28 | ScalarFunction function; |
29 | //! List of child-expressions of the function |
30 | vector<unique_ptr<Expression>> children; |
31 | //! The bound function data (if any) |
32 | unique_ptr<FunctionData> bind_info; |
33 | //! Whether or not the function is an operator, only used for rendering |
34 | bool is_operator; |
35 | |
36 | public: |
37 | bool HasSideEffects() const override; |
38 | bool IsFoldable() const override; |
39 | string ToString() const override; |
40 | bool PropagatesNullValues() const override; |
41 | hash_t Hash() const override; |
42 | bool Equals(const BaseExpression &other) const override; |
43 | |
44 | unique_ptr<Expression> Copy() override; |
45 | void Verify() const override; |
46 | |
47 | void Serialize(FieldWriter &writer) const override; |
48 | static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader); |
49 | }; |
50 | } // namespace duckdb |
51 |