適用対象:
Databricks SQL
Databricks Runtime 17.1 以降" とマークされているチェック
Important
この機能は パブリック プレビュー段階です。
注
この機能は、Databricks SQL クラシック ウェアハウスでは使用できません。 Databricks SQL ウェアハウスの詳細については、 SQL ウェアハウスの種類に関するページを参照してください。
入力 GEOGRAPHY または GEOMETRY 値内の空でないポイントの数を返します。
Syntax
st_npoints ( geoExpr )
Arguments
-
geoExpr:GEOGRAPHYまたはGEOMETRYの値。
Returns
INT型の値。入力GEOGRAPHYまたはGEOMETRY値内の空でないポイントの数を表します。
入力がNULL場合、この関数はNULLを返します。
Examples
-- Returns the number of points in a non-empty multipoint geometry.
> SELECT st_npoints(st_geomfromtext('MULTIPOINT(10 34,44 57,EMPTY)'));
2
-- Returns the number of points in an empty multipoint geometry.
> SELECT st_npoints(st_geomfromtext('MULTIPOINT(EMPTY,EMPTY)'));
0
-- Returns the number of points in a non-empty polygon geometry.
> SELECT st_npoints(st_geomfromtext('POLYGON((0 0,1 0,1 1,0 1,0 0))'));
5