Skip to content

minor: derive group_column_supported_type from make_group_column - #25541

Merged
jayzhan211 merged 1 commit into
apache:mainfrom
jayzhan211:simplify/group-column-type-table
Sep 20, 2026
Merged

jayzhan211 merged 1 commit into
apache:mainfrom
jayzhan211:simplify/group-column-type-table

Conversation

@jayzhan211

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A — small refactor, no issue filed.

Rationale for this change

multi_group_by keeps the set of types GroupValuesColumn supports in two places:

  • make_group_column, the factory that builds a GroupColumn for a field, and
  • group_column_supported_type, a hand-written allow-list that supported_schema uses to choose between GroupValuesColumn and the GroupValuesRows fallback.

The two must accept exactly the same types: if the allow-list accepts a type the factory rejects, the planner picks GroupValuesColumn and the query then fails with not_impl_err when the columns are built. Today that is enforced by "keep the two in lockstep" comments on both sides (valid Time32/Time64 units, non-negative FixedSizeBinary width, the nested/row-backed fallback, recursion into List and Dictionary) and by a pinning test over a sample of types. Every new specialization has to be added twice.

One case had already drifted: a Dictionary with a non-integer key type is accepted by the allow-list but rejected by the factory. It is not a valid Arrow type, so it is not reachable in practice, but it shows the shape of the problem.

What changes are included in this PR?

  • group_column_supported_type now asks the factory: make_group_column(..).is_ok(). The 50-line allow-list and the lockstep comments are removed, so the two cannot disagree. Building a column only creates empty buffers, and this runs once per stream, not per batch.
  • The pinning test is kept as the specification of which types take the column path and which fall back to rows; its doc comment is updated to say so. It gains the drifted Dictionary(Utf8, Int32) case, which fails on main (expected group_column_supported_type=false).

No behaviour change for any valid Arrow type.

What is the testing strategy for this PR?

Existing tests: group_column_supported_type_matches_make_group_column (supported and intentionally unsupported types, including nested and row-backed cases), the supported_schema_* tests and the rest of the multi_group_by tests.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Sep 20, 2026
@jayzhan211
jayzhan211 marked this pull request as ready for review September 20, 2026 11:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.39%. Comparing base (a9579bd) to head (b46fc50).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25541      +/-   ##
==========================================
- Coverage   82.39%   82.39%   -0.01%     
==========================================
  Files        1138     1138              
  Lines      434623   434617       -6     
  Branches   434623   434617       -6     
==========================================
- Hits       358100   358090      -10     
  Misses      54856    54856              
- Partials    21667    21671       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhuqi-lucas zhuqi-lucas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks @jayzhan211 !

@jayzhan211
jayzhan211 added this pull request to the merge queue Sep 20, 2026
Merged via the queue into apache:main with commit 1cfc355 Sep 20, 2026
41 checks passed
@jayzhan211
jayzhan211 deleted the simplify/group-column-type-table branch September 20, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants