Phoenix 6219 GlobalIndexChecker doesn't work for SingleCell indexes#993
Phoenix 6219 GlobalIndexChecker doesn't work for SingleCell indexes#993gokceni wants to merge 1 commit into
Conversation
| private final boolean mutable; | ||
| private final boolean useSnapshot; | ||
|
|
||
| private static final Logger LOGGER = LoggerFactory.getLogger(IndexExtendedIT.class); |
There was a problem hiding this comment.
This object is not being used
| @@ -326,10 +326,10 @@ private void repairIndexRows(byte[] indexRowKey, long ts, List<Cell> row) throws | |||
| buildIndexScan.setAttribute(BaseScannerRegionObserver.REBUILD_INDEXES, TRUE_BYTES); | |||
| buildIndexScan.setAttribute(BaseScannerRegionObserver.SKIP_REGION_BOUNDARY_CHECK, Bytes.toBytes(true)); | |||
| // Scan only columns included in the index table plus the empty column | |||
There was a problem hiding this comment.
Is this comment still applicable ?
There was a problem hiding this comment.
Yes, it is. The difference is that in getAllColumns, you get index cols. The getAllColumnsForDataTable, you get the mapping columns in data table. For example: in index there is Col1 but in hbase it is in a cell with others with column qualifier:1. But in data table it is in its own cell with col qualifier Col1.
| if (!dataTable.isTransactional() | ||
| || !dataTable.getTransactionProvider().getTransactionProvider().isUnsupported(Feature.MAINTAIN_LOCAL_INDEX_ON_SERVER)) { | ||
| indexesItr = maintainedLocalIndexes(indexes.iterator()); | ||
| indexesItr = maintainedLocalOrGlobalIndexesWithoutMatchingStorageScheme(dataTable, indexes.iterator()); |
There was a problem hiding this comment.
Shouldn't this still be maintainedLocalIndexes since it is called inside if (onlyLocalIndexex)
There was a problem hiding this comment.
Unfortunately onlyLocalIndexes variable name is misleading. So it is immutableIndexes or transactional indexes
boolean onlyLocalIndexes = dataTable.isImmutableRows() || dataTable.isTransactional();
| conn.commit(); | ||
|
|
||
| stmt.execute(String.format("CREATE " + (localIndex ? "LOCAL" : "") + " INDEX %s ON %s (UPPER(NAME, 'en_US')) ASYNC ", indexTableName,dataTableFullName)); | ||
| stmt.execute(String.format("CREATE " + (localIndex ? "LOCAL" : "") + " INDEX %s ON %s (UPPER(NAME, 'en_US')) ASYNC " + this.indexDDLOptions, indexTableName,dataTableFullName)); |
There was a problem hiding this comment.
nit: can use String.format parameter rather than concatenating indexDDLOptions
|
|
||
| stmt.execute( | ||
| String.format("CREATE INDEX %s ON %s (UPPER(NAME, 'en_US')) ", indexName, | ||
| String.format("CREATE INDEX %s ON %s (UPPER(NAME, 'en_US')) " + this.indexDDLOptions, indexName, |
There was a problem hiding this comment.
ditto, String.format vs concatenation
| conn.commit(); | ||
| String | ||
| sql = | ||
| "UPSERT /*+ NO_INDEX */ INTO " + idxName + "(\":PK1\",\":INT_PK\",\"0:V1\",\"0:V2\",\"0:V4\") SELECT /*+ NO_INDEX */ PK1,INT_PK, V1, V2,V4 FROM " |
There was a problem hiding this comment.
Does a NO_INDEX hint in an upsert clause do anything?
There was a problem hiding this comment.
I copy pasted this from PostIndexDDLCompilerTest. I think it is valid but not mean much since this is already the index. Let me remove it
| conn.commit(); | ||
| String | ||
| sql = | ||
| "UPSERT /*+ NO_INDEX */ INTO " + idxName + "(\":PK1\",\":INT_PK\",\"0:V1\",\"0:V2\",\"0:V4\") SELECT /*+ NO_INDEX */ PK1,INT_PK, V1, V2,V4 FROM " |
|
💔 -1 overall
This message was automatically generated. |
|
Thanks @gjacoby126 for the review! I added one more test to SingleCellIndexIT called testMultipleColumnFamilies |
|
💔 -1 overall
This message was automatically generated. |
|
Merged |
No description provided.