Skip to content
Merged
Show file tree
Hide file tree
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 @@ -199,6 +199,7 @@ protected void updateIndexAndCommitIfNeeded(JavaRDD<WriteStatus> writeStatusRDD,
commitOnAutoCommit(result);
}

@Override
protected String getCommitActionType() {
return table.getMetaClient().getCommitActionType();
}
Expand Down Expand Up @@ -276,14 +277,6 @@ public Iterator<List<WriteStatus>> handleUpdate(String partitionPath, String fil
return handleUpdateInternal(upsertHandle, fileId);
}

public Iterator<List<WriteStatus>> handleUpdate(String partitionPath, String fileId,
Map<String, HoodieRecord<T>> keyToNewRecords,
HoodieBaseFile oldDataFile) throws IOException {
// these are updates
HoodieMergeHandle upsertHandle = getUpdateHandle(partitionPath, fileId, keyToNewRecords, oldDataFile);
return handleUpdateInternal(upsertHandle, fileId);
}

protected Iterator<List<WriteStatus>> handleUpdateInternal(HoodieMergeHandle upsertHandle, String fileId)
throws IOException {
if (upsertHandle.getOldFilePath() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.apache.hudi.table.HoodieTable;
import org.apache.hudi.table.WorkloadProfile;
import org.apache.hudi.table.action.HoodieWriteMetadata;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.spark.Partitioner;
import org.apache.spark.api.java.JavaRDD;
import scala.Tuple2;
Expand All @@ -41,8 +39,6 @@
public class SparkInsertOverwriteCommitActionExecutor<T extends HoodieRecordPayload<T>>
extends BaseSparkCommitActionExecutor<T> {

private static final Logger LOG = LogManager.getLogger(SparkInsertOverwriteCommitActionExecutor.class);

private final JavaRDD<HoodieRecord<T>> inputRecordsRDD;

public SparkInsertOverwriteCommitActionExecutor(HoodieEngineContext context,
Expand All @@ -53,7 +49,7 @@ public SparkInsertOverwriteCommitActionExecutor(HoodieEngineContext context,
}

@Override
public HoodieWriteMetadata execute() {
public HoodieWriteMetadata<JavaRDD<WriteStatus>> execute() {
return SparkWriteHelper.newInstance().write(instantTime, inputRecordsRDD, context, table,
config.shouldCombineBeforeInsert(), config.getInsertShuffleParallelism(), this, false);
}
Expand All @@ -68,6 +64,7 @@ protected String getCommitActionType() {
return HoodieTimeline.REPLACE_COMMIT_ACTION;
}

@Override
protected Map<String, List<String>> getPartitionToReplacedFileIds(JavaRDD<WriteStatus> writeStatuses) {
return writeStatuses.map(status -> status.getStat().getPartitionPath()).distinct().mapToPair(partitionPath ->
new Tuple2<>(partitionPath, getAllExistingFileIds(partitionPath))).collectAsMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
public class SparkMergeHelper<T extends HoodieRecordPayload> extends AbstractMergeHelper<T, JavaRDD<HoodieRecord<T>>,
JavaRDD<HoodieKey>, JavaRDD<WriteStatus>> {

private SparkMergeHelper() {
}

private static class MergeHelperHolder {
private static final SparkMergeHelper SPARK_MERGE_HELPER = new SparkMergeHelper();
}
Expand Down