メインコンテンツまでスキップ

h3_距離

2 つのH3 セル ID間のグリッド距離を返します。Spark Connect をサポートします。

対応する Databricks SQL 関数については、 h3_distance関数を参照してください。

構文

Python
from pyspark.databricks.sql import functions as dbf

dbf.h3_distance(col1=<col1>, col2=<col2>)

パラメーター

パラメーター

Type

説明

col1

pyspark.sql.Column または str

または文字列として表される H3 セル ID。

col2

pyspark.sql.Column または str

または文字列として表される H3 セル ID。

Python
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()
Output
[Row(result=2)]