Skip to content
Permalink
Browse files
[NO ISSUE][IDX] Do not store source indicators for primary key indexes
- user model changes: no
- storage format changes: no
- interface changes: no

Details:
Since secondary primary key indexes do not have/store SKs, there
should be no matching source indicators.

Change-Id: I6c2b3bb8115b6a079ccde28cb20c28a248b6b95b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
  • Loading branch information
AliSolaiman committed Jan 26, 2022
1 parent 4cced3e commit e22d76c5be4bc04591dc7f5d1188d60836e9d17c
Showing 1 changed file with 2 additions and 5 deletions.
@@ -1331,11 +1331,8 @@ protected void doCreateIndex(MetadataProvider metadataProvider, CreateIndexState
List<List<String>> keyFieldNames = new ArrayList<>(indexedElementsCount);
List<IAType> keyFieldTypes = new ArrayList<>(indexedElementsCount);
List<Integer> keyFieldSourceIndicators = new ArrayList<>(indexedElementsCount);
if (isSecondaryPrimary) {
// BACK-COMPAT: secondary primary index has one source indicator
// which is set to META_RECORD_INDICATOR
keyFieldSourceIndicators.add(Index.META_RECORD_INDICATOR);
} else {
// secondary primary indexes do not have search keys (no SKs), and thus no equivalent indicators
if (!isSecondaryPrimary) {
for (int i = 0; i < indexedElementsCount; i++) {
CreateIndexStatement.IndexedElement indexedElement = indexedElements.get(i);
keyFieldNames.add(indexedElement.getProjectList().get(0).first);

0 comments on commit e22d76c

Please sign in to comment.