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

Biju Nair commented on PHOENIX-3921:
------------------------------------

Let me know if the proposed change makes sense and I can provide a patch.

> ScanUtil#unsetReversed doesn't seem to unset reversal of Scan
> -------------------------------------------------------------
>
>                 Key: PHOENIX-3921
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3921
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Biju Nair
>
> Created a new iterator with a {{scan}} object set to be non reversed using 
> {{ScanUtil.unsetReversed(scan)}}. But the iteration moves in the reverse 
> order. {{BaseResultIterators.java}} has the condition check
> {code}
> boolean isReverse = ScanUtil.isReversed(scan);
> {code}
> Looking at 
> [ScanUtil.java|https://github.com/apache/phoenix/blob/2cb617f352048179439d242d1165a9ffb39ad81c/phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java#L609]
>  {{isReversed}} method is defined as
> {code}
> return scan.getAttribute(BaseScannerRegionObserver.REVERSE_SCAN) != null;
> {code}
> do we need to change the condition check to compare to 
> {{PDataType.TRUE_BYTES}}
> The current logic will return {{isReversed}} as {{true}} whether the 
> {{BaseScannerRegionObserver.REVERSE_SCAN}} attribute is set to 
> {{PDataType.TRUE_BYTES}} or {{PDataType.FALSE_BYTES}} which corresponds to 
> values set in {{setReversed}} and {{unsetReversed}} methods.
>  



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to