You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2022/01/25 21:10:16 UTC

Change in asterixdb[neo]: [NO ISSUE][IDX] Do not store source indicators for primary key indexes

From Ali Alsuliman <al...@gmail.com>:

Ali Alsuliman has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004 )


Change subject: [NO ISSUE][IDX] Do not store source indicators for primary key indexes
......................................................................

[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
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
1 file changed, 2 insertions(+), 5 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/04/15004/1

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);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: neo
Gerrit-Change-Id: I6c2b3bb8115b6a079ccde28cb20c28a248b6b95b
Gerrit-Change-Number: 15004
Gerrit-PatchSet: 1
Gerrit-Owner: Ali Alsuliman <al...@gmail.com>
Gerrit-MessageType: newchange

Change in asterixdb[neo]: [NO ISSUE][IDX] Do not store source indicators for primary key indexes

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Ali Alsuliman <al...@gmail.com>:

Ali Alsuliman has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004 )

Change subject: [NO ISSUE][IDX] Do not store source indicators for primary key indexes
......................................................................

[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 <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <al...@gmail.com>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
1 file changed, 2 insertions(+), 5 deletions(-)

Approvals:
  Dmitry Lychagin: Looks good to me, approved
  Ali Alsuliman: Looks good to me, but someone else must approve
  Jenkins: Verified; Verified

Objections:
  Anon. E. Moose #1000171: Violations found



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);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: neo
Gerrit-Change-Id: I6c2b3bb8115b6a079ccde28cb20c28a248b6b95b
Gerrit-Change-Number: 15004
Gerrit-PatchSet: 2
Gerrit-Owner: Ali Alsuliman <al...@gmail.com>
Gerrit-Reviewer: Ali Alsuliman <al...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-MessageType: merged

Change in asterixdb[neo]: [NO ISSUE][IDX] Do not store source indicators for primary key indexes

Posted by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu>.
From Ali Alsuliman <al...@gmail.com>:

Ali Alsuliman has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004 )


Change subject: [NO ISSUE][IDX] Do not store source indicators for primary key indexes
......................................................................

[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
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
1 file changed, 2 insertions(+), 5 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/04/15004/1

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);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15004
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: neo
Gerrit-Change-Id: I6c2b3bb8115b6a079ccde28cb20c28a248b6b95b
Gerrit-Change-Number: 15004
Gerrit-PatchSet: 1
Gerrit-Owner: Ali Alsuliman <al...@gmail.com>
Gerrit-MessageType: newchange