ishitadixit-dot commented on code in PR #2594:
URL: https://github.com/apache/phoenix/pull/2594#discussion_r3861645800


##########
phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -2459,6 +2460,53 @@ private void disableTable(Admin admin, TableName 
tableName) throws IOException {
     }
   }
 
+  private void enableTable(Admin admin, TableName tableName) throws 
IOException {
+    try {
+      admin.enableTable(tableName);
+    } catch (TableNotDisabledException e) {
+      LOGGER.info("Table already enabled, continuing with next steps", e);
+    }
+  }
+
+  /**
+   * PHOENIX-7788: re-enable a disabled physical HBase table if SYSTEM.CATALOG 
has no row for it. If
+   * metadata exists, leave it disabled — an admin may have disabled the 
registered table.
+   */
+  private void reenableOrphanedDisabledHBaseTable(byte[] schemaBytes, byte[] 
tableBytes,
+    boolean isNamespaceMapped, PTableType tableType) throws SQLException {
+    if (tableType != PTableType.TABLE) {

Review Comment:
   The current guard also handles SYSTEM tables. `tableType != 
PTableType.TABLE` returns early for everything that isn't TABLE, which is: 
SYSTEM, VIEW, INDEX, SUBQUERY, PROJECTED, CDC.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to