Compartilhar via


Função h3_isvalid

Aplica-se a: verificação marcada como sim Databricks SQL verificação marcada como sim Databricks Runtime 11.3 LTS e versões posteriores

Retorna true se a entrada BIGINT ou STRING for uma ID de célula H3 válida.

Sintaxe

h3_isvalid ( expr )

Argumentos

  • expr: uma expressão BIGINT ou uma expressão STRING.

Retornos

Um valor do tipo BOOLIANO, indicando se a entrada BIGINT ou STRING corresponde a uma ID de célula H3 válida ou não.

A função retorna NULL se a entrada for NULL.

Exemplos

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