Share via


st_y function

Applies to: check marked yes Databricks Runtime 17.1 and above

Important

This feature is in Public Preview.

Returns the Y coordinate of the input point GEOMETRY, or NULL if the point is empty.

Syntax

st_y ( geoExpr )

Arguments

  • geoExpr: A GEOMETRY value.

Returns

A value of type DOUBLE, Y coordinate of the input point GEOMETRY.

The function returns NULL if the input is NULL or if the point is empty.

Examples

-- Returns the Y coordinate of a non-empty point geometry.
> SELECT st_y(st_geomfromtext('POINT Z (2 3 4)'))
  3.0
-- Returns `NULL` for an empty point geometry.
> SELECT st_y(st_geomfromtext('POINT ZM EMPTY'))
  NULL