Skip to content

Commit 00aac26

Browse files
committed
Apply comments
1 parent a4d26b3 commit 00aac26

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/collect.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ abstract class Collect extends ImperativeAggregate {
4545

4646
override def inputTypes: Seq[AbstractDataType] = Seq(AnyDataType)
4747

48-
override def supportsPartial: Boolean = false
48+
override def forceSortAggregate: Boolean = true
4949

5050
override def aggBufferAttributes: Seq[AttributeReference] = Nil
5151

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/interfaces.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ sealed abstract class AggregateFunction extends Expression with ImplicitCastInpu
175175

176176
/**
177177
* Indicates if this function needs to aggregate values group-by-group in a single step.
178-
* If false, we must always use a `SortAggregateExec` operator without partial aggregates.
178+
* If true, we must always use a `SortAggregateExec` operator without partial aggregates.
179179
*/
180-
def supportsPartial: Boolean = true
180+
def forceSortAggregate: Boolean = false
181181

182182
/**
183183
* Result of the aggregate function when the input is empty. This is currently only used for the

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ abstract class AggregateWindowFunction extends DeclarativeAggregate with WindowF
431431
override val frame = SpecifiedWindowFrame(RowFrame, UnboundedPreceding, CurrentRow)
432432
override def dataType: DataType = IntegerType
433433
override def nullable: Boolean = true
434-
override def supportsPartial: Boolean = false
434+
override def forceSortAggregate: Boolean = true
435435
override lazy val mergeExpressions =
436436
throw new UnsupportedOperationException("Window Functions do not support merging.")
437437
}

sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
261261
}
262262

263263
val aggregateOperator =
264-
if (aggregateExpressions.map(_.aggregateFunction).exists(!_.supportsPartial)) {
264+
if (aggregateExpressions.map(_.aggregateFunction).exists(_.forceSortAggregate)) {
265265
if (functionsWithDistinct.nonEmpty) {
266266
sys.error("Distinct columns cannot exist in Aggregate operator containing " +
267267
"aggregate functions which don't support partial aggregation.")

sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ private[hive] case class HiveUDAFFunction(
336336

337337
override def nullable: Boolean = true
338338

339-
override def supportsPartial: Boolean = false
339+
override def forceSortAggregate: Boolean = true
340340

341341
override lazy val dataType: DataType = inspectorToDataType(returnInspector)
342342

0 commit comments

Comments
 (0)