Skip to content

Commit

Permalink
[VL] fix: use bool for isEmpty in decimal sum (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Apr 13, 2023
1 parent 3d141dd commit 04132e0
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ case class GlutenHashAggregateExecTransformer(
// Select sum from Velox Struct.
expressionNodes.add(ExpressionBuilder.makeSelection(colIdx, 0))
// Select isEmpty from Velox Struct.
expressionNodes.add(ExpressionBuilder
.makeCast(ConverterUtils.getTypeNode(BooleanType, nullable = true),
ExpressionBuilder.makeSelection(colIdx, 1), SQLConf.get.ansiEnabled))
expressionNodes.add(ExpressionBuilder.makeSelection(colIdx, 1))
colIdx += 1
case _: Corr =>
// Select count from Velox struct with count casted from LongType into DoubleType.
Expand Down Expand Up @@ -202,7 +200,7 @@ case class GlutenHashAggregateExecTransformer(
structTypeNodes.add(ConverterUtils.getTypeNode(DoubleType, nullable = true))
case sum: Sum if sum.dataType.isInstanceOf[DecimalType] =>
structTypeNodes.add(ConverterUtils.getTypeNode(sum.dataType, nullable = true))
structTypeNodes.add(ConverterUtils.getTypeNode(IntegerType, nullable = false))
structTypeNodes.add(ConverterUtils.getTypeNode(BooleanType, nullable = false))
case other =>
throw new UnsupportedOperationException(s"$other is not supported.")
}
Expand Down

0 comments on commit 04132e0

Please sign in to comment.