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

Casting complex type(tuple/bag/map) does not take effect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.2.0
    • 0.7.0
    • impl
    • None
    • Reviewed

    Description

      Consider the following Pig script which casts return values of the SQUARE UDF which are tuples of doubles to long. The describe output of B shows it is long, however the result is still double.

      register statistics.jar;
      A = load 'myfloatdata.txt' using PigStorage() as (doublecol:double);
      B = foreach A generate (tuple(long))statistics.SQUARE(doublecol) as squares:(loadtimesq);
      describe B;
      explain B;
      dump B;
      

      ===========================================
      Describe output of B:
      B:

      {squares: (loadtimesq: long)}

      ===========================================================
      Sample output of B:
      ((7885.44))
      ((792098.2200010001))
      ((1497360.9268889998))
      ((50023.7956))
      ((0.972196))
      ((0.30980356))
      ((9.9760144E-7))
      ===========================================================
      Cause: The cast for Tuples has not been implemented in POCast.java

      Attachments

        1. myfloatdata.txt
          2 kB
          Viraj Bhat
        2. SQUARE.java
          1 kB
          Viraj Bhat
        3. PIG-613-1.patch
          64 kB
          Daniel Dai
        4. PIG-613-2.patch
          73 kB
          Daniel Dai

        Issue Links

          Activity

            People

              daijy Daniel Dai
              viraj Viraj Bhat
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: