GitHub user michalsenkyr opened a pull request: https://github.com/apache/spark/pull/16541
[SPARK-19088][SQL] Optimize sequence type deserialization codegen ## What changes were proposed in this pull request? Optimization of arbitrary Scala sequence deserialization introduced by #16240. The previous implementation constructed an array which was then converted by `to`. This required two passes in most cases. This implementation attempts to remedy that by using `Builder`s provided by the `newBuilder` method on every Scala collection's companion object to build the resulting collection directly. ## How was this patch tested? ```bash ./build/mvn -DskipTests clean package && ./dev/run-tests ``` Additionally in Spark Shell: ```scala case class QueueClass(q: scala.collection.immutable.Queue[Int]) spark.createDataset(Seq(List(1,2,3))).map(x => QueueClass(scala.collection.immutable.Queue(x: _*))).map(_.q.dequeue).collect ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/michalsenkyr/spark dataset-seq-builder Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/16541.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #16541 ---- commit 4aaef15844848e16dc68d4be4d0a013c8ddcd7d7 Author: Michal Senkyr <mike.sen...@gmail.com> Date: 2017-01-10T23:00:34Z Rewrote sequence deserialization implementation to use builders ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org