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 >> Parsing JSON using JsonLoader


Copy link to this message
-
Parsing JSON using JsonLoader
I am having hard time representing the below JSON in Pig. All I need is either a bag or a tuple of toppings.

{
   "Toppings":[
      "Barbecue Sauce",
      "Chicken",
      "Cheese"
   ]
}

I've tried the below (and other variations) with no luck. Appreciate some help.

data = LOAD '/user/hue/data/toppings.json' USING JsonLoader('Toppings:bag{t:tuple(chararray)}');
DUMP data;

Regards.
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