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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteFunction.java:
##########
@@ -463,16 +439,15 @@ private void registerMetrics() {
     writeMetrics.registerMetrics();
   }
 
-  protected List<WriteStatus> writeBucket(String instant, DataBucket bucket, 
List<HoodieRecord> records) {
-    bucket.preWrite(records);
+  protected List<WriteStatus> writeRecords(String instant, List<HoodieRecord> 
records) {
     writeMetrics.startFileFlush();
-    List<WriteStatus> statuses = writeFunction.apply(records, instant);
+    List<WriteStatus> statuses = 
writeFunction.apply(deduplicateRecordsIfNeeded(records), instant);

Review Comment:
   The reason for preWrite is to update the instant time of the first record as 
either `I` or `U`, so that the correspondent write handle can be choosed. Of 
course the records in the same bucket has the same loc, but that is not what we 
design the preWrite for.



-- 
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