Skip to content

Commit

Permalink
PHOENIX-4855 Continue to write base table column metadata when creati…
Browse files Browse the repository at this point in the history
…ng a view in order to support rollback (addendum)
  • Loading branch information
twdsilva committed Oct 6, 2018
1 parent 14b5780 commit ad29c1c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,10 @@ public ResultSet getColumns(String catalog, String schemaPattern, String tableNa
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;
Expand Down Expand Up @@ -892,7 +893,7 @@ public ResultSet getColumns(String catalog, String schemaPattern, String tableNa
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(new KeyValue(rowKey, TABLE_FAMILY_BYTES, KEY_SEQ_BYTES,
Expand Down

0 comments on commit ad29c1c

Please sign in to comment.