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

[NSE-1202]Check aggregate mode for first func in build check #1203

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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