1 | #include "duckdb/parser/expression/positional_reference_expression.hpp" |
---|---|
2 | #include "duckdb/planner/expression_binder.hpp" |
3 | #include "duckdb/planner/binder.hpp" |
4 | |
5 | namespace duckdb { |
6 | |
7 | BindResult ExpressionBinder::BindPositionalReference(unique_ptr<ParsedExpression> &expr, idx_t depth, |
8 | bool root_expression) { |
9 | auto &ref = expr->Cast<PositionalReferenceExpression>(); |
10 | if (depth != 0) { |
11 | throw InternalException("Positional reference expression could not be bound"); |
12 | } |
13 | // replace the positional reference with a column |
14 | auto column = binder.bind_context.PositionToColumn(ref); |
15 | expr = std::move(column); |
16 | return BindExpression(expr_ptr&: expr, depth, root_expression); |
17 | } |
18 | |
19 | } // namespace duckdb |
20 |