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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala
##########
@@ -316,6 +316,8 @@ case class Literal (value: Any, dataType: DataType) extends 
LeafExpression {
       (value, o.value) match {
         case (null, null) => true
         case (a: Array[Byte], b: Array[Byte]) => util.Arrays.equals(a, b)
+        case (a: ArrayBasedMapData, b: ArrayBasedMapData) =>
+          a.keyArray == b.keyArray && a.valueArray == b.valueArray

Review comment:
       I also considered that way first, but I didn't do that because of this.
   ```scala
   /**
    * This is an internal data representation for map type in Spark SQL. This 
should not implement
    * `equals` and `hashCode` because the type cannot be used as join keys, 
grouping keys, or
    * in equality tests. See SPARK-9415 and PR#13847 for the discussions.
    */
   abstract class MapData extends Serializable
   ```
   




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