dongjoon-hyun commented on code in PR #59567:
URL: https://github.com/apache/spark/pull/59567#discussion_r4314657363
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Mode.scala:
##########
@@ -195,7 +195,10 @@ case class Mode(
// 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.
+ //
+ // Unwrap binary keys (see `toBufferKey`) before they are ordered or
returned.
val collationAwareBuffer = getCollationAwareBuffer(child.dataType, buffer)
Review Comment:
Thank you, @peter-toth. I reproduced it at the head and applied your
suggestion. I also added a test to `CollationAggregationSuite` and updated the
PR description.
##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala:
##########
@@ -1321,6 +1321,40 @@ class DataFrameAggregateSuite extends SharedSparkSession
Row(Row(Double.NaN)))
}
+ test("SPARK-XXXXX: mode compares binary values by content") {
Review Comment:
Thank you. Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]