Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
check aggregate mode for first func in build check (#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackylee-ch authored Jan 6, 2023
1 parent bf76ad8 commit d318eff
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,22 @@ case class ColumnarHashAggregateExec(
s"${other} is not supported in Columnar StddevSamp")
}
case first @ First(_, _) =>
// Spark will use sort agg for string type input, see AggUtils.scala.
// So it will fallback to row-based operator for such case.
val supportedTypes = List(ByteType, ShortType, IntegerType, LongType,
FloatType, DoubleType, DateType, BooleanType, StringType)
val aggBufferAttr = first.inputAggBufferAttributes
val attr = ConverterUtils.getAttrFromExpr(aggBufferAttr.head)
// Currently, decimal is not supported.
if (supportedTypes.indexOf(attr.dataType) == -1) {
throw new UnsupportedOperationException(s"${attr.dataType} is NOT" +
s" supported in Columnar First!")
mode match {
case Partial | Final =>
// Spark will use sort agg for string type input, see AggUtils.scala.
// So it will fallback to row-based operator for such case.
val supportedTypes = List(ByteType, ShortType, IntegerType, LongType,
FloatType, DoubleType, DateType, BooleanType, StringType)
val aggBufferAttr = first.inputAggBufferAttributes
val attr = ConverterUtils.getAttrFromExpr(aggBufferAttr.head)
// Currently, decimal is not supported.
if (supportedTypes.indexOf(attr.dataType) == -1) {
throw new UnsupportedOperationException(s"${attr.dataType} is NOT" +
s" supported in Columnar First!")
}
case other =>
throw new UnsupportedOperationException(s"${other} is NOT supported" +
" for First agg func.")
}
case other =>
throw new UnsupportedOperationException(
Expand Down

0 comments on commit d318eff

Please sign in to comment.