{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13090","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13090/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13090/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13090/events","html_url":"https://github.com/apache/spark/pull/13090","id":154632009,"number":13090,"title":"[SPARK-15308][SQL] RowEncoder should preserve nested column name.","user":{"login":"ueshin","id":506656,"avatar_url":"https://avatars.githubusercontent.com/u/506656?v=3","gravatar_id":"","url":"https://api.github.com/users/ueshin","html_url":"https://github.com/ueshin","followers_url":"https://api.github.com/users/ueshin/followers","following_url":"https://api.github.com/users/ueshin/following{/other_user}","gists_url":"https://api.github.com/users/ueshin/gists{/gist_id}","starred_url":"https://api.github.com/users/ueshin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ueshin/subscriptions","organizations_url":"https://api.github.com/users/ueshin/orgs","repos_url":"https://api.github.com/users/ueshin/repos","events_url":"https://api.github.com/users/ueshin/events{/privacy}","received_events_url":"https://api.github.com/users/ueshin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-13T04:32:01Z","updated_at":"2016-05-20T06:52:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13090","html_url":"https://github.com/apache/spark/pull/13090","diff_url":"https://github.com/apache/spark/pull/13090.diff","patch_url":"https://github.com/apache/spark/pull/13090.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThe following code generates wrong schema:\r\n\r\n```\r\nval schema = new StructType().add(\r\n  \"struct\",\r\n  new StructType()\r\n    .add(\"i\", IntegerType, nullable = false)\r\n    .add(\r\n      \"s\",\r\n      new StructType().add(\"int\", IntegerType, nullable = false),\r\n      nullable = false),\r\n  nullable = false)\r\nval ds = sqlContext.range(10).map(l => Row(l, Row(l)))(RowEncoder(schema))\r\nds.printSchema()\r\n```\r\n\r\nThis should print as follows:\r\n\r\n```\r\nroot\r\n |-- struct: struct (nullable = false)\r\n |    |-- i: integer (nullable = false)\r\n |    |-- s: struct (nullable = false)\r\n |    |    |-- int: integer (nullable = false)\r\n```\r\n\r\nbut the result is:\r\n\r\n```\r\nroot\r\n |-- struct: struct (nullable = false)\r\n |    |-- col1: integer (nullable = false)\r\n |    |-- col2: struct (nullable = false)\r\n |    |    |-- col1: integer (nullable = false)\r\n```\r\n\r\nThis PR fixes `RowEncoder` to preserve nested column name.\r\n\r\n## How was this patch tested?\r\n\r\nExisting tests and I added a test to check if `RowEncoder` preserves nested column name.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/220531062","html_url":"https://github.com/apache/spark/pull/13090#issuecomment-220531062","issue_url":"https://api.github.com/repos/apache/spark/issues/13090","id":220531062,"user":{"login":"rxin","id":323388,"avatar_url":"https://avatars.githubusercontent.com/u/323388?v=3","gravatar_id":"","url":"https://api.github.com/users/rxin","html_url":"https://github.com/rxin","followers_url":"https://api.github.com/users/rxin/followers","following_url":"https://api.github.com/users/rxin/following{/other_user}","gists_url":"https://api.github.com/users/rxin/gists{/gist_id}","starred_url":"https://api.github.com/users/rxin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxin/subscriptions","organizations_url":"https://api.github.com/users/rxin/orgs","repos_url":"https://api.github.com/users/rxin/repos","events_url":"https://api.github.com/users/rxin/events{/privacy}","received_events_url":"https://api.github.com/users/rxin/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T06:52:34Z","updated_at":"2016-05-20T06:52:34Z","body":"@ueshin unfortunately this no longer merges cleanly ...\r\n "}}
{"actor":{"display_login":"rxin"}}