Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/147#discussion_r49880434
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java ---
    @@ -237,7 +237,9 @@ public void initializeScan(Scan scan) {
             return temp;
         }
         
    -    public Scan intersectScan(Scan scan, final byte[] originalStartKey, 
final byte[] originalStopKey, final int keyOffset, boolean 
crossesRegionBoundary) {
    +    public Scan intersectScan(Scan scan, final ImmutableBytesWritable 
originalStartKeyPtr, final ImmutableBytesWritable originalStopKeyPtr, final int 
keyOffset, boolean crossesRegionBoundary) {
    +        byte[] originalStartKey= originalStartKeyPtr.get();
    +        byte[] originalStopKey= originalStopKeyPtr.get();
    --- End diff --
    
    You can't treat an ImmutableBytesWritable the same as what was a byte[] 
before because an ImmutableBytesWritable has an offset and a length. By doing 
it this way, you're assuming that the offset is 0 and the length is 
byte[].length. Instead, you'd want to change the type and adjust the code as 
necessary:
    
        ImmutableBytesWritable originalStartKey= originalStartKeyPtr;
        ImmutableBytesWritable originalStopKey = originalStopKeyPtr;



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to