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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala
##########
@@ -291,12 +296,22 @@ object RowEncoder {
           MapObjects(deserializerFor(_), input, et),
           "array",
           ObjectType(classOf[Array[_]]), returnNullable = false)
-      StaticInvoke(
-        scala.collection.mutable.WrappedArray.getClass,
-        ObjectType(classOf[Seq[_]]),
-        "make",
-        arrayData :: Nil,
-        returnNullable = false)
+      if (Utils.isScala212) {
+        StaticInvoke(
+          scala.collection.mutable.WrappedArray.getClass,
+          ObjectType(classOf[Seq[_]]),
+          "make",
+          arrayData :: Nil,
+          returnNullable = false)
+      } else {
+        // Use ArraySeq.unsafeWrapArray instead of WrappedArray.make in Scala 
2.13
+        StaticInvoke(

Review comment:
       I am not sure can we use 
`scala.collection.immutable.ArraySeq.unsafeWrapArray` instead of 
`scala.collection.mutable.ArraySeq.make`, but `RowEncoderSuite` suite was fixed 
for this.




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