नोट
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप साइन इन करने या निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
Applies to:
Databricks SQL
Databricks Runtime
Returns the Levenshtein distance between the strings str1 and str2.
Syntax
levenshtein(str1, str2 [, maxDistance])
Arguments
str1: ASTRINGexpression.str2: ASTRINGexpression.maxDistance: An optionalINTEGERexpression limiting the maximum Levenshtein distance considered. The default is unlimited.Applies to:
Databricks SQL
Databricks Runtime 13.3 LTS and above
Returns
An INTEGER.
If maxDistance is less than the distance between the two strings the function returns -1.
If maxDistance is negative the function returns -1.
Examples
> SELECT levenshtein('kitten', 'sitting');
3
> SELECT levenshtein('kitten', 'sitting', 2);
-1
> SELECT levenshtein('kitten', 'sitting', 4);
3