Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-2279

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: 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. test-macro.zip
        1 kB
        Mark Roddy
      2. duplication-pigunit-parser-exception-HACK.patch
        2 kB
        Johannes Schwenk

        Issue Links

          Activity

          Hide
          markroddy Mark Roddy added a comment -

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

          Show
          markroddy Mark Roddy added a comment - Attached a sample PigUnit test that fails with the previously described error.
          Hide
          juan.gentile Juan Gentile added a comment -

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

          Thank you

          Show
          juan.gentile Juan Gentile added a comment - I'm also having this problem, is there any workaround? Thank you
          Hide
          markroddy 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
          markroddy 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 Juan Gentile added a comment -

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

          Show
          juan.gentile Juan Gentile added a comment - Hi Mark, yes please, it'd be useful. Thank you!!
          Hide
          daijy Daniel Dai added a comment -

          Mark, can you post the patch on Jira?

          Show
          daijy Daniel Dai added a comment - Mark, can you post the patch on Jira?
          Hide
          johannesch 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
          johannesch 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
          juan.gentile 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 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
          leon29 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
          leon29 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
          metaruslan Ruslan Al-Fakikh added a comment -

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

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

            People

            • Assignee:
              Unassigned
              Reporter:
              markroddy Mark Roddy
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:

                Development