You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/08/04 04:48:43 UTC
[PR] [SPARK-58539] Support error details in `SparkConnectError` using gRPC `ErrorInfo` [spark-connect-swift]
dongjoon-hyun opened a new pull request, #474:
URL: https://github.com/apache/spark-connect-swift/pull/474
### What changes were proposed in this pull request?
This PR improves `SparkConnectError` to carry error details and replaces message-substring-based
error classification with `google.rpc.ErrorInfo` parsing.
1. Each `SparkConnectError` case now carries a `Details` payload (`message`, `errorClass`,
`sqlState`, `messageParameters`). The cases are renamed to `lowerCamelCase` while the original
spellings are kept as compatibility static properties, so the existing `throw`/`catch`/
`#expect(throws:)` call sites continue to compile unchanged.
2. A new `GrpcErrorConverter` classifies errors by the Spark error class from `ErrorInfo` of the
gRPC status details, like the PySpark and Scala clients. Message-substring matching remains only
as a fallback.
3. The three duplicated substring-matching sites (`SparkConnectClient.withGPRC`,
`DataFrame.withGPRC`, `ddlParse`) are unified into the converter.
### Why are the changes needed?
Users could not access the server error message, error class, or SQLSTATE from a caught error, and
the classification relied on fragile substring matching duplicated in three places.
### Does this PR introduce _any_ user-facing change?
Yes, `SparkConnectError` provides detailed error information now.
```swift
} catch SparkConnectError.tableOrViewNotFound(let details) {
print(details.errorClass) // Optional("TABLE_OR_VIEW_NOT_FOUND")
print(details.sqlState) // Optional("42P01")
}
```
The existing code using the original case spellings continues to compile and behave the same.
### How was this patch tested?
Pass the CIs with the newly added `SparkConnectErrorTests` test suite. All existing test suites pass
unmodified, which proves the source compatibility of this change.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Fable 5
--
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-58539] Support error details in `SparkConnectError` using gRPC `ErrorInfo` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #474: [SPARK-58539] Support error details in `SparkConnectError` using gRPC `ErrorInfo`
URL: https://github.com/apache/spark-connect-swift/pull/474
--
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-58539] Support error details in `SparkConnectError` using gRPC `ErrorInfo` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #474:
URL: https://github.com/apache/spark-connect-swift/pull/474#issuecomment-5174996865
Thank you, @viirya !
--
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-58539] Support error details in `SparkConnectError` using gRPC `ErrorInfo` [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #474:
URL: https://github.com/apache/spark-connect-swift/pull/474#issuecomment-5175000936
Merged to main
--
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