You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "INNOCENT-BOY (via GitHub)" <gi...@apache.org> on 2023/06/29 05:44:53 UTC

[GitHub] [pinot] INNOCENT-BOY commented on a diff in pull request #10991: [enhance]: When enable case-insensitive, don't allow to add newly col…

INNOCENT-BOY commented on code in PR #10991:
URL: https://github.com/apache/pinot/pull/10991#discussion_r1246134976


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSchemaRestletResource.java:
##########
@@ -359,7 +359,8 @@ private void validateSchemaInternal(Schema schema) {
     validateSchemaName(schema.getSchemaName());
     try {
       List<TableConfig> tableConfigs = _pinotHelixResourceManager.getTableConfigsForSchema(schema.getSchemaName());
-      SchemaUtils.validate(schema, tableConfigs);
+      boolean isIgnoreCase = _pinotHelixResourceManager.isIgnoreCase();
+      SchemaUtils.validate(schema, tableConfigs, isIgnoreCase);

Review Comment:
   Thanks for you review @walterddr !
   I think broker starter has already encapsulated this parameter.
   ```
   boolean caseInsensitive =
           _brokerConf.getProperty(Helix.ENABLE_CASE_INSENSITIVE_KEY, Helix.DEFAULT_ENABLE_CASE_INSENSITIVE);
       TableCache tableCache = new TableCache(_propertyStore, caseInsensitive);
   ```
   The reason why I extract this keyword from Helix ResouceManger is that PinotHelixResourceManger has extract this parameter from HelixAdmin and save it to Table Cache. So I don't think we need find another way to get this parameter. And PinotSchemaRestletResouce has injected an instance _pinotHelixResourceManager. So i don't that is a big deal.
   ```
   Map<String, String> configs = _helixAdmin.getConfig(helixConfigScope,
           Arrays.asList(Helix.ENABLE_CASE_INSENSITIVE_KEY));
       boolean caseInsensitive = Boolean.parseBoolean(configs.getOrDefault(Helix.ENABLE_CASE_INSENSITIVE_KEY,
               Boolean.toString(Helix.DEFAULT_ENABLE_CASE_INSENSITIVE)));
       _tableCache = new TableCache(_propertyStore, caseInsensitive);
      ```



-- 
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-unsubscribe@pinot.apache.org

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


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