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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]