Forum

Tagged: 

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

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

    Anbu
    Participant

    Hi,

    When i try to create a macro in grunt> shell. its not allowing me.?

    [training@localhost ~]$ pig -x local;
    2015-07-26 21:31:54,863 [main] INFO org.apache.pig.Main – Logging error messages to: /home/training/pig_1437971514862.log
    2015-07-26 21:31:55,094 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine – Connecting to hadoop file system at: file:///

    grunt> DEFINE call_Macro(B1)
    >> returns Ans{
    >> D = GROUP $B1 BY Class;
    >> $Ans = FOREACH D GENERATE group,SUM(B.Marks);
    >> };
    2015-07-26 21:33:07,294 [main] ERROR org.apache.pig.tools.grunt.Grunt – ERROR 1000: Error during parsing. Encountered ” “(” “( “” at line 1, column 18.
    Was expecting one of:
    <IDENTIFIER> …
    <EXECCOMMAND> …

    Details at logfile: /home/training/pig_1437971514862.log
    grunt>

    The below query need to write in grunt> shell.

    Macro Declartion part:

    A = load ‘/home/hduser/stud.txt’ as (StudId:int,StudName:chararray,Class:int,Marks:double);

    B = FOREACH A GENERATE $2,$3;

    C = call_Macro(B);

    STORE C INTO ‘/home/hduser/call_out1’;

Viewing 1 post (of 1 total)
Reply To: How to create macro in Pig.
Your information:




cf22

Your Name (required)

Your Email (required)

Subject

Phone No

Your Message

Cart

  • No products in the cart.