Skip to content

GH-50223: [C++][Compute] Support string_view/binary_view keys in the hash-aggregate Grouper#50224

Draft
fangchenli wants to merge 2 commits into
apache:mainfrom
fangchenli:gh-string-view-grouper
Draft

GH-50223: [C++][Compute] Support string_view/binary_view keys in the hash-aggregate Grouper#50224
fangchenli wants to merge 2 commits into
apache:mainfrom
fangchenli:gh-string-view-grouper

Conversation

@fangchenli

@fangchenli fangchenli commented Jun 18, 2026

Copy link
Copy Markdown

Rationale for this change

Grouper rejected string_view and binary_view group keys with NotImplemented: Keys of type string_view, so Table.group_by on a view-typed key failed.

What changes are included in this PR?

  • Add BinaryViewKeyEncoder in row_encoder_internal.{h,cc}. It encodes view keys using the existing variable-length row format and decodes them into a fresh view array of the original type.
  • GrouperImpl::Make dispatches view keys to the new encoder.
  • GrouperFastImpl::CanUse rejects view keys, so they fall back to GrouperImpl.

Are these changes tested?

Yes, unit tests added.

Are there any user-facing changes?

Yes. Table.group_by now accepts string_view and binary_view group keys

@github-actions

Copy link
Copy Markdown

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@fangchenli fangchenli changed the title [C++][Compute] Support string_view/binary_view keys in the hash-aggregate Grouper GH-50223: [C++][Compute] Support string_view/binary_view keys in the hash-aggregate Grouper Jun 18, 2026
@github-actions

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant