shounakmk219 commented on code in PR #12417:
URL: https://github.com/apache/pinot/pull/12417#discussion_r1521129920
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -1617,9 +1619,9 @@ public List<String> getSchemaNames() {
public List<String> getSchemaNames(@Nullable String databaseName) {
List<String> schemas = _propertyStore.getChildNames(
PinotHelixPropertyStoreZnRecordProvider.forSchema(_propertyStore).getRelativePath(),
AccessOption.PERSISTENT);
- if (schemas != null) {
- return schemas.stream().filter(schemaName ->
isPartOfDatabase(schemaName, databaseName))
- .collect(Collectors.toList());
+ if (databaseName != null) {
Review Comment:
This will return all schemas when `databaseName` is `null`, shouldn't the
`null` database name be considered as the `default` database and only return
schemas under the `default` database?
##########
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 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]