1#include "duckdb/planner/expression_binder/relation_binder.hpp"
2
3using namespace std;
4
5namespace duckdb {
6
7RelationBinder::RelationBinder(Binder &binder, ClientContext &context, string op)
8 : ExpressionBinder(binder, context), op(move(op)) {
9}
10
11BindResult RelationBinder::BindExpression(ParsedExpression &expr, idx_t depth, bool root_expression) {
12 switch (expr.expression_class) {
13 case ExpressionClass::AGGREGATE:
14 return BindResult("aggregate functions are not allowed in " + op);
15 case ExpressionClass::DEFAULT:
16 return BindResult(op + " cannot contain DEFAULT clause");
17 case ExpressionClass::SUBQUERY:
18 return BindResult("subqueries are not allowed in " + op);
19 case ExpressionClass::WINDOW:
20 return BindResult("window functions are not allowed in " + op);
21 default:
22 return ExpressionBinder::BindExpression(expr, depth);
23 }
24}
25
26string RelationBinder::UnsupportedAggregateMessage() {
27 return "aggregate functions are not allowed in " + op;
28}
29
30} // namespace duckdb
31