Grokbase Groups Pig user January 2010
FAQ
Hi,

We are trying to test a pig script using JUnit and the PigServer. This pig
script uses parameters. It works great running it through the pig command
line, but the registerScript function blows with a ParseException on both
the %declare and %default directives.

org.apache.pig.tools.pigscript.parser.ParseException: Encountered " <PATH>
"%declare "" at line 2, column 1.
Was expecting one of:
<EOF>
"cat" ...
"cd" ...
"cp" ...
...


Am I doing something wrong?

Thanks,
Christian

Search Discussions

  • Olga Natkovich at Jan 6, 2010 at 6:15 pm
    Yes, parameter substitution is implemented as a preprocessor that
    rewrites the script before passing it to PigServer.

    Olga

    -----Original Message-----
    From: Christian
    Sent: Wednesday, January 06, 2010 8:56 AM
    To: [email protected]
    Subject: ParseException when using PigServer.registerScript against a
    file that has a %declare directive

    Hi,

    We are trying to test a pig script using JUnit and the PigServer. This
    pig
    script uses parameters. It works great running it through the pig
    command
    line, but the registerScript function blows with a ParseException on
    both
    the %declare and %default directives.

    org.apache.pig.tools.pigscript.parser.ParseException: Encountered "
    <PATH>
    "%declare "" at line 2, column 1.
    Was expecting one of:
    <EOF>
    "cat" ...
    "cd" ...
    "cp" ...
    ...


    Am I doing something wrong?

    Thanks,
    Christian
  • Thejas Nair at Jan 6, 2010 at 6:20 pm
    Hi Christian,
    Parameter substitution is currently supported only for the command line mode
    (batch mode).
    A preprocessor processes the entire pig-script at once to do parameter
    substitution. This preprocessor does not get invoked when you call PigServer
    directly or if the interactive mode (grunt shell) is used.

    -Thejas



    On 1/6/10 8:56 AM, "Christian" wrote:

    Hi,

    We are trying to test a pig script using JUnit and the PigServer. This pig
    script uses parameters. It works great running it through the pig command
    line, but the registerScript function blows with a ParseException on both
    the %declare and %default directives.

    org.apache.pig.tools.pigscript.parser.ParseException: Encountered " <PATH>
    "%declare "" at line 2, column 1.
    Was expecting one of:
    <EOF>
    "cat" ...
    "cd" ...
    "cp" ...
    ...


    Am I doing something wrong?

    Thanks,
    Christian

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedJan 6, '10 at 4:56p
activeJan 6, '10 at 6:20p
posts3
users3
websitepig.apache.org

People

Translate

site design / logo © 2023 Grokbase