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 @@ -168,7 +168,6 @@ public void testLogCompactionOnMORTable() throws Exception {
client.compact(compactionTimeStamp.get());

prevCommitTime = compactionTimeStamp.get();
//TODO: Below commits are creating duplicates when all the tests are run together. but individually they are passing.
for (int i = 0; i < 2; i++) {
// Upsert
newCommitTime = HoodieActiveTimeline.createNewInstantTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public boolean getBelongsToIncrementalQuery() {
}

public boolean isSplitable() {
return !toString().contains(".log") && !includeBootstrapFilePath();
return !toString().contains(".log") && deltaLogFiles.isEmpty() && !includeBootstrapFilePath();
}

public PathWithBootstrapFileStatus getPathWithBootstrapFileStatus() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.hudi.hadoop.realtime;

import org.apache.hudi.common.model.HoodieLogFile;
import org.apache.hudi.common.util.Option;
import org.apache.hudi.hadoop.PathWithBootstrapFileStatus;

Expand Down Expand Up @@ -65,4 +66,16 @@ void pathNotSplitableForBootstrapScenario() throws IOException {
rtPath.setPathWithBootstrapFileStatus(path);
assertFalse(new HoodieMergeOnReadTableInputFormat().isSplitable(fs, rtPath), "Path for bootstrap should not be splitable.");
}

@Test
void pathNotSplitableIfContainsDeltaFiles() throws IOException {
URI basePath = Files.createTempFile(tempDir, "target", ".parquet").toUri();
HoodieRealtimePath rtPath = new HoodieRealtimePath(new Path("foo"), "bar", basePath.toString(), Collections.emptyList(), "000", false, Option.empty());
assertTrue(new HoodieMergeOnReadTableInputFormat().isSplitable(fs, rtPath), "Path only contains the base file should be splittable");

URI logPath = Files.createTempFile(tempDir, ".test", ".log.4_1-149-180").toUri();
HoodieLogFile logFile = new HoodieLogFile(fs.getFileStatus(new Path(logPath)));
rtPath = new HoodieRealtimePath(new Path("foo"), "bar", basePath.toString(), Collections.singletonList(logFile), "000", false, Option.empty());
assertFalse(new HoodieMergeOnReadTableInputFormat().isSplitable(fs, rtPath), "Path contains log files should not be splittable.");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path for bootstrap should not be splitable

Is the error message right ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}