xiangfu0 commented on code in PR #20457:
URL: https://github.com/apache/pinot/pull/20457#discussion_r4807196006


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotLogicalTableResource.java:
##########
@@ -199,6 +207,26 @@ public SuccessResponse deleteLogicalTable(
     }
   }
 
+  private void authorizePhysicalTables(LogicalTableConfig logicalTableConfig, 
Request request, HttpHeaders headers) {
+    // Adding a physical table to a logical table prevents deletion of that 
physical table while it is referenced.
+    Set<String> physicalTableNames = new 
LinkedHashSet<>(logicalTableConfig.getPhysicalTableConfigMap().keySet());
+    TimeBoundaryConfig boundary = logicalTableConfig.getTimeBoundaryConfig();
+    // The config validator rejects missing strategy names before persisting 
the mapping.
+    if (boundary != null && 
StringUtils.isNotEmpty(boundary.getBoundaryStrategy())) {
+      try {
+        physicalTableNames.addAll(TimeBoundaryStrategyService.getInstance()
+            
.getTimeBoundaryStrategy(boundary.getBoundaryStrategy()).getTimeBoundaryTableNames(logicalTableConfig));
+      } catch (IllegalArgumentException | ClassCastException e) {

Review Comment:
   Fixed in `74e8b5570a`. Create and update now return HTTP 400 for malformed 
time-boundary source lists. Valid source names still go through authorization. 
All 51 focused controller tests passed.



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