snowflake.snowpark.functions.h3_try_grid_distance¶
- snowflake.snowpark.functions.h3_try_grid_distance(cell_id_1: Union[snowflake.snowpark.column.Column, str], cell_id_2: Union[snowflake.snowpark.column.Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.40.0/src/snowflake/snowpark/_functions/scalar_functions.py#L2044-L2066)¶
Returns the grid distance between two H3 cell IDs. Returns None if the input is invalid.
- Parameters:
cell_id_1 (ColumnOrName) – First H3 cell ID.
cell_id_2 (ColumnOrName) – Second H3 cell ID.
- Returns:
The grid distance between the two H3 cell IDs or None if the input is invalid.
- Return type:
Example:
>>> df = session.create_dataframe([[582046271372525567, 581883543651614719]], schema=["cell_id_1", "cell_id_2"]) >>> df.select(h3_try_grid_distance(df["cell_id_1"], df["cell_id_2"]).alias("result")).collect() [Row(RESULT=None)]