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/12/27 21:46:07 UTC

[GitHub] [phoenix] swaroopak commented on a change in pull request #665: PHOENIX-5650: IndexUpgradeTool does not rebuild view indexes

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_r361750883
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
 ##########
 @@ -648,17 +648,18 @@ private boolean extractTablesAndIndexes(PhoenixConnection conn) {
         }
 
         if (hasViewIndex) {
-            String viewSql = "SELECT DISTINCT TABLE_NAME, TENANT_ID FROM "
-                    + "SYSTEM.CATALOG "
-                    + "WHERE COLUMN_FAMILY = \'" + dataTableFullName + "\' "
+            String viewSql = "SELECT DISTINCT COLUMN_FAMILY, TENANT_ID FROM "
+                    + "SYSTEM.CHILD_LINK "
+                    + "WHERE TABLE_NAME = \'" + tableName + "\' "
                     + (!StringUtil.EMPTY_STRING.equals(schemaName) ? "AND TABLE_SCHEM = \'"
                     + schemaName + "\' " : "")
                     + "AND LINK_TYPE = "
-                    + PTable.LinkType.PHYSICAL_TABLE.getSerializedValue();
+                    + PTable.LinkType.CHILD_TABLE.getSerializedValue();
 
             ResultSet rs = conn.createStatement().executeQuery(viewSql);
             while (rs.next()) {
-                String viewName = rs.getString(1);
+                String viewFullName = rs.getString(1);
 
 Review comment:
   I meant to use getTableNameFromFullName(); thanks for pointing out though. :) 

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