Skip to content

Add cudf::strings::count API for literal strings - #22288

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
davidwendt:count-fast-path
Apr 27, 2026
Merged

Add cudf::strings::count API for literal strings#22288
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
davidwendt:count-fast-path

Conversation

@davidwendt

@davidwendt davidwendt commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new libcudf API for counting string matches within rows of a strings column. This is meant to be a fast-path option for the current cudf::strings::count() which only accepts a regex pattern. If that API determines the pattern only contains a literal string (no regex pattern or flags) then this can be called internally automatically. Exposing this as a public API provides some consistency with other APIs like find, contains, and split which have both regex and non-regex versions.

This API will match the behavior of the regex count API which includes not counting overlapping matches.

Reference fast-path logic being worked on here: #22178

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt self-assigned this Apr 24, 2026
@davidwendt
davidwendt requested review from a team as code owners April 24, 2026 14:30
@davidwendt davidwendt added feature request New feature or request 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. labels Apr 24, 2026
@davidwendt
davidwendt requested review from bdice and mhaseeb123 April 24, 2026 14:30
@davidwendt davidwendt added the non-breaking Non-breaking change label Apr 24, 2026
@github-actions github-actions Bot added the CMake CMake build issue label Apr 24, 2026
@davidwendt

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit cb6fe6d into NVIDIA:main Apr 27, 2026
140 of 141 checks passed
@davidwendt
davidwendt deleted the count-fast-path branch April 27, 2026 15:08
vyasr pushed a commit to vyasr/cudf that referenced this pull request May 4, 2026
Adds a new libcudf API for counting string matches within rows of a strings column. This is meant to be a fast-path option for the current `cudf::strings::count()` which only accepts a regex pattern. If that API determines the pattern only contains a literal string (no regex pattern or flags) then this can be called internally automatically. Exposing this as a public API provides some consistency with other APIs like `find`, `contains`, and `split` which have both regex and non-regex versions.

This API will match the behavior of the regex count API which includes not counting overlapping matches.

Reference fast-path logic being worked on here: NVIDIA#22178

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Muhammad Haseeb (https://github.com/mhaseeb123)

URL: NVIDIA#22288
shrshi pushed a commit to shrshi/cudf that referenced this pull request May 12, 2026
Adds a new libcudf API for counting string matches within rows of a strings column. This is meant to be a fast-path option for the current `cudf::strings::count()` which only accepts a regex pattern. If that API determines the pattern only contains a literal string (no regex pattern or flags) then this can be called internally automatically. Exposing this as a public API provides some consistency with other APIs like `find`, `contains`, and `split` which have both regex and non-regex versions.

This API will match the behavior of the regex count API which includes not counting overlapping matches.

Reference fast-path logic being worked on here: NVIDIA#22178

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Muhammad Haseeb (https://github.com/mhaseeb123)

URL: NVIDIA#22288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team CMake CMake build issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants