Pig
  1. Pig
  2. PIG-2279

Error when using PigUnit on a script that uses IMPORT another script with macros

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Executing PigUnit against a script which uses the import command always fails with error:
      org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <line 4> : Duplicated import file 'somemacro.pig'

      Even though the script being tested does not preform an import of the same script twice.

      I've tried with a couple of different scripts/tests and it appears that PigUnit fails on any test of a pig script where an import command is issued.

      1. duplication-pigunit-parser-exception-HACK.patch
        2 kB
        Johannes Schwenk
      2. test-macro.zip
        1 kB
        Mark Roddy

        Issue Links

          Activity

          Hide
          Ruslan Al-Fakikh added a comment -

          It seems to be a duplicate of
          https://issues.apache.org/jira/browse/PIG-3114

          Show
          Ruslan Al-Fakikh added a comment - It seems to be a duplicate of https://issues.apache.org/jira/browse/PIG-3114
          Hide
          Leonardo Brambilla added a comment -

          Hello Mark, do you have the patch to fix this issue? Would be great if you can post it here or send a link to github for instance.

          Thanks in advance.

          Show
          Leonardo Brambilla added a comment - Hello Mark, do you have the patch to fix this issue? Would be great if you can post it here or send a link to github for instance. Thanks in advance.
          Hide
          Juan Gentile added a comment -

          Thanks for the hack Johannes, I'd like to see Mark's solution though, Mark, could you attach it?

          Thank you,

          Show
          Juan Gentile added a comment - Thanks for the hack Johannes, I'd like to see Mark's solution though, Mark, could you attach it? Thank you,
          Hide
          Johannes Schwenk added a comment -

          Attached my patch, which is an ugly HACK, as it suppresses ParserException beeing thrown for both duplicate imports and duplicate macros. Use it at your own risk!

          Show
          Johannes Schwenk added a comment - Attached my patch, which is an ugly HACK, as it suppresses ParserException beeing thrown for both duplicate imports and duplicate macros. Use it at your own risk!
          Hide
          Daniel Dai added a comment -

          Mark, can you post the patch on Jira?

          Show
          Daniel Dai added a comment - Mark, can you post the patch on Jira?
          Hide
          Juan Gentile added a comment -

          Hi Mark, yes please, it'd be useful. Thank you!!

          Show
          Juan Gentile added a comment - Hi Mark, yes please, it'd be useful. Thank you!!
          Hide
          Mark Roddy added a comment -

          Juan, to work around I run a patched version of Pig that doesn't raise an error on duplicate imports. I could provide the patch if you were interested.

          Show
          Mark Roddy added a comment - Juan, to work around I run a patched version of Pig that doesn't raise an error on duplicate imports. I could provide the patch if you were interested.
          Hide
          Juan Gentile added a comment -

          I'm also having this problem, is there any workaround?

          Thank you

          Show
          Juan Gentile added a comment - I'm also having this problem, is there any workaround? Thank you
          Hide
          Mark Roddy added a comment -

          Attached a sample PigUnit test that fails with the previously described error.

          Show
          Mark Roddy added a comment - Attached a sample PigUnit test that fails with the previously described error.

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Roddy
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:

                Development