LuciferYang opened a new pull request, #57249: URL: https://github.com/apache/spark/pull/57249
### What changes were proposed in this pull request? Rename the legacy error condition `_LEGACY_ERROR_TEMP_0012` to `DISTRIBUTE_BY_UNSUPPORTED`, with SQLSTATE `0A000` (feature not supported). ### Why are the changes needed? The error-conditions README disallows new `_LEGACY_ERROR_TEMP_*` entries and asks existing ones to be given proper names. This converts one of them. The error is raised by the base `AstBuilder`, which does not support `DISTRIBUTE BY`. The Spark SQL parser (`SparkSqlAstBuilder`) overrides `withRepartitionByExpression` to support it, but parsers built on the base `AstBuilder` via `CatalystSqlParser` reject `DISTRIBUTE BY`. This path is user-reachable, for example when parsing a metric view SQL source through `CatalystSqlParser.parseQuery`, so the condition deserves a proper user-facing name and SQLSTATE. ### 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 `PlanParserSuite` (which uses `CatalystSqlParser`) that parses `select * from t distribute by a` and asserts the `DISTRIBUTE_BY_UNSUPPORTED` condition. `build/sbt "catalyst/testOnly *PlanParserSuite" "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) -- 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]
