Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.disq-bio</groupId>
<artifactId>disq</artifactId>
<version>0.3.7-SNAPSHOT</version>
<version>0.3.7-bugfix-SNAPSHOT</version>

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.

This change isn't necessary for this pull request -- versioning will be handled by the Maven release plugin on the next release cycle.

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.

Woops! That's funny, I literally told @tedsharpe the same thing on his last PR and then I did it myself...

<name>Disq</name>
<description>A library for manipulating bioinformatics sequencing formats in Apache Spark.</description>
<url>https://github.com/disq-bio/disq</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
package org.disq_bio.disq.impl.file;

import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
Expand Down Expand Up @@ -84,4 +88,14 @@ public RecordReader<Void, FileSplit> createRecordReader(
InputSplit split, TaskAttemptContext context) {
return new FileSplitRecordReader();
}

/**
* We override this method because super.listStatus returns files in an effectively random order
* on some filesystems. This breaks ordering assumptions and results in data corruption. We sort
* the results here in order to guarantee part files are returned in numeric order.
*/
@Override
protected List<FileStatus> listStatus(final JobContext job) throws IOException {
return super.listStatus(job).stream().sorted().collect(Collectors.toList());
}
}