You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2014/12/11 04:03:12 UTC

[jira] [Commented] (SPARK-4824) Join should use `Iterator` rather than `Iterable`

    [ https://issues.apache.org/jira/browse/SPARK-4824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14242056#comment-14242056 ] 

Apache Spark commented on SPARK-4824:
-------------------------------------

User 'zsxwing' has created a pull request for this issue:
https://github.com/apache/spark/pull/3671

> Join should use `Iterator` rather than `Iterable`
> -------------------------------------------------
>
>                 Key: SPARK-4824
>                 URL: https://issues.apache.org/jira/browse/SPARK-4824
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>            Reporter: Shixiong Zhu
>
> In Scala, `map` and `flatMap` of `Iterable` will copy the contents of `Iterable` to a new `Seq`. Such as,
> {code}
>   val iterable = Seq(1, 2, 3).map(v => {
>     println(v)
>     v
>   })
>   println("Iterable map done")
>   val iterator = Seq(1, 2, 3).iterator.map(v => {
>     println(v)
>     v
>   })
>   println("Iterator map done")
> {code}
> outputed
> {code}
> 1
> 2
> 3
> Iterable map done
> Iterator map done
> {code}
> So we should use 'iterator' to reduce memory consumed by join.
> Found by [~johannes.simon]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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