stream2000 commented on code in PR #8550:
URL: https://github.com/apache/hudi/pull/8550#discussion_r1174773967
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -522,7 +522,10 @@ private boolean commitInstant(String instant, long
checkpointId) {
.flatMap(Collection::stream)
.collect(Collectors.toList());
- if (writeResults.size() == 0) {
+ // Control whether we can commit on empty batch to start a new instant
after each checkpoint
+ boolean allowCommitOnEmptyBatch =
conf.get(FlinkOptions.WRITE_ALLOW_COMMIT_ON_EMPTY_BATCH);
+
+ if (writeResults.size() == 0 && !allowCommitOnEmptyBatch) {
Review Comment:
> I don't think that the commits in the timeline could be empty and beyond
the design
We already have a config `hoodie.allow.empty.commit` that defaults to true.
And its documents says that the config is useful in cases where extra metadata
needs to be published regardless e.g tracking source offsets when ingesting data
> does it mean that the watermark of this commit is null?
I don't know exactly how you store the watermark, maybe through extra
metadata? In this case, we can still keep the extra metadata in commit files
even with an empty commit (maybe we need to modify the code).
> this could increase the possibility that there are several commits in one
checkpoint.
I don't understand why there could be a possibility that commits multiple
instants in one checkpoint, could you show me a simple case? In my
understanding, we can make sure that have only one instant during a checkpoint.
Thanks for your review, hope to have further discussions about this!
--
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]