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
14namespace duckdb {
15class ScalarFunctionCatalogEntry;
16
17//! Represents a function call that has been bound to a base function
18class BoundFunctionExpression : public Expression {
19public:
20 static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_FUNCTION;
21
22public:
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
36public:
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