Copilot commented on code in PR #17064:
URL: https://github.com/apache/pinot/pull/17064#discussion_r2454581242


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -762,6 +762,9 @@ static void validateUpsertAndDedupConfig(TableConfig 
tableConfig, Schema schema)
       return;
     }
 
+    Preconditions.checkState(tableConfig.getTierConfigsList() == null || 
tableConfig.getTierConfigsList().isEmpty(),
+        "Tiered storage is not supported for Upsert/Dedup tables");
+
     boolean isUpsertEnabled = tableConfig.getUpsertMode() != 
UpsertConfig.Mode.NONE;
     boolean isDedupEnabled = tableConfig.getDedupConfig() != null && 
tableConfig.getDedupConfig().isDedupEnabled();
 

Review Comment:
   The validation is performed before checking if Upsert or Dedup is actually 
enabled (lines 768-769). This means the validation will fail even for tables 
that have tier configs but don't actually use Upsert/Dedup. Consider moving 
this check after the `isUpsertEnabled` and `isDedupEnabled` checks and only 
enforce it when either feature is actually enabled.
   ```suggestion
       boolean isUpsertEnabled = tableConfig.getUpsertMode() != 
UpsertConfig.Mode.NONE;
       boolean isDedupEnabled = tableConfig.getDedupConfig() != null && 
tableConfig.getDedupConfig().isDedupEnabled();
   
       // Only enforce tiered storage restriction if Upsert or Dedup is enabled
       if (isUpsertEnabled || isDedupEnabled) {
         Preconditions.checkState(tableConfig.getTierConfigsList() == null || 
tableConfig.getTierConfigsList().isEmpty(),
             "Tiered storage is not supported for Upsert/Dedup tables");
       }
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to