SUM in pig
2017-06-11
Problem 1 Write a pig script to calculate the sum of profits earned by selling a particular product. Below is the query to create data into hive table. CREATE SCHEMA IF NOT EXISTS bdp; CREATE TABLE bdp.profits (product_id INT,profit BIGINT); INSERT INTO TABLE bdp.profits VALUES (‘123′,’1365’),(‘124′,’3253’),(‘125′,’91522’), (‘123′,’51842’),(‘127′,’19616’),(‘128′,’2433’), (‘127′,’182652’),(‘130′,’21632’),(‘122′,’21632’), (‘127′,’21632’),(‘135′,’21632’),(‘123′,’21632’),(‘135′,’3282’); SolutionRead More →