Home | About | Sematext search-lucene.com search-hadoop.com
 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.