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

   ### What changes were proposed in this pull request?
   
   Rename the legacy error condition `_LEGACY_ERROR_TEMP_1069` to 
`CREATE_EXTERNAL_TABLE_WITHOUT_LOCATION`, with SQLSTATE `42601`.
   
   ### Why are the changes needed?
   
   The error-conditions README disallows new `_LEGACY_ERROR_TEMP_*` entries and 
asks existing ones to be resolved. This resolves one of them.
   
   The error is raised by `SessionCatalog.createTable` when an EXTERNAL table 
has no location, e.g. `CREATE EXTERNAL TABLE t(i INT) STORED AS PARQUET` 
without a LOCATION clause. It is an analysis-time `AnalysisException`, 
consistent with sibling "missing required clause" errors such as 
`SORT_BY_WITHOUT_BUCKETING` and `CREATE_VIEW_WITH_IF_NOT_EXISTS_AND_REPLACE`, 
which are top-level names with SQLSTATE `42601`. A top-level name is therefore 
used here rather than an `INVALID_SQL_SYNTAX.*` subclass, which is reserved for 
parse-time `ParseException`s.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Only the error condition name is assigned; the message text is 
unchanged. The `_LEGACY_ERROR_TEMP_*` names are not part of the public API.
   
   ### How was this patch tested?
   
   Added a `checkError` test in `SessionCatalogSuite` that creates an EXTERNAL 
table with an empty storage location and asserts the 
`CREATE_EXTERNAL_TABLE_WITHOUT_LOCATION` condition. `build/sbt 
"catalyst/testOnly *InMemorySessionCatalogSuite" "core/testOnly 
org.apache.spark.SparkThrowableSuite"` passes.
   
   ### 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