LuciferYang commented on code in PR #44591:
URL: https://github.com/apache/spark/pull/44591#discussion_r1441453603
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:
##########
@@ -938,6 +939,14 @@ case class MapObjects private(
executeFuncOnCollection(input).foreach(builder += _)
mutable.ArraySeq.make(builder.result())
}
+ case Some(cls) if classOf[immutable.ArraySeq[_]].isAssignableFrom(cls) =>
+ implicit val tag: ClassTag[Any] = elementClassTag()
+ input => {
+ val builder = immutable.ArraySeq.newBuilder[Any]
Review Comment:
```suggestion
val builder = mutable.ArrayBuilder.make[Any]
builder.sizeHint(input.size)
executeFuncOnCollection(input).foreach(builder += _)
immutable.ArraySeq.unsafeWrapArray(builder.result())
```
--
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]