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

several aggregate functions do not check the number of arguments and do not correctly check for a type "bag"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • i686 i386 GNU/Linux

    Description

      DIFF expects two bags as the argument. But in this negative test case we pass:
      1) there is a single argument to diff instead of two,
      2) The argument should be a bag but is an int.

      TEST: AggregateFunc_190

      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( A.Fint) + DIFF( A.Fint);
      STORE X INTO '/user/pig/tests/results/araceli.1234381533/AggregateFunc_190.out' USING PigStorage();

      ERROR 1000: Error during parsing. Atomic field expected but found non-atomic field

      TEST AggregateFunc_1901

      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( A.Fint, A.Fint) + DIFF( A.Fint, A.Fint);
      STORE X INTO '/user/pig/tests/results/araceli.1234467894/AggregateFunc_1901.out' USING PigStorage();

      ERROR 1000: Error during parsing. Atomic field expected but found non-atomic field

      TEST AggregateFunc_1902

      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( A.Fint, A.Fint + A.Fint);
      STORE X INTO '/user/pig/tests/results/araceli.1234467894/AggregateFunc_1902.out' USING PigStorage();

      throws error: ERROR 1039: Incompatible types in Add Operator left hand side:bag right hand side:bag

      Attachments

        Activity

          People

            thejas Thejas Nair
            araceli Araceli Henley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: