Vamsi-klu opened a new pull request, #58193:
URL: https://github.com/apache/spark/pull/58193

   ### What changes were proposed in this pull request?
   
   Assign a stable name to `_LEGACY_ERROR_TEMP_1059` (invalid `STORED AS` file 
format).
   
   - Catalog: delete `_LEGACY_ERROR_TEMP_1059`, add 
`INVALID_FILE_FORMAT_FOR_STORED_AS` with SQLSTATE `42601` and the same message: 
`STORED AS with file format '<serdeInfo>' is invalid.`
   - `QueryCompilationErrors.invalidFileFormatForStoredAsError` now uses that 
condition. The helper, the `serdeInfo` placeholder name, 
`ResolveSessionCatalog`, and `HiveSerDe` are unchanged.
   - Add `checkError` coverage in `QueryCompilationErrorsSuite` for CREATE 
TABLE, CTAS, and CREATE TABLE LIKE with `STORED AS UNKNOWN_FORMAT`. The LIKE 
source is `USING parquet` so the suite does not need Hive.
   
   `INSERT OVERWRITE DIRECTORY ... STORED AS` still uses 
`_LEGACY_ERROR_TEMP_0035` and is out of scope.
   
   Closed apache/spark#57445 used this same name and SQLSTATE. That PR was 
closed after a false "already merged" claim.
   
   ### Why are the changes needed?
   
   https://issues.apache.org/jira/browse/SPARK-58267
   
   Sub-task of SPARK-37935. TEMP ids are not a stable public condition. The id 
is still in current `master`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Clients that match `_LEGACY_ERROR_TEMP_1059` by condition name will 
need the new name. The message text is unchanged, including the `<serdeInfo>` 
placeholder. Named conditions now report SQLSTATE `42601`.
   
   ### How was this patch tested?
   
   - `build/sbt "sql/testOnly 
org.apache.spark.sql.errors.QueryCompilationErrorsSuite -- -z 
INVALID_FILE_FORMAT_FOR_STORED_AS"`
   - `build/sbt "core/testOnly org.apache.spark.SparkThrowableSuite -- -z 
\"Error conditions are correctly formatted\""`
   
   No SQL golden files. No Hive module run.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor Grok 4.6
   
   cc @uros-b @MaxGekk
   


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