Skip to content

[SPARK-58216][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_1069#57370

Closed
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-1069
Closed

[SPARK-58216][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_1069#57370
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-1069

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

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

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)

…_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`.
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>
@LuciferYang

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@LuciferYang

Copy link
Copy Markdown
Contributor Author

Thank you @HyukjinKwon

@LuciferYang
LuciferYang deleted the assign-name-legacy-1069 branch July 20, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants