适用于: Databricks SQL
Databricks Runtime 11.3 LTS 及更高版本
如果输入 BIGINT 或 STRING 是有效的 H3 单元 ID,则返回 true。
h3_isvalid ( expr )
expr
:一个 BIGINT 表达式或 STRING 表达式。
BOOLEAN 类型的值,指示输入 BIGINT 或 STRING 是否对应于有效的 H3 单元 ID。
如果输入为 NULL,则该函数返回 NULL。
-- Simple example taking a long as input.
> SELECT h3_isvalid(599686042433355775)
true
-- Simple example taking a valid hexadecimal string as input.
> SELECT h3_isvalid('85283473fffffff')
true
-- Example taking a long as input that is not a valid H3 cell ID.
> SELECT h3_isvalid(599686042433355776)
false
-- Example where the input is an invalid hexadecimal string.
> SELECT h3_isvalid('I am not an H3 cell ID')
false