You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "peterxcli (via GitHub)" <gi...@apache.org> on 2026/09/08 01:40:51 UTC
[PR] fix: accept empty flags in regexp_like and regexp_match [datafusion]
peterxcli opened a new pull request, #25046:
URL: https://github.com/apache/datafusion/pull/25046
## Which issue does this PR close?
Closes #25021.
## Rationale for this change
An empty flags string should behave like omitted flags. `regexp_match` currently rejects it, and `regexp_like` can accept or reject it depending on whether the optimizer simplifies the call.
## What changes are included in this PR?
Treat empty flags as no flags before calling Arrow's regex kernels. Apply the same handling to scalar evaluation and the regex compilation size check during planning.
## What is the testing strategy for this PR?
Regression tests cover every combination of scalar and array arguments for `Utf8`, `LargeUtf8`, and `Utf8View`, including empty patterns, captures, and batches containing empty, null, and nonempty flags. The planning test also verifies that empty flags preserve the compilation size limit.
All 35 regex tests pass on the current base. The extended workspace suite passed before rebasing: 11,259 Rust tests plus SQLLogicTests. Formatting, workspace Clippy with all targets and features, and the repository lint suite pass.
Existing regex benchmarks were run against `main` at `6ab4ce660` using the `ci` profile. Timings varied substantially under concurrent machine load, so they do not support a performance conclusion.
## Are there any user-facing changes?
Yes. `regexp_match('foobarbaz', 'b..', '')` returns `[bar]`, and `regexp_like('foobarbaz', 'b..', flags)` returns `true` when the flags column contains an empty string.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: accept empty flags in regexp_like and regexp_match [datafusion]
Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on PR #25046:
URL: https://github.com/apache/datafusion/pull/25046#issuecomment-5578462594
cc @jayzhan211, ptal, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: accept empty flags in regexp_like and regexp_match [datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 merged PR #25046:
URL: https://github.com/apache/datafusion/pull/25046
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: accept empty flags in regexp_like and regexp_match [datafusion]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25046:
URL: https://github.com/apache/datafusion/pull/25046#issuecomment-5578027273
## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/25046?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `93.54839%` with `6 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 81.72%. Comparing base ([`8f40f33`](https://app.codecov.io/gh/apache/datafusion/commit/8f40f33c211937e9b1724925a9ef152f049fccc5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a73e874`](https://app.codecov.io/gh/apache/datafusion/commit/a73e8743076ae810a8602f5e0d5bf9ac8b379438?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/datafusion/pull/25046?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [datafusion/functions/src/regex/mod.rs](https://app.codecov.io/gh/apache/datafusion/pull/25046?src=pr&el=tree&filepath=datafusion%2Ffunctions%2Fsrc%2Fregex%2Fmod.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9mdW5jdGlvbnMvc3JjL3JlZ2V4L21vZC5ycw==) | 96.15% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/25046?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [datafusion/functions/src/regex/regexpmatch.rs](https://app.codecov.io/gh/apache/datafusion/pull/25046?src=pr&el=tree&filepath=datafusion%2Ffunctions%2Fsrc%2Fregex%2Fregexpmatch.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9mdW5jdGlvbnMvc3JjL3JlZ2V4L3JlZ2V4cG1hdGNoLnJz) | 66.66% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/25046?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [datafusion/functions/src/regex/regexplike.rs](https://app.codecov.io/gh/apache/datafusion/pull/25046?src=pr&el=tree&filepath=datafusion%2Ffunctions%2Fsrc%2Fregex%2Fregexplike.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9mdW5jdGlvbnMvc3JjL3JlZ2V4L3JlZ2V4cGxpa2UucnM=) | 88.88% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/25046?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #25046 +/- ##
=======================================
Coverage 81.72% 81.72%
=======================================
Files 1127 1127
Lines 416310 416395 +85
Branches 416310 416395 +85
=======================================
+ Hits 340222 340316 +94
+ Misses 56097 56082 -15
- Partials 19991 19997 +6
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/25046?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] fix: accept empty flags in regexp_like and regexp_match [datafusion]
Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on PR #25046:
URL: https://github.com/apache/datafusion/pull/25046#issuecomment-5625484647
@jayzhan211 Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org