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

Casting docs do not cover casting chararrays

    XMLWordPrintableJSON

    Details

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

      Description

      The documentation appears to be out of date in regards to casting chararrays.
      http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#Cast+Operators lists chararray as being uncastable to anything else.

      This isn't the case since PIG-893

      grunt> x = load 'tmp/numbers' as (a:chararray, b:chararray);
      grunt> y = foreach x generate ((long) b) + 1;
      grunt> z = foreach y generate (chararray) $0;
      grunt> dump y
      (2L)
      (4L)
      (6L)
      (3L)
      (8L)
      grunt> dump z
      (2)
      (4)
      (6)
      (3)
      (8)

        Attachments

          Activity

            People

            • Assignee:
              chandec Corinne Chandel
              Reporter:
              dvryaboy Dmitriy V. Ryaboy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: