phoenix-dev mailing list archives

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

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

James Taylor commented on PHOENIX-4624:
---------------------------------------

Yep, sorry about that - forgot to push it. It's been committed now.

> 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