重要
此功能目前以公共预览版提供。
分析输入 WKB 说明并返回相应的 Geography 值。
有关相应的 Databricks SQL 函数,请参阅 st_geogfromwkb 函数。
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_geogfromwkb(col=<col>)
参数
| 参数 | 类型 | Description |
|---|---|---|
col |
pyspark.sql.Column 或 str |
WKB 格式的 BINARY 值,表示 Geography 值。 |
例子
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(bytes.fromhex('0103000000010000000400000000000000000000000000000000000000000000000000144000000000000018400000000000001c4000000000000020c000000000000000000000000000000000'),)], ['wkb'])
df.select(dbf.st_astext(dbf.st_geogfromwkb('wkb')).alias('result')).collect()
[Row(result='POLYGON((0 0,5 6,7 -8,0 0))')]