listDatabases
Returns a list of databases available across all sessions.
Syntax
listDatabases(pattern: str = None)
Parameters
Parameter | Type | Description |
|---|---|---|
| str, optional | The pattern that the database name needs to match. |
Returns
list of Database
Examples
Python
spark.catalog.listDatabases()
# [Database(name='default', catalog='spark_catalog', description='default database', ...
spark.catalog.listDatabases("def*")
# [Database(name='default', catalog='spark_catalog', description='default database', ...
spark.catalog.listDatabases("def2*")
# []