GitHub user zsxwing opened a pull request:

    https://github.com/apache/spark/pull/11313

    Fix the issue that Iterator.map().toSeq is not Serializable

    ## What changes were proposed in this pull request?
    
    `scala.collection.Iterator`'s methods (e.g., map, filter) will return an 
`AbstractIterator` which is not Serializable. E.g.,
    ```Scala
    scala> val iter = Array(1, 2, 3).iterator.map(_ + 1)
    iter: Iterator[Int] = non-empty iterator
    
    scala> println(iter.isInstanceOf[Serializable])
    false
    ```
    If we call something like `scala.collection.Iterator.map(...).toSeq`, it 
will a `Stream` that contains a non-serializable `AbstractIterator` field and 
make the `Stream` be non-serializable.
    
    This PR uses `toArray` instead of `toSeq` to fix such issue in `def 
createDataFrame(data: java.util.List[_], beanClass: Class[_]): DataFrame`.  
    
    ## How was the this patch tested?
    
    Jenkins tests.
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zsxwing/spark SPARK-13390

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/11313.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 #11313
    
----
commit 07a88b5f45028c5460fee0ea679095e589feea6e
Author: Shixiong Zhu <[email protected]>
Date:   2016-02-22T22:41:46Z

    Fix the issue that Iterator.map().toSeq is not Serializable

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to