重要
此功能目前以公共预览版提供。
以字符串形式返回输入 Geography 或 Geometry 值的类型。
有关相应的 Databricks SQL 函数,请参阅 st_geometrytype 函数。
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_geometrytype(col=<col>)
参数
| 参数 | 类型 | Description |
|---|---|---|
col |
pyspark.sql.Column 或 str |
地理或几何图形值。 |
例子
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POINT(4 5)',)], ['wkt'])
df.select(dbf.st_geometrytype(dbf.st_geomfromtext('wkt')).alias('result')).collect()
[Row(result='ST_Point')]