hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peyman Mohajerian <mohaj...@gmail.com>
Subject Re: get_json_object for nested field returning a String instead of an Array
Date Mon, 07 Apr 2014 23:14:03 GMT
perhaps: https://github.com/rcongiu/Hive-JSON-Serde


On Mon, Apr 7, 2014 at 6:52 PM, Narayanan K <knarayanan88@gmail.com> wrote:

> Hi all
>
> I am using get_json_object to read a json text file. I have created
> the external table as below :
>
> CREATE EXTERNAL TABLE EXT_TABLE ( json string)
> PARTITIONED BY (dt string)
> LOCATION '/users/abc/';
>
>
> The json data has some fields that are not simple fields but fields
> which are nested fields like -  "field" : [{"id":1},{"id":2}.. ].
>
> While using the get_json_object to retrieve that field, it is
> returning back a string instead of an Array. Hence I am not able to
> explode the array as it is a string.
>
> Is there some way we can get an array of get_json_object instead of a
> string so that we can perform explode on this nested field ? or Anyway
> we can convert the string into an array so that I can use explode ?
>
> Thanks in advance,
> Narayanan
>

Mime
View raw message