Skip to content

feat: add regexp_instr function#1382

Merged
timsaucer merged 3 commits intoapache:mainfrom
mesejo:feat/add_regexp_instr
Feb 18, 2026
Merged

feat: add regexp_instr function#1382
timsaucer merged 3 commits intoapache:mainfrom
mesejo:feat/add_regexp_instr

Conversation

@mesejo
Copy link
Contributor

@mesejo mesejo commented Feb 16, 2026

Which issue does this PR close?

Related to #803.

Rationale for this change

The current implementation of regexp_instr in DataFusion does not support the end option. Hence, None is passed to the function's implementation, exposing it to Python.

Additionally, fix the implementation for the optional argument start in regexp_count.

Are there any user-facing changes?

Yes, but no breaking changes.

The current implementation of regexp_instr in Datafusion, does not support
endoption. Hence None is passed in the implementation of the function
exposing it to Python.
Copy link
Member

@timsaucer timsaucer left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines 780 to 783
f.regexp_instr(column("a"), literal("([lr])"), n=literal(2)),
pa.array([4, 4, 0], type=pa.int64()),
),
],
Copy link
Member

Choose a reason for hiding this comment

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

I recommend adding in tests for all options. I don't expect problems here but it's come up in the past to make sure there are no mistakes along the path.

Copy link
Contributor Author

@mesejo mesejo Feb 18, 2026

Choose a reason for hiding this comment

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

Makes sense. Added a few more tests, with different option settings.

@mesejo mesejo force-pushed the feat/add_regexp_instr branch from d05217b to 842bfea Compare February 18, 2026 16:14
@timsaucer timsaucer merged commit 675e41e into apache:main Feb 18, 2026
18 checks passed
@timsaucer
Copy link
Member

Nice work! Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments