This topic contains 3 replies, has 2 voices, and was last updated by sayanti 2 months, 1 week ago.
1) Number of recordings grouped by recclass.
2) Heaviest and Lightest Meteorite landing recorded.
3)Find the average mass
Ans: The required query is: FOR COPY:
hadoop fs -copyFromLocal ‘/user/cloudera/desktop/data.csv’ /user/cloudera FOR LOAD:
z1 = load ‘/user/cloudera/data.csv’ using PigStorage(‘,’) as (a1:chararray, a2:int, a3:chararray, a4:chararray, a5:long, a6:chararray, a7:int, a8:double, a9:double, a10:chararray, a11:chararray, a12:chararray, a13:chararray);
d = GROUP z1 BY a4; e = FOREACH d GENERATE group, COUNT(z1);
OUTPUT: (C3/4-UNG,1) (C5/6-UNG,1) (EH3/4-AN,1) (H(L)3-AN,1) (H3.0-3.4,1)
Ans: FOR HEAVIEST:
e = foreach z1 generate a1, a5; f = order e by $1 DESC; max = LIMIT f 1;
FOR LIGHTEST: g = foreach z1 generate a1, a5; x = order g by $1 ASC; min = LIMIT x 1;
OUTPUT (Österplana 023,)
3) Find the average mass
Ans: grouped = group z1 all; avg =foreach grouped generate AVG(z1.a5); dump avg;
Mail (will not be published) (required):
Your Name (required)
Your Email (required)
Enter the destination URL
Or link to existing content