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

Incorrect input types passed on to eval function

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.9.0
    • Component/s: impl
    • Labels:
      None

      Description

      The below script fails by throwing a ClassCastException from the MAX udf. The udf expects the value of the bag supplied to be databyte array, but at run time the udf gets the actual type, ie Double in this case. This causes the script execution to fail with exception;

      Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to org.apache.pig.data.DataByteArray

      The same script runs properly with Pig 0.8.

      A = LOAD 'myinput' as (f1,f2,f3);
      B = foreach A generate f1,f2+f3/1000.0 as doub;
      C = group B by f1;
      D = foreach C generate (long)(MAX(B.doub)) as f4;
      dump D;
      

      myinput
      -------
      a 1000 12345
      b 2000 23456
      c 3000 34567
      a 1500 54321
      b 2500 65432

        Attachments

        1. PIG-2004-0.patch
          4 kB
          Daniel Dai
        2. PIG-2004.1.patch
          8 kB
          Thejas M Nair

          Activity

            People

            • Assignee:
              thejas Thejas M Nair
              Reporter:
              vivekp Vivek Padmanabhan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: