Funktionen h3_isvalid
Gäller för: Databricks SQL
Databricks Runtime 11.3 LTS och senare
Returnerar sant om indata-BIGINT eller STRING är ett giltigt H3-cell-ID.
Syntax
h3_isvalid ( expr )
Argument
expr
: Ett BIGINT-uttryck eller ett STRING-uttryck.
Returer
Ett värde av typen BOOLEAN som anger om bigint- eller STRING-indata motsvarar ett giltigt H3-cell-ID eller inte.
Funktionen returnerar NULL om indata är NULL.
Exempel
-- 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