virajjasani commented on code in PR #2026:
URL: https://github.com/apache/phoenix/pull/2026#discussion_r1842251400


##########
phoenix-core-client/src/main/java/org/apache/phoenix/util/ViewUtil.java:
##########
@@ -886,4 +893,42 @@ public static void 
addTagsToPutsForViewAlteredProperties(List<Mutation> tableMet
 
         }
     }
+
+    /**
+     * Retrieves the list of unique view index ids from SYSTEM.CATALOG for a 
given view index table
+     * @param connection - Phoenix Connection
+     * @param tableName - name of the view index table for which view index 
ids need to be retrieved
+     * @param includeTenantViewIndexes - true if tenant view indexes to be 
included otherwise false
+     * @return - list of view index ids
+     * @throws IOException
+     * @throws SQLException
+     */
+    public static List<String> getViewIndexIds(final PhoenixConnection 
connection, final String tableName, final boolean includeTenantViewIndexes)
+            throws IOException, SQLException {
+        Preconditions.checkArgument(MetaDataUtil.isViewIndex(tableName));
+        List<String> viewIndexIdsString = new ArrayList<>();
+        PreparedStatement preparedStatement = 
connection.prepareStatement(getViewIndexIdsQuery(tableName, 
includeTenantViewIndexes));

Review Comment:
   Good to have INFO log with the value of `getViewIndexIdsQuery()` to help 
debug if something goes wrong.



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

To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to