通过


current_schema

返回当前数据库。

Syntax

from pyspark.sql import functions as sf

sf.current_schema()

例子

示例 1:获取当前架构

from pyspark.sql import functions as sf
spark.range(1).select(sf.current_schema()).show()
+----------------+
|current_schema()|
+----------------+
|         default|
+----------------+