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

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

ABORTED: Integrated in Jenkins build PreCommit-PHOENIX-Build #1785 (See 
[https://builds.apache.org/job/PreCommit-PHOENIX-Build/1785/])
PHOENIX-4624 COLLATION_KEY function cannot handle null values (Shehzaad 
(jtaylor: rev 916186e974da77e4b58ca9392c3052957b8eecba)
* (edit) 
phoenix-core/src/test/java/org/apache/phoenix/expression/function/CollationKeyFunctionTest.java
* (edit) 
phoenix-core/src/main/java/org/apache/phoenix/expression/function/CollationKeyFunction.java
* (edit) 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CollationKeyFunctionIT.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)

Reply via email to