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

Error in projection implementation or in typechecking when casting a member of Bag

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • None
    • 0.9.0
    • None
    • None
    • i686 i386 GNU/Linux

    Description

      As one of its members, a bag contains "age" of type "int". When this value is used as an argument to DIFF and cast as an int for the comparison, the following error is thrown:

      9/02/11 14:20:46 INFO mapReduceLayer.MapReduceLauncher: 50% complete
      09/02/11 14:21:31 ERROR mapReduceLayer.MapReduceLauncher: Map reduce job failed
      09/02/11 14:21:31 ERROR mapReduceLayer.MapReduceLauncher: Number of failed jobs: 1
      09/02/11 14:21:31 ERROR mapReduceLayer.MapReduceLauncher: Job failed!
      error message for task: map
      error message for task: reduce
      09/02/11 14:21:31 ERROR grunt.Grunt: ERROR 1072: Out of bounds access: Request for field number 1 exceeds tuple size of 1

      Steps to reproduce

      1. valid use of DIFF with valid cast for bag field
        TEST ErrorHandling.AggregateFunc_601

      A =LOAD '/user/pig/tests/data/types/DataAll' USING PigStorage() AS ( Fint:int, Flong:long, Fdouble:double, Ffloat:float, Fchar:chararray, Fchararray:chararray, Fbytearray:bytearray, Fmap:map[], Fbag:BAG

      { t:tuple( name, age, avg ) }

      , Ftuple name:chararray, age:int, avg:float) );
      B =GROUP A ALL;
      X =FOREACH B GENERATE DIFF ( ( BAG

      {tuple(int)} ) A.Fbag.age, A.Fint );
      STORE X INTO '/user/pig/tests/results/araceli.1234390832/AggregateFunc_601.out' USING PigStorage();

      # invalid use of DIFF with valid cast for bag field, DIFF contains one argument instead off two
      TEST ErrorHandling.AggregateFunc_60

      A =LOAD '/user/pig/tests/data/types/DataAll' USING PigStorage() AS ( Fint:int, Flong:long, Fdouble:double, Ffloat:float, Fchar:chararray, Fchararray:chararray, Fbytearray:bytearray, Fmap:map[], Fbag:BAG{ t:tuple( name, age, avg ) }, Ftuple name:chararray, age:int, avg:float) );
      B =GROUP A ALL;
      X =FOREACH B GENERATE DIFF ( ( BAG{tuple(int)}

      ) A.Fbag.age );
      STORE X INTO '/user/pig/tests/results/araceli.1234381533/AggregateFunc_60.out' USING PigStorage();

      Attachments

        Activity

          People

            gates Alan Gates
            araceli Araceli Henley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: