[SPARK-58216][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_1069#57370
Closed
LuciferYang wants to merge 1 commit into
Closed
[SPARK-58216][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_1069#57370LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
…_TEMP_1069 Rename the legacy error condition `_LEGACY_ERROR_TEMP_1069` to `CREATE_EXTERNAL_TABLE_WITHOUT_LOCATION`, with SQLSTATE `42601`. 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`, so a top-level name is used here rather than a subclass. A `checkError` test is added in `SessionCatalogSuite`.
HyukjinKwon
approved these changes
Jul 20, 2026
LuciferYang
added a commit
that referenced
this pull request
Jul 20, 2026
…_TEMP_1069 ### 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) Closes #57370 from LuciferYang/assign-name-legacy-1069. Authored-by: YangJie <yangjie01@baidu.com> Signed-off-by: yangjie01 <yangjie01@baidu.com> (cherry picked from commit e71ddb2) Signed-off-by: yangjie01 <yangjie01@baidu.com>
Contributor
Author
Contributor
Author
|
Thank you @HyukjinKwon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Rename the legacy error condition
_LEGACY_ERROR_TEMP_1069toCREATE_EXTERNAL_TABLE_WITHOUT_LOCATION, with SQLSTATE42601.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.createTablewhen an EXTERNAL table has no location, e.g.CREATE EXTERNAL TABLE t(i INT) STORED AS PARQUETwithout a LOCATION clause. It is an analysis-timeAnalysisException, consistent with sibling "missing required clause" errors such asSORT_BY_WITHOUT_BUCKETINGandCREATE_VIEW_WITH_IF_NOT_EXISTS_AND_REPLACE, which are top-level names with SQLSTATE42601. A top-level name is therefore used here rather than anINVALID_SQL_SYNTAX.*subclass, which is reserved for parse-timeParseExceptions.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
checkErrortest inSessionCatalogSuitethat creates an EXTERNAL table with an empty storage location and asserts theCREATE_EXTERNAL_TABLE_WITHOUT_LOCATIONcondition.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)