-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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-37061][SQL] Fix CustomMetrics when using Inner Classes #34345
Closed
Conversation
This file contains 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
Previously CustomMetrics use Class.getCanonicalName when attempting to get the class name of CustomMetric implementations. These names replace special characters for marking inner classes like ($) with ".". While those names are appropriate for referring to classes withing source files, they will not work during reflection where the Class.getName output should be used.
dongjoon-hyun
changed the title
SPARK-37061: Fix CustomMetrics when using Inner Classes
[SPARK-37061][CORE] Fix CustomMetrics when using Inner Classes
Oct 21, 2021
Thank you for making a PR, @RussellSpitzer . cc @viirya |
viirya
changed the title
[SPARK-37061][CORE] Fix CustomMetrics when using Inner Classes
[SPARK-37061][SQL] Fix CustomMetrics when using Inner Classes
Oct 21, 2021
viirya
approved these changes
Oct 21, 2021
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.
Thanks for catching and fixing it!
dongjoon-hyun
approved these changes
Oct 21, 2021
dongjoon-hyun
pushed a commit
that referenced
this pull request
Oct 21, 2021
### What changes were proposed in this pull request? Previously CustomMetrics use Class.getCanonicalName when attempting to get the class name of CustomMetric implementations. These names replace special characters for marking inner classes like ($) with ".". While those names are appropriate for referring to classes within source files, they will not work during reflection where the Class.getName output should be used. ### Why are the changes needed? InnerClasses could never be found in when they are used as Custom Metrics ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests modified so they access both an independent metric class as well as an inner class. Closes #34345 from RussellSpitzer/SPARK-37061. Authored-by: Russell Spitzer <russell.spitzer@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 2ce551e) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Merged to master/3.2. |
Test build #144475 has finished for PR 34345 at commit
|
sunchao
pushed a commit
to sunchao/spark
that referenced
this pull request
Dec 8, 2021
### What changes were proposed in this pull request? Previously CustomMetrics use Class.getCanonicalName when attempting to get the class name of CustomMetric implementations. These names replace special characters for marking inner classes like ($) with ".". While those names are appropriate for referring to classes within source files, they will not work during reflection where the Class.getName output should be used. ### Why are the changes needed? InnerClasses could never be found in when they are used as Custom Metrics ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests modified so they access both an independent metric class as well as an inner class. Closes apache#34345 from RussellSpitzer/SPARK-37061. Authored-by: Russell Spitzer <russell.spitzer@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 2ce551e) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit b776709) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
catalinii
pushed a commit
to lyft/spark
that referenced
this pull request
Feb 22, 2022
### What changes were proposed in this pull request? Previously CustomMetrics use Class.getCanonicalName when attempting to get the class name of CustomMetric implementations. These names replace special characters for marking inner classes like ($) with ".". While those names are appropriate for referring to classes within source files, they will not work during reflection where the Class.getName output should be used. ### Why are the changes needed? InnerClasses could never be found in when they are used as Custom Metrics ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests modified so they access both an independent metric class as well as an inner class. Closes apache#34345 from RussellSpitzer/SPARK-37061. Authored-by: Russell Spitzer <russell.spitzer@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 2ce551e) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
catalinii
pushed a commit
to lyft/spark
that referenced
this pull request
Mar 4, 2022
### What changes were proposed in this pull request? Previously CustomMetrics use Class.getCanonicalName when attempting to get the class name of CustomMetric implementations. These names replace special characters for marking inner classes like ($) with ".". While those names are appropriate for referring to classes within source files, they will not work during reflection where the Class.getName output should be used. ### Why are the changes needed? InnerClasses could never be found in when they are used as Custom Metrics ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests modified so they access both an independent metric class as well as an inner class. Closes apache#34345 from RussellSpitzer/SPARK-37061. Authored-by: Russell Spitzer <russell.spitzer@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 2ce551e) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Previously CustomMetrics use Class.getCanonicalName when attempting to get the
class name of CustomMetric implementations. These names replace special characters
for marking inner classes like ($) with ".". While those names are appropriate for
referring to classes within source files, they will not work during reflection where
the Class.getName output should be used.
Why are the changes needed?
InnerClasses could never be found in when they are used as Custom Metrics
Does this PR introduce any user-facing change?
No
How was this patch tested?
Tests modified so they access both an independent metric class as well as an inner class.