codope commented on code in PR #9761:
URL: https://github.com/apache/hudi/pull/9761#discussion_r1368138053


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java:
##########
@@ -866,11 +866,11 @@ public void validateInsertSchema() throws 
HoodieInsertException {
   }
 
   public HoodieFileFormat getBaseFileFormat() {
-    return metaClient.getTableConfig().getBaseFileFormat();
-  }
-
-  public HoodieFileFormat getLogFileFormat() {
-    return metaClient.getTableConfig().getLogFileFormat();
+    HoodieTableConfig tableConfig = metaClient.getTableConfig();
+    if (tableConfig.contains(HoodieTableConfig.BASE_FILE_FORMAT)) {
+      return metaClient.getTableConfig().getBaseFileFormat();
+    }
+    return config.getBaseFileFormat();

Review Comment:
   My thinking is as follows: Suppose you've an existing table in ORC, and now 
you're upgrading to the newer version with this write config. You would not 
have set the write config and then default value will be set to Parquet, even 
though you intend to write in ORC. 
   But I understand your concern. I think a better way here would be to:
   1. Check table config if multi file formats are enabled. If so, then use 
writeConfig.getBaseFileFormat() if present.
   2. Else, use the tableConfig.getBaseFileFormat.
   Wdyt?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to