phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Mottram <Simon.Mott...@cucumber.co.nz>
Subject Re: Unable to use some functions on DECIMAL columns
Date Sat, 01 Aug 2020 01:10:03 GMT
Hi Josh

Thanks very much for the reply, I did share the error at the top of the email

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)

There's a few SQL statements to reliably reproduce the error, I thought that would be enough
but I'm very open to providing any assistance I can.  What further info would be helpful?

Cheers

S
________________________________
From: Josh Elser <elserj@apache.org>
Sent: 01 August 2020 2:26 AM
To: user@phoenix.apache.org <user@phoenix.apache.org>
Subject: Re: Unable to use some functions on DECIMAL columns

Simon,

If you have clear bug report, please open up a Jira issue for it. Keep
in mind that as much information as you can provide to indicate the
problem you see, the better. Assume that whoever might read your Jira
issue is coming from zero-context. Right now, you haven't shared any
error, so you're expecting a bit from someone to both help you by first
reproducing the code you've shared, analyze if an error is expected, and
then fix it.

Ideally, you can submit a patch to try to fix the issues you're seeing ;)

On 7/29/20 10:18 PM, Simon Mottram wrote:
>
> 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;

Mime
View raw message