Skip to content
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-18055][SQL] Use correct mirror in ExpresionEncoder #17201

Closed
wants to merge 1 commit into from

Conversation

marmbrus
Copy link
Contributor

@marmbrus marmbrus commented Mar 8, 2017

Previously, we were using the mirror of passed in TypeTag when reflecting to build an encoder. This fails when the outer class is built in (i.e. Seq's default mirror is based on root classloader) but inner classes (i.e. A in Seq[A]) are defined in the REPL or a library.

This patch changes us to always reflect based on a mirror created using the context classloader.

@marmbrus
Copy link
Contributor Author

marmbrus commented Mar 8, 2017

/cc @cloud-fan

@SparkQA
Copy link

SparkQA commented Mar 8, 2017

Test build #74167 has finished for PR 17201 at commit 3af20fd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

retest this please

@cloud-fan
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Mar 8, 2017

Test build #74177 has finished for PR 17201 at commit 3af20fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Mar 8, 2017
Previously, we were using the mirror of passed in `TypeTag` when reflecting to build an encoder.  This fails when the outer class is built in (i.e. `Seq`'s default mirror is based on root classloader) but inner classes (i.e. `A` in `Seq[A]`) are defined in the REPL or a library.

This patch changes us to always reflect based on a mirror created using the context classloader.

Author: Michael Armbrust <michael@databricks.com>

Closes #17201 from marmbrus/replSeqEncoder.

(cherry picked from commit 314e48a)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
asfgit pushed a commit that referenced this pull request Mar 8, 2017
Previously, we were using the mirror of passed in `TypeTag` when reflecting to build an encoder.  This fails when the outer class is built in (i.e. `Seq`'s default mirror is based on root classloader) but inner classes (i.e. `A` in `Seq[A]`) are defined in the REPL or a library.

This patch changes us to always reflect based on a mirror created using the context classloader.

Author: Michael Armbrust <michael@databricks.com>

Closes #17201 from marmbrus/replSeqEncoder.

(cherry picked from commit 314e48a)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@asfgit asfgit closed this in 314e48a Mar 8, 2017
@cloud-fan
Copy link
Contributor

thanks, merging to master/2.1/2.0!

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.

3 participants