LuciferYang commented on a change in pull request #29434:
URL: https://github.com/apache/spark/pull/29434#discussion_r471070973
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala
##########
@@ -314,7 +314,7 @@ trait Row extends Serializable {
*
* @throws ClassCastException when data type does not match.
*/
- def getSeq[T](i: Int): Seq[T] = getAs[Seq[T]](i)
+ def getSeq[T](i: Int): scala.collection.Seq[T] =
getAs[scala.collection.Seq[T]](i)
Review comment:
On the other hand, we can use
`scala.collection.immutable.ArraySeq.unsafeWrapArray` to instead of
`WrappedArray.make` in Scala 2.13 to produce a `immutable.ArraySeq`,then we
remove the changes here.
But `immutable.ArraySeq.unsafeWrapArray` not support in Scala 2.12, this
will causes a code branch to distinguish between Scala versions in
`RowEncoder.deserializerFor` and we need use reflect api to get
`immutable.ArraySeq` class as follow:
```
if (isScala213) {
StaticInvoke(
Utils.classForName("scala.collection.immutable.ArraySeq"),
ObjectType(classOf[Seq[_]]),
"unsafeWrapArray",
arrayData :: Nil,
returnNullable = false)
} else {
....
}
```
----------------------------------------------------------------
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]