pyspark.sql.Catalog.getDatabase

Catalog.getDatabase(dbName: str) → pyspark.sql.catalog.Database

Get the database with the specified name. This throws an AnalysisException when the database cannot be found.

Parameters
dbNamestr

name of the database to check existence.

Examples

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