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 2017/03/09 19:02:53 UTC

phoenix git commit: PHOENIX-3727 Upserts into salted table are failing in Phoenix-Calcite

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 fe5b2a75b -> 5844cc48d


PHOENIX-3727 Upserts into salted table are failing in Phoenix-Calcite


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 5844cc48d1b3664fbf33e9762c24f759e75fe198
Parents: fe5b2a7
Author: Samarth <sa...@salesforce.com>
Authored: Thu Mar 9 11:02:46 2017 -0800
Committer: Samarth <sa...@salesforce.com>
Committed: Thu Mar 9 11:02:46 2017 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/compile/UpsertCompiler.java   | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5844cc48/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
index 260e591..2304d83 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java
@@ -129,7 +129,7 @@ public class UpsertCompiler {
             pkValues[0] = new byte[] {0};
         }
         for(int i = 0; i < numSplColumns; i++) {
-            pkValues[i] = values[i];
+            pkValues[i + (table.getBucketNum() != null ? 1 : 0)] = values[i];
         }
         Long rowTimestamp = null; // case when the table doesn't have a row timestamp column
         RowTimestampColInfo rowTsColInfo = new RowTimestampColInfo(useServerTimestamp, rowTimestamp);
@@ -191,10 +191,6 @@ public class UpsertCompiler {
             if(tableRef.getTable().getViewIndexId() != null) {
                 values[i++] = PSmallint.INSTANCE.toBytes(tableRef.getTable().getViewIndexId());
             }
-            
-            for(int k = 0; k <  pkSlotIndexes.length; k++) {
-                pkSlotIndexes[k] += (i + (tableRef.getTable().getBucketNum() != null ? 1 : 0));
-            }
         }
         int rowCount = 0;
         Map<ImmutableBytesPtr, RowMutationState> mutation = Maps.newHashMapWithExpectedSize(batchSize);