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/26 18:32:36 UTC

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

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

 ##########
 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:
   nit: maybe better to name `viewName` here?
   I think it's better to have String `viewFullName` = SchemaUtil.getTableName(schemaName, `viewName`), since this is a full name that contains schema and view name. 
   

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