phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbo...@apache.org
Subject [47/51] [abbrv] phoenix git commit: PHOENIX-4855 Continue to write base table column metadata when creating a view in order to support rollback (addendum)
Date Wed, 17 Oct 2018 21:53:34 GMT
PHOENIX-4855 Continue to write base table column metadata when creating a view in order to
support rollback (addendum)


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

Branch: refs/heads/4.x-cdh5.15
Commit: 00ba63b5ab575365013bb15990fdda045a18d63c
Parents: 708a788
Author: Thomas D'Silva <tdsilva@apache.org>
Authored: Sat Oct 6 20:40:54 2018 +0100
Committer: Pedro Boado <pboado@apache.org>
Committed: Wed Oct 17 22:50:43 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/00ba63b5/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
index 18c9000..52dfe99 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDatabaseMetaData.java
@@ -737,9 +737,10 @@ public class PhoenixDatabaseMetaData implements DatabaseMetaData {
             boolean isSalted = table.getBucketNum()!=null;
             boolean tenantColSkipped = false;
             List<PColumn> columns = table.getColumns();
-            columns = Lists.newArrayList(columns.subList(isSalted ? 1 : 0, columns.size()));
+            int startOffset = isSalted ? 1 : 0;
+			columns = Lists.newArrayList(columns.subList(startOffset, columns.size()));
             for (PColumn column : columns) {
-                if (isTenantSpecificConnection && column.equals(table.getPKColumns().get(0)))
{
+                if (isTenantSpecificConnection && column.equals(table.getPKColumns().get(startOffset)))
{
                     // skip the tenant column
                     tenantColSkipped = true;
                     continue;
@@ -874,7 +875,7 @@ public class PhoenixDatabaseMetaData implements DatabaseMetaData {
                 byte[] keySeqBytes = ByteUtil.EMPTY_BYTE_ARRAY;
                 int pkPos = table.getPKColumns().indexOf(column);
                 if (pkPos!=-1) {
-                    short keySeq = (short) (pkPos + 1 - (isSalted ? 1 : 0) - (tenantColSkipped
? 1 : 0));
+                    short keySeq = (short) (pkPos + 1 - startOffset - (tenantColSkipped ?
1 : 0));
                     keySeqBytes = PSmallint.INSTANCE.toBytes(keySeq);
                 }
                 cells.add(KeyValueUtil.newKeyValue(rowKey, TABLE_FAMILY_BYTES, KEY_SEQ_BYTES,


Mime
View raw message