alamb commented on code in PR #7186:
URL: https://github.com/apache/arrow-datafusion/pull/7186#discussion_r1283284682
##########
datafusion/optimizer/src/simplify_expressions/regex.rs:
##########
@@ -131,6 +131,15 @@ fn str_from_literal(l: &Literal) -> Option<&str> {
}
}
+/// returns a str represented by `Literal` if it contains a valid utf8
+/// sequence and is unsafe for like (maybe has '%' or '_')
+fn str_from_literal_unsafe_like(l: &Literal) -> Option<&str> {
Review Comment:
I was somewhat confused about this name and the comments as the code doesn't
actually check for '%' or '_`
What would you think about renaming it something like
```suggestion
/// returns a str represented by `Literal` if it contains a valid utf8
fn str_from_literal(l: &Literal) -> Option<&str> {
```
And then renaming the existing `str_from_literal` to something like this:
to
```rust
/// returns a str represented by `Literal` if it contains a valid utf8
/// sequence and is safe for `like` (has no '%' and '_')
fn like_str_from_literal(l: &Literal) -> Option<&str> {
```
--
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]