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

HiveAggregateReduceFunctionsRule could generate an inconsistent result

    XMLWordPrintableJSON

Details

    Description

      HiveAggregateReduceFunctionsRule translates AVG, STDDEV_POP, STDDEV_SAMP, VAR_POP, and VAR_SAMP. Those UDFs accept string types and try to decode them as floating point values. It is possible that undecodable values exist.

      We found that it could cause inconsistent behaviors with or without CBO.

      0: jdbc:hive2://hive-hiveserver2:10000/defaul> SELECT AVG('text');
      ...
      +------+
      | _c0  |
      +------+
      | 0.0  |
      +------+
      1 row selected (18.229 seconds)
      0: jdbc:hive2://hive-hiveserver2:10000/defaul> set hive.cbo.enable=false;
      No rows affected (0.013 seconds)
      0: jdbc:hive2://hive-hiveserver2:10000/defaul> SELECT AVG('text');
      ...
      +-------+
      |  _c0  |
      +-------+
      | NULL  |
      +-------+ 

      Attachments

        Issue Links

          Activity

            People

              okumin Shohei Okumiya
              okumin Shohei Okumiya
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: