{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/12239","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/12239/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/12239/comments","events_url":"https://api.github.com/repos/apache/spark/issues/12239/events","html_url":"https://github.com/apache/spark/pull/12239","id":146683300,"number":12239,"title":"[SPARK-14459] [SQL] Detect relation partitioning and adjust the logical plan","user":{"login":"rdblue","id":87915,"avatar_url":"https://avatars.githubusercontent.com/u/87915?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-07T16:55:25Z","updated_at":"2016-04-07T16:57:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12239","html_url":"https://github.com/apache/spark/pull/12239","diff_url":"https://github.com/apache/spark/pull/12239.diff","patch_url":"https://github.com/apache/spark/pull/12239.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis detects a relation's partitioning and adds checks to the analyzer.\r\nIf an InsertIntoTable node has no partitioning, it is replaced by the\r\nrelation's partition scheme and input columns are correctly adjusted,\r\nplacing the partition columns at the end in partition order. If an\r\nInsertIntoTable node has partitioning, it is checked against the table's\r\nreported partitions.\r\n\r\nThese changes required adding a PartitionedRelation trait to the catalog\r\ninterface because Hive's MetastoreRelation doesn't extend\r\nCatalogRelation.\r\n\r\nThis commit also includes a fix to InsertIntoTable's resolved logic,\r\nwhich now detects that all expected columns are present, including\r\ndynamic partition columns. Previously, the number of expected columns\r\nwas not checked and resolved was true if there were missing columns.\r\n\r\n## How was this patch tested?\r\n\r\nThis adds new tests to the InsertIntoTableSuite that are fixed by this PR.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/206992736","html_url":"https://github.com/apache/spark/pull/12239#issuecomment-206992736","issue_url":"https://api.github.com/repos/apache/spark/issues/12239","id":206992736,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","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":"2016-04-07T16:57:15Z","updated_at":"2016-04-07T16:57:15Z","body":"Can one of the admins verify this patch?"}}