mirror of https://github.com/citusdata/citus.git
Fix regression in distributing sum aggregation
parent
04b5dc39bc
commit
79fde86d6c
|
@ -1934,6 +1934,21 @@ MasterAggregateExpression(Aggref *originalAggregate,
|
||||||
newMasterAggregate->aggdistinct = NULL;
|
newMasterAggregate->aggdistinct = NULL;
|
||||||
newMasterAggregate->aggfilter = NULL;
|
newMasterAggregate->aggfilter = NULL;
|
||||||
|
|
||||||
|
if (aggregateType != AGGREGATE_CUSTOM_COMMUTE)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Aggregates like sum may require passing to different signatures.
|
||||||
|
* eg sum(bigint) returns numeric, so we need to use sum(numeric) on coordinator.
|
||||||
|
*/
|
||||||
|
const char *aggregateName = AggregateNames[aggregateType];
|
||||||
|
Oid aggregateFunctionId = AggregateFunctionOid(aggregateName,
|
||||||
|
workerReturnType);
|
||||||
|
Oid masterReturnType = get_func_rettype(aggregateFunctionId);
|
||||||
|
|
||||||
|
newMasterAggregate->aggfnoid = aggregateFunctionId;
|
||||||
|
newMasterAggregate->aggtype = masterReturnType;
|
||||||
|
}
|
||||||
|
|
||||||
column = makeVar(masterTableId, walkerContext->columnId, workerReturnType,
|
column = makeVar(masterTableId, walkerContext->columnId, workerReturnType,
|
||||||
workerReturnTypeMod, workerCollationId, columnLevelsUp);
|
workerReturnTypeMod, workerCollationId, columnLevelsUp);
|
||||||
walkerContext->columnId++;
|
walkerContext->columnId++;
|
||||||
|
|
Loading…
Reference in New Issue