dbatomic commented on code in PR #45693:
URL: https://github.com/apache/spark/pull/45693#discussion_r1539021429


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ArrayBasedMapBuilder.scala:
##########
@@ -36,7 +36,9 @@ class ArrayBasedMapBuilder(keyType: DataType, valueType: 
DataType) extends Seria
   private lazy val keyToIndex = keyType match {
     // Binary type data is `byte[]`, which can't use `==` to check equality.
     case _: AtomicType | _: CalendarIntervalType | _: NullType
-      if !keyType.isInstanceOf[BinaryType] => new java.util.HashMap[Any, Int]()
+      if !keyType.isInstanceOf[BinaryType] && 
(!keyType.isInstanceOf[StringType] ||

Review Comment:
   Let's wait for Collation Refactory PR for this. This should be 
stringType.isBinaryComparable?
   
   Also, can you push `StringType` in a separate `case`. Relying on order 
evaluation of || is not a good thing (I don't know if scala standard enforces 
this). E.g. you can end up with 
`keyType.asInstanceOf[StringType].isBinaryCollation` evaluating first which 
will throw if this is not a `StringType`.
   



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