{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/200421789","pull_request_review_id":134735989,"id":200421789,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDQyMTc4OQ==","diff_hunk":"@@ -203,33 +203,33 @@ class DataSourceV2Suite extends QueryTest with SharedSQLContext {\n         val path = file.getCanonicalPath\n         assert(spark.read.format(cls.getName).option(\"path\", path).load().collect().isEmpty)\n \n-        spark.range(10).select('id, -'id).write.format(cls.getName)\n+        spark.range(10).select('id as 'i, -'id as 'j).write.format(cls.getName)","path":"sql/core/src/test/scala/org/apache/spark/sql/sources/v2/DataSourceV2Suite.scala","position":5,"original_position":5,"commit_id":"b906ab1698d653b35ca7ac1316c08e39d9f59008","original_commit_id":"b906ab1698d653b35ca7ac1316c08e39d9f59008","user":{"login":"rdblue","id":87915,"node_id":"MDQ6VXNlcjg3OTE1","avatar_url":"https://avatars1.githubusercontent.com/u/87915?v=4","gravatar_id":"","url":"https://api.github.com/users/rdblue","html_url":"https://github.com/rdblue","followers_url":"https://api.github.com/users/rdblue/followers","following_url":"https://api.github.com/users/rdblue/following{/other_user}","gists_url":"https://api.github.com/users/rdblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rdblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdblue/subscriptions","organizations_url":"https://api.github.com/users/rdblue/orgs","repos_url":"https://api.github.com/users/rdblue/repos","events_url":"https://api.github.com/users/rdblue/events{/privacy}","received_events_url":"https://api.github.com/users/rdblue/received_events","type":"User","site_admin":false},"body":"Yes. The new resolution rule validates the dataframe that will be written to the table.\r\n\r\nBecause this uses the `DataFrameWriter` API, it matches columns by name because there isn't a strong expectation for ordering in the dataframe API (e.g. `withColumn` doesn't specify where the new column is added).","created_at":"2018-07-05T16:55:29Z","updated_at":"2018-07-05T16:55:29Z","html_url":"https://github.com/apache/spark/pull/21305#discussion_r200421789","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/21305","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/200421789"},"html":{"href":"https://github.com/apache/spark/pull/21305#discussion_r200421789"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/21305"}},"in_reply_to_id":200230564},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/21305","id":187569657,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg3NTY5NjU3","html_url":"https://github.com/apache/spark/pull/21305","diff_url":"https://github.com/apache/spark/pull/21305.diff","patch_url":"https://github.com/apache/spark/pull/21305.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/21305","number":21305,"state":"open","locked":false,"title":"[SPARK-24251][SQL] Add AppendData logical plan.","user":{"login":"rdblue","id":87915,"node_id":"MDQ6VXNlcjg3OTE1","avatar_url":"https://avatars1.githubusercontent.com/u/87915?v=4","gravatar_id":"","url":"https://api.github.com/users/rdblue","html_url":"https://github.com/rdblue","followers_url":"https://api.github.com/users/rdblue/followers","following_url":"https://api.github.com/users/rdblue/following{/other_user}","gists_url":"https://api.github.com/users/rdblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rdblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdblue/subscriptions","organizations_url":"https://api.github.com/users/rdblue/orgs","repos_url":"https://api.github.com/users/rdblue/repos","events_url":"https://api.github.com/users/rdblue/events{/privacy}","received_events_url":"https://api.github.com/users/rdblue/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nThis adds a new logical plan, AppendData, that was proposed in SPARK-23521: Standardize SQL logical plans.\r\n\r\n* DataFrameWriter uses the new AppendData plan for DataSourceV2 appends\r\n* AppendData is resolved if its output columns match the incoming data frame\r\n* A new analyzer rule, ResolveOutputColumns, validates data before it is appended. This rule will add safe casts, rename columns, and checks nullability\r\n\r\n## How was this patch tested?\r\n\r\nExisting tests for v2 appends. Will add AppendData tests to validate logical plan analysis.","created_at":"2018-05-11T21:05:03Z","updated_at":"2018-07-05T16:55:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f57c1cb42418ce512552478d52b32fea4e2f6a40","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/21305/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/21305/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/21305/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/b906ab1698d653b35ca7ac1316c08e39d9f59008","head":{"label":"rdblue:SPARK-24251-add-append-data","ref":"SPARK-24251-add-append-data","sha":"b906ab1698d653b35ca7ac1316c08e39d9f59008","user":{"login":"rdblue","id":87915,"node_id":"MDQ6VXNlcjg3OTE1","avatar_url":"https://avatars1.githubusercontent.com/u/87915?v=4","gravatar_id":"","url":"https://api.github.com/users/rdblue","html_url":"https://github.com/rdblue","followers_url":"https://api.github.com/users/rdblue/followers","following_url":"https://api.github.com/users/rdblue/following{/other_user}","gists_url":"https://api.github.com/users/rdblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rdblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdblue/subscriptions","organizations_url":"https://api.github.com/users/rdblue/orgs","repos_url":"https://api.github.com/users/rdblue/repos","events_url":"https://api.github.com/users/rdblue/events{/privacy}","received_events_url":"https://api.github.com/users/rdblue/received_events","type":"User","site_admin":false},"repo":{"id":26284539,"node_id":"MDEwOlJlcG9zaXRvcnkyNjI4NDUzOQ==","name":"spark","full_name":"rdblue/spark","owner":{"login":"rdblue","id":87915,"node_id":"MDQ6VXNlcjg3OTE1","avatar_url":"https://avatars1.githubusercontent.com/u/87915?v=4","gravatar_id":"","url":"https://api.github.com/users/rdblue","html_url":"https://github.com/rdblue","followers_url":"https://api.github.com/users/rdblue/followers","following_url":"https://api.github.com/users/rdblue/following{/other_user}","gists_url":"https://api.github.com/users/rdblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rdblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdblue/subscriptions","organizations_url":"https://api.github.com/users/rdblue/orgs","repos_url":"https://api.github.com/users/rdblue/repos","events_url":"https://api.github.com/users/rdblue/events{/privacy}","received_events_url":"https://api.github.com/users/rdblue/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rdblue/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/rdblue/spark","forks_url":"https://api.github.com/repos/rdblue/spark/forks","keys_url":"https://api.github.com/repos/rdblue/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdblue/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdblue/spark/teams","hooks_url":"https://api.github.com/repos/rdblue/spark/hooks","issue_events_url":"https://api.github.com/repos/rdblue/spark/issues/events{/number}","events_url":"https://api.github.com/repos/rdblue/spark/events","assignees_url":"https://api.github.com/repos/rdblue/spark/assignees{/user}","branches_url":"https://api.github.com/repos/rdblue/spark/branches{/branch}","tags_url":"https://api.github.com/repos/rdblue/spark/tags","blobs_url":"https://api.github.com/repos/rdblue/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdblue/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdblue/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdblue/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdblue/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/rdblue/spark/languages","stargazers_url":"https://api.github.com/repos/rdblue/spark/stargazers","contributors_url":"https://api.github.com/repos/rdblue/spark/contributors","subscribers_url":"https://api.github.com/repos/rdblue/spark/subscribers","subscription_url":"https://api.github.com/repos/rdblue/spark/subscription","commits_url":"https://api.github.com/repos/rdblue/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdblue/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdblue/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdblue/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdblue/spark/contents/{+path}","compare_url":"https://api.github.com/repos/rdblue/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdblue/spark/merges","archive_url":"https://api.github.com/repos/rdblue/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdblue/spark/downloads","issues_url":"https://api.github.com/repos/rdblue/spark/issues{/number}","pulls_url":"https://api.github.com/repos/rdblue/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/rdblue/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/rdblue/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdblue/spark/labels{/name}","releases_url":"https://api.github.com/repos/rdblue/spark/releases{/id}","deployments_url":"https://api.github.com/repos/rdblue/spark/deployments","created_at":"2014-11-06T18:50:45Z","updated_at":"2017-09-13T03:31:54Z","pushed_at":"2018-07-04T22:22:10Z","git_url":"git://github.com/rdblue/spark.git","ssh_url":"git@github.com:rdblue/spark.git","clone_url":"https://github.com/rdblue/spark.git","svn_url":"https://github.com/rdblue/spark","homepage":null,"size":250005,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"ca8243f30fc6939ee099a9534e3b811d5c64d2cf","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxNzE2NTY1OA==","name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2018-07-05T16:29:48Z","pushed_at":"2018-07-05T16:25:39Z","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":272945,"stargazers_count":17966,"watchers_count":17966,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16340,"mirror_url":null,"archived":false,"open_issues_count":568,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":16340,"open_issues":568,"watchers":17966,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/21305"},"html":{"href":"https://github.com/apache/spark/pull/21305"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/21305"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/21305/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/21305/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/21305/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/b906ab1698d653b35ca7ac1316c08e39d9f59008"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rdblue"}}