marcuslin123 opened a new pull request, #59405:
URL: https://github.com/apache/spark/pull/59405
### What changes were proposed in this pull request?
This pull request updates invalid metric view YAML version errors to include
the versions that
Spark supports.
It also centralizes version-specific deserialization and serialization in
one ordered registry so
the supported-version list cannot drift from the actual handlers.
Factory-level and SQL-facing
regression tests cover the updated behavior.
### Why are the changes needed?
The existing error reports only the invalid version. Users must otherwise
inspect documentation or
source code to discover which versions are accepted. Listing the supported
versions makes the error
actionable, while the shared registry keeps that information consistent as
versions are added.
### Does this PR introduce _any_ user-facing change?
Yes. An invalid metric view YAML version now produces an error such as:
```
Invalid YAML version: 1.1. Supported YAML versions: 0.1
```
Previously, the error stopped after `Invalid YAML version: 1.1`.
### How was this patch tested?
Added regression coverage to `MetricViewFactorySuite` for deserialization
and serialization, and to
`SimpleMetricViewSuite` for the SQL-facing structured error.
```
build/sbt catalyst/scalastyle catalyst/Test/scalastyle sql/scalastyle
sql/Test/scalastyle \
'catalyst/testOnly
org.apache.spark.sql.metricview.serde.MetricViewFactorySuite' \
'sql/testOnly org.apache.spark.sql.execution.SimpleMetricViewSuite'
```
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (used for code assistance).
--
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]