다음을 통해 공유

st_z 函数

适用于:检查标记为“是”的 Databricks SQL 检查标记为“是”是 Databricks Runtime 17.1 及更高版本

重要

此功能目前以公共预览版提供。

注释

此功能在 Databricks SQL 经典仓库上不可用。 若要详细了解 Databricks SQL 仓库,请参阅 SQL 仓库类型

返回输入点 GEOMETRY 值的 Z 坐标,或者 NULL 该点为空或没有 Z 坐标。

语法

st_z ( geoExpr )

论据

  • geoExpr:一个 GEOMETRY 值。

退货

类型 DOUBLE值,等于输入点 GEOMETRY 值的 Z 坐标。

如果输入为NULL或点为空,则函数返回NULL

错误条件

例子

-- Returns the Z coordinate of a non-empty point geometry with a Z coordinate.
> SELECT st_z(st_geomfromtext('POINT Z (1 2 3)'));
  3.0
-- Returns the Z coordinate of a non-empty point geometry without a Z coordinate.
> SELECT st_z(st_geomfromtext('POINT M (2 3 4)'));
  NULL
-- Returns `NULL` for an empty point geometry.
> SELECT st_z(st_geomfromtext('POINT ZM EMPTY'));
  NULL