File tree Expand file tree Collapse file tree
native/spark-expr/src/string_funcs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,9 +114,7 @@ pub fn spark_levenshtein(args: &[ColumnarValue]) -> Result<ColumnarValue> {
114114 . as_any ( )
115115 . downcast_ref :: < Int32Array > ( )
116116 . ok_or_else ( || {
117- DataFusionError :: Internal (
118- "levenshtein threshold must be Int32" . to_string ( ) ,
119- )
117+ DataFusionError :: Internal ( "levenshtein threshold must be Int32" . to_string ( ) )
120118 } ) ?;
121119
122120 let result: Int32Array = left_arr
@@ -320,18 +318,11 @@ mod tests {
320318 #[ test]
321319 fn test_spark_levenshtein_threshold_negative ( ) {
322320 // Negative threshold means distance always exceeds threshold → return -1
323- let left = ColumnarValue :: Array ( Arc :: new ( StringArray :: from ( vec ! [
324- Some ( "abc" ) ,
325- Some ( "abc" ) ,
326- ] ) ) ) ;
327- let right = ColumnarValue :: Array ( Arc :: new ( StringArray :: from ( vec ! [
328- Some ( "abc" ) ,
329- Some ( "adc" ) ,
330- ] ) ) ) ;
331- let threshold = ColumnarValue :: Array ( Arc :: new ( Int32Array :: from ( vec ! [
332- Some ( -1 ) ,
333- Some ( -5 ) ,
334- ] ) ) ) ;
321+ let left =
322+ ColumnarValue :: Array ( Arc :: new ( StringArray :: from ( vec ! [ Some ( "abc" ) , Some ( "abc" ) ] ) ) ) ;
323+ let right =
324+ ColumnarValue :: Array ( Arc :: new ( StringArray :: from ( vec ! [ Some ( "abc" ) , Some ( "adc" ) ] ) ) ) ;
325+ let threshold = ColumnarValue :: Array ( Arc :: new ( Int32Array :: from ( vec ! [ Some ( -1 ) , Some ( -5 ) ] ) ) ) ;
335326
336327 let result = spark_levenshtein ( & [ left, right, threshold] ) . unwrap ( ) ;
337328 match result {
You can’t perform that action at this time.
0 commit comments