snleee commented on a change in pull request #6094: URL: https://github.com/apache/incubator-pinot/pull/6094#discussion_r501258061
########## File path: pinot-core/src/main/java/org/apache/pinot/core/segment/processing/framework/SegmentProcessorFramework.java ########## @@ -187,6 +203,38 @@ public void processSegments() Arrays.toString(_outputSegmentsDir.list())); } + private SegmentNameGenerator getSegmentNameGenerator(TableConfig tableConfig, Schema schema, + SegmentConfig segmentConfig) { + String rawTableName = TableNameBuilder.extractRawTableName(tableConfig.getTableName()); + String segmentNameGeneratorType = segmentConfig.getSegmentNameGeneratorType(); + if (segmentNameGeneratorType == null) { + segmentNameGeneratorType = SIMPLE_SEGMENT_NAME_GENERATOR; + } + + switch (segmentNameGeneratorType) { + case SIMPLE_SEGMENT_NAME_GENERATOR: + return new SimpleSegmentNameGenerator(rawTableName, segmentConfig.getSegmentPostfix()); + case NORMALIZED_DATE_SEGMENT_NAME_GENERATOR: + Preconditions.checkState(tableConfig != null, + "In order to use NormalizedDateSegmentNameGenerator, table config must be provided"); Review comment: Actually, this check is unnecessary. I removed the precondition block. When generating the `SegmentProcessorConfig`, there's a validation that enforces to always have `tableConfig` and `schema`. ---------------------------------------------------------------- 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. 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