-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-39958][SQL] Add warning log when unable to load custom metric object #37386
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
Conversation
|
Previous discussion: #31451 (comment) I think we don't need to construct the instance using reflection, how about removing constructor checks? |
Then how can we construct the instance? |
|
Just about to ask same question. |
|
Oh, I see. Previous I misunderstand that instances constructed by Could you please enhance the comment of |
Okay. |
| case NonFatal(e) => | ||
| logWarning(s"Unable to load custom metric object for class `$className`. " + | ||
| "Please make sure that the custom metric class is in the classpath and " + | ||
| "it has 0-arg constructor", e) |
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.
nit. . at the end of the sentence?
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.
Added. Thanks.
dongjoon-hyun
left a comment
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.
+1, LGTM.
| case NonFatal(e) => | ||
| logWarning(s"Unable to load custom metric object for class `$className`. " + | ||
| "Please make sure that the custom metric class is in the classpath and " + | ||
| "it has 0-arg constructor.", e) |
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.
Utils#loadExtensions also allows "single-argument constructor that accepts SparkConf", do we need to mention that?
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 don't think we should. Actually we don't need the implementing class to implement it.
pan3793
left a comment
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, LGTM
|
The known and unrelated sparkr failure: Unrelated Python linter: |
|
Merged, thanks! |
What changes were proposed in this pull request?
Currently when
SQLAppStatusListenercannot load custom metric object, it silently ignores the error. We better provide a warning log for users.Why are the changes needed?
Improving user experience.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing tests