Skip to content

Commit

Permalink
fix decimal avg final agg output (apache#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 authored and JkSelf committed Mar 22, 2023
1 parent 52a1bf0 commit f839722
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,11 @@ case class GlutenHashAggregateExecTransformer(
getIntermediateTypeNode(aggregateFunction))
aggregateNodeList.add(partialNode)
case Final =>
val dataType = aggregateFunction match {
case avg: Average =>
GlutenDecimalUtil.getAvgSumDataType(avg)
case _ =>
aggregateFunction.dataType
}
val aggFunctionNode = ExpressionBuilder.makeAggregateFunction(
AggregateFunctionsBuilder.create(args, aggregateFunction),
childrenNodeList,
modeToKeyWord(aggregateMode),
ConverterUtils.getTypeNode(dataType, aggregateFunction.nullable))
ConverterUtils.getTypeNode(aggregateFunction.dataType, aggregateFunction.nullable))
aggregateNodeList.add(aggFunctionNode)
case other =>
throw new UnsupportedOperationException(s"$other is not supported.")
Expand Down

0 comments on commit f839722

Please sign in to comment.