h3_isvalid 功能

適用於:勾選為是 Databricks SQL 勾選為是 Databricks 執行環境 11.3 LTS 及以上版本 勾選是 Lakehouse//RT

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