Forum

This topic contains 3 replies, has 2 voices, and was last updated by  sayanti 4 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3220 Reply

    Neha Bhakat
    Participant

    1) Number of recordings grouped by recclass.

    2) Heaviest and Lightest Meteorite landing recorded.

    3)Find the average mass

    #3221 Reply

    sayanti
    Participant

    1) Number of recordings grouped by recclass.

    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)

    #3226 Reply

    sayanti
    Participant

    2) Heaviest and Lightest Meteorite landing recorded.

    Ans:
    FOR HEAVIEST:

    e = foreach z1 generate a1, a5;
    f = order e by $1 DESC;
    max = LIMIT f 1;

    OUTPUT
    (Jilin,4000000)

    FOR LIGHTEST:
    g = foreach z1 generate a1, a5;
    x = order g by $1 ASC;
    min = LIMIT x 1;

    OUTPUT
    (Österplana 023,)

    #3228 Reply

    sayanti
    Participant

    3) Find the average mass

    Ans:
    grouped = group z1 all;
    avg =foreach grouped generate AVG(z1.a5);
    dump avg;

    OUTPUT
    (1791.934070865965)

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: NASA PROJECT
Your information:




cf22

Your Name (required)

Your Email (required)

Subject

Phone No

Your Message

Cart

  • No products in the cart.