abhishekbafna commented on code in PR #15900:
URL: https://github.com/apache/pinot/pull/15900#discussion_r2120459872
##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/TableConfigsRestletResource.java:
##########
@@ -283,6 +285,17 @@ public SuccessResponse deleteConfig(
String tableName, @Context HttpHeaders headers) {
try {
tableName = DatabaseUtils.translateTableName(tableName, headers);
+
+ // Validate the table is not referenced in any logical table config.
Review Comment:
```
@DELETE
@Path("/tableConfigs/{tableName}")
...
public SuccessResponse deleteConfig(
@ApiParam(value = "TableConfigs name i.e. raw table name", required =
true) @PathParam("tableName")
String tableName, @Context HttpHeaders headers) {
```
By API definition, input should be raw table name and not physical table
name. But the code does not have any validation for that and processed to
deletion of the input table. Ideally, we should add a validation to ensure that
input is raw table name not physical table name. We not changing the API
defining only enforcing it.
I will a validation as described above and relevant test for the same.
--
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]