Returns a two-element array of primary and secondary phonetic encodings for an input string, based on the Double Metaphone algorithm.

The Double Metaphone algorithm processes an input string to render a primary and secondary spelling for it. For English language words, the algorithm removes silent letters, normalizes combinations of characters to a single definition, and removes vowels, except from the beginnings of words. In this manner, the algorithm can normalize inconsistencies between spellings for better matching. For more information, see https://en.wikipedia.org/wiki/Metaphone.

Tip: This function is useful for performing fuzzy matching between string values, such as between potential join key values.

Source values can be string literals, column references, or expressions that evaluate to strings.

String literal reference example:

doublemetaphone('My String')

Output: See below.

["MSTRNK","MSTRNK"]

 Column reference example:

doublemetaphone(string1)

Output: Generates a new double_metaphone column containing the evaluation of string1 column values through the Double Metaphone algorithm.

doublemetaphone(string_ref)


ArgumentRequired?Data TypeDescription
string_refYstringName of column or string literal to apply to the function

string_ref1

String literal, column reference, or expression whose elements you want to filter through the Double Metaphone algorithm.

Required?Data TypeExample Value
YesString literal, column reference, or expression evaluating to a stringmyString1


Example - Phonetic string comparisons