Skip to content

[SPARK-58129][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0031#57261

Open
Ma77Ball wants to merge 3 commits into
apache:masterfrom
Ma77Ball:SPARK-58129-invalid-bucket-count
Open

[SPARK-58129][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0031#57261
Ma77Ball wants to merge 3 commits into
apache:masterfrom
Ma77Ball:SPARK-58129-invalid-bucket-count

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented Jul 14, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

Give the legacy error class _LEGACY_ERROR_TEMP_0031 a proper name. It is raised when the count in a bucket(...) partition transform is not an integer literal (e.g. bucket('x', c)). Since it overlaps the existing INVALID_BUCKET_COUNT, both are grouped as sub-conditions:

  • INVALID_BUCKET_COUNT.NON_INTEGER_LITERAL - the former _LEGACY_ERROR_TEMP_0031.
  • INVALID_BUCKET_COUNT.OUT_OF_RANGE - the existing out-of-range check.

Why are the changes needed?

Part of the effort to name legacy error classes (parent SPARK-37935): replace an unnamed placeholder with a stable, meaningful condition.

Does this PR introduce any user-facing change?

Yes. _LEGACY_ERROR_TEMP_0031 becomes INVALID_BUCKET_COUNT.NON_INTEGER_LITERAL, and the existing INVALID_BUCKET_COUNT becomes INVALID_BUCKET_COUNT.OUT_OF_RANGE. Messages and parameters are unchanged.

How was this patch tested?

Added a QueryParsingErrorsSuite test for the parse error, updated the existing SparkConnectProtoSuite test, and SparkThrowableSuite passes.

Was this patch authored or co-authored using generative AI tooling?

Yes, co-authored with Claude Opus 4.8

Ma77Ball added 3 commits July 14, 2026 16:09
…P_0031

Replace _LEGACY_ERROR_TEMP_0031 ("Invalid number of buckets:
<describe>.") with a proper error condition. Its meaning overlaps the
existing INVALID_BUCKET_COUNT (a valid integer bucket count that is out
of range), so fold both into INVALID_BUCKET_COUNT as sub-conditions:
NON_INTEGER_LITERAL (the former legacy error, raised at parse time) and
OUT_OF_RANGE (the existing analysis-time check).
@Ma77Ball

Copy link
Copy Markdown
Author

cc @MaxGekk or @gengliangwang, PTAL this PR names the legacy error class _LEGACY_ERROR_TEMP_0031 under INVALID_BUCKET_COUNT as a sub-condition (SPARK-58129 part of SPARK-37935)

@Ma77Ball Ma77Ball force-pushed the SPARK-58129-invalid-bucket-count branch from 067817b to 8eff8b1 Compare July 15, 2026 10:33

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Ma77Ball! @MaxGekk @cloud-fan PTAL when you have some time.

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.

2 participants