-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-21985][PySpark] PairDeserializer is broken for double-zipped RDDs #19226
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4a9eb93
remove check and add tests
aray 0d64a6d
woops
aray e99ed23
convert batches to list in PairDeserializer so we can check the len a…
aray 66477f8
update doc and test
aray 54b7fd0
only convert to list if __len__ not available, set number of partitio…
aray f6d42f4
style
aray ff1417e
add comment per review
aray 5282ee5
nit comment
aray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -644,6 +644,18 @@ def test_cartesian_chaining(self): | |
| set([(x, (y, y)) for x in range(10) for y in range(10)]) | ||
| ) | ||
|
|
||
| def test_zip_chaining(self): | ||
| # Tests for SPARK-21985 | ||
| rdd = self.sc.parallelize(range(10), 2) | ||
|
||
| self.assertSetEqual( | ||
| set(rdd.zip(rdd).zip(rdd).collect()), | ||
| set([((x, x), x) for x in range(10)]) | ||
| ) | ||
| self.assertSetEqual( | ||
| set(rdd.zip(rdd.zip(rdd)).collect()), | ||
| set([(x, (x, x)) for x in range(10)]) | ||
| ) | ||
|
|
||
| def test_deleting_input_files(self): | ||
| # Regression test for SPARK-1025 | ||
| tempFile = tempfile.NamedTemporaryFile(delete=False) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we fix the doc in
Serializer._load_stream_without_unbatchingto say, it returns iterator of iterables?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.
fixed in 66477f8
Uh oh!
There was an error while loading. Please reload this page.
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.
Ah, I had to be clear. Actually, I meant if
Serializer._load_stream_without_unbatchingworks as documentedan iterator of deserialized batches (lists), everything should have worked fine. So, I think the reverse is actually more correct becausePairDeserializerandCartesianDeserializerdo not follow this.I am okay with the current change too but I believe the reverse is better because I think we could prevent such issues in the future and make the things simpler. WDYT @aray and @holdenk ?