snowflake.snowpark.functions.h3_cell_to_parent¶

snowflake.snowpark.functions.h3_cell_to_parent(cell_id: Union[snowflake.snowpark.column.Column, str], target_resolution: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the parent H3 cell at the specified target resolution.

Parameters:
  • cell_id (ColumnOrName) – The H3 cell IDs.

  • target_resolution (ColumnOrName) – The target resolution levels.

Returns:

The parent H3 cell at the target resolution.

Return type:

Column

Example::
>>> from snowflake.snowpark.functions import col
>>> df = session.create_dataframe([[613036919424548863, 7], [608533319805566975, 6]], schema=["cell_id", "target_resolution"])
>>> df.select(h3_cell_to_parent(col("cell_id"), col("target_resolution")).alias("parent_cell")).collect()
[Row(PARENT_CELL=608533319805566975), Row(PARENT_CELL=604029720295636991)]
Copy