{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/11313","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/11313/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/11313/comments","events_url":"https://api.github.com/repos/apache/spark/issues/11313/events","html_url":"https://github.com/apache/spark/pull/11313","id":135570183,"number":11313,"title":"[SPARK-13390][SQL]Fix the issue due to Iterator.map().toSeq is not Serializable","user":{"login":"zsxwing","id":1000778,"avatar_url":"https://avatars.githubusercontent.com/u/1000778?v=3","gravatar_id":"","url":"https://api.github.com/users/zsxwing","html_url":"https://github.com/zsxwing","followers_url":"https://api.github.com/users/zsxwing/followers","following_url":"https://api.github.com/users/zsxwing/following{/other_user}","gists_url":"https://api.github.com/users/zsxwing/gists{/gist_id}","starred_url":"https://api.github.com/users/zsxwing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsxwing/subscriptions","organizations_url":"https://api.github.com/users/zsxwing/orgs","repos_url":"https://api.github.com/users/zsxwing/repos","events_url":"https://api.github.com/users/zsxwing/events{/privacy}","received_events_url":"https://api.github.com/users/zsxwing/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-22T22:50:07Z","updated_at":"2016-02-23T23:04:38Z","closed_at":"2016-02-23T23:04:38Z","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/11313","html_url":"https://github.com/apache/spark/pull/11313","diff_url":"https://github.com/apache/spark/pull/11313.diff","patch_url":"https://github.com/apache/spark/pull/11313.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\n`scala.collection.Iterator`'s methods (e.g., map, filter) will return an `AbstractIterator` which is not Serializable. E.g.,\r\n```Scala\r\nscala> val iter = Array(1, 2, 3).iterator.map(_ + 1)\r\niter: Iterator[Int] = non-empty iterator\r\n\r\nscala> println(iter.isInstanceOf[Serializable])\r\nfalse\r\n```\r\nIf we call something like `Iterator.map(...).toSeq`, it will create a `Stream` that contains a non-serializable `AbstractIterator` field and make the `Stream` be non-serializable.\r\n\r\nThis PR uses `toArray` instead of `toSeq` to fix such issue in `def createDataFrame(data: java.util.List[_], beanClass: Class[_]): DataFrame`.  \r\n\r\n## How was the this patch tested?\r\n\r\nJenkins tests.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/187955679","html_url":"https://github.com/apache/spark/pull/11313#issuecomment-187955679","issue_url":"https://api.github.com/repos/apache/spark/issues/11313","id":187955679,"user":{"login":"zsxwing","id":1000778,"avatar_url":"https://avatars.githubusercontent.com/u/1000778?v=3","gravatar_id":"","url":"https://api.github.com/users/zsxwing","html_url":"https://github.com/zsxwing","followers_url":"https://api.github.com/users/zsxwing/followers","following_url":"https://api.github.com/users/zsxwing/following{/other_user}","gists_url":"https://api.github.com/users/zsxwing/gists{/gist_id}","starred_url":"https://api.github.com/users/zsxwing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsxwing/subscriptions","organizations_url":"https://api.github.com/users/zsxwing/orgs","repos_url":"https://api.github.com/users/zsxwing/repos","events_url":"https://api.github.com/users/zsxwing/events{/privacy}","received_events_url":"https://api.github.com/users/zsxwing/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T23:04:38Z","updated_at":"2016-02-23T23:04:38Z","body":"Just found this happened to be fixed in #10511. `rows` will be materialized in LocalTableScan.\r\n\r\nI'm going to resubmit this patch against branch-1.6 since this is not necessary for master."}}