Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 9b839b56f -> 94a6a92c3


PHOENIX-3926 Do not use EncodedColumnQualifierCellsList optimization when doing 
raw scans


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 94a6a92c3eea73ff1d4b7be47e4df734a7c0373a
Parents: 9b839b5
Author: Samarth Jain <sama...@apache.org>
Authored: Thu Jun 8 14:37:41 2017 -0700
Committer: Samarth Jain <sama...@apache.org>
Committed: Thu Jun 8 14:37:41 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/phoenix/iterate/BaseResultIterators.java | 4 ++--
 .../java/org/apache/phoenix/util/EncodedColumnsUtil.java     | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/94a6a92c/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index e72e380..8d6c107 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -269,7 +269,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
     
     private static void setQualifierRanges(boolean keyOnlyFilter, PTable 
table, Scan scan,
             StatementContext context) throws SQLException {
-        if (EncodedColumnsUtil.useEncodedQualifierListOptimization(table)) {
+        if (EncodedColumnsUtil.useEncodedQualifierListOptimization(table, 
scan)) {
             Pair<Integer, Integer> minMaxQualifiers = new Pair<>();
             for (Pair<byte[], byte[]> whereCol : 
context.getWhereConditionColumns()) {
                 byte[] cq = whereCol.getSecond();
@@ -375,7 +375,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
         if (statement.getHint().hasHint(Hint.SEEK_TO_COLUMN)) {
             // Allow seeking to column during filtering
             preventSeekToColumn = false;
-        } else if 
(!EncodedColumnsUtil.useEncodedQualifierListOptimization(table)) {
+        } else if 
(!EncodedColumnsUtil.useEncodedQualifierListOptimization(table, scan)) {
             /*
              * preventSeekToColumn cannot be true, even if hinted, when 
encoded qualifier list
              * optimization is being used. When using the optimization, it is 
necessary that we

http://git-wip-us.apache.org/repos/asf/phoenix/blob/94a6a92c/phoenix-core/src/main/java/org/apache/phoenix/util/EncodedColumnsUtil.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/EncodedColumnsUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/EncodedColumnsUtil.java
index 591fc0c..0cf996a 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/EncodedColumnsUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/EncodedColumnsUtil.java
@@ -125,8 +125,12 @@ public class EncodedColumnsUtil {
         return new Pair<>(minQ, maxQ);
     }
 
-    public static boolean useEncodedQualifierListOptimization(PTable table) {
-        return table.getImmutableStorageScheme() != null
+    public static boolean useEncodedQualifierListOptimization(PTable table, 
Scan scan) {
+        /*
+         * HBase doesn't allow raw scans to have columns set. And we need 
columns to be set
+         * explicitly on the scan to use this optimization.
+         */
+        return !scan.isRaw() && table.getImmutableStorageScheme() != null
                 && table.getImmutableStorageScheme() == 
ImmutableStorageScheme.ONE_CELL_PER_COLUMN
                 && usesEncodedColumnNames(table) && !table.isTransactional()
                 && !ScanUtil.hasDynamicColumns(table);

Reply via email to