snowflake.snowpark.functions.h3_try_grid_path¶
- snowflake.snowpark.functions.h3_try_grid_path(cell_id_1: Union[snowflake.snowpark.column.Column, str], cell_id_2: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Returns the grid path between two H3 cell IDs. Returns None if no path exists or if the input cell IDs are invalid.
- Parameters:
cell_id_1 (ColumnOrName) – The first H3 cell ID.
cell_id_2 (ColumnOrName) – The second H3 cell ID.
- Returns:
An array of H3 cell IDs representing the grid path, or None if no path exists or if inputs are invalid.
- Return type:
Example:
>>> df = session.create_dataframe([['813d7ffffffffff', '81343ffffffffff']], schema=["cell1", "cell2"]) >>> df.select(h3_try_grid_path(df["cell1"], df["cell2"]).alias("grid_path")).collect() [Row(GRID_PATH=None)]