Is pre-compile pattern string in regexp_match operation
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Is your feature request related to a problem or challenge?
I noticed below code:
https://github.com/apache/datafusion/blob/6a4a280e3cf70fe5f1a1cfe7c2de13e4c39f89bb/datafusion/physical-expr/src/expressions/binary.rs#L537-L564
This looks like every time record_batch is evaluated, it will execute the compiled pattern string and use the compiled results to match arrow-array
### Describe the solution you'd like
when building binary physical expr , we can pre-compile pattern string if op is regex_match
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start in datafusion/physical-expr/src/expressions/binary.rs at lines 537-564 and trace how the binary physical expression handles regexp_match during record-batch evaluation. Confirm where the pattern is compiled, then verify that construction-time compilation preserves matching behavior while avoiding repeated compilation for each batch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100