Files
impala/testdata
Thomas Tauber-Marshall 96b976aff3 IMPALA-6295: Fix mix/max handling of 'nan' and 'inf'
This patch fixes several issues related to the min/max aggregate
functions and their handling of 'nan' and 'inf':
- Previously, if 'inf' or '-inf' was the only value for the min/max
  and codegen was being used, the result would be incorrect. This
  occurred, for example in the case of 'inf' and 'min', because we
  set an initial value of numeric_limits::max, which is less than
  'inf', so the returned min was numeric_limits::max when it should be
  'inf'. The fix is to set the initial value to
  numeric_limits::infinity.
- Previously, if one of the values was 'nan', the result of min/max
  was non-deterministic depending on the order the values were
  evaluated in. This occurs because 'nan' < or > 'any value' is always
  false, so if the first value added was 'nan', all other comparisons
  would be false and 'nan' would be returned, whereas if the first
  value wasn't 'nan' then the 'nan' wouldn't be returned. The fix is
  to treat 'nan' specially and to always return 'nan' if there is a
  single 'nan' value.

Testing:
- Added e2e tests for both scenarios, as well as adding a little extra
  nan/inf coverage for other aggregate functions.

Change-Id: Ia1e206105937ce5afc75ca5044597d39b3dc6a81
Reviewed-on: http://gerrit.cloudera.org:8080/8854
Reviewed-by: Bikramjeet Vig <bikramjeet.vig@cloudera.com>
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins
2018-01-04 01:23:43 +00:00
..
2014-01-08 10:46:44 -08:00
2014-01-08 10:46:35 -08:00
2014-01-08 10:46:35 -08:00
2011-09-28 09:02:07 -07:00
2011-12-30 00:26:27 -08:00
2011-09-28 09:02:07 -07:00
2014-01-08 10:44:40 -08:00
2016-09-22 02:00:50 +00:00
2017-08-31 01:40:47 +00:00