You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ewan Higgs (JIRA)" <ji...@apache.org> on 2015/04/27 22:37:38 UTC
[jira] [Resolved] (SPARK-5300) Spark loads file partitions in
inconsistent order on native filesystems
[ https://issues.apache.org/jira/browse/SPARK-5300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ewan Higgs resolved SPARK-5300.
-------------------------------
Resolution: Won't Fix
I submitted a fix at the FileSystem level based on comments in the mailing list. The patch was rejected because it's expected that anyone implementing a file input format should make sure the files are loaded in order. They can do that by overriding the listStatus function as follows:
{code}
// Sort the file pieces since order matters.
override def listStatus(job: JobContext): List[FileStatus] = {
val listing = super.listStatus(job)
val sortedListing= listing.sortWith{ (lhs, rhs) => {
lhs.getPath().compareTo(rhs.getPath()) < 0
} }
sortedListing.toList
}
{code}
> Spark loads file partitions in inconsistent order on native filesystems
> -----------------------------------------------------------------------
>
> Key: SPARK-5300
> URL: https://issues.apache.org/jira/browse/SPARK-5300
> Project: Spark
> Issue Type: Bug
> Components: Input/Output
> Affects Versions: 1.1.0, 1.2.0
> Environment: Linux, EXT4, for example.
> Reporter: Ewan Higgs
>
> Discussed on user list in April 2014:
> http://apache-spark-user-list.1001560.n3.nabble.com/Spark-reads-partitions-in-a-wrong-order-td4818.html
> And on dev list January 2015:
> http://apache-spark-developers-list.1001551.n3.nabble.com/RDD-order-guarantees-td10142.html
> When using a file system which isn't HDFS, file partitions ('part-00000, part-00001', etc.) are not guaranteed to load in the same order. This means previously sorted RDDs will be loaded out of order.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org