1#include "duckdb/planner/expression_binder/aggregate_binder.hpp"
2
3#include "duckdb/planner/binder.hpp"
4
5namespace duckdb {
6
7AggregateBinder::AggregateBinder(Binder &binder, ClientContext &context) : ExpressionBinder(binder, context, true) {
8}
9
10BindResult AggregateBinder::BindExpression(unique_ptr<ParsedExpression> &expr_ptr, idx_t depth, bool root_expression) {
11 auto &expr = *expr_ptr;
12 switch (expr.expression_class) {
13 case ExpressionClass::WINDOW:
14 throw ParserException("aggregate function calls cannot contain window function calls");
15 default:
16 return ExpressionBinder::BindExpression(expr_ptr, depth);
17 }
18}
19
20string AggregateBinder::UnsupportedAggregateMessage() {
21 return "aggregate function calls cannot be nested";
22}
23} // namespace duckdb
24