j1wonpark opened a new pull request, #58022:
URL: https://github.com/apache/spark/pull/58022

   ### What changes were proposed in this pull request?
   
   Follow-up of SPARK-58619, requested in 
https://github.com/apache/spark/pull/57009#discussion_r3786757968: remove the 
JDBC driver's hard-coded `INVALID_HANDLE.SESSION_` remapping and key the 
`SQLNonTransientConnectionException` mapping on the SQLSTATE the converted 
error already carries (class `08`), keeping the server-provided state. The test 
stub now takes the sqlState explicitly, matching what `GrpcExceptionConverter` 
supplies.
   
   ### Why are the changes needed?
   
   Since SPARK-58619 the server reports `08003` for the 
`INVALID_HANDLE.SESSION_*` conditions, so the driver-side remapping duplicates 
knowledge in `error-conditions.json` and needs manual sync whenever conditions 
move within class `08` (raised in the SPARK-58619 review).
   
   ### Does this PR introduce _any_ user-facing change?
   
   No against Spark 4.3+ servers (the driver first ships in 4.3). Pre-4.3 
servers report `HY000` for the session conditions, so against them the error 
now surfaces as a plain `SQLException` with the server's `HY000` instead of 
being remapped; the documented Connect upgrade path is server-first 
(`spark-connect-overview.md`, Upgradability). Any other class-08 SQLSTATE a 
server reports also maps to the connection-exception type, matching how JDBC 
consumers read class `08`.
   
   ### How was this patch tested?
   
   `JdbcErrorUtilsSuite`: new cases pin that a class-08 state maps to 
`SQLNonTransientConnectionException` regardless of the condition name, and that 
a pre-4.3 `HY000` session error stays unmapped (both fail without the change); 
the existing gRPC, precedence, cause-chain, and passthrough cases are unchanged.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to