GitHub user JoshRosen opened a pull request:
https://github.com/apache/spark/pull/15922
[SPARK-18462] Fix ClassCastException in SparkListenerDriverAccumUpdates
event
## What changes were proposed in this pull request?
This patch fixes a `ClassCastException: java.lang.Integer cannot be cast to
java.lang.Long` error which could occur in the HistoryServer while trying to
process a deserialized `SparkListenerDriverAccumUpdates` event.
The problem stems from `jackson-module-scala` handles primitive type
parameters (see
https://github.com/FasterXML/jackson-module-scala/wiki/FAQ#deserializing-optionint-and-other-primitive-challenges
for more details). This was causing a problem where our code expected a field
to be deserialized as a `(Long, Long)` tuple but we got an `(Int, Int)` tuple
instead.
This patch hacks around this issue by registering a custom `Converter` with
Jackson in order to deserialize the tuples as `(Object, Object)` and perform
the appropriate casting.
## How was this patch tested?
New regression tests in `SQLListenerSuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/JoshRosen/spark SPARK-18462
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15922.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15922
----
commit 0dcad4b1502ec8c7c45e17e4a8029545d7337e2a
Author: Josh Rosen <[email protected]>
Date: 2016-11-16T01:17:58Z
Add failing regression test.
commit 9f674be5efd72cf58e2139343202904f26e14966
Author: Josh Rosen <[email protected]>
Date: 2016-11-18T00:06:12Z
Add fix using custom Jackson converter.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]