You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (JIRA)" <ji...@apache.org> on 2017/06/24 14:38:00 UTC

[jira] [Resolved] (SPARK-21203) Wrong results of insertion of Array of Struct

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

Wenchen Fan resolved SPARK-21203.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.2.0
                   2.1.2

> Wrong results of insertion of Array of Struct
> ---------------------------------------------
>
>                 Key: SPARK-21203
>                 URL: https://issues.apache.org/jira/browse/SPARK-21203
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.1, 2.2.0
>            Reporter: Xiao Li
>            Assignee: Xiao Li
>            Priority: Critical
>             Fix For: 2.1.2, 2.2.0
>
>
> {noformat}
>       spark.sql(
>         """
>           |CREATE TABLE `tab1`
>           |(`custom_fields` ARRAY<STRUCT<`id`: BIGINT, `value`: STRING>>)
>           |USING parquet
>         """.stripMargin)
>       spark.sql(
>         """
>           |INSERT INTO `tab1`
>           |SELECT ARRAY(named_struct('id', 1, 'value', 'a'), named_struct('id', 2, 'value', 'b'))
>         """.stripMargin)
>       spark.sql("SELECT custom_fields.id, custom_fields.value FROM tab1").show()
> {noformat}
> The returned result is wrong:
> {noformat}
> Row(Array(2, 2), Array("b", "b"))
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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