Jackie-Jiang commented on code in PR #10991: URL: https://github.com/apache/pinot/pull/10991#discussion_r1253942094
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/SchemaUtils.java: ########## @@ -95,8 +101,14 @@ public static void validate(Schema schema, List<TableConfig> tableConfigs) { * 6) Schema validations from {@link Schema#validate} */ public static void validate(Schema schema) { + validate(schema, false); + } + + public static void validate(Schema schema, boolean isIgnoreCase) { schema.validate(); + List allColumnName = schema.getColumnNames().stream().map(column -> column.toLowerCase()) + .collect(Collectors.toList()); Review Comment: We need to create this List only when `isIgnoreCase` is set to `true`. To make it more efficient, we can simply check while adding columns ```suggestion if (isIgnoreCase) { Set<String> lowerCaseColumnNames = new HashSet<>; for (String column : schema.getColumnNames()) { Preconditions.checkState(lowerCaseColumnNames.add(column.toLowerCase()), ...); } } List allColumnName = schema.getColumnNames().stream().map(column -> column.toLowerCase()) .collect(Collectors.toList()); ``` -- 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