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

Bug in Schema comparison for casting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None
    • i686 i386 GNU/Linux

    Description

      This is a bug int he Schema comparison for casting. This is a valid use of a cast in SUM, the first and second arguments are a cast to a Bag with an int.

      ERROR 1045: Could not infer the matching function for org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an explicit cast.

      TEST: AggregateFunc_61

      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 SUM ( ( BAG

      {tuple(int)} ) A.Fbag.age, ( BAG{tuple(int)}

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

      Suggest you also try:
      X =FOREACH B GENERATE SUM ( ( BAG

      {tuple(int)}

      ) A.Fbag.age, A.Fint );

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              araceli Araceli Henley
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: