doris icon indicating copy to clipboard operation
doris copied to clipboard

[feature](function) Support levenshtein distance function

Open kzh1458003655-web opened this issue 1 month ago • 1 comments

What problem does this PR solve?

Implemented the Levenshtein Distance function for string comparison.

Syntax: levenshtein(str1, str2)

Return: Returns the Levenshtein distance (int32) between two strings.

Tests

Added comprehensive unit tests in be/test/vec/function/function_levenshtein_test.cpp. Verified with various cases including empty strings, basic edits, and unicode characters.

kzh1458003655-web avatar Dec 11 '25 08:12 kzh1458003655-web

Thank you for your contribution to Apache Doris. Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

hello-stephen avatar Dec 11 '25 08:12 hello-stephen