LuciferYang commented on a change in pull request #29434:
URL: https://github.com/apache/spark/pull/29434#discussion_r471898154



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ArrayBasedMapData.scala
##########
@@ -136,7 +136,8 @@ object ArrayBasedMapData {
     keys.zip(values).toMap
   }
 
-  def toScalaMap(keys: Seq[Any], values: Seq[Any]): Map[Any, Any] = {
+  def toScalaMap(keys: scala.collection.Seq[Any],

Review comment:
       Yep, now it must be `s.c.Seq` unless we accept `case ArrayType(et, 
nullable)` of `RowEncoder.deserializerFor` method has a 2.13-only branch to use 
`immutable.ArraySeq.unsafeMake` create a `immutable.Seq`. We can't use 
uniformly` immutable.ArraySeq ` because they are in different packages with 
different Scala version,  I haven't found a perfect replacement of 
`WrappedArray.make` method yet.
   
   Now `WrappedArray.make` create a `mutable.ArraySeq` instance in Scala 2.13 , 
so  the `toScalaMap` method input args are `mutable.ArraySeq` type not 
`immutable.ArraySeq` and `Seq` alias representative ` `immutable.Seq`,  this is 
not a match.On the other hand the `toScalaMap` method is called in reflection 
mode, inconvenient to add 'toSeq'.




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