int tableOffset = table.getBucketNum() == null ? 0 : 1;
int minTablePKOffset = getMinPKOffset(table, tenantId);
int minIndexPKOffset = getMinPKOffset(index, tenantId);
if (index.getColumns().size()-minIndexPKOffset != table.getColumns().size()-minTablePKOffset) {
// We'll end up not using this by the optimizer, so just throw
throw new ColumnNotFoundException(WildcardParseNode.INSTANCE.toString());
}
for (int i = tableOffset, j = tableOffset; i < table.getColumns().size(); i++) {
PColumn column = table.getColumns().get(i);
// Skip tenant ID column (which may not be the first column, but is the first PK column)
if (SchemaUtil.isPKColumn(column) && j++ < minTablePKOffset) {