Condividi tramite


current_database

Restituisce il database corrente.

Sintassi

from pyspark.sql import functions as sf

sf.current_database()

Esempi

Esempio 1: Ottenere il database corrente

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