{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/22198","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/22198/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/22198/comments","events_url":"https://api.github.com/repos/apache/spark/issues/22198/events","html_url":"https://github.com/apache/spark/pull/22198","id":353308086,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMzkyMTk4","number":22198,"title":"[SPARK-25121][SQL] Supports multi-part table names for broadcast hint resolution","user":{"login":"maropu","id":692303,"node_id":"MDQ6VXNlcjY5MjMwMw==","avatar_url":"https://avatars3.githubusercontent.com/u/692303?v=4","gravatar_id":"","url":"https://api.github.com/users/maropu","html_url":"https://github.com/maropu","followers_url":"https://api.github.com/users/maropu/followers","following_url":"https://api.github.com/users/maropu/following{/other_user}","gists_url":"https://api.github.com/users/maropu/gists{/gist_id}","starred_url":"https://api.github.com/users/maropu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maropu/subscriptions","organizations_url":"https://api.github.com/users/maropu/orgs","repos_url":"https://api.github.com/users/maropu/repos","events_url":"https://api.github.com/users/maropu/events{/privacy}","received_events_url":"https://api.github.com/users/maropu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2018-08-23T09:53:15Z","updated_at":"2018-09-21T14:53:11Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/22198","html_url":"https://github.com/apache/spark/pull/22198","diff_url":"https://github.com/apache/spark/pull/22198.diff","patch_url":"https://github.com/apache/spark/pull/22198.patch"},"body":"## What changes were proposed in this pull request?\r\nThis pr fixed code to respect a database name for broadcast table hint resolution.\r\nCurrently, spark ignores a database name in multi-part names;\r\n```\r\nscala> sql(\"CREATE DATABASE testDb\")\r\nscala> spark.range(10).write.saveAsTable(\"testDb.t\")\r\n\r\n// without this patch\r\nscala> spark.range(10).join(spark.table(\"testDb.t\"), \"id\").hint(\"broadcast\", \"testDb.t\").explain\r\n== Physical Plan ==\r\n*(2) Project [id#24L]\r\n+- *(2) BroadcastHashJoin [id#24L], [id#26L], Inner, BuildLeft\r\n   :- BroadcastExchange HashedRelationBroadcastMode(List(input[0, bigint, false]))\r\n   :  +- *(1) Range (0, 10, step=1, splits=4)\r\n   +- *(2) Project [id#26L]\r\n      +- *(2) Filter isnotnull(id#26L)\r\n         +- *(2) FileScan parquet testdb.t[id#26L] Batched: true, Format: Parquet, Location: InMemoryFileIndex[file:/Users/maropu/Repositories/spark/spark-2.3.1-bin-hadoop2.7/spark-warehouse..., PartitionFilters: [], PushedFilters: [IsNotNull(id)], ReadSchema: struct<id:bigint>\r\n\r\n// with this patch\r\nscala> spark.range(10).join(spark.table(\"testDb.t\"), \"id\").hint(\"broadcast\", \"testDb.t\").explain\r\n== Physical Plan ==\r\n*(2) Project [id#3L]\r\n+- *(2) BroadcastHashJoin [id#3L], [id#5L], Inner, BuildRight\r\n   :- *(2) Range (0, 10, step=1, splits=4)\r\n   +- BroadcastExchange HashedRelationBroadcastMode(List(input[0, bigint, true]))\r\n      +- *(1) Project [id#5L]\r\n         +- *(1) Filter isnotnull(id#5L)\r\n            +- *(1) FileScan parquet testdb.t[id#5L] Batched: true, Format: Parquet, Location: InMemoryFileIndex[file:/Users/maropu/Repositories/spark/spark-master/spark-warehouse/testdb.db/t], PartitionFilters: [], PushedFilters: [IsNotNull(id)], ReadSchema: struct<id:bigint>\r\n```\r\n\r\n## How was this patch tested?\r\nAdded tests in `DataFrameJoinSuite`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/423560237","html_url":"https://github.com/apache/spark/pull/22198#issuecomment-423560237","issue_url":"https://api.github.com/repos/apache/spark/issues/22198","id":423560237,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzU2MDIzNw==","user":{"login":"AmplabJenkins","id":4031291,"node_id":"MDQ6VXNlcjQwMzEyOTE=","avatar_url":"https://avatars3.githubusercontent.com/u/4031291?v=4","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T14:53:11Z","updated_at":"2018-09-21T14:53:11Z","author_association":"NONE","body":"Merged build finished. Test PASSed."}}
{"actor":{"display_login":"AmplabJenkins"}}