Skip to main content

h3_maxchild

Returns the child of maximum value of the input H3 cell at the specified resolution. Supports Spark Connect.

For the corresponding Databricks SQL function, see h3_maxchild function.

Syntax

Python
from pyspark.databricks.sql import functions as dbf

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

Parameters

Parameter

Type

Description

col1

pyspark.sql.Column or str

An H3 cell ID, represented as a int or a str

col2

pyspark.sql.Column, str, or int

The resolution of the maximum value child cell ID to return. Must be non-negative and larger or equal to the resolution of the first argument.

Examples

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