You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by sa...@apache.org on 2016/08/05 21:03:26 UTC

[27/50] [abbrv] phoenix git commit: PHOENIX-3121 Queries with filter and reverse scan failing when limit is a multiple of scanner cache size

PHOENIX-3121 Queries with filter and reverse scan failing when limit is a multiple of scanner cache size


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/6de5b613
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6de5b613
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6de5b613

Branch: refs/heads/encodecolumns
Commit: 6de5b613abee53e84ada5fb6404897734043e71a
Parents: 829db70
Author: Samarth <sa...@salesforce.com>
Authored: Wed Jul 27 15:30:24 2016 -0700
Committer: Samarth <sa...@salesforce.com>
Committed: Wed Jul 27 15:30:24 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/execute/BaseQueryPlan.java    | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6de5b613/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java b/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
index 757e304..f6c7be4 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/BaseQueryPlan.java
@@ -236,6 +236,12 @@ public abstract class BaseQueryPlan implements QueryPlan {
         
         if (OrderBy.REV_ROW_KEY_ORDER_BY.equals(orderBy)) {
             ScanUtil.setReversed(scan);
+            // Hack for working around PHOENIX-3121 (reverse scans fail when limit is a multiple of scanner cache size).
+            //TODO: remove once PHOENIX-3121 is fixed.
+            int scannerCacheSize = context.getStatement().getFetchSize();
+            if (limit != null && limit % scannerCacheSize == 0) {
+                scan.setCaching(scannerCacheSize + 1);
+            }
         }
         
         if (statement.getHint().hasHint(Hint.SMALL)) {