Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Last active December 18, 2018 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgadiraju/15f22e7a45e70cff8f199cd631cc8d15 to your computer and use it in GitHub Desktop.
Save dgadiraju/15f22e7a45e70cff8f199cd631cc8d15 to your computer and use it in GitHub Desktop.
orders = LOAD '/user/itversity/data/retail_db/orders/part-00000' USING PigStorage(',')
AS (order_id: int, order_date: chararray, customer_id: int, order_status: chararray);
grouped = GROUP orders BY order_status;
ordercount = FOREACH grouped GENERATE group, COUNT_STAR(orders) AS cnt;
DUMP ordercount;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment