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

h3_toparent

指定された解像度で入力 H3 セル ID の親H3 セル IDを返します。Spark Connect をサポートします。

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

構文

Python
from pyspark.databricks.sql import functions as dbf

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

パラメーター

パラメーター

Type

説明

col1

pyspark.sql.Column または str

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

col2

pyspark.sql.Columnstr 、または int

返される親 H3 セル ID の解像度。負でない値で、最初の引数の解像度以下である必要があります。

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(599686042433355775, 0,)], ['h3l', 'res'])
df.select(dbf.h3_toparent('h3l', 'res').alias('result')).collect()
Output
[Row(result=577199624117288959)]
Python
df.select(dbf.h3_toparent('h3l', 0).alias('result')).collect()
Output
[Row(result=577199624117288959)]