1
0

[HUDI-1151] Fix NPE when no new data in kafka using HoodieDeltaStreamer (#1921)

This commit is contained in:
Mathieu
2020-08-07 00:03:20 +08:00
committed by GitHub
parent 51ea27d665
commit b51646dcc7

View File

@@ -577,7 +577,7 @@ public class HoodieDeltaStreamer implements Serializable {
try {
long start = System.currentTimeMillis();
Pair<Option<String>, JavaRDD<WriteStatus>> scheduledCompactionInstantAndRDD = deltaSync.syncOnce();
if (scheduledCompactionInstantAndRDD.getLeft().isPresent()) {
if (null != scheduledCompactionInstantAndRDD && scheduledCompactionInstantAndRDD.getLeft().isPresent()) {
LOG.info("Enqueuing new pending compaction instant (" + scheduledCompactionInstantAndRDD.getLeft() + ")");
asyncCompactService.enqueuePendingCompaction(new HoodieInstant(State.REQUESTED,
HoodieTimeline.COMPACTION_ACTION, scheduledCompactionInstantAndRDD.getLeft().get()));