Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ExportAggregateFunction Struct Reference

Static Public Member Functions

static unique_ptr< BoundAggregateExpression > Bind (unique_ptr< BoundAggregateExpression > child_aggregate)

Member Function Documentation

◆ Bind()

unique_ptr< BoundAggregateExpression > duckdb::ExportAggregateFunction::Bind ( unique_ptr< BoundAggregateExpression > child_aggregate)
static
237289 {
237290 auto &bound_function = child_aggregate->function;
237291 if (!bound_function.HasStateCombineCallback()) {
237292 throw BinderException("Cannot use EXPORT_STATE for non-combinable function %s", bound_function.name);
237293 }
237294 if (bound_function.HasBindCallback()) {
237295 throw BinderException("Cannot use EXPORT_STATE on aggregate functions with custom binders");
237296 }
237297 if (bound_function.HasStateDestructorCallback()) {
237298 throw BinderException("Cannot use EXPORT_STATE on aggregate functions with custom destructors");
237299 }
237300 // this should be required
237301 D_ASSERT(bound_function.HasStateSizeCallback());
237302 D_ASSERT(bound_function.HasStateFinalizeCallback());
237303
237304 D_ASSERT(child_aggregate->function.GetReturnType().id() != LogicalTypeId::INVALID);
237305#ifdef DEBUG
237306 for (auto &arg_type : child_aggregate->function.arguments) {
237307 D_ASSERT(arg_type.id() != LogicalTypeId::INVALID);
237308 }
237309#endif
237310 auto export_bind_data = make_uniq<ExportAggregateFunctionBindData>(child_aggregate->Copy());
237311 aggregate_state_t state_type(child_aggregate->function.name, child_aggregate->function.GetReturnType(),
237312 child_aggregate->function.arguments);
237313 auto return_type = LogicalType::AGGREGATE_STATE(std::move(state_type));
237314
237315 auto export_function =
237316 AggregateFunction("aggregate_state_export_" + bound_function.name, bound_function.arguments, return_type,
237317 bound_function.GetStateSizeCallback(), bound_function.GetStateInitCallback(),
237318 bound_function.GetStateUpdateCallback(), bound_function.GetStateCombineCallback(),
237319 ExportAggregateFinalize, bound_function.GetStateSimpleUpdateCallback(),
237320 /* can't bind this again */ nullptr, /* no dynamic state yet */ nullptr,
237321 /* can't propagate statistics */ nullptr, nullptr);
237322 export_function.SetNullHandling(FunctionNullHandling::SPECIAL_HANDLING);
237323 export_function.SetSerializeCallback(ExportStateAggregateSerialize);
237324 export_function.SetDeserializeCallback(ExportStateAggregateDeserialize);
237325
237326 return make_uniq<BoundAggregateExpression>(export_function, std::move(child_aggregate->children),
237327 std::move(child_aggregate->filter), std::move(export_bind_data),
237328 child_aggregate->aggr_type);
237329}

The documentation for this struct was generated from the following file: