Condividi tramite


getDatabase

Ottenere il database con il nome specificato. Viene generata un'eccezione AnalysisException quando non è possibile trovare il database.

Sintassi

getDatabase(dbName: str)

Parametri

Parametro Tipo Descrizione
dbName str Nome del database da ottenere.

Restituzioni

Database

Database trovato dal nome.

Examples

spark.catalog.getDatabase("default")
# Database(name='default', catalog='spark_catalog', description='default database', ...

# Using the fully qualified name with the catalog name.
spark.catalog.getDatabase("spark_catalog.default")
# Database(name='default', catalog='spark_catalog', description='default database', ...