-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28556][SQL] QueryExecutionListener should also notify Error #25292
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
| */ | ||
| @DeveloperApi | ||
| def onFailure(funcName: String, qe: QueryExecution, exception: Exception): Unit | ||
| def onFailure(funcName: String, qe: QueryExecution, error: Throwable): Unit |
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.
This will need a release note.
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.
There is another issue in this API: It passes a private class QueryExecution to the user in a public API. Didn't fix it as it will require a re-design of this API.
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.
Yea, we should sort those problems out. There's another occurrence at Dataset.queryExecution as an API.
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'm a bit concerned about this change. This broke one of my project that uses this API. Instead of changing the signature here, did we consider just wrapping the exception?
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.
RE: QueryExecution I think that has become a developer API at this point. I think a lot of developers use it to debug things.
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.
wrapping the exception?
This is a good suggestion. This can avoid api changes, and we can also fix this bug that errors are not sent to the listener in 2.4.
|
Test build #108345 has finished for PR 25292 at commit
|
sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala
Outdated
Show resolved
Hide resolved
|
Test build #108348 has finished for PR 25292 at commit
|
|
Test build #108349 has finished for PR 25292 at commit
|
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.
HyukjinKwon
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.
LGTM too
|
Merged to master. |
|
Hi, @gatorsmile , @zsxwing , @HyukjinKwon . |
|
For the following, cc @rxin since he is a release manager for 3.0.0. (Also, cc @gatorsmile ). |
|
Hi, @marmbrus . |
|
I don't see any discussion of alternatives to breaking the API here or on JIRA. I'm just asking that we discuss. I don't see anything "illegitimate" about that... We can open a JIRA after others have a chance to chime in. |
|
I didn't think about wrapping the exception. Totally agree that this is actually a better solution. It can avoid breaking APIs , and in addition, the same fix can be applied to maintenance branches (such as branch-2.4). I will create a new JIRA ticket for this alternative solution. |
…QueryExecutionListener ### What changes were proposed in this pull request? This PR manually reverts changes in #25292 and then wraps java.lang.Error with `QueryExecutionException` to notify `QueryExecutionListener` to send it to `QueryExecutionListener.onFailure` which only accepts `Exception`. The bug fix PR for 2.4 is #27904. It needs a separate PR because the touched codes were changed a lot. ### Why are the changes needed? Avoid API changes and fix a bug. ### Does this PR introduce any user-facing change? Yes. Reverting an API change happening in 3.0. QueryExecutionListener APIs will be the same as 2.4. ### How was this patch tested? The new added test. Closes #27907 from zsxwing/SPARK-31144. Authored-by: Shixiong Zhu <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit 1ddf44d) Signed-off-by: Dongjoon Hyun <[email protected]>
…QueryExecutionListener ### What changes were proposed in this pull request? This PR manually reverts changes in #25292 and then wraps java.lang.Error with `QueryExecutionException` to notify `QueryExecutionListener` to send it to `QueryExecutionListener.onFailure` which only accepts `Exception`. The bug fix PR for 2.4 is #27904. It needs a separate PR because the touched codes were changed a lot. ### Why are the changes needed? Avoid API changes and fix a bug. ### Does this PR introduce any user-facing change? Yes. Reverting an API change happening in 3.0. QueryExecutionListener APIs will be the same as 2.4. ### How was this patch tested? The new added test. Closes #27907 from zsxwing/SPARK-31144. Authored-by: Shixiong Zhu <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
…QueryExecutionListener ### What changes were proposed in this pull request? This PR manually reverts changes in apache#25292 and then wraps java.lang.Error with `QueryExecutionException` to notify `QueryExecutionListener` to send it to `QueryExecutionListener.onFailure` which only accepts `Exception`. The bug fix PR for 2.4 is apache#27904. It needs a separate PR because the touched codes were changed a lot. ### Why are the changes needed? Avoid API changes and fix a bug. ### Does this PR introduce any user-facing change? Yes. Reverting an API change happening in 3.0. QueryExecutionListener APIs will be the same as 2.4. ### How was this patch tested? The new added test. Closes apache#27907 from zsxwing/SPARK-31144. Authored-by: Shixiong Zhu <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
Right now
Erroris not sent toQueryExecutionListener.onFailure. If there is anyError(such asAssertionError) when running a query,QueryExecutionListener.onFailurecannot be triggered.This PR changes
onFailureto accept aThrowableinstead.How was this patch tested?
Jenkins