Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
Returns the grid distance between two H3 cell IDs. Supports Spark Connect.
For the corresponding Databricks SQL function, see h3_distance function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.h3_distance(col1=<col1>, col2=<col2>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col1 |
pyspark.sql.Column or str |
An H3 cell ID, represented as a Column or string. |
col2 |
pyspark.sql.Column or str |
An H3 cell ID, represented as a Column or string. |
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(599686030622195711, 599686015589810175,)], ['h3l1', 'h3l2'])
df.select(dbf.h3_distance('h3l1', 'h3l2').alias('result')).collect()
[Row(result=2)]