From 0f0088fe4b740c4acec0cb25988250db8fb483b6 Mon Sep 17 00:00:00 2001 From: yuzhaojing <32435329+yuzhaojing@users.noreply.github.com> Date: Thu, 30 Dec 2021 11:54:34 +0800 Subject: [PATCH] [HUDI-3124] Bootstrap when timeline have completed instant (#4467) Co-authored-by: yuzhaojing --- .../org/apache/hudi/sink/bootstrap/BootstrapOperator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapOperator.java b/hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapOperator.java index f6055ba11..4832f18bf 100644 --- a/hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapOperator.java +++ b/hudi-flink/src/main/java/org/apache/hudi/sink/bootstrap/BootstrapOperator.java @@ -179,9 +179,6 @@ public class BootstrapOperator> protected void loadRecords(String partitionPath) throws Exception { long start = System.currentTimeMillis(); - BaseFileUtils fileUtils = BaseFileUtils.getInstance(this.hoodieTable.getBaseFileFormat()); - Schema schema = new TableSchemaResolver(this.hoodieTable.getMetaClient()).getTableAvroSchema(); - final int parallelism = getRuntimeContext().getNumberOfParallelSubtasks(); final int maxParallelism = getRuntimeContext().getMaxNumberOfParallelSubtasks(); final int taskID = getRuntimeContext().getIndexOfThisSubtask(); @@ -193,6 +190,9 @@ public class BootstrapOperator> Option latestCommitTime = commitsTimeline.filterCompletedInstants().lastInstant(); if (latestCommitTime.isPresent()) { + BaseFileUtils fileUtils = BaseFileUtils.getInstance(this.hoodieTable.getBaseFileFormat()); + Schema schema = new TableSchemaResolver(this.hoodieTable.getMetaClient()).getTableAvroSchema(); + List fileSlices = this.hoodieTable.getSliceView() .getLatestFileSlicesBeforeOrOn(partitionPath, latestCommitTime.get().getTimestamp(), true) .collect(toList());