지정된 해상도에서 입력 H3 셀 ID 의 부모 H3 셀 ID를 반환합니다. Spark Connect를 지원합니다.
해당 Databricks SQL 함수에 대해 알아보려면 h3_toparent 함수를 참조하세요.
문법
from pyspark.databricks.sql import functions as dbf
dbf.h3_toparent(col1=<col1>, col2=<col2>)
매개 변수
| 매개 변수 | 유형 | Description |
|---|---|---|
col1 |
pyspark.sql.Column 또는 str |
BIGINT 또는 문자열로 표현되는 H3 셀 ID |
col2 |
pyspark.sql.Column, str 또는 int |
반환할 부모 H3 셀 ID의 해상도를 나타냅니다. 음수가 아니고 작거나 첫 번째 인수의 해상도와 같아야 합니다. |
예시
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()
[Row(result=577199624117288959)]
df.select(dbf.h3_toparent('h3l', 0).alias('result')).collect()
[Row(result=577199624117288959)]