pyspark.sql.functions.current_database

pyspark.sql.functions.current_database() → pyspark.sql.column.Column[source]

Returns the current database.

New in version 3.5.0.

Examples

>>> spark.range(1).select(current_database()).show()
+------------------+
|current_database()|
+------------------+
|           default|
+------------------+