dongjoon-hyun commented on a change in pull request #30455:
URL: https://github.com/apache/spark/pull/30455#discussion_r529081950



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala
##########
@@ -120,7 +120,7 @@ class GenericArrayData(val array: Array[Any]) extends 
ArrayData {
             if (!o2.isInstanceOf[Double] || ! 
java.lang.Double.isNaN(o2.asInstanceOf[Double])) {
               return false
             }
-          case _ => if (!o1.equals(o2)) {
+          case _ => if (o1.getClass != o2.getClass || o1 != o2) {

Review comment:
       Yes. We cannot use `equals` and we cannot use `!=` here due to the 
following.
   ```scala
   scala> Float.NaN == Float.NaN
   val res2: Boolean = false
   
   scala> Float.NaN.equals(Float.NaN)
   val res3: Boolean = true
   ```




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

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