1#include "duckdb/planner/expression_binder/index_binder.hpp"
2
3using namespace duckdb;
4using namespace std;
5
6IndexBinder::IndexBinder(Binder &binder, ClientContext &context) : ExpressionBinder(binder, context) {
7}
8
9BindResult IndexBinder::BindExpression(ParsedExpression &expr, idx_t depth, bool root_expression) {
10 switch (expr.expression_class) {
11 case ExpressionClass::WINDOW:
12 return BindResult("window functions are not allowed in index expressions");
13 case ExpressionClass::SUBQUERY:
14 return BindResult("cannot use subquery in index expressions");
15 default:
16 return ExpressionBinder::BindExpression(expr, depth);
17 }
18}
19
20string IndexBinder::UnsupportedAggregateMessage() {
21 return "aggregate functions are not allowed in index expressions";
22}
23