[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>
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 438397c..fa3fe37 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -1331,11 +1331,8 @@
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);