kadirozde commented on code in PR #1569:
URL: https://github.com/apache/phoenix/pull/1569#discussion_r1148446530


##########
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java:
##########
@@ -588,21 +590,70 @@ public InternalScanner 
preCompact(ObserverContext<RegionCoprocessorEnvironment>
                 @Override
                 public InternalScanner run() throws Exception {
                     InternalScanner internalScanner = scanner;
+                    if (request.isMajor()) {
+                        boolean isDisabled = false;
+                        final String fullTableName = 
tableName.getNameAsString();
+                        PTable table = null;
+                        try (PhoenixConnection conn = 
QueryUtil.getConnectionOnServer(
+                                
compactionConfig).unwrap(PhoenixConnection.class)) {
+                            table = PhoenixRuntime.getTableNoCache(conn, 
fullTableName);
+                        } catch (Exception e) {
+                            if (e instanceof TableNotFoundException) {
+                                LOGGER.debug("Ignoring HBase table that is not 
a Phoenix table: "
+                                        + fullTableName);
+                                // non-Phoenix HBase tables won't be found, do 
nothing
+                            } else {
+                                LOGGER.error(
+                                        "Unable to modify compaction scanner 
to retain deleted "
+                                                + "cells for a table with 
disabled Index; "
+                                                + fullTableName, e);
+                            }
+                        }
+                        if (table != null &&
+                                
!PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME.equals(fullTableName) &&
+                                !ScanUtil.hasCoprocessor(c.getEnvironment(),
+                                GlobalIndexChecker.class.getName())) {
+                            List<PTable>
+                                    indexes =
+                                    PTableType.INDEX.equals(table.getType()) ?
+                                            Lists.newArrayList(table) :
+                                            table.getIndexes();

Review Comment:
   Yes, I will add it



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