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

[NSE-1120] Support sum window function with order by statement #1122

Merged
merged 11 commits into from
Oct 17, 2022
Prev Previous commit
Next Next commit
Fall back for decimal type
PHILO-HE committed Oct 13, 2022
commit dca06c7cb5bf075038720582fe9b7bcd0ceec2c4
Original file line number Diff line number Diff line change
@@ -185,6 +185,10 @@ case class ColumnarWindowExec(windowExpression: Seq[NamedExpression],
} else {
// Only default frame is used in order by case.
checkSortFunctionFrame(expr.windowSpec)
// TODO: support decimal type.
if (expr.windowFunction.dataType.isInstanceOf[DecimalType]) {
throw new UnsupportedOperationException("Decimal type is not supported!")
}
val desc: Option[Boolean] = orderSpec.foldLeft[Option[Boolean]](None) {
(desc, s) =>
val currentDesc = s.direction match {
Original file line number Diff line number Diff line change
@@ -866,7 +866,7 @@ arrow::Status WindowSumKernel::Finish(ArrayList* out) {
PROC(arrow::UInt64Type, arrow::UInt64Array, arrow::Int64Type, arrow::Int64Builder, arrow::Int64Array) \
PROC(arrow::Int64Type, arrow::Int64Array, arrow::Int64Type, arrow::Int64Builder, arrow::Int64Array) \
PROC(arrow::FloatType, arrow::FloatArray, arrow::DoubleType, arrow::DoubleBuilder, arrow::DoubleArray) \
PROC(arrow::DoubleType, arrow::DoubleArray, arrow::DoubleType, arrow::DoubleBuilder, arrow::DoubleArray)\
PROC(arrow::DoubleType, arrow::DoubleArray, arrow::DoubleType, arrow::DoubleBuilder, arrow::DoubleArray)

// For sum, result type can be different from input type. Should NOT be return_type_.
// Only one element in type_list_, i.e., one col input.