shounakmk219 commented on code in PR #16898:
URL: https://github.com/apache/pinot/pull/16898#discussion_r2381024134


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java:
##########
@@ -228,6 +228,13 @@ public ConfigSuccessResponse addTable(String 
tableConfigStr,
       ResourceUtils.checkPermissionAndAccess(tableNameWithType, request, 
httpHeaders,
           AccessType.CREATE, Actions.Table.CREATE_TABLE, 
_accessControlFactory, LOGGER);
 
+      // fail if table entry is present in IS. This saves all the validation 
checks if table already exists
+      if (_pinotHelixResourceManager.hasTable(tableNameWithType)) {

Review Comment:
   The check is same as the one done in `/tableConfigs`, if you are asking 
about the messaging, I am keeping this message in line with the 
`_pinotHelixResourceManager.addTable()` error message for existing table while 
the `/tableConfigs` error message is little tricky as the endpoint can create 3 
resources at once (schema, offline table, realtime table), so it is possible 
that someone is trying to add an offline table while the schema and realtime 
table already exists hence it suggests to use the PUT api.



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