snowflake.snowpark.functions.h3_compact_cells_strings¶
- snowflake.snowpark.functions.h3_compact_cells_strings(array_of_cell_ids: Union[snowflake.snowpark.column.Column, str]) Column [source]¶
Returns a compacted array of H3 cell IDs by removing redundant cells that are covered by their parent cells at coarser resolutions.
- Parameters:
array_of_cell_ids (ColumnOrName) – An array of H3 cell ID strings to be compacted.
- Returns:
The compacted array of H3 cell ID strings.
- Return type:
Example:
>>> df = session.create_dataframe([[ ... ['8a2a10705507fff', '8a2a1070550ffff', '8a2a10705517fff', '8a2a1070551ffff', ... '8a2a10705527fff', '8a2a1070552ffff', '8a2a10705537fff', '8a2a10705cdffff'] ... ]], schema=["cell_ids"]) >>> df.select(h3_compact_cells_strings("cell_ids").alias("compacted")).collect() [Row(COMPACTED='[\n "8a2a10705cdffff",\n "892a1070553ffff"\n]')]