Skip to content

PostgreSQL compatibility: regexp_count should count empty-pattern matches #22267

Closed

Description

@Dandandan

Split out from #22247.

Mismatch

regexp_count should count empty-pattern matches.

SELECT regexp_count('abc', '');

PostgreSQL:

4

DataFusion:

0

Expected behavior

For PostgreSQL-compatible SQL semantics, DataFusion should either match PostgreSQL's result or raise the same class of domain/semantic error.

Activity

  1. xiedeyantu commented on May 16, 2026

    @xiedeyantu
    Member

    take

  2. toby-bridges commented on May 17, 2026

    @toby-bridges

    I’m taking a look at this one. I’m going to verify the current empty-pattern behavior locally and, if it stays narrowly scoped, send a small fix with tests.

  3. toby-bridges commented on May 17, 2026

    @toby-bridges

    I’m taking a look at this one. I’m going to verify the current regexp_count empty-pattern behavior locally and, if it stays narrowly scoped, send a small fix with tests.

  4. xiedeyantu commented on May 17, 2026

    @xiedeyantu
    Member

    Thank you for also paying attention to this issue. I have taken this issue and am working on fixing it. I will submit the PR once I have it sorted out.

  5. added a commit that references this issue on May 20, 2026
    a19dbc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions