{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/30566973","id":30566973,"diff_hunk":"@@ -584,6 +588,34 @@ abstract class HadoopFsRelation private[sql](maybePartitionSpec: Option[Partitio\n   }\n \n   /**\n+   * For a non-partitioned relation, this method builds an `RDD[Row]` containing all rows within\n+   * this relation. For partitioned relations, this method is called for each selected partition,\n+   * and builds an `RDD[Row]` containing all rows within that single partition.\n+   *\n+   * Note: This interface is subject to change in future.\n+   *\n+   * @param requiredColumns Required columns.\n+   * @param filters Candidate filters to be pushed down. The actual filter should be the conjunction\n+   *        of all `filters`.  The pushed down filters are currently purely an optimization as they\n+   *        will all be evaluated again. This means it is safe to use them with methods that produce\n+   *        false positives such as filtering partitions based on a bloom filter.\n+   * @param inputFiles For a non-partitioned relation, it contains paths of all data files in the\n+   *        relation. For a partitioned relation, it contains paths of all data files in a single\n+   *        selected partition.\n+   * @param broadcastedConf A shared broadcast Hadoop Configuration, which can be used to reduce the\n+   *                        overhead of broadcasting the Configuration for every Hadoop RDD.\n+   *\n+   * @since 1.4.0\n+   */\n+  def buildScan(","path":"sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala","position":52,"original_position":52,"commit_id":"9e7c3cd1984bcee9e5538c72f556ffd8d91f3f23","original_commit_id":"9e7c3cd1984bcee9e5538c72f556ffd8d91f3f23","user":{"login":"liancheng","id":230655,"avatar_url":"https://avatars.githubusercontent.com/u/230655?v=3","gravatar_id":"","url":"https://api.github.com/users/liancheng","html_url":"https://github.com/liancheng","followers_url":"https://api.github.com/users/liancheng/followers","following_url":"https://api.github.com/users/liancheng/following{/other_user}","gists_url":"https://api.github.com/users/liancheng/gists{/gist_id}","starred_url":"https://api.github.com/users/liancheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liancheng/subscriptions","organizations_url":"https://api.github.com/users/liancheng/orgs","repos_url":"https://api.github.com/users/liancheng/repos","events_url":"https://api.github.com/users/liancheng/events{/privacy}","received_events_url":"https://api.github.com/users/liancheng/received_events","type":"User","site_admin":false},"body":"Also need to add `broadcastedConf` to the other two `buildScan` overrides in `HadoopFsRelation`.","created_at":"2015-05-19T03:30:52Z","updated_at":"2015-05-19T03:30:52Z","html_url":"https://github.com/apache/spark/pull/6252#discussion_r30566973","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/6252","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/30566973"},"html":{"href":"https://github.com/apache/spark/pull/6252#discussion_r30566973"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/6252"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/6252","id":35690977,"html_url":"https://github.com/apache/spark/pull/6252","diff_url":"https://github.com/apache/spark/pull/6252.diff","patch_url":"https://github.com/apache/spark/pull/6252.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/6252","number":6252,"state":"open","locked":false,"title":"[SPARK-7713] [SQL] Use shared broadcast hadoop conf for partitioned table scan.","user":{"login":"yhuai","id":2072857,"avatar_url":"https://avatars.githubusercontent.com/u/2072857?v=3","gravatar_id":"","url":"https://api.github.com/users/yhuai","html_url":"https://github.com/yhuai","followers_url":"https://api.github.com/users/yhuai/followers","following_url":"https://api.github.com/users/yhuai/following{/other_user}","gists_url":"https://api.github.com/users/yhuai/gists{/gist_id}","starred_url":"https://api.github.com/users/yhuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhuai/subscriptions","organizations_url":"https://api.github.com/users/yhuai/orgs","repos_url":"https://api.github.com/users/yhuai/repos","events_url":"https://api.github.com/users/yhuai/events{/privacy}","received_events_url":"https://api.github.com/users/yhuai/received_events","type":"User","site_admin":false},"body":"https://issues.apache.org/jira/browse/SPARK-7713\r\n\r\nI tested the performance with the following code:\r\n```scala\r\nimport sqlContext._\r\nimport sqlContext.implicits._\r\n\r\n(1 to 5000).foreach { i =>\r\n  val df = (1 to 1000).map(j => (j, s\"str$j\")).toDF(\"a\", \"b\").save(s\"/tmp/partitioned/i=$i\")\r\n}\r\n\r\nsqlContext.sql(\"\"\"\r\nCREATE TEMPORARY TABLE partitionedParquet\r\nUSING org.apache.spark.sql.parquet\r\nOPTIONS (\r\n  path '/tmp/partitioned'\r\n)\"\"\")\r\n\r\ntable(\"partitionedParquet\").explain(true)\r\n```\r\n\r\nIn our master `explain` takes 40s in my laptop. With this PR, `explain` takes 14s.","created_at":"2015-05-19T02:23:15Z","updated_at":"2015-05-19T03:30:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d746864a02f06fe981de479fcecddc1888e4c9f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/6252/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/6252/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/6252/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/9e7c3cd1984bcee9e5538c72f556ffd8d91f3f23","head":{"label":"yhuai:broadcastHadoopConf","ref":"broadcastHadoopConf","sha":"9e7c3cd1984bcee9e5538c72f556ffd8d91f3f23","user":{"login":"yhuai","id":2072857,"avatar_url":"https://avatars.githubusercontent.com/u/2072857?v=3","gravatar_id":"","url":"https://api.github.com/users/yhuai","html_url":"https://github.com/yhuai","followers_url":"https://api.github.com/users/yhuai/followers","following_url":"https://api.github.com/users/yhuai/following{/other_user}","gists_url":"https://api.github.com/users/yhuai/gists{/gist_id}","starred_url":"https://api.github.com/users/yhuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhuai/subscriptions","organizations_url":"https://api.github.com/users/yhuai/orgs","repos_url":"https://api.github.com/users/yhuai/repos","events_url":"https://api.github.com/users/yhuai/events{/privacy}","received_events_url":"https://api.github.com/users/yhuai/received_events","type":"User","site_admin":false},"repo":{"id":17964653,"name":"spark","full_name":"yhuai/spark","owner":{"login":"yhuai","id":2072857,"avatar_url":"https://avatars.githubusercontent.com/u/2072857?v=3","gravatar_id":"","url":"https://api.github.com/users/yhuai","html_url":"https://github.com/yhuai","followers_url":"https://api.github.com/users/yhuai/followers","following_url":"https://api.github.com/users/yhuai/following{/other_user}","gists_url":"https://api.github.com/users/yhuai/gists{/gist_id}","starred_url":"https://api.github.com/users/yhuai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhuai/subscriptions","organizations_url":"https://api.github.com/users/yhuai/orgs","repos_url":"https://api.github.com/users/yhuai/repos","events_url":"https://api.github.com/users/yhuai/events{/privacy}","received_events_url":"https://api.github.com/users/yhuai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yhuai/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/yhuai/spark","forks_url":"https://api.github.com/repos/yhuai/spark/forks","keys_url":"https://api.github.com/repos/yhuai/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yhuai/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yhuai/spark/teams","hooks_url":"https://api.github.com/repos/yhuai/spark/hooks","issue_events_url":"https://api.github.com/repos/yhuai/spark/issues/events{/number}","events_url":"https://api.github.com/repos/yhuai/spark/events","assignees_url":"https://api.github.com/repos/yhuai/spark/assignees{/user}","branches_url":"https://api.github.com/repos/yhuai/spark/branches{/branch}","tags_url":"https://api.github.com/repos/yhuai/spark/tags","blobs_url":"https://api.github.com/repos/yhuai/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yhuai/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yhuai/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/yhuai/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yhuai/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/yhuai/spark/languages","stargazers_url":"https://api.github.com/repos/yhuai/spark/stargazers","contributors_url":"https://api.github.com/repos/yhuai/spark/contributors","subscribers_url":"https://api.github.com/repos/yhuai/spark/subscribers","subscription_url":"https://api.github.com/repos/yhuai/spark/subscription","commits_url":"https://api.github.com/repos/yhuai/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/yhuai/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/yhuai/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/yhuai/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/yhuai/spark/contents/{+path}","compare_url":"https://api.github.com/repos/yhuai/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yhuai/spark/merges","archive_url":"https://api.github.com/repos/yhuai/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yhuai/spark/downloads","issues_url":"https://api.github.com/repos/yhuai/spark/issues{/number}","pulls_url":"https://api.github.com/repos/yhuai/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/yhuai/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/yhuai/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yhuai/spark/labels{/name}","releases_url":"https://api.github.com/repos/yhuai/spark/releases{/id}","created_at":"2014-03-21T01:38:52Z","updated_at":"2015-05-07T05:56:12Z","pushed_at":"2015-05-19T02:20:02Z","git_url":"git://github.com/yhuai/spark.git","ssh_url":"git@github.com:yhuai/spark.git","clone_url":"https://github.com/yhuai/spark.git","svn_url":"https://github.com/yhuai/spark","homepage":null,"size":105880,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"3a6003866ade45974b43a9e785ec35fb76a32b99","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-05-19T03:13:17Z","pushed_at":"2015-05-19T03:18:45Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1692011,"stargazers_count":4011,"watchers_count":4011,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3521,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":300,"forks":3521,"open_issues":300,"watchers":4011,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/6252"},"html":{"href":"https://github.com/apache/spark/pull/6252"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/6252"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/6252/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/6252/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/6252/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/9e7c3cd1984bcee9e5538c72f556ffd8d91f3f23"}}}}