Akanksha-kedia commented on code in PR #17372:
URL: https://github.com/apache/pinot/pull/17372#discussion_r2625630069


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java:
##########
@@ -632,6 +632,59 @@ public static int hammingDistance(String input1, String 
input2) {
     return distance;
   }
 
+  /**
+   * Calculates the Levenshtein edit distance between two strings.
+   * The Levenshtein distance is the minimum number of single-character edits
+   * (insertions, deletions, or substitutions) needed to transform one string 
into another.
+   * This complements the existing hammingDistance function by handling 
strings of different lengths.
+   *
+   * @param input1 First string
+   * @param input2 Second string
+   * @return The Levenshtein distance between the two strings, or -1 if either 
input is null
+   */
+  @ScalarFunction
+  public static int levenshteinDistance(String input1, String input2) {

Review Comment:
   framework handle.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to