Skip to content

Conversation

@JoshRosen
Copy link
Contributor

@JoshRosen JoshRosen commented Nov 18, 2016

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 how 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.

@yhuai
Copy link
Contributor

yhuai commented Nov 18, 2016

lgtm pending jenkins

@SparkQA
Copy link

SparkQA commented Nov 18, 2016

Test build #68810 has finished for PR 15922 at commit 9f674be.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class SparkListenerDriverAccumUpdates(

asfgit pushed a commit that referenced this pull request Nov 18, 2016
…es 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 how `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`.

Author: Josh Rosen <[email protected]>

Closes #15922 from JoshRosen/SPARK-18462.

(cherry picked from commit d9dd979)
Signed-off-by: Reynold Xin <[email protected]>
@rxin
Copy link
Contributor

rxin commented Nov 18, 2016

Merging in master/branch-2.1/branch-2.0.

asfgit pushed a commit that referenced this pull request Nov 18, 2016
…es 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 how `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`.

Author: Josh Rosen <[email protected]>

Closes #15922 from JoshRosen/SPARK-18462.

(cherry picked from commit d9dd979)
Signed-off-by: Reynold Xin <[email protected]>
@asfgit asfgit closed this in d9dd979 Nov 18, 2016
@JoshRosen JoshRosen deleted the SPARK-18462 branch November 18, 2016 02:52
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…es 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 how `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`.

Author: Josh Rosen <[email protected]>

Closes apache#15922 from JoshRosen/SPARK-18462.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants