If you try the queries marked with BUG below, you get an exception

SQL Error [00000]: Error -1 (00000) : Error while executing SQL "ESELECT PERCENTILE_DISC (0.5) WITHIN GROUP (ORDER BY DECIMALCOLUMN ASC) FROM TEST.TESTEXCEPTIONS": Remote driver error: ArrayIndexOutOfBoundsException: (null exception message)

As far as I can tell I am using the functions correctly.

Best Regards

Simon

To reproduce:

Using HBase
HBASE_VERSION=2.0.0
HBASE_MINOR_VERSION=2.0
PHOENIX_VERSION=5.0.0

Connecting using thin client: phoenix-5.0.0-HBase-2.0-thin-client.jar

NOTE: We can't use thick client as I haven't resolved issues connecting my API which runs inside docker.  That's another story.

CREATE TABLE IF NOT EXISTS TEST.TESTEXCEPTIONS ( KEYCOL VARCHAR NOT NULL PRIMARY KEY, INTEGERCOLUMN INTEGER , DECIMALCOLUMN DECIMAL);

UPSERT INTO TEST.TESTEXCEPTIONS(KEYCOL, INTEGERCOLUMN, DECIMALCOLUMN) VALUES('A', 1, 1.1);
UPSERT INTO TEST.TESTEXCEPTIONS(KEYCOL, INTEGERCOLUMN, DECIMALCOLUMN) VALUES('B', 2, 2.2);
UPSERT INTO TEST.TESTEXCEPTIONS(KEYCOL, INTEGERCOLUMN, DECIMALCOLUMN) VALUES('C', 3, 3.3);

-- PERCENTILE_DISC
-- Integer columns works
SELECT PERCENTILE_DISC (0.5) WITHIN GROUP (ORDER BY INTEGERCOLUMN ASC) FROM TEST.TESTEXCEPTIONS;
 
-- BUG: Decimal columns throws NPE
SELECT PERCENTILE_DISC (0.5) WITHIN GROUP (ORDER BY DECIMALCOLUMN ASC) FROM TEST.TESTEXCEPTIONS;

-- STDDEV_POP
-- Integer columns works
SELECT STDDEV_POP(INTEGERCOLUMN) FROM TEST.TESTEXCEPTIONS;

-- BUG:  Decimal columns throws NPE
SELECT STDDEV_POP(DECIMALCOLUMN) FROM TEST.TESTEXCEPTIONS;

-- STDDEV_SAMP
-- Integer columns works
SELECT STDDEV_SAMP(INTEGERCOLUMN) FROM TEST.TESTEXCEPTIONS;

-- BUG:  Decimal columns throws NPE
SELECT STDDEV_SAMP(DECIMALCOLUMN) FROM TEST.TESTEXCEPTIONS;


-- PERCENTILE_CONT
-- Integer columns works
SELECT PERCENTILE_CONT (0.5) WITHIN GROUP (ORDER BY INTEGERCOLUMN ASC) FROM TEST.TESTEXCEPTIONS;
 
-- Decimal columns works
SELECT PERCENTILE_CONT (0.5) WITHIN GROUP (ORDER BY DECIMALCOLUMN ASC) FROM TEST.TESTEXCEPTIONS;