Hive
  1. Hive
  2. HIVE-362

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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

        Activity

        Adam Kramer created issue -
        Raghotham Murthy made changes -
        Field Original Value New Value
        Issue Type Wish [ 5 ] Bug [ 1 ]
        Component/s Clients [ 12312587 ]
        Neil Conway made changes -
        Summary avg() returns null if any item in the list is null; create function that doesn't avg() ignores null values; consider variant that doesn't
        Zheng Shao made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development