Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Sam Joe
I tried using EXPLODE function on the nested json array but it doesn't work and throws following error: FAILED: UDFArgumentException explode() takes an array or a map as a parameter Thanks, Joel On Tue, Oct 27, 2015 at 3:20 PM, Sam Joe wrote: > Hi, > > Is it possible to use json_tuple functio

RE: Using json_tuple for Nested json Arrays

2015-10-27 Thread Ryan Harris
, October 27, 2015 1:29 PM To: user@hive.apache.org Subject: Re: Using json_tuple for Nested json Arrays I tried using EXPLODE function on the nested json array but it doesn't work and throws following error: FAILED: UDFArgumentException explode() takes an array or a map as a parameter Thanks,

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Sam Joe
as in these examples: > > > http://mechanics.flite.com/blog/2014/04/16/using-explode-and-lateral-view-in-hive/ > > > http://stackoverflow.com/questions/28716165/how-to-query-struct-array-with-hive-get-json-object > > > > > > *From:* Sam Joe [mailto:games2013....@gmai

RE: Using json_tuple for Nested json Arrays

2015-10-27 Thread Ryan Harris
weets_raw limit 10; You should also be able to use json_tuple(), but start simple From: Sam Joe [mailto:games2013@gmail.com] Sent: Tuesday, October 27, 2015 1:43 PM To: user@hive.apache.org Subject: Re: Using json_tuple for Nested json Arrays Hi Ryan, Thanks for your reply! I d

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Sam Joe
> > SELECT get_json_object(text_col, '$.id') as id FROM tweets_raw limit 10; > > > > You should also be able to use json_tuple(), but start simple > > > > *From:* Sam Joe [mailto:games2013....@gmail.com] > *Sent:* Tuesday, October 27, 2015 1:43 PM > &

RE: Using json_tuple for Nested json Arrays

2015-10-27 Thread Ryan Harris
From: Sam Joe [mailto:games2013@gmail.com<mailto:games2013@gmail.com>] Sent: Tuesday, October 27, 2015 1:43 PM To: user@hive.apache.org<mailto:user@hive.apache.org> Subject: Re: Using json_tuple for Nested json Arrays Hi Ryan, Thanks for your reply! I didn't t

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Sam Joe
":"crop","h":150},"small":{"w":340,"resize":"fit","h":255},"large":{"w":1024,"resize":"fit","h":768},"medium":{"w":600,"resize":"fit&

RE: Using json_tuple for Nested json Arrays

2015-10-27 Thread Ryan Harris
a map as a parameter Apparently, hive doesn't think tr3.media is an array or map..so what is it? From: Sam Joe [mailto:games2013@gmail.com] Sent: Tuesday, October 27, 2015 2:56 PM To: user@hive.apache.org Subject: Re: Using json_tuple for Nested json Arrays Hi Ryan, The statement returns nu

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Sam Joe
o what is > it? > > > > *From:* Sam Joe [mailto:games2013@gmail.com] > *Sent:* Tuesday, October 27, 2015 2:56 PM > > *To:* user@hive.apache.org > *Subject:* Re: Using json_tuple for Nested json Arrays > > > > Hi Ryan, > > > > The statement returns nul

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Nishant Aggarwal
Hello Sam, You can easily achieve this by using elephant-bird.jars in pig. We are also caturing tweets via flume and filter them using pig and elephant-jars. You can find the related jars over internet. Cheers, Nishant Aggarwal On 28 Oct 2015 00:50, "Sam Joe" wrote: > Hi, > > Is it possible to u

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Sam Joe
Thanks Nishant! Will try using Pig json loader too to achieve this requirement. If you have any tutorial for extracting data from complex nested json arrays (as the example given in my previous email), please send it. Appreciate your help! Thanks, Joel On Tue, Oct 27, 2015 at 10:20 PM, Nishant A

RE: Using json_tuple for Nested json Arrays

2015-10-27 Thread Ryan Harris
a' turns out to be an array datatype you just need to troubleshoot the explode() From: Sam Joe [mailto:games2013@gmail.com] Sent: Tuesday, October 27, 2015 7:37 PM To: user@hive.apache.org Subject: Re: Using json_tuple for Nested json Arrays Hi Ryan, I think tr3.media a complex jso

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Gopal Vijayaraghavan
Hi, > If you have any tutorial for extracting data from complex nested json >arrays (as the example given in my previous email), please send it. 90% of working with the real world is cleansing bad data. People under-sell hive's flexibility in situations like this. This is what I do hive> comp

Re: Using json_tuple for Nested json Arrays

2015-10-27 Thread Nishant Aggarwal
Hello Sam, Please find attached PIG script for the same. You may find the necessary jars below. http://mvnrepository.com/artifact/com.twitter.elephantbird/elephant-bird-pig Note: Same functionality can be achieved in Hive as well. Thanks and Regards Nishant Aggarwal, PMP Cell No:- +91 99588