diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala index f3eeaa96b3d46..7a4f04bf04f7a 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala @@ -137,21 +137,20 @@ case class Mode( if (buffer.isEmpty) { return null } - /* - * The Mode class uses special collation awareness logic - * to handle string data types with various collations. - * - * For string types that don't support binary equality, - * we create a new map where the keys are the collation keys of the original strings. - * - * Keys from the original map are aggregated based on the corresponding collation keys. - * The groupMapReduce method groups the entries by collation key and maps each group - * to a single value (the sum of the counts), and finally reduces the groups to a single map. - * - * The new map is then used in the rest of the Mode evaluation logic. - * - * It is expected to work for all simple and complex types with collated fields. - */ + + // The Mode class uses special collation awareness logic + // to handle string data types with various collations. + // + // For string types that don't support binary equality, + // we create a new map where the keys are the collation keys of the original strings. + // + // Keys from the original map are aggregated based on the corresponding collation keys. + // The groupMapReduce method groups the entries by collation key and maps each group + // to a single value (the sum of the counts), and finally reduces the groups to a single map. + // + // The new map is then used in the rest of the Mode evaluation logic. + // + // It is expected to work for all simple and complex types with collated fields. val collationAwareBuffer = getCollationAwareBuffer(child.dataType, buffer) reverseOpt.map { reverse => diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/SupportsOrderingWithinGroup.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/SupportsOrderingWithinGroup.scala index 453251ac61cde..cb4555d4b902f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/SupportsOrderingWithinGroup.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/SupportsOrderingWithinGroup.scala @@ -39,7 +39,7 @@ trait SupportsOrderingWithinGroup { self: AggregateFunction => * Tells Analyzer that DISTINCT is supported. * The DISTINCT can conflict with order so some functions can ban it. * - * @see [[QueryCompilationErrors.functionMissingWithinGroupError]] + * @see [[QueryCompilationErrors.distinctWithOrderingFunctionUnsupportedError]] */ def isDistinctSupported: Boolean }