You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2023/07/06 01:54:08 UTC

[GitHub] [incubator-paimon] JingsongLi commented on a diff in pull request #1500: [core] add file-format-per-level for paimon

JingsongLi commented on code in PR #1500:
URL: https://github.com/apache/incubator-paimon/pull/1500#discussion_r1253827727


##########
paimon-core/src/main/java/org/apache/paimon/io/KeyValueFileWriterFactory.java:
##########
@@ -90,11 +97,21 @@ public DataFilePathFactory pathFactory() {
     }
 
     public RollingFileWriter<KeyValue, DataFileMeta> createRollingMergeTreeFileWriter(int level) {
+        updateFormatByLevel(level);
         return new RollingFileWriter<>(
                 () -> createDataFileWriter(pathFactory.newPath(), level, getCompression(level)),
                 suggestedFileSize);
     }
 
+    private void updateFormatByLevel(int level) {
+        String fileFormat = levelFormats.get(level);
+        if (null != fileFormat) {
+            pathFactory.setFormatIdentifier(fileFormat);

Review Comment:
   Do not provide `setFormatIdentifier`, This is difficult to maintain.
   
   A better way is to pass parameters when you need to do something, rather than setting its class variables.



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

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