Thanks Peyman. Actually the problem with Hive-Json-Serde is that we need to provide the entire schema upfront while creating the table.
My requirement is that we just project/aggregate on the fields using get_json_object after creating the external table without schema. This way the external table is agnostic to any new schema changes. Would love to get a solution for converting get_json_object to return an Array instead of a string.. Can we use any Hive UDFs to convert string into an explodable Array object ? Thanks Narayanan On Mon, Apr 7, 2014 at 4:14 PM, Peyman Mohajerian <mohaj...@gmail.com> wrote: > perhaps: https://github.com/rcongiu/Hive-JSON-Serde > > > On Mon, Apr 7, 2014 at 6:52 PM, Narayanan K <knarayana...@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 > >