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

   ### What changes were proposed in this pull request?
   
   Rename the legacy error condition `_LEGACY_ERROR_TEMP_0033` to
   `STORED_AS_AND_STORED_BY_BOTH_SPECIFIED`, defined as an internal error
   (SQLSTATE `XX000`).
   
   ### Why are the changes needed?
   
   The error-conditions README disallows new `_LEGACY_ERROR_TEMP_*` entries and
   asks existing ones to be given proper names. This converts one of them.
   
   The condition is raised in `AstBuilder.visitCreateFileFormat`, in the branch
   where both `STORED AS` and `STORED BY` are present. That branch is not
   reachable from normal parsing:
   
   - The grammar rule `createFileFormat` is `STORED AS fileFormat | STORED BY 
storageHandler`,
     so one clause carries only one of the two.
   - Two clauses (`STORED AS ... STORED BY ...`) are rejected earlier by
     `checkDuplicateClauses` as `DUPLICATE_CLAUSES`.
   
   As it only signals an internal inconsistency, it is named as an internal 
error
   following the `UNEXPECTED_USE_OF_PARAMETER_MARKER` precedent, rather than 
given
   a user-facing SQLSTATE.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The code path is unreachable from user queries, so the change is not
   observable in practice.
   
   ### How was this patch tested?
   
   `build/sbt "core/testOnly org.apache.spark.SparkThrowableSuite"` passes,
   covering the JSON validation gates (alphabetical ordering, mandatory 
SQLSTATE,
   round-trip). No test is added because the path is unreachable.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)
   


-- 
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