Skip to content

Commit 9f2ff66

Browse files
committed
perf[fsst]: like pushdown using a dfa
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 0e3698d commit 9f2ff66

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

encodings/fsst/src/compute/like.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,10 @@ mod tests {
10191019
Ok(result.into_bool())
10201020
}
10211021

1022+
fn like(array: FSSTArray, pattern: &str) -> VortexResult<BoolArray> {
1023+
run_like(array, pattern, LikeOptions::default())
1024+
}
1025+
10221026
#[test]
10231027
fn test_like_prefix() -> VortexResult<()> {
10241028
let fsst = make_fsst(
@@ -1031,7 +1035,7 @@ mod tests {
10311035
],
10321036
Nullability::NonNullable,
10331037
);
1034-
let result = run_like(fsst, "http%", LikeOptions::default())?;
1038+
let result = like(fsst, "http%")?;
10351039
assert_arrays_eq!(
10361040
&result,
10371041
&BoolArray::from_iter([true, true, false, true, false])
@@ -1045,7 +1049,7 @@ mod tests {
10451049
&[Some("hello"), None, Some("help"), None, Some("goodbye")],
10461050
Nullability::Nullable,
10471051
);
1048-
let result = run_like(fsst, "hel%", LikeOptions::default())?;
1052+
let result = like(fsst, "hel%")?; // spellchecker:disable-line
10491053
assert_arrays_eq!(
10501054
&result,
10511055
&BoolArray::from_iter([Some(true), None, Some(true), None, Some(false)])
@@ -1064,7 +1068,7 @@ mod tests {
10641068
],
10651069
Nullability::NonNullable,
10661070
);
1067-
let result = run_like(fsst, "%hello%", LikeOptions::default())?;
1071+
let result = like(fsst, "%hello%")?;
10681072
assert_arrays_eq!(&result, &BoolArray::from_iter([true, true, false, true]));
10691073
Ok(())
10701074
}
@@ -1080,7 +1084,7 @@ mod tests {
10801084
],
10811085
Nullability::NonNullable,
10821086
);
1083-
let result = run_like(fsst, "%lazy dog%", LikeOptions::default())?;
1087+
let result = like(fsst, "%lazy dog%")?;
10841088
assert_arrays_eq!(&result, &BoolArray::from_iter([true, false, true, false]));
10851089
Ok(())
10861090
}
@@ -1106,7 +1110,7 @@ mod tests {
11061110
&[Some("abc"), Some(""), Some("xyz")],
11071111
Nullability::NonNullable,
11081112
);
1109-
let result = run_like(fsst, "%", LikeOptions::default())?;
1113+
let result = like(fsst, "%")?;
11101114
assert_arrays_eq!(&result, &BoolArray::from_iter([true, true, true]));
11111115
Ok(())
11121116
}

0 commit comments

Comments
 (0)