wwj6591812 commented on code in PR #4245: URL: https://github.com/apache/paimon/pull/4245#discussion_r1773647432
########## paimon-common/src/main/java/org/apache/paimon/format/FileFormat.java: ########## @@ -103,14 +110,19 @@ private static Optional<FileFormat> fromIdentifier( return Optional.empty(); } - public static FileFormat getFileFormat(Options options, String formatIdentifier) { - FormatContext context = - new FormatContext( - options.removePrefix(formatIdentifier + "."), - options.get(CoreOptions.READ_BATCH_SIZE), - options.get(CoreOptions.WRITE_BATCH_SIZE), - options.get(CoreOptions.FILE_COMPRESSION_ZSTD_LEVEL), - options.get(CoreOptions.FILE_BLOCK_SIZE)); - return FileFormat.fromIdentifier(formatIdentifier, context); + protected Options getIdentifierPrefixOptions(Options options, boolean keepPrefix) { + Map<String, String> result = new HashMap<>(); + String prefix = formatIdentifier.toLowerCase() + "."; + for (String key : options.keySet()) { + if (key.toLowerCase().startsWith(prefix)) { + String substr = key.substring(prefix.length()); Review Comment: Change substr to another better name? ########## paimon-format/src/main/java/org/apache/paimon/format/avro/AvroFileFormat.java: ########## @@ -62,11 +62,14 @@ public class AvroFileFormat extends FileFormat { public static final ConfigOption<Map<String, String>> AVRO_ROW_NAME_MAPPING = Review Comment: In AvroFileFormat, IDENTIFIER && AVRO_OUTPUT_CODEC && AVRO_ROW_NAME_MAPPING should be private. ########## paimon-common/src/main/java/org/apache/paimon/format/FileFormat.java: ########## @@ -74,9 +75,15 @@ public Optional<SimpleStatsExtractor> createStatsExtractor( return Optional.empty(); } - @VisibleForTesting public static FileFormat fromIdentifier(String identifier, Options options) { - return fromIdentifier(identifier, new FormatContext(options, 1024, 1024)); + return fromIdentifier( Review Comment: This called method fromIdentifier should be private. -- 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: issues-unsubscr...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org