Fonction h3_ispentagon

S’applique à :coche marquée oui Databricks SQL oui coché Databricks Runtime 11.3 LTS et versions ultérieures

Retourne true si le type BIGINT ou STRING hexadécimal d’entrée correspond à une cellule H3 pentagonale ou non.

Syntaxe

h3_ispentagon ( h3CellIdExpr )

Arguments

  • h3CellIdExpr : expression BIGINT ou expression STRING hexadécimale représentant un ID de cellule H3.

Retours

Valeur de type BOOLEAN indiquant si l’entrée BIGINT ou STRING hexadécimale correspond à une cellule H3 pentagonale.

La fonction retourne NULL si l’entrée est NULL. La fonction effectue une validation partielle pour déterminer si l’argument d’entrée est un ID de cellule H3 valide. Une valeur d’ID H3 comprise entre 0x08001fffffffffff et 0x08ff3b6db6db6db6 constitue une condition nécessaire mais pas suffisante. Le comportement de la fonction n’est pas défini si l’ID de cellule d’entrée ne correspond pas à un ID de cellule valide.

Conditions d'erreur

  • Si h3CellIdExpr correspond à une STRING qui ne peut pas être convertie en BIGINT ou qui correspond à une valeur BIGINT inférieure à 0x08001fffffffffff ou supérieure à 0x08ff3b6db6db6db6, la fonction retourne H3_INVALID_CELL_ID.

Exemples

-- Simple example taking a long as input.
> SELECT h3_ispentagon(590112357393367039)
  true

-- Simple example taking a hexadecimal string as input.
> SELECT h3_ispentagon('85283473fffffff')
  false

-- Input is an invalid H3 cell ID.
> SELECT h3_ispentagon(0)
  [H3_INVALID_CELL_ID] 0 is not a valid H3 cell ID