danny0405 commented on code in PR #5850:
URL: https://github.com/apache/hudi/pull/5850#discussion_r896351920


##########
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/internal/DataSourceInternalWriterHelper.java:
##########
@@ -68,6 +68,7 @@ public DataSourceInternalWriterHelper(String instantTime, 
HoodieWriteConfig writ
     this.metaClient = 
HoodieTableMetaClient.builder().setConf(configuration).setBasePath(writeConfig.getBasePath()).build();
     this.metaClient.validateTableProperties(writeConfig.getProps());
     this.hoodieTable = HoodieSparkTable.create(writeConfig, new 
HoodieSparkEngineContext(new JavaSparkContext(sparkSession.sparkContext())), 
metaClient);
+    writeClient.preWrite(instantTime, WriteOperationType.BULK_INSERT, 
metaClient);

Review Comment:
   The fix makes sense but the not a good idea to put a write logic in the 
constructor, 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