alamb commented on code in PR #8168:
URL: https://github.com/apache/arrow-datafusion/pull/8168#discussion_r1392665370
##########
datafusion/physical-expr/src/string_expressions.rs:
##########
@@ -643,6 +644,31 @@ pub fn overlay<T: OffsetSizeTrait>(args: &[ArrayRef]) ->
Result<ArrayRef> {
}
}
+///Returns the Levenshtein distance between the two given strings
+/// LEVENSHTEIN('kitten', 'sitting') = 3
+pub fn levenshtein<T: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
Review Comment:
Would it be possible to use the existing implementation in :
https://github.com/apache/arrow-datafusion/blob/aaaf698b5e46dd1c4d29bce69dc539a667d2dda6/datafusion/common/src/utils.rs#L484
##########
datafusion/physical-expr/Cargo.toml:
##########
@@ -67,6 +67,7 @@ regex = { version = "1.8", optional = true }
sha2 = { version = "^0.10.1", optional = true }
unicode-segmentation = { version = "^1.7.1", optional = true }
uuid = { version = "^1.2", features = ["v4"] }
+edit-distance = "2.1.0"
Review Comment:
I think we can avoid this new dependency by either reusing our existing
implementation (see below)
--
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]