phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-4624) COLLATION_KEY function cannot handle null values
Date Tue, 06 Mar 2018 00:37:00 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-4624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16387049#comment-16387049
] 

Hudson commented on PHOENIX-4624:
---------------------------------

SUCCESS: Integrated in Jenkins build Phoenix-4.x-HBase-1.3 #53 (See [https://builds.apache.org/job/Phoenix-4.x-HBase-1.3/53/])
PHOENIX-4624 COLLATION_KEY function cannot handle null values (Shehzaad (jtaylor: rev bad0381df675d7b10de200671c8738b8572ebf2f)
* (edit) phoenix-core/src/test/java/org/apache/phoenix/expression/function/CollationKeyFunctionTest.java
* (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/CollationKeyFunctionIT.java
* (edit) phoenix-core/src/main/java/org/apache/phoenix/expression/function/CollationKeyFunction.java


> COLLATION_KEY function cannot handle null values
> ------------------------------------------------
>
>                 Key: PHOENIX-4624
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4624
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Shehzaad Nakhoda
>            Assignee: Shehzaad Nakhoda
>            Priority: Major
>             Fix For: 4.14.0
>
>         Attachments: PHOENIX-4624_v1.patch
>
>
> COLLATION_KEY throws a NullPointerException when it encounters values that are null.
> Example:
> 0: jdbc:phoenix:localhost> create table hello_table (ID DECIMAL PRIMARY KEY, NAME
VARCHAR);
> No rows affected (0.323 seconds)
> 0: jdbc:phoenix:localhost> upsert into hello_table VALUES(1, 'One');
> 1 row affected (0.032 seconds)
> 0: jdbc:phoenix:localhost> upsert into hello_table VALUES(2, 'Two');
> 1 row affected (0.006 seconds)
> 0: jdbc:phoenix:localhost> upsert into hello_table VALUES(0, NULL);
> 1 row affected (0.004 seconds)
> 0: jdbc:phoenix:localhost> select * from hello_table order by collation_key(name,
'en_US');
> +------------------------------------------+------------------------------------------+
> |                    ID                    |                   NAME                 
 |
> +------------------------------------------+------------------------------------------+
> java.lang.RuntimeException: org.apache.phoenix.exception.PhoenixIOException: org.apache.phoenix.exception.PhoenixIOException:
org.apache.hadoop.hbase.DoNotRetryIOException: HELLO_TABLE,,1519258211363.5898d1758d5b82ada5b27b2a8a9fba27.:
null
> 	at org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:96)
> 	at org.apache.phoenix.util.ServerUtil.throwIOException(ServerUtil.java:62)
> 	at org.apache.phoenix.iterate.NonAggregateRegionScannerFactory.getTopNScanner(NonAggregateRegionScannerFactory.java:327)
> 	at org.apache.phoenix.iterate.NonAggregateRegionScannerFactory.getRegionScanner(NonAggregateRegionScannerFactory.java:164)
> 	at org.apache.phoenix.coprocessor.ScanRegionObserver.doPostScannerOpen(ScanRegionObserver.java:72)
> 	at org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.overrideDelegate(BaseScannerRegionObserver.java:235)
> 	at org.apache.phoenix.coprocessor.BaseScannerRegionObserver$RegionScannerHolder.nextRaw(BaseScannerRegionObserver.java:286)
> 	at org.apache.hadoop.hbase.regionserver.HRegionServer.scan(HRegionServer.java:3361)
> 	at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32492)
> 	at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2211)
> 	at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:104)
> 	at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133)
> 	at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108)
> 	at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.NullPointerException
> 	at org.apache.phoenix.expression.function.CollationKeyFunction.evaluate(CollationKeyFunction.java:121)
> 	at org.apache.phoenix.iterate.OrderedResultIterator.getResultIterator(OrderedResultIterator.java:260)
> 	at org.apache.phoenix.iterate.OrderedResultIterator.next(OrderedResultIterator.java:199)
> 	at org.apache.phoenix.iterate.NonAggregateRegionScannerFactory.getTopNScanner(NonAggregateRegionScannerFactory.java:322)
> 	... 11 more
> 	at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
> 	at sqlline.TableOutputFormat.print(TableOutputFormat.java:33)
> 	at sqlline.SqlLine.print(SqlLine.java:1652)
> 	at sqlline.Commands.execute(Commands.java:833)
> 	at sqlline.Commands.sql(Commands.java:732)
> 	at sqlline.SqlLine.dispatch(SqlLine.java:807)
> 	at sqlline.SqlLine.begin(SqlLine.java:681)
> 	at sqlline.SqlLine.start(SqlLine.java:398)
> 	at sqlline.SqlLine.main(SqlLine.java:292)
> 0: jdbc:phoenix:localhost> select name from hello_table group by name order by collation_key(name,
'en_US');
> +------------------------------------------+
> |                   NAME                   |
> +------------------------------------------+
> java.lang.NullPointerException
> 	at org.apache.phoenix.expression.function.CollationKeyFunction.evaluate(CollationKeyFunction.java:121)
> 	at org.apache.phoenix.iterate.OrderedResultIterator.getResultIterator(OrderedResultIterator.java:260)
> 	at org.apache.phoenix.iterate.OrderedResultIterator.next(OrderedResultIterator.java:199)
> 	at org.apache.phoenix.iterate.OrderedAggregatingResultIterator.next(OrderedAggregatingResultIterator.java:51)
> 	at org.apache.phoenix.jdbc.PhoenixResultSet.next(PhoenixResultSet.java:779)
> 	at sqlline.IncrementalRows.hasNext(IncrementalRows.java:62)
> 	at sqlline.TableOutputFormat.print(TableOutputFormat.java:33)
> 	at sqlline.SqlLine.print(SqlLine.java:1652)
> 	at sqlline.Commands.execute(Commands.java:833)
> 	at sqlline.Commands.sql(Commands.java:732)
> 	at sqlline.SqlLine.dispatch(SqlLine.java:807)
> 	at sqlline.SqlLine.begin(SqlLine.java:681)
> 	at sqlline.SqlLine.start(SqlLine.java:398)
> 	at sqlline.SqlLine.main(SqlLine.java:292)
> 0: jdbc:phoenix:localhost> 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message