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

   ### What changes were proposed in this pull request?
   This PR assigns a proper name to the legacy error condition 
`_LEGACY_ERROR_TEMP_1080`, renaming it to `TABLE_DATABASE_NOT_SPECIFIED` 
(SQLSTATE `42601`), as part of SPARK-37935 (migrate onto error classes). The 
condition is thrown by `QueryCompilationErrors.tableNotSpecifyDatabaseError`, 
raised from `CatalogTable.database` when the table's `TableIdentifier` has no 
database component. The message text is unchanged: `Table <identifier> did not 
specify database.`
   
   ### Why are the changes needed?
   `_LEGACY_ERROR_TEMP_*` conditions are placeholders without stable, 
meaningful names. Giving this condition a proper name improves the diagnostic 
experience and advances the SPARK-37935 goal of migrating all legacy error 
conditions onto named error classes. SQLSTATE `42601` matches its sibling 
`TABLE_LOCATION_URI_NOT_SPECIFIED`.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. The error condition name changes from `_LEGACY_ERROR_TEMP_1080` to 
`TABLE_DATABASE_NOT_SPECIFIED`. The message text (`Table <identifier> did not 
specify database.`) is unchanged. This surfaces when a `CatalogTable`'s 
database is accessed but its identifier omits the database.
   
   ### How was this patch tested?
   Added a `checkError` test in `QueryCompilationErrorsSuite` asserting the new 
condition name and message parameters. Ran `SparkThrowableSuite` (validates 
`error-conditions.json` formatting, ordering, and SQLSTATE invariants) and 
`QueryCompilationErrorsSuite`; both pass.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Co-authored with Claude 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