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

Division of an integer by an integer returns an integer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.10.0
    • None
    • impl
    • None

    Description

      Currently,

      a = load 'data' as (i:int); 
      b = foreach a generate i / 23;
      

      will result in values in b being truncated to nearest int.
      SQL standard says correct behavior in such cases is to return double. MySQL does this correctly as well.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ashutoshc Ashutosh Chauhan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: