You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2016/05/20 16:35:12 UTC

[jira] [Resolved] (SPARK-15308) RowEncoder should preserve nested column name.

     [ https://issues.apache.org/jira/browse/SPARK-15308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reynold Xin resolved SPARK-15308.
---------------------------------
       Resolution: Fixed
         Assignee: Takuya Ueshin
    Fix Version/s: 2.0.0

> RowEncoder should preserve nested column name.
> ----------------------------------------------
>
>                 Key: SPARK-15308
>                 URL: https://issues.apache.org/jira/browse/SPARK-15308
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Takuya Ueshin
>            Assignee: Takuya Ueshin
>             Fix For: 2.0.0
>
>
> The following code generates wrong schema:
> {code}
> val schema = new StructType().add(
>   "struct",
>   new StructType()
>     .add("i", IntegerType, nullable = false)
>     .add(
>       "s",
>       new StructType().add("int", IntegerType, nullable = false),
>       nullable = false),
>   nullable = false)
> val ds = sqlContext.range(10).map(l => Row(l, Row(l)))(RowEncoder(schema))
> ds.printSchema()
> {code}
> This should print as follows:
> {code}
> root
>  |-- struct: struct (nullable = false)
>  |    |-- i: integer (nullable = false)
>  |    |-- s: struct (nullable = false)
>  |    |    |-- int: integer (nullable = false)
> {code}
> but the result is:
> {code}
> root
>  |-- struct: struct (nullable = false)
>  |    |-- col1: integer (nullable = false)
>  |    |-- col2: struct (nullable = false)
>  |    |    |-- col1: integer (nullable = false)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org