Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 29, 2026

Rationale for this change

The grouper code was creating a shared_ptr<DataType> for every key type, even when it wasn't needed. This resulted in unnecessary reference counting operations. For example, BooleanKeyEncoder and NullKeyEncoder don't require a shared_ptr in their constructors, yet we were creating one for every key of those types.

What changes are included in this PR?

Changed GrouperImpl::Make() to use TypeHolder references directly and only call GetSharedPtr() when needed by encoder constructors. This eliminates shared_ptr creation for Type::BOOL and Type::NA cases. Other encoder types (dictionary, fixed-width, binary) still require shared_ptr since their constructors take shared_ptr<DataType> parameters for ownership.

Are these changes tested?

Yes, existing tests.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the awaiting review Awaiting review label Jan 29, 2026
@github-actions
Copy link

⚠️ GitHub issue #49065 has been automatically assigned in GitHub to PR creator.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@kou kou merged commit 8a77885 into apache:main Jan 30, 2026
51 of 53 checks passed
@kou kou removed the awaiting review Awaiting review label Jan 30, 2026
@github-actions github-actions bot added the awaiting merge Awaiting merge label Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants