Freigeben über


h3_isvalid-Funktion

Gilt für:Häkchen ja Databricks SQL Häkchen gesetzt ja Databricks Runtime 11.3 LTS und höher

Gibt „true“ zurück, wenn der Eingabe-BIGINT oder STRING eine gültige H3-Zellen-ID ist.

Syntax

h3_isvalid ( expr )

Argumente

  • expr: Ein BIGINT-Ausdruck oder ein STRING-Ausdruck.

Gibt zurück

Ein Wert vom Typ BOOLEAN, der angibt, ob der Eingabe-BIGINT oder -STRING einer gültigen H3-Zellen-ID entspricht oder nicht.

Die Funktion gibt NULL zurück, wenn die Eingabe NULL ist.

Beispiele

-- 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