You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2026/07/16 14:10:17 UTC

[PR] [SPARK-58172][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_0031 [spark]

LuciferYang opened a new pull request, #57305:
URL: https://github.com/apache/spark/pull/57305

   ### What changes were proposed in this pull request?
   
   Convert the legacy error condition `_LEGACY_ERROR_TEMP_0031` ("Invalid number of buckets: <describe>.") into the `INVALID_SQL_SYNTAX.INVALID_BUCKET_NUMBER` subclass (SQLSTATE `42000`, inherited from the `INVALID_SQL_SYNTAX` umbrella).
   
   ### 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 `AstBuilder` when the first argument of a `bucket` partition transform is not an integer literal, e.g. `CREATE TABLE ... PARTITIONED BY (bucket('12', b))`. The sibling errors reported from the same transform-argument path -- `INVALID_SQL_SYNTAX.INVALID_COLUMN_REFERENCE` and `INVALID_SQL_SYNTAX.TRANSFORM_WRONG_NUM_ARGS` -- already live under the `INVALID_SQL_SYNTAX` umbrella, so folding this into `INVALID_SQL_SYNTAX.INVALID_BUCKET_NUMBER` keeps the parser syntax errors consistent instead of introducing a new top-level name.
   
   ### 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 `QueryParsingErrorsSuite` that parses `CREATE TABLE my_tab(a INT, b STRING) USING parquet PARTITIONED BY (bucket('12', b))` and asserts the `INVALID_SQL_SYNTAX.INVALID_BUCKET_NUMBER` condition. `build/sbt "sql/testOnly *QueryParsingErrorsSuite" "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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-58172][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_0031 [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang closed pull request #57305: [SPARK-58172][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_0031
URL: https://github.com/apache/spark/pull/57305


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-58172][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_0031 [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #57305:
URL: https://github.com/apache/spark/pull/57305#issuecomment-5014884906

   ok, let me close this one , thank you @uros-b 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org