You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/08/16 06:02:07 UTC

[GitHub] [spark] LuciferYang commented on a change in pull request #29433: [CLOSED][SQL] Pass all test of sql/catalyst module in Scala 2.13

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org