ramesh004 opened a new pull request, #60528:
URL: https://github.com/apache/spark/pull/60528
…_TEMP_1089
Renames the legacy error condition `_LEGACY_ERROR_TEMP_1089` to the
descriptive name `COLUMN_STATISTICS_DESERIALIZATION_NOT_SUPPORTED`, continuing
the SPARK-37935 effort to give every error condition a stable, meaningful name.
- `error-conditions.json`: the entry moves out of the `_LEGACY_ERROR_TEMP_*`
block and is defined under the new name
`COLUMN_STATISTICS_DESERIALIZATION_NOT_SUPPORTED`, keeping the same message
text ("Column statistics deserialization is not supported for column <name> of
data type: <dataType>.") and gaining the SQLSTATE `0A000` (feature not
supported), which the legacy entry lacked. The condition stays alphabetically
ordered among the `COLUMN_*` conditions as `SparkThrowableSuite` requires.
- `QueryCompilationErrors.scala`:
`columnStatisticsDeserializationNotSupportedError(name, dataType)` now raises
the `AnalysisException` with `errorClass =
"COLUMN_STATISTICS_DESERIALIZATION_NOT_SUPPORTED"` instead of the legacy class.
This is the error thrown by `CatalogColumnStat.fromExternalString` when it is
asked to deserialize a column statistic whose Catalyst data type is not one of
the supported atomic/decimal/date-time types.
- `QueryCompilationErrorsSuite.scala`: adds a `checkError` test that calls
`CatalogColumnStat.fromExternalString` with an unsupported `NullType` and
asserts the raised `AnalysisException` carries condition
`COLUMN_STATISTICS_DESERIALIZATION_NOT_SUPPORTED` with parameters `name =
"col1"` and `dataType = "NullType"`; the catalog import now also brings in
`CatalogColumnStat`.
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'common/utils/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the
guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
This PR assigns the descriptive name
COLUMN\_STATISTICS\_DESERIALIZATION\_NOT\_SUPPORTED to the legacy error
condition \_LEGACY\_ERROR\_TEMP\_1089, as part of the ongoing SPARK\-37935
effort to replace temporary error\-condition names with stable and meaningful
names.
The following changes are included:
- In error\-conditions.json, \_LEGACY\_ERROR\_TEMP\_1089 is replaced with
COLUMN\_STATISTICS\_DESERIALIZATION\_NOT\_SUPPORTED.
- The existing error message is preserved.
- SQLSTATE 0A000, representing an unsupported feature, is added.
- The new condition is placed alphabetically among the other COLUMN\_\*
conditions.
- QueryCompilationErrors.columnStatisticsDeserializationNotSupportedError is
updated to use the new condition name.
- A regression test is added to QueryCompilationErrorsSuite to verify the
condition and its message parameters.
### Why are the changes needed?
Conditions named \_LEGACY\_ERROR\_TEMP\_\* are temporary placeholders that
do not describe the underlying failure and do not provide a SQLSTATE.
Replacing \_LEGACY\_ERROR\_TEMP\_1089 with
COLUMN\_STATISTICS\_DESERIALIZATION\_NOT\_SUPPORTED makes the error easier to
understand for users, tests, and tools that inspect structured Spark errors. It
also moves the codebase closer to retiring the remaining legacy error
conditions under SPARK\-37935.
### Does this PR introduce any user\-facing change?
Yes.
When CatalogColumnStat.fromExternalString attempts to deserialize column
statistics for an unsupported data type, the resulting error now reports:
- Error condition: COLUMN\_STATISTICS\_DESERIALIZATION\_NOT\_SUPPORTED
- SQLSTATE: 0A000
Previously, it reported \_LEGACY\_ERROR\_TEMP\_1089 without a SQLSTATE.
The human\-readable error message remains unchanged.
Applications and tests that explicitly check the old error\-condition name
may need to be updated to use
COLUMN\_STATISTICS\_DESERIALIZATION\_NOT\_SUPPORTED.
### How was this patch tested?
A new test was added to QueryCompilationErrorsSuite.
The test calls CatalogColumnStat.fromExternalString with the unsupported
NullType and verifies through checkError that the resulting AnalysisException
contains:
- Condition: COLUMN\_STATISTICS\_DESERIALIZATION\_NOT\_SUPPORTED
- Parameter name: col1
- Parameter dataType: NullType
The following test suites were also run:
- SparkThrowableSuite: 38 tests passed. This suite validates the structure,
SQLSTATE, and alphabetical ordering of entries in error\-conditions.json.
- The new QueryCompilationErrorsSuite regression test passed.
--
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]