You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "heyihong (via GitHub)" <gi...@apache.org> on 2026/02/02 19:42:32 UTC
[PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
heyihong opened a new pull request, #54094:
URL: https://github.com/apache/spark/pull/54094
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as new features, bug fixes, or other behavior changes. Documentation-only updates are not considered user-facing changes.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2804805294
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
The root error is the top-level error in the error cause chain. The definition is the same as in https://github.com/apache/spark/blob/master/sql/connect/common/src/main/protobuf/spark/connect/base.proto#L1050-L1054.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #54094: [SPARK-55314][CONNECT] Propagate observed metrics errors to client
URL: https://github.com/apache/spark/pull/54094
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2822581220
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
Having root_error_idx is more flexible and self-contained as part of the protocol because it makes fewer assumptions about the order of errors, since the implementation does not need to place the error at the head of the list.
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
Having `root_error_idx` is more flexible and self-contained as part of the protocol because it makes fewer assumptions about the order of errors, since the implementation does not need to place the error at the head of the list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2822581220
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
Having `root_error_idx` is more flexible and self-contained as part of the protocol because it makes fewer assumptions about the order of errors. The implementation does not need to place the error at the head of the list.
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
Having `root_error_idx` is more flexible and self-contained as part of the protocol because it makes fewer assumptions about the order of errors. So the implementation does not need to place the error at the head of the list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2817292089
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
OK this follows the existing pattern, but shouldn't we always put the root error in the head of the list? then there is no need to have `root_error_idx`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #54094:
URL: https://github.com/apache/spark/pull/54094#issuecomment-3914983409
cc @HyukjinKwon to review the python client changes, the other parts LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2804491277
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
+ // A list of errors that occurred while collecting the observed metrics.
+ // If the length is 0, it means no errors occurred.
+ repeated FetchErrorDetailsResponse.Error errors = 6;
Review Comment:
why it's a list? because a query can have many observations?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #54094:
URL: https://github.com/apache/spark/pull/54094#issuecomment-3855448502
## JIRA Issue Information
=== Sub-task SPARK-55314 ===
Summary: Propagate observed metrics errors to client
Assignee: None
Status: Open
Affected: ["4.2.0"]
---
*This comment was automatically generated by GitHub Actions*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2804799389
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
+ // A list of errors that occurred while collecting the observed metrics.
+ // If the length is 0, it means no errors occurred.
+ repeated FetchErrorDetailsResponse.Error errors = 6;
Review Comment:
It is for future extensions if we want to support returning cause exceptions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #54094:
URL: https://github.com/apache/spark/pull/54094#issuecomment-3923746304
Merged to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #54094:
URL: https://github.com/apache/spark/pull/54094#issuecomment-3888704742
I need a bit more context. What's the current protobuf protocol for observed metrics and how this PR changes it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2804489762
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
what is root error? how is this different from normal query errors?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #54094:
URL: https://github.com/apache/spark/pull/54094#discussion_r2804805294
##########
sql/connect/common/src/main/protobuf/spark/connect/base.proto:
##########
@@ -491,6 +491,12 @@ message ExecutePlanResponse {
repeated Expression.Literal values = 2;
repeated string keys = 3;
int64 plan_id = 4;
+ // (Optional) The index of the root error in errors.
+ // The field will not be set if there are no errors.
+ optional int32 root_error_idx = 5;
Review Comment:
The definition is the same as in https://github.com/apache/spark/blob/master/sql/connect/common/src/main/protobuf/spark/connect/base.proto#L1050-L1054
.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-55314][CONNECT] Propagate observed metrics errors to client [spark]
Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on PR #54094:
URL: https://github.com/apache/spark/pull/54094#issuecomment-3891074300
> I need a bit more context. What's the current protobuf protocol for observed metrics and how this PR changes it?
Yes, below is the summary of the `Success path`:
1. The driver runs the plan; observations produce Rows (or the Python accumulator produces a seq of values).
2. The server converts those to ObservedMetrics: name, keys, values (each value as Expression.Literal).
3. The result is sent as ExecutePlanResponse.observed_metrics (repeated).
4. The client treats each item as success: keys and values have the same length; it decodes each Literal and builds either a Row (Scala) or PlanObservedMetrics / pairs (Python).
For this PR, success path is unchanged; it only adds reporting of observation collection failures via root_error_idx and errors, and surfaces those failures on both Scala and Python clients.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org