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

avg() ignores null values; consider variant that doesn't

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None

      Description

      Some of the current aggregates (sum, avg) have a fairly standard behavior: If any item in the list is NULL, the sum, average, etc., cannot be computed. And so, NULL is returned.

      1) If this is the case, the query should return much faster--see a null, return NULL, exit(0).

      2) It would be nice to have versions or ways to use these functions with NULL data--specifically, to treat the NULL as zero or to ignore the NULL and return the results for non-NULL data.

      This also would apply to the variance functions referenced in https://issues.apache.org/jira/browse/HIVE-165

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              akramer Adam Kramer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: