Omega359 commented on code in PR #13414: URL: https://github.com/apache/datafusion/pull/13414#discussion_r1842743554
########## datafusion/functions/src/regex/regexpcount.rs: ########## @@ -977,4 +985,25 @@ mod tests { .unwrap(); assert_eq!(re.as_ref(), &expected); } + + fn test_case_regexp_count_cache_check<A>() Review Comment: I ran this test locally and verified it failed with the "i" flags item. ########## datafusion/functions/src/regex/regexpcount.rs: ########## @@ -548,19 +549,25 @@ where } } -fn compile_and_cache_regex<'a>( - regex: &'a str, - flags: Option<&'a str>, - regex_cache: &'a mut HashMap<String, Regex>, -) -> Result<&'a Regex, ArrowError> { - if !regex_cache.contains_key(regex) { +fn compile_and_cache_regex<'strings, 'cache>( + regex: &'strings str, + flags: Option<&'strings str>, + regex_cache: &'cache mut HashMap<(&'strings str, Option<&'strings str>), Regex>, +) -> Result<&'cache Regex, ArrowError> +where + 'strings: 'cache, Review Comment: I've never seen this before. Does this effectively mean 'strings is equivalent to 'cache ? -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org