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


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/TableConfigsRestletResource.java:
##########
@@ -322,26 +322,25 @@ public ConfigSuccessResponse updateConfig(
       @ApiParam(value = "Force update the table schema") @DefaultValue("false")
       @QueryParam("forceTableSchemaUpdate") boolean forceTableSchemaUpdate,
       String tableConfigsStr, @Context HttpHeaders headers) throws Exception {
+    tableName = DatabaseUtils.translateTableName(tableName, headers);
     Pair<TableConfigs, Map<String, Object>> tableConfigsAndUnrecognizedProps;
     TableConfigs tableConfigs;
     String translatedTableName;
     try {
-      translatedTableName = DatabaseUtils.translateTableName(tableName, 
headers);
       tableConfigsAndUnrecognizedProps =
           JsonUtils.stringToObjectAndUnrecognizedProperties(tableConfigsStr, 
TableConfigs.class);
       tableConfigs = tableConfigsAndUnrecognizedProps.getLeft();
-      Preconditions.checkState(
-          DatabaseUtils.translateTableName(tableConfigs.getTableName(), 
headers).equals(translatedTableName),
-          "Table name mismatch: %s is not equivalent to %s", 
tableConfigs.getTableName(), tableName);
+      
tableConfigs.setTableName(DatabaseUtils.translateTableName(tableConfigs.getTableName(),
 headers));

Review Comment:
   setting the table name here will make all the validations on table/schema 
names redundant which are part of `validateConfig(tableConfigs, typesToSkip);` 
called below. This in a way allows user to pass invalid schema or 
realtime/offline table names as ultimately it gets overridden by the raw table 
name.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to