162682 {
162683 lock_guard<mutex> glock(lock);
162684 for (
idx_t aggr_idx = 0; aggr_idx <
state.aggregate_expressions.size(); aggr_idx++) {
162685 auto &aggregate =
state.aggregate_expressions[aggr_idx]->Cast<BoundAggregateExpression>();
162686
162687 if (aggregate.IsDistinct()) {
162688 continue;
162689 }
162690
162691 Vector source_state(
Value::POINTER(CastPointerToValue(other.state.aggregate_data[aggr_idx].get())));
162692 Vector dest_state(
Value::POINTER(CastPointerToValue(
state.aggregate_data[aggr_idx].get())));
162693
162694 AggregateInputData aggr_input_data(aggregate.bind_info.get(),
allocator,
162695 AggregateCombineType::ALLOW_DESTRUCTIVE);
162696 if (!aggregate.function.HasStateCombineCallback()) {
162697 throw InternalException("Aggregate function " + aggregate.function.name +
162698 " does not support combining of states");
162699 }
162700 aggregate.function.GetStateCombineCallback()(source_state, dest_state, aggr_input_data, 1);
162701#ifdef DEBUG
162702 state.counts[aggr_idx] += other.state.counts[aggr_idx];
162703#endif
162704 }
162705}
static DUCKDB_API Value POINTER(uintptr_t value)
Create a pointer Value from a specified value.
Definition duckdb.cpp:132331
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237