phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] priyankporwal commented on a change in pull request #514: PHOENIX-5261: Implement ALTER TABLE/VIEW ADD COLUMN CASCADE
Date Mon, 10 Jun 2019 05:50:26 GMT
priyankporwal commented on a change in pull request #514: PHOENIX-5261: Implement ALTER TABLE/VIEW
ADD COLUMN CASCADE
URL: https://github.com/apache/phoenix/pull/514#discussion_r291885314
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
 ##########
 @@ -1445,6 +1446,35 @@ public Integer getBucketNum() {
         return indexes;
     }
 
+    @Override
+    public List<PTable> getIndexes(boolean viewOnly) {
+        List<PTable> indexes = new ArrayList<>();
+        indexes.addAll(this.indexes);
+        if (viewOnly) {
+            for (PTable index: this.indexes) {
+                if(index.getTableName().toString().contains("#")) {
+                    indexes.remove(index);
+                }
+            }
+        }
+        return indexes;
+    }
+
+    @Override
+    public List<PTable> getIndexes(List<NamedNode> indexes) {
+        List<PTable> indexesPTable = Lists.newArrayListWithExpectedSize(indexes.size());
+        List<String> indexesParam = Lists.newArrayListWithExpectedSize(indexes.size());
+        for (NamedNode index : indexes) {
+            indexesParam.add(index.getName());
+        }
+        for (PTable index : this.indexes) {
+            if(indexesParam.contains(index.getTableName().getString())) {
 
 Review comment:
   What if 'indexes' contains names that are not present?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message