-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-3926 [CORE] Reopened: result of JavaRDD collectAsMap() is not serializable #3587
Conversation
Test build #24099 has started for PR 3587 at commit
|
Test build #24099 has finished for PR 3587 at commit
|
Test FAILed. |
Test build #24102 has started for PR 3587 at commit
|
Test build #24102 has finished for PR 3587 at commit
|
Test PASSed. |
|
||
// Add no-arg constructor just for serialization | ||
def this() = this(null) |
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.
You can remove this()
since you have already copying the codes.
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.
It won't have a no-arg constructor in addition to its main one arg constructor otherwise right? This is the point of this change.
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.
I ran your unit test after removing the no-arg constructor, and it worked fine.
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.
Hm, so it does. Maybe I misunderstood the original error. It's complaining about the superclass (MapWrapper
) not having a no-arg constructor? So copying the class works, since we no longer subclass MapWrapper
, but the copy in SerializableMapWrapper
need not define a no-arg constructor. OK, that line can be removed.
…ied code in LICENSE
Test build #24184 has started for PR 3587 at commit
|
LGTM |
Test build #24184 has finished for PR 3587 at commit
|
Test PASSed. |
LGTM, too. Merging into |
…erializable My original 'fix' didn't fix at all. Now, there's a unit test to check whether it works. Of the two options to really fix it -- copy the `Map` to a `java.util.HashMap`, or copy and modify Scala's implementation in `Wrappers.MapWrapper`, I went with the latter. Author: Sean Owen <sowen@cloudera.com> Closes #3587 from srowen/SPARK-3926 and squashes the following commits: 8586bb9 [Sean Owen] Remove unneeded no-arg constructor, and add additional note about copied code in LICENSE 7bb0e66 [Sean Owen] Make SerializableMapWrapper actually serialize, and add unit test (cherry picked from commit e829bfa) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
Merged to |
I've merged this into |
…erializable My original 'fix' didn't fix at all. Now, there's a unit test to check whether it works. Of the two options to really fix it -- copy the `Map` to a `java.util.HashMap`, or copy and modify Scala's implementation in `Wrappers.MapWrapper`, I went with the latter. Author: Sean Owen <sowen@cloudera.com> Closes #3587 from srowen/SPARK-3926 and squashes the following commits: 8586bb9 [Sean Owen] Remove unneeded no-arg constructor, and add additional note about copied code in LICENSE 7bb0e66 [Sean Owen] Make SerializableMapWrapper actually serialize, and add unit test (cherry picked from commit e829bfa) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
My original 'fix' didn't fix at all. Now, there's a unit test to check whether it works. Of the two options to really fix it -- copy the
Map
to ajava.util.HashMap
, or copy and modify Scala's implementation inWrappers.MapWrapper
, I went with the latter.