Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-6459

Change the precison/scale for intermediate sum result in the avg() udf

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.13.0
    • 0.13.0
    • UDF
    • None

    Description

      The avg() udf, when applied to a decimal column, selects the precision/scale of the intermediate sum field as (p+4, s+4), which is the same for the precision/scale of the avg() result. However, the additional scale increase is unnecessary, and the problem of data overflow may occur. The requested change is that for the intermediate sum result, the precsion/scale is set to (p+10, s), which is consistent to sum() udf. The avg() result still keeps its precision/scale.

      Attachments

        1. HIVE-6459.4.patch
          45 kB
          Xuefu Zhang
        2. HIVE-6459.3.patch
          49 kB
          Xuefu Zhang
        3. HIVE-6459.2.patch
          49 kB
          Xuefu Zhang
        4. HIVE-6459.1.patch
          6 kB
          Xuefu Zhang
        5. HIVE-6459.patch
          4 kB
          Xuefu Zhang

        Issue Links

          Activity

            People

              xuefuz Xuefu Zhang
              xuefuz Xuefu Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: