snowflake.snowpark.functions.h3_grid_path¶

snowflake.snowpark.functions.h3_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 as a JSON array of H3 cell IDs.

Parameters:
  • cell_id_1 (ColumnOrName) – The starting H3 cell ID.

  • cell_id_2 (ColumnOrName) – The ending H3 cell ID.

Returns:

A JSON array of H3 cell IDs representing the grid path.

Return type:

Column

Examples:

>>> df = session.create_dataframe([
...     [617540519103561727, 617540519052967935],
...     [617540519046414335, 617540519047462911]
... ], schema=["cell_id_1", "cell_id_2"])
>>> df.select(h3_grid_path("cell_id_1", "cell_id_2").alias("grid_path")).collect()
[Row(GRID_PATH='[\n  617540519103561727,\n  617540519046414335,\n  617540519047462911,\n  617540519044055039,\n  617540519045103615,\n  617540519052967935\n]'), Row(GRID_PATH='[\n  617540519046414335,\n  617540519047462911\n]')]
Copy