{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/18356","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/18356/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/18356/comments","events_url":"https://api.github.com/repos/apache/spark/issues/18356/events","html_url":"https://github.com/apache/spark/pull/18356","id":237062792,"number":18356,"title":"[SPARK-21144][SQL][BRANCH-2.2] Check column name duplication in read/write paths","user":{"login":"maropu","id":692303,"avatar_url":"https://avatars0.githubusercontent.com/u/692303?v=3","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":7,"created_at":"2017-06-20T00:51:47Z","updated_at":"2017-06-21T01:58:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/18356","html_url":"https://github.com/apache/spark/pull/18356","diff_url":"https://github.com/apache/spark/pull/18356.diff","patch_url":"https://github.com/apache/spark/pull/18356.patch"},"body":"## What changes were proposed in this pull request?\r\nThis pr fixed unexpected results when the data schema and partition schema have the duplicate columns.\r\n```\r\nwithTempPath { dir =>\r\n  val basePath = dir.getCanonicalPath\r\n  spark.range(0, 3).toDF(\"foo\").write.parquet(new Path(basePath, \"foo=1\").toString)\r\n  spark.range(0, 3).toDF(\"foo\").write.parquet(new Path(basePath, \"foo=a\").toString)\r\n  spark.read.parquet(basePath).show()\r\n}\r\n\r\n+---+\r\n|foo|\r\n+---+\r\n|  1|\r\n|  1|\r\n|  a|\r\n|  a|\r\n|  1|\r\n|  a|\r\n+---+\r\n```\r\nThis patch added code to check name duplication when reading from/writing to files. This comes from #17758 to fix this issue for v2.2.\r\n\r\n## How was this patch tested?\r\nCreated a new test suite `SchemaUtilsSuite` and added tests in existing suites:  `DataFrameSuite`, `DDLSuite`, `JDBCWriteSuite`, `DataFrameReaderWriterSuite`, `HiveMetastoreCatalog`, and `HiveDDLSuite`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/309940658","html_url":"https://github.com/apache/spark/pull/18356#issuecomment-309940658","issue_url":"https://api.github.com/repos/apache/spark/issues/18356","id":309940658,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars0.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":"2017-06-21T01:58:03Z","updated_at":"2017-06-21T01:58:03Z","body":"Merged build finished. Test FAILed."}}
{"actor":{"display_login":"AmplabJenkins"}}