Josh Elser created PHOENIX-3940:
-----------------------------------
Summary: NullPointerException on PERCENTILE_CONT over an empty
result set
Key: PHOENIX-3940
URL: https://issues.apache.org/jira/browse/PHOENIX-3940
Project: Phoenix
Issue Type: Bug
Reporter: Josh Elser
Assignee: Josh Elser
Priority: Minor
Fix For: 4.12.0
A user reported that when running a query with {{PERCENTILE_CONT}} where the
selection has no results (e.g. nothing to compute the P_C on), a
NullPointerException is thrown.
Glancing at the code, it can handle the case where there is only one value, but
handling the case where there are no values fails.
Reading over Oracle and SqlServer docs, it doesn't saw what "should" happen in
these cases. Is "0" a sane value? Or is an exception actually a good idea?
https://docs.microsoft.com/en-us/sql/t-sql/functions/percentile-cont-transact-sql
https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions115.htm#SQLRF00687
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)