[
https://issues.apache.org/jira/browse/PHOENIX-3940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Josh Elser updated PHOENIX-3940:
--------------------------------
Attachment: PHOENIX-3940.001.patch
.001 Adds a test for both of the values being null. Added IT which breaks
before the fix.
I'm not sure if {{return false}} (which causes the client to see a {{null}}
value) is the proper action or not. I would welcome any opinions :)
> 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
>
> Attachments: PHOENIX-3940.001.patch
>
>
> 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)