-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-28699][Core] Cache an indeterminate RDD could lead to incorrect result while stage rerun #25420
[SPARK-28699][Core] Cache an indeterminate RDD could lead to incorrect result while stage rerun #25420
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ case class CachedRDDBuilder( | |
|
||
private def buildBuffers(): RDD[CachedBatch] = { | ||
val output = cachedPlan.output | ||
val cached = cachedPlan.execute().mapPartitionsInternal { rowIterator => | ||
val cached = cachedPlan.execute().mapPartitionsWithIndexInternal({ (_, rowIterator) => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we only run cached plan once. I think it should be determinate? If so, this map should not be order sensitive effectively? |
||
new Iterator[CachedBatch] { | ||
def next(): CachedBatch = { | ||
val columnBuilders = output.map { attribute => | ||
|
@@ -131,7 +131,7 @@ case class CachedRDDBuilder( | |
|
||
def hasNext: Boolean = rowIterator.hasNext | ||
} | ||
}.persist(storageLevel) | ||
}, isOrderSensitive = true).persist(storageLevel) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite get it. The |
||
|
||
cached.setName(cachedName) | ||
cached | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this for the behavior change, as the approach now, we need to abort the stage of the current mapStage.
As we will finally support stage rerun, I suggest to skip this behavior, we can directly support the cache scenario after SPARK-25341 merged.