Forum

This topic contains 0 replies, has 1 voice, and was last updated by  Shivraj 2 years, 11 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1199 Reply

    Shivraj
    Participant

    The input file contains below data

    I learn big data
    I learn hadoop
    I learn sqoop

    pig commands

    word_temp = LOAD ‘/home/cloudera/Desktop/wordcountproblem’ as (words:chararray);
    word_split = FOREACH word_temp GENERATE FLATTEN(TOKENIZE(words)) as word;
    word_group = GROUP word_split BY word;
    word_count = FOREACH word_group GENERATE COUNT(word_split), group;
    store word_count into ‘/home/cloudera/Desktop/wordcount_pig’;

    output
    3 I
    1 big
    1 data
    3 learn
    1 sqoop
    1 hadoop

    Cheers,
    Shivraj

Viewing 1 post (of 1 total)
Reply To: PIG assignment – word count
Your information:




cf22

Your Name (required)

Your Email (required)

Subject

Phone No

Your Message

Cart

  • No products in the cart.