[
https://issues.apache.org/jira/browse/HBASE-16498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15436297#comment-15436297
]
ramkrishna.s.vasudevan commented on HBASE-16498:
------------------------------------------------
I just saw the code of Scan
{code}
private byte [] startRow = HConstants.EMPTY_START_ROW;
private byte [] stopRow = HConstants.EMPTY_END_ROW;
{code}
We already set it to the default values. So your change should be fine. I was
thinking it could be a return type change. But just a query in your eg you are
explicitly setting it to NULL. (in the test case). Ideally if there is no Stop
row then there is no need to set any.
So you want to handle such cases?
> NPE when Scan's stopRow is set NULL
> -----------------------------------
>
> Key: HBASE-16498
> URL: https://issues.apache.org/jira/browse/HBASE-16498
> Project: HBase
> Issue Type: Bug
> Components: Client
> Affects Versions: 2.0.0, 1.3.0, 0.98.21
> Reporter: Pankaj Kumar
> Assignee: Pankaj Kumar
> Priority: Minor
> Attachments: HBASE-16498.patch
>
>
> During scan operation we validate whether this is the last region of table,
> if not then records will be retrieved from nextscanner. If stop row is set
> null then NPE will be thrown while validating stop row with region endkey.
> {noformat}
> java.lang.NullPointerException
> at
> org.apache.hadoop.hbase.client.ClientScanner.checkScanStopRow(ClientScanner.java:217)
> at
> org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:266)
> at
> org.apache.hadoop.hbase.client.ClientScanner.possiblyNextScanner(ClientScanner.java:237)
> at
> org.apache.hadoop.hbase.client.ClientScanner.loadCache(ClientScanner.java:537)
> at
> org.apache.hadoop.hbase.client.ClientScanner.nextWithSyncCache(ClientScanner.java:363)
> at
> org.apache.hadoop.hbase.client.ClientSimpleScanner.next(ClientSimpleScanner.java:50)
> at
> org.apache.hadoop.hbase.client.AbstractClientScanner.next(AbstractClientScanner.java:70)
> at
> org.apache.hadoop.hbase.client.TestAdmin2.testScanWithSplitKeysAndNullStartEndRow(TestAdmin2.java:803)
> {noformat}
> We should return empty byte array when start/end row is set NULL.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)