[SPARK-28556][SQL] QueryExecutionListener should also notify Error#25292
[SPARK-28556][SQL] QueryExecutionListener should also notify Error#25292zsxwing wants to merge 3 commits intoapache:masterfrom
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.
This will need a release note.
There was a problem hiding this comment.
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.
Yea, we should sort those problems out. There's another occurrence at Dataset.queryExecution as an API.
There was a problem hiding this comment.
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.
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.
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
|
|
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 <zsxwing@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 1ddf44d) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
…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 <zsxwing@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
…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 <zsxwing@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
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