| 692 | } |
| 693 | |
| 694 | unique_ptr<BoundAggregateExpression> FunctionBinder::BindAggregateFunction(AggregateFunction bound_function, |
| 695 | vector<unique_ptr<Expression>> children, |
| 696 | unique_ptr<Expression> filter, |
| 697 | AggregateType aggr_type) { |
| 698 | ResolveTemplateTypes(bound_function, children); |
| 699 | |
| 700 | unique_ptr<FunctionData> bind_info; |
| 701 | if (bound_function.HasBindCallback()) { |
| 702 | bind_info = bound_function.GetBindCallback()(context, bound_function, children); |
| 703 | // we may have lost some arguments in the bind |
| 704 | children.resize(MinValue(bound_function.arguments.size(), children.size())); |
| 705 | } |
| 706 | |
| 707 | CheckTemplateTypesResolved(bound_function); |
| 708 | |
| 709 | // check if we need to add casts to the children |
| 710 | CastToFunctionArguments(bound_function, children); |
| 711 | |
| 712 | return make_uniq<BoundAggregateExpression>(std::move(bound_function), std::move(children), std::move(filter), |
| 713 | std::move(bind_info), aggr_type); |
| 714 | } |
| 715 | |
| 716 | } // namespace duckdb |
no test coverage detected