Skip to content

[SPARK-58283][SQL] Assign names to the error conditions _LEGACY_ERROR_TEMP_1138-1141#57456

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

[SPARK-58283][SQL] Assign names to the error conditions _LEGACY_ERROR_TEMP_1138-1141#57456
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-1138-1141

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Resolve four legacy error conditions raised while resolving a data source provider in DataSource.lookupDataSource, converting them to proper top-level names in error-conditions.json:

  • _LEGACY_ERROR_TEMP_1138ORC_DATA_SOURCE_REQUIRES_HIVE_SUPPORT (0A000)
  • _LEGACY_ERROR_TEMP_1139AVRO_DATA_SOURCE_NOT_ENABLED (42K02)
  • _LEGACY_ERROR_TEMP_1140KAFKA_DATA_SOURCE_NOT_ENABLED (42K02)
  • _LEGACY_ERROR_TEMP_1141MULTIPLE_DATA_SOURCES (42710)

The message text is preserved verbatim from the legacy entries.

Why are the changes needed?

The error-conditions README disallows new _LEGACY_ERROR_TEMP_* entries and asks existing ones to be resolved. This resolves four of them.

They are kept as top-level names rather than folded into the existing DATA_SOURCE_NOT_FOUND / MULTIPLE_XML_DATA_SOURCE: the Avro/Kafka errors are AnalysisExceptions (not the SparkClassNotFoundException of DATA_SOURCE_NOT_FOUND) and carry module-specific deployment guidance, and the multiple-sources error mirrors the existing XML-specific MULTIPLE_XML_DATA_SOURCE but for the generic provider path.

Does this PR introduce any user-facing change?

No. Only the error condition names are assigned; the message text is unchanged. The _LEGACY_ERROR_TEMP_* names are not part of the public API.

How was this patch tested?

Updated the existing checkError assertions to the new condition names in SQLQuerySuite, DDLSuite, ResolvedDataSourceSuite, and DDLSourceLoadSuite. build/sbt "sql/testOnly *ResolvedDataSourceSuite *DDLSourceLoadSuite *SQLQuerySuite *InMemoryCatalogedDDLSuite" "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_1138-1141

Resolve four legacy error conditions raised while resolving a data source
provider in `DataSource.lookupDataSource`, converting them to proper top-level
names in `error-conditions.json`:

- `_LEGACY_ERROR_TEMP_1138` -> `ORC_DATA_SOURCE_REQUIRES_HIVE_SUPPORT` (0A000)
- `_LEGACY_ERROR_TEMP_1139` -> `AVRO_DATA_SOURCE_NOT_ENABLED` (42K02)
- `_LEGACY_ERROR_TEMP_1140` -> `KAFKA_DATA_SOURCE_NOT_ENABLED` (42K02)
- `_LEGACY_ERROR_TEMP_1141` -> `MULTIPLE_DATA_SOURCES` (42710)

All four are user-facing `AnalysisException`s. They are kept as top-level names
rather than folded into the existing `DATA_SOURCE_NOT_FOUND` / `MULTIPLE_XML_DATA_SOURCE`:
the Avro/Kafka errors are thrown as `AnalysisException` (not the
`SparkClassNotFoundException` of `DATA_SOURCE_NOT_FOUND`) and carry
module-specific deployment guidance; the multiple-sources error mirrors the
existing XML-specific one but for the generic path. The message text is
preserved verbatim from the legacy entries. Existing `checkError` assertions
are updated to the new condition names.
@uros-b

uros-b commented Jul 23, 2026

Copy link
Copy Markdown
Member

Thank you @LuciferYang!

LuciferYang added a commit that referenced this pull request Jul 24, 2026
…_TEMP_1138-1141

### What changes were proposed in this pull request?

Resolve four legacy error conditions raised while resolving a data source provider in `DataSource.lookupDataSource`, converting them to proper top-level names in `error-conditions.json`:

- `_LEGACY_ERROR_TEMP_1138` → `ORC_DATA_SOURCE_REQUIRES_HIVE_SUPPORT` (`0A000`)
- `_LEGACY_ERROR_TEMP_1139` → `AVRO_DATA_SOURCE_NOT_ENABLED` (`42K02`)
- `_LEGACY_ERROR_TEMP_1140` → `KAFKA_DATA_SOURCE_NOT_ENABLED` (`42K02`)
- `_LEGACY_ERROR_TEMP_1141` → `MULTIPLE_DATA_SOURCES` (`42710`)

The message text is preserved verbatim from the legacy entries.

### Why are the changes needed?

The error-conditions README disallows new `_LEGACY_ERROR_TEMP_*` entries and asks existing ones to be resolved. This resolves four of them.

They are kept as top-level names rather than folded into the existing `DATA_SOURCE_NOT_FOUND` / `MULTIPLE_XML_DATA_SOURCE`: the Avro/Kafka errors are `AnalysisException`s (not the `SparkClassNotFoundException` of `DATA_SOURCE_NOT_FOUND`) and carry module-specific deployment guidance, and the multiple-sources error mirrors the existing XML-specific `MULTIPLE_XML_DATA_SOURCE` but for the generic provider path.

### Does this PR introduce _any_ user-facing change?

No. Only the error condition names are assigned; the message text is unchanged. The `_LEGACY_ERROR_TEMP_*` names are not part of the public API.

### How was this patch tested?

Updated the existing `checkError` assertions to the new condition names in `SQLQuerySuite`, `DDLSuite`, `ResolvedDataSourceSuite`, and `DDLSourceLoadSuite`. `build/sbt "sql/testOnly *ResolvedDataSourceSuite *DDLSourceLoadSuite *SQLQuerySuite *InMemoryCatalogedDDLSuite" "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 #57456 from LuciferYang/assign-name-legacy-1138-1141.

Authored-by: YangJie <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
(cherry picked from commit 9ce65b2)
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 @uros-b

@LuciferYang
LuciferYang deleted the assign-name-legacy-1138-1141 branch July 24, 2026 02:57
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.

3 participants