Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 158ea9ab8 -> ade0c52e7


PHOENIX-4366 Rebuilding a local index fails sometimes (addendum)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: ade0c52e7009e95a6a3220e84128dd5898d92752
Parents: 158ea9a
Author: James Taylor <jtay...@salesforce.com>
Authored: Wed Apr 11 15:20:08 2018 -0700
Committer: James Taylor <jtay...@salesforce.com>
Committed: Wed Apr 11 15:29:34 2018 -0700

----------------------------------------------------------------------
 .../NonAggregateRegionScannerFactory.java       | 36 +++++++++++---------
 1 file changed, 20 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/ade0c52e/phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java
index 438afd8..92d5464 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/NonAggregateRegionScannerFactory.java
@@ -18,8 +18,15 @@
 
 package org.apache.phoenix.iterate;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import static 
org.apache.phoenix.util.EncodedColumnsUtil.getMinMaxQualifiersFromScan;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.KeyValue;
@@ -63,15 +70,8 @@ import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.ServerUtil;
 import org.apache.tephra.Transaction;
 
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import static 
org.apache.phoenix.util.EncodedColumnsUtil.getMinMaxQualifiersFromScan;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 
 public class NonAggregateRegionScannerFactory extends RegionScannerFactory {
 
@@ -104,13 +104,17 @@ public class NonAggregateRegionScannerFactory extends 
RegionScannerFactory {
     boolean useNewValueColumnQualifier = 
EncodedColumnsUtil.useNewValueColumnQualifier(scan);
 
     Set<KeyValueColumnExpression> arrayKVRefs = Sets.newHashSet();
+    KeyValueSchema kvSchema = null;
+    ValueBitSet kvSchemaBitSet = null;
     Expression[] arrayFuncRefs = 
deserializeArrayPositionalExpressionInfoFromScan(scan, innerScanner, 
arrayKVRefs);
-    KeyValueSchema.KeyValueSchemaBuilder builder = new 
KeyValueSchema.KeyValueSchemaBuilder(0);
-    for (Expression expression : arrayFuncRefs) {
-        builder.addField(expression);
+    if (arrayFuncRefs != null) {
+        KeyValueSchema.KeyValueSchemaBuilder builder = new 
KeyValueSchema.KeyValueSchemaBuilder(0);
+        for (Expression expression : arrayFuncRefs) {
+            builder.addField(expression);
+        }
+        kvSchema = builder.build();
+        kvSchemaBitSet = ValueBitSet.newInstance(kvSchema);
     }
-    KeyValueSchema kvSchema = builder.build();
-    ValueBitSet kvSchemaBitSet = ValueBitSet.newInstance(kvSchema);
     TupleProjector tupleProjector = null;
     HRegion dataRegion = null;
     IndexMaintainer indexMaintainer = null;

Reply via email to