snowflake.snowpark.functions.soundex_p123¶
- snowflake.snowpark.functions.soundex_p123(varchar_expr: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Returns a phonetic representation of a string using the Soundex algorithm with P123 encoding. This function converts names or words that sound similar into the same code, making it useful for fuzzy matching and searching.
- Parameters:
varchar_expr (ColumnOrName) – The string expression to convert to Soundex P123 format.
- Returns:
The Soundex P123 encoded string.
- Return type:
- Examples::
>>> from snowflake.snowpark.functions import col >>> df = session.create_dataframe([["Pfister"], ["Lloyd"], ["Smith"], ["Johnson"]], schema=["name"]) >>> df.select(soundex_p123(col("name")).alias("soundex_result")).collect() [Row(SOUNDEX_RESULT='P123'), Row(SOUNDEX_RESULT='L430'), Row(SOUNDEX_RESULT='S530'), Row(SOUNDEX_RESULT='J525')]