priyankporwal commented on a change in pull request #551: PHOENIX-5415: NPE in
getting conf from addHbaseResources in IndexUpgr…
URL: https://github.com/apache/phoenix/pull/551#discussion_r307844034
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
##########
@@ -572,34 +577,40 @@ private void prepareToRebuildIndexes(Connection conn,
String dataTableFullName)
}
if (hasViewIndex) {
- ResultSet
- rs =
+ ResultSet rs =
conn.createStatement().executeQuery(
"SELECT DISTINCT TABLE_NAME, TENANT_ID FROM "
- + "SYSTEM.CATALOG WHERE COLUMN_FAMILY
= \'"
- + viewIndexPhysicalName
- + "\' AND TABLE_TYPE = \'i\' AND " +
"LINK_TYPE = "
+ + "SYSTEM.CATALOG "
+ + "WHERE COLUMN_FAMILY =
\'"+dataTableFullName+"\' "
+ + "AND LINK_TYPE = "
+
PTable.LinkType.PHYSICAL_TABLE.getSerializedValue());
while (rs.next()) {
Review comment:
I feel that the body of this while loop could be a helper func -
findViewIndexes(string viewName). In fact, this should probably belong to some
core Phoenix metadata classes for reuse. That we can do later, but for now, we
should consider refactoring into another function.
----------------------------------------------------------------
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