Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Reading json file.


Copy link to this message
-
Re: Reading json file.
Have you seen these?
http://pig.apache.org/docs/r0.11.0/api/org/apache/pig/builtin/JsonStorage.html

http://hortonworks.com/blog/jsonize-anything-in-pig-with-tojson/

Regards,
Shahab
On Thu, Aug 29, 2013 at 6:19 PM, jamal sasha <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have json file in follwoing format:
> { "_id" : "foo.com", "categories" : [], "h1" : { "bar==" : { "first" :
> 1281916800, "last" : 1316995200 }, "foo==" : { "first" : 1281916800, "last"
> : 1316995200 } }, "name2" : [ "foobarl.com", "foobar2.com" ], "rep" :
> null }
> So, how do i parse this json in pig..
>
> also, the categories and rep can have some char in it..and might not be
> always empty.
>
> Thanks
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB