swaroopak commented on a change in pull request #665: PHOENIX-5650: 
IndexUpgradeTool does not rebuild view indexes
URL: https://github.com/apache/phoenix/pull/665#discussion_r363519295
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
 ##########
 @@ -673,16 +668,21 @@ private boolean 
extractTablesAndIndexes(PhoenixConnection conn) {
         return indexInfos;
     }
 
+    @VisibleForTesting
+    public String getViewSql(String tableName, String schemaName) {
+       return "SELECT DISTINCT COLUMN_FAMILY, TENANT_ID FROM "
+                + "SYSTEM.CHILD_LINK "
+                + "WHERE TABLE_NAME = \'" + tableName + "\' "
+                + (!StringUtil.EMPTY_STRING.equals(schemaName) ? "AND 
TABLE_SCHEM = \'"
 
 Review comment:
   to avoid any NPE due to schemaName being null, it's better to check .equals 
on a constant. It reads longer but it is not that long :) 

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

Reply via email to