← string_distance operator page · string/string_distance/jaro_winkler_sc/identical_strings

Identical strings 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

string_distance(jaro_winkler, SC_1, SC_2) with SC_1 = FOO and SC_2 = FOO: two identical strings, one of the two cases whose distance needs no approximation, with Disjoint strings.

Manual:

String distances: "Returns the distance between two strings using the specified distance method", and for jaro_winkler "Returns the Jaro–Winkler distance, which is a string metric measuring an edit distance between two sequences", with no formula and no value beyond "a value between 0 and 1" for "FOO" and "BAR"; the Wikipedia article that it links says that "the distance is defined as the inversion of that value (distance = 1 − similarity)" (read on 2026-10-24).

Expected:

SC_r is 0, a Number: identical strings have a Jaro similarity of 1, which the Winkler prefix boost cannot raise, so the distance is 1 − 1.

script.vtl ⇩

SC_r := string_distance(jaro_winkler, SC_1, SC_2);

input/scalars.csv ⇩

SC_1SC_2
FOOFOO

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "String"},
    {"name": "SC_2", "type": "String"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_r", "type": "Number", "value": 0}
  ]
}