You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2017/08/24 10:25:00 UTC
[jira] [Resolved] (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:all-tabpanel ]
Hyukjin Kwon resolved SPARK-21804.
----------------------------------
Resolution: Fixed
Fix Version/s: 2.3.0
Issue resolved by pull request 19017
[https://github.com/apache/spark/pull/19017]
> 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
> Fix For: 2.3.0
>
>
> 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