spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao Li (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-21203) Wrong results of insertion of Array of Struct
Date Sat, 24 Jun 2017 03:28:02 GMT

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

Xiao Li updated SPARK-21203:
----------------------------
    Summary: Wrong results of insertion of Array of Struct  (was: Wrong results are inserted
by Array of Struct)

> 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
>
> {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


Mime
View raw message