You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-52383][CONNECT] Improve errors in SparkConnectPlanner
### What changes were proposed in this pull request?
This PR improves error handling in SparkConnectPlanner by:
1. Adding new error handling methods in `InvalidInputErrors.scala` for better error messages:
- `invalidEnum` for handling invalid enum values
- `invalidOneOfField` for handling invalid oneOf fields in protobuf messages
- `cannotBeEmpty` for handling empty fields
- `streamingQueryRunIdMismatch` and `streamingQueryNotFound` for streaming query errors
2. Replacing specific error messages with more generic ones. For examples:
- Replacing `unknownRelationNotSupported` with `invalidOneOfField`
- Replacing `catalogTypeNotSupported` with `invalidOneOfField`
- Replacing `functionIdNotSupported` with `invalidOneOfField`
- Replacing `expressionIdNotSupported` with `invalidOneOfField`
- Replacing `dataSourceIdNotSupported` with `invalidOneOfField`
3. Improving error handling for protobuf-related issues:
- Better handling of oneOf fields in protobuf messages
- More descriptive error messages for invalid enum values
- Better handling of empty fields
### Why are the changes needed?
1. Provide more specific and descriptive error messages
2. Better handle protobuf-related issues that are common in the Connect API
3. Make error messages more consistent across different parts of the codebase
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
`build/sbt "connect/testOnly *SparkConnectPlannerSuite"`
`build/sbt "connect/testOnly *InvalidInputErrorsSuite"`
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor 0.50.7 (Universal)
Closesapache#51062 from heyihong/SPARK-52383.
Authored-by: Yihong He <heyihong.cn@gmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
0 commit comments