gokceni commented on a change in pull request #641: PHOENIX-5589
GlobalIndexChecker does not populate global index relate…
URL: https://github.com/apache/phoenix/pull/641#discussion_r350973998
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
##########
@@ -958,6 +958,13 @@ public static void
setScanAttributesForIndexReadRepair(Scan scan, PTable table,
// This index table must be being deleted. No need to set the scan
attributes
return;
}
+ // MetaDataClient modifies the index table name for view indexes if
the parent view of an index has a child
+ // view. This, we need to recreate a PTable object with the correct
table name for the rest of this code to work
+ if
(table.getName().getString().contains(QueryConstants.CHILD_VIEW_INDEX_NAME_SEPARATOR))
{
+ int lastIndexOf =
table.getName().getString().lastIndexOf(QueryConstants.CHILD_VIEW_INDEX_NAME_SEPARATOR);
+ String indexName =
table.getName().getString().substring(lastIndexOf + 1);
Review comment:
Recommend to check that lastIndexOf < tableName length so that we don't get
IndexOutOfBounds exception
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services