phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Batyrshin (Jira)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-5568) PERCENTILE_CONT doesn't work with length() function
Date Mon, 11 Nov 2019 14:10:00 GMT
Alex Batyrshin created PHOENIX-5568:
---------------------------------------

             Summary: PERCENTILE_CONT doesn't work with length() function
                 Key: PHOENIX-5568
                 URL: https://issues.apache.org/jira/browse/PHOENIX-5568
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.14.2
            Reporter: Alex Batyrshin


{code:java}
CREATE TABLE percentile_test (
    pk varchar primary key,
    data varchar
);

UPSERT INTO percentile_test VALUES ('pk1', '12345');
UPSERT INTO percentile_test VALUES ('pk2', '123');
UPSERT INTO percentile_test VALUES ('pk3', '1234567890');

SELECT PERCENTILE_CONT( 0.9 )  WITHIN GROUP ( ORDER BY length(data) ASC ) FROM percentile_test;

java.lang.ClassCastException: org.apache.phoenix.expression.function.LengthFunction cannot
be cast to org.apache.phoenix.expression.ColumnExpression
        at org.apache.phoenix.expression.aggregator.PercentileClientAggregator.evaluate(PercentileClientAggregator.java:50)
        at org.apache.phoenix.schema.KeyValueSchema.toBytes(KeyValueSchema.java:112)
        at org.apache.phoenix.schema.KeyValueSchema.toBytes(KeyValueSchema.java:93)
        at org.apache.phoenix.expression.aggregator.Aggregators.toBytes(Aggregators.java:112)
        at org.apache.phoenix.iterate.BaseGroupedAggregatingResultIterator.next(BaseGroupedAggregatingResultIterator.java:82)
        at org.apache.phoenix.iterate.UngroupedAggregatingResultIterator.next(UngroupedAggregatingResultIterator.java:39)
        at org.apache.phoenix.iterate.DelegateResultIterator.next(DelegateResultIterator.java:44)
        at org.apache.phoenix.trace.TracingIterator.next(TracingIterator.java:56)
        at org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:805)
        at sqlline.BufferedRows.<init>(BufferedRows.java:37)
        at sqlline.SqlLine.print(SqlLine.java:1660)
        at sqlline.Commands.execute(Commands.java:833)
        at sqlline.Commands.sql(Commands.java:732)
        at sqlline.SqlLine.dispatch(SqlLine.java:813)
        at sqlline.SqlLine.begin(SqlLine.java:686)
        at sqlline.SqlLine.start(SqlLine.java:398)
        at sqlline.SqlLine.main(SqlLine.java:291){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message