共用方式為


h3_isvalid函式

適用於: 檢查標示為是 Databricks SQL 檢查標示為是 Databricks Runtime 11.3 LTS 和更新版本

如果輸入 BIGINT 或 STRING 是有效的 H3 單元格標識碼,則傳回 true。

語法

h3_isvalid ( expr )

引數

  • expr:BIGINT 運算式或 STRING 運算式。

傳回

BOOLEAN 類型的值,指出輸入 BIGINT 或 STRING 是否對應至有效的 H3 單元格標識符。

如果輸入為 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