You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jen-Ming Chung (JIRA)" <ji...@apache.org> on 2017/08/22 06:31:00 UTC
[jira] [Commented] (SPARK-21804) json_tuple returns null values
within repeated columns except the first one
[ https://issues.apache.org/jira/browse/SPARK-21804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16136385#comment-16136385 ]
Jen-Ming Chung commented on SPARK-21804:
----------------------------------------
I’m working on this
> json_tuple returns null values within repeated columns except the first one
> ---------------------------------------------------------------------------
>
> Key: SPARK-21804
> URL: https://issues.apache.org/jira/browse/SPARK-21804
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.2.0
> Reporter: Jen-Ming Chung
> Priority: Minor
> Labels: starter
>
> I was testing json_tuple in extracting values from JSON but I found it could actually returns null values within repeated columns except the first one as below:
> {code:language=scala}
> scala> spark.sql("""SELECT json_tuple('{"a":1, "b":2}', 'a', 'b', 'a')""").show()
> +---+---+----+
> | c0| c1| c2|
> +---+---+----+
> | 1| 2|null|
> +---+---+----+
> {code}
> I think this should be consistent with Hive's implementation:
> {code:language=scala}
> hive> SELECT json_tuple('{"a": 1, "b": 2}', 'a', 'a');
> ...
> 1 1
> {code}
--
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