Skip to content

Commit abd37d1

Browse files
Dandandanalamb
andauthored
Update datafusion/functions/src/regex/regexpreplace.rs
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 114eec6 commit abd37d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

datafusion/functions/src/regex/regexpreplace.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ fn regex_replace_posix_groups(replacement: &str) -> String {
205205
/// is `\1`, build a shorter regex (stripping trailing `.*$`) and use
206206
/// `captures_read` with `CaptureLocations` for direct extraction — no
207207
/// `expand()`, no `String` allocation.
208+
/// This pattern appears in ClickBench Q28: which uses a regexp like
209+
/// `^https?://(?:www\.)?([^/]+)/.*$`
208210
fn try_build_short_extract_regex(pattern: &str, replacement: &str) -> Option<Regex> {
209211
if replacement != "${1}" || !pattern.starts_with('^') || !pattern.ends_with(".*$") {
210212
return None;

0 commit comments

Comments
 (0)