mirror of
https://github.com/apache/impala.git
synced 2026-01-07 00:02:28 -05:00
The analytic function PERCENT_RANK() is implemented as a query rewrite in the analysis stage. An edge case where the count of the rows returned is 1 resulted in a divide by zero which returned NaN as the result. This patch fixes that by creating a conditional expression. Change-Id: Ic8d826363e4108e0246b8e844355f3382a4a3193 Reviewed-on: http://gerrit.cloudera.org:8080/1131 Reviewed-by: Sailesh Mukil <sailesh@cloudera.com> Tested-by: Internal Jenkins