Skip to content

[SPARK-58267][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_1059#57445

Open
Ma77Ball wants to merge 2 commits into
apache:masterfrom
Ma77Ball:SPARK-58267-legacy-error-1059
Open

[SPARK-58267][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_1059#57445
Ma77Ball wants to merge 2 commits into
apache:masterfrom
Ma77Ball:SPARK-58267-legacy-error-1059

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Rename the legacy error condition _LEGACY_ERROR_TEMP_1059 to
INVALID_FILE_FORMAT_FOR_STORED_AS, 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 ResolveSessionCatalog when a CREATE TABLE uses STORED AS <fileFormat> with a file format that does not map to a known Hive SerDe, e.g.
CREATE TABLE t (c1 INT) STORED AS UNKNOWN_FORMAT. It is an analysis-time
AnalysisException.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added a checkError test in QueryCompilationErrorsSuite that runs CREATE TABLE ... STORED AS <unknown format> and asserts the INVALID_FILE_FORMAT_FOR_STORED_AS
condition. build/sbt "core/testOnly org.apache.spark.SparkThrowableSuite" passes.

Was this patch authored or co-authored using generative AI tooling?

Co-Authored with: Claude Opus 4.8

@Ma77Ball
Ma77Ball marked this pull request as ready for review July 22, 2026 23:54
@uros-b

uros-b commented Jul 23, 2026

Copy link
Copy Markdown
Member

Thank you @Ma77Ball!

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