Jiwon Park created SPARK-58619:
----------------------------------

             Summary: Support sub-condition level SQLSTATE in the error 
condition framework
                 Key: SPARK-58619
                 URL: https://issues.apache.org/jira/browse/SPARK-58619
             Project: Spark
          Issue Type: Improvement
          Components: Spark Core
    Affects Versions: 5.0.0
            Reporter: Jiwon Park


A SQLSTATE can only be assigned to a top-level error condition: 
{{ErrorSubInfo}} has no {{sqlState}} field and 
{{ErrorClassesJsonReader.getSqlState}} resolves only the main condition, so 
every sub-condition unconditionally inherits its parent's value.

{{INVALID_HANDLE.SESSION_CHANGED}}, {{SESSION_CLOSED}}, and 
{{SESSION_NOT_FOUND}} mean the server-side session backing a Connect client is 
gone, which SQL standard 08003 (connection does not exist) describes, yet they 
inherit the generic HY000 that {{INVALID_HANDLE}} received before they were 
added. The Connect JDBC driver hard-codes a remapping as a result (raised in 
the SPARK-57933 PR review), and splitting them into new top-level conditions 
would break deployed clients that match the condition names to drive 
transparent reattach and session invalidation.

Proposal: add an optional {{sqlState}} field to {{ErrorSubInfo}} and resolve 
the sub-condition's SQLSTATE first with fallback to the main condition's (as 
{{getBreakingChangeInfo}} already does), assign 08003 to the three session 
sub-conditions, and give PySpark's {{get_sqlstate}} the same fallback (it 
currently reports no SQLSTATE for sub-conditions without their own, e.g. 
{{NEAREST_BY_JOIN.UNSUPPORTED_MODE}}).




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to