Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,29 @@ public BulkInsertWriterHelper getWriterHelper() {
// Utilities
// -------------------------------------------------------------------------
private void initWriterHelper() {
this.currentInstant = instantToWrite(true);
if (this.currentInstant == null) {
final String instant = instantToWrite(true);
if (instant == null) {
// in case there are empty checkpoints that has no input data
throw new HoodieException("No inflight instant when flushing data!");
}
this.writerHelper = new BulkInsertWriterHelper(this.config, this.writeClient.getHoodieTable(), this.writeClient.getConfig(),
this.currentInstant, this.taskID, getRuntimeContext().getNumberOfParallelSubtasks(), getRuntimeContext().getAttemptNumber(),
instant, this.taskID, getRuntimeContext().getNumberOfParallelSubtasks(), getRuntimeContext().getAttemptNumber(),
this.rowType);
}

private void flushData(boolean endInput) {
final List<WriteStatus> writeStatus;
final String instant;
if (this.writerHelper != null) {
writeStatus = this.writerHelper.getWriteStatuses(this.taskID);
instant = this.writerHelper.getInstantTime();
this.currentInstant = this.writerHelper.getInstantTime();
} else {
writeStatus = Collections.emptyList();
instant = instantToWrite(false);
LOG.info("No data to write in subtask [{}] for instant [{}]", taskID, instant);
this.currentInstant = instantToWrite(false);
LOG.info("No data to write in subtask [{}] for instant [{}]", taskID, this.currentInstant);
}
final WriteMetadataEvent event = WriteMetadataEvent.builder()
.taskID(taskID)
.instantTime(instant)
.instantTime(this.currentInstant)
.writeStatus(writeStatus)
.lastBatch(true)
.endInput(endInput)
Expand Down