pyspark.sql.Catalog.listCatalogs¶
-
Catalog.
listCatalogs
(pattern: Optional[str] = None) → List[pyspark.sql.catalog.CatalogMetadata][source]¶ Returns a list of catalogs in this session.
New in version 3.4.0.
- Parameters
- patternstr
The pattern that the catalog name needs to match.
- Returns
- list
A list of
CatalogMetadata
.
Examples
>>> spark.catalog.listCatalogs() [CatalogMetadata(name='spark_catalog', description=None)]
>>> spark.catalog.listCatalogs("spark*") [CatalogMetadata(name='spark_catalog', description=None)]
>>> spark.catalog.listCatalogs("hive*") []