Skip to content

Commit

Permalink
Add small fix and cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-martinez-maqueda-sap committed Aug 3, 2022
1 parent 9f3e8ac commit f3dd390
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions arrow/src/compute/kernels/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ fn replace_like_wildcards(pattern: &str) -> Result<String> {
result.push('\\');
result.push('\\');
}

}
} else if regex_syntax::is_meta_character(c) {
result.push('\\');
Expand Down Expand Up @@ -370,7 +369,9 @@ pub fn nlike_utf8_scalar<OffsetSize: OffsetSizeTrait>(
for i in 0..left.len() {
result.append(left.value(i) != right);
}
} else if right.ends_with('%') && !right[..right.len() - 1].contains(is_like_pattern)
} else if right.ends_with('%')
&& !right.ends_with("\\%")
&& !right[..right.len() - 1].contains(is_like_pattern)
{
// fast path, can use ends_with
for i in 0..left.len() {
Expand Down Expand Up @@ -443,7 +444,9 @@ pub fn ilike_utf8_scalar<OffsetSize: OffsetSizeTrait>(
for i in 0..left.len() {
result.append(left.value(i) == right);
}
} else if right.ends_with('%') && !right[..right.len() - 1].contains(is_like_pattern)
} else if right.ends_with('%')
&& !right.ends_with("\\%")
&& !right[..right.len() - 1].contains(is_like_pattern)
{
// fast path, can use ends_with
for i in 0..left.len() {
Expand Down Expand Up @@ -524,7 +527,9 @@ pub fn nilike_utf8_scalar<OffsetSize: OffsetSizeTrait>(
for i in 0..left.len() {
result.append(left.value(i) != right);
}
} else if right.ends_with('%') && !right[..right.len() - 1].contains(is_like_pattern)
} else if right.ends_with('%')
&& !right.ends_with("\\%")
&& !right[..right.len() - 1].contains(is_like_pattern)
{
// fast path, can use ends_with
for i in 0..left.len() {
Expand Down

0 comments on commit f3dd390

Please sign in to comment.