You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2019/10/01 20:40:02 UTC
[GitHub] [phoenix] gjacoby126 commented on a change in pull request #514:
PHOENIX-5261: Implement ALTER TABLE/VIEW ADD COLUMN CASCADE
gjacoby126 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_r330264252
##########
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:
@swaroopak - Perhaps we should use List<String> since NamedNode is specifically part of the parse path.
----------------------------------------------------------------
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