jiwen624 commented on code in PR #58234:
URL: https://github.com/apache/spark/pull/58234#discussion_r4075856417


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/PivotFirst.scala:
##########
@@ -87,13 +87,25 @@ case class PivotFirst(
 
   override val dataType: DataType = ArrayType(valueDataType)
 
-  private val usesTreeMap: Boolean = 
!TypeUtils.typeWithProperEquals(pivotColumn.dataType)
+  private val usesOrderingBasedIndex: Boolean = pivotColumn.dataType match {
+    case FloatType | DoubleType => true

Review Comment:
   Good catch, thanks! Changed it in 
[5657bf5](https://github.com/apache/spark/pull/58234/changes/b8476f30a7025a7ea25daf79e6059e0143121e26):
 The `float/double` go back to the HashMap and use normalized bits as keys like 
`CollectSet` does, so NaN and -0.0 still match and lookups stay O(1). The 
TreeMap is now only used for types without proper equals.



-- 
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]

Reply via email to