Applies to: Databricks SQL Databricks Runtime 11.2 and above
Returns the resolution of the input H3 cell.
h3CellIdExpr: A BIGINT expression, or a hexadecimal STRING expression representing an H3 cell ID.
A value of whose type INT between 0 and 15, that is the resolution of the input H3 cell ID.
The function returns NULL if the input is NULL.
The function does partial validation regarding whether the input argument is a valid H3 cell ID. A necessary, but not sufficient condition for a valid H3 ID is that its value is between
The behavior of the function is undefined if the input cell ID is not a valid cell ID.
h3CellIdExpris a STRING that cannot be converted to a BIGINT or corresponds to a BIGINT value that is smaller than
0x08001fffffffffffor larger than
0x08ff3b6db6db6db6, the function returns H3_INVALID_CELL_ID.
-- Simple example taking a long as input. > SELECT h3_resolution(599686042433355775) 5 -- Simple example taking a hexadecimal string as input. > SELECT h3_resolution('85283473fffffff') 5 -- Input is an invalid H3 cell ID. > SELECT h3_resolution(0) [H3_INVALID_CELL_ID] 0 is not a valid H3 cell ID