Skip to main content

jaro_winkler_similarity function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 19 and above

Returns the Jaro-Winkler similarity between str1 and str2.

Syntax​

jaro_winkler_similarity(str1, str2)

Arguments​

  • str1: A STRING expression.
  • str2: A STRING expression.

Returns​

A DOUBLE between 0.0 and 1.0, where 1.0 indicates identical strings and 0.0 indicates no similarity.

The comparison is case-sensitive. If both arguments are empty strings, the result is 1.0. If only one argument is empty, the result is 0.0. If either argument is NULL, the result is NULL.

Examples​

SQL
> SELECT jaro_winkler_similarity('MARTHA', 'MARHTA');
0.9611111111111111

> SELECT jaro_winkler_similarity('abc', 'xyz');
0.0

> SELECT jaro_winkler_similarity('ABC', 'abc');
0.0

> SELECT jaro_winkler_similarity('abc', NULL);
NULL