snowflake.snowpark.functions.h3_grid_disk

snowflake.snowpark.functions.h3_grid_disk(cell_id: Union[snowflake.snowpark.column.Column, str], k_value: Union[snowflake.snowpark.column.Column, str]) Column[source]

Returns an array of H3 cell IDs within k distance of the origin cell.

Parameters:
  • cell_id (ColumnOrName) – The H3 cell ID as the center of the disk.

  • k_value (ColumnOrName) – The distance (number of rings) from the center cell.

Returns:

An array of H3 cell IDs within the specified distance.

Return type:

Column

Example:

>>> df = session.create_dataframe([[617540519050084351, 1], [617540519050084351, 2]], schema=["cell_id", "k_value"])
>>> df.select(h3_grid_disk("cell_id", "k_value").alias("grid_disk")).collect()
[Row(GRID_DISK='[\n  617540519050084351,\n  617540519051657215,\n  617540519050608639,\n  617540519050870783,\n  617540519050346495,\n  617540519051395071,\n  617540519051132927\n]'), Row(GRID_DISK='[\n  617540519050084351,\n  617540519051657215,\n  617540519050608639,\n  617540519050870783,\n  617540519050346495,\n  617540519051395071,\n  617540519051132927,\n  617540519048249343,\n  617540519048773631,\n  617540519089143807,\n  617540519088095231,\n  617540519107756031,\n  617540519108018175,\n  617540519104086015,\n  617540519103561727,\n  617540519046414335,\n  617540519047462911,\n  617540519044579327,\n  617540519044317183\n]')]
Copy