xiedeyantu opened a new pull request, #22311:
URL: https://github.com/apache/datafusion/pull/22311

   ## Which issue does this PR close?
   
   - Closes #22267
   
   ## Rationale for this change
   
   `regexp_count` did not handle empty regular-expression patterns correctly. 
An empty pattern should be counted as valid matches instead of returning `0`. 
This also affects calls that use the `start` argument and certain flag 
combinations.
   
   ## What changes are included in this PR?
   
   - Fix `regexp_count` so empty-pattern matches are counted correctly.
   - Adjust `start` handling so character offsets are computed correctly.
   - Update unit tests and sqllogictest coverage for empty patterns, `start`, 
and flags.
   - Update expected results to match the corrected behavior.
   
   ## Are these changes tested?
   
   - Yes. Rust unit tests were updated.
   - Yes. Sqllogictest coverage was added/updated.
   - I also ran:
     - `cargo test -p datafusion-sqllogictest --test sqllogictests 
table_functions`
     - `cargo test -p datafusion-sqllogictest --test sqllogictests scalar`
   
   ## Are there any user-facing changes?
   
   - Yes. `regexp_count` now returns correct counts for empty patterns, so 
results may differ from the previous behavior.


-- 
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]

Reply via email to