Grokbase Groups Pig user July 2010
FAQ
I call a pig script

pig -param DATE=$date ~/bin/script.pig

inside of the pig script I filter records thru a perl udf


DEFINE parser `parser.pl` SHIP ( 'parser.pl' );

------------------------------------------------------


raw_records = LOAD '/logs/$DATE';
parsed_recs = STREAM raw_records THROUGH parser;

A simple question "How do I access the date parameter inside of the perl
script?"

Thanks

Allan.

Search Discussions

  • Dmitriy Ryaboy at Jul 27, 2010 at 6:45 pm
    DEFINE parser `parser.pl $DATE` SHIP ('parser.pl');

    Meaning -- you can pass the args on the command line you bind to the keyword
    "parser", and have your perl script read said command-line args.

    -D
    On Tue, Jul 27, 2010 at 6:18 AM, Kochis, Allan wrote:

    I call a pig script

    pig -param DATE=$date ~/bin/script.pig

    inside of the pig script I filter records thru a perl udf


    DEFINE parser `parser.pl` SHIP ( 'parser.pl' );

    ------------------------------------------------------


    raw_records = LOAD '/logs/$DATE';
    parsed_recs = STREAM raw_records THROUGH parser;

    A simple question "How do I access the date parameter inside of the perl
    script?"

    Thanks

    Allan.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedJul 27, '10 at 1:18p
activeJul 27, '10 at 6:45p
posts2
users2
websitepig.apache.org

2 users in discussion

Kochis, Allan: 1 post Dmitriy Ryaboy: 1 post

People

Translate

site design / logo © 2023 Grokbase