Catalog
The catalog interface for inspecting and managing catalogs, databases, tables, views, functions, and the query cache. Access it with spark.catalog. Mirrors org.apache.spark.sql.catalog.
Listing methods return typed Datasets (Dataset[Table], Dataset[Database], ...); predicate methods return a Boolean; command-like methods return Unit and run immediately.
spark.catalog.listTables().show()
spark.catalog.listTables().collect().map(_.name)
spark.catalog.tableExists("my_table") // => true
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Computes table statistics like ANALYZE TABLE ... COMPUTE STATISTICS (Spark 4.2+).
Computes table statistics like ANALYZE TABLE ... COMPUTE STATISTICS (Spark 4.2+).
Attributes
Caches the table in memory.
Caches the table in memory.
Attributes
Caches the table with the given storage level.
Caches the table with the given storage level.
Attributes
Removes all cached tables from the in-memory cache.
Removes all cached tables from the in-memory cache.
Attributes
Creates a database (namespace); dbName may be multi-part (Spark 4.2+).
Creates a database (namespace); dbName may be multi-part (Spark 4.2+).
Attributes
Creates a database with the given properties (e.g. comment, location), like CREATE NAMESPACE ... WITH DBPROPERTIES (Spark 4.2+).
Creates a database with the given properties (e.g. comment, location), like CREATE NAMESPACE ... WITH DBPROPERTIES (Spark 4.2+).
Attributes
(Java-specific) Creates a database with the given properties (Spark 4.2+).
(Java-specific) Creates a database with the given properties (Spark 4.2+).
Attributes
Creates a table from the files at path using the data source source.
Creates a table from the files at path using the data source source.
Attributes
Creates a table from a data source and options.
Creates a table from a data source and options.
Attributes
(Java-specific) Creates a table from a data source and options.
(Java-specific) Creates a table from a data source and options.
Attributes
Creates a table from a data source, a description, and options.
Creates a table from a data source, a description, and options.
Attributes
(Java-specific) Creates a table from a data source, a description, and options.
(Java-specific) Creates a table from a data source, a description, and options.
Attributes
Creates a table from a data source, a schema, and options.
Creates a table from a data source, a schema, and options.
Attributes
(Java-specific) Creates a table from a data source, a schema, and options.
(Java-specific) Creates a table from a data source, a schema, and options.
Attributes
Creates a table from a data source, a schema, a description, and options.
Creates a table from a data source, a schema, a description, and options.
Attributes
(Java-specific) Creates a table from a data source, schema, description, and options.
(Java-specific) Creates a table from a data source, schema, description, and options.
Attributes
Returns the current default catalog.
Returns the current default catalog.
Attributes
Returns the current default database.
Returns the current default database.
Attributes
Returns true if the database exists.
Returns true if the database exists.
Attributes
Drops a database; with cascade, also drops the objects it contains (Spark 4.2+).
Drops a database; with cascade, also drops the objects it contains (Spark 4.2+).
Attributes
Drops a global temporary view; returns true if it existed.
Drops a global temporary view; returns true if it existed.
Attributes
Drops a persistent table; temporary views are dropped with dropTempView (Spark 4.2+).
Drops a local temporary view; returns true if it existed.
Drops a local temporary view; returns true if it existed.
Attributes
Drops a persistent view; temporary views are dropped with dropTempView (Spark 4.2+).
Returns true if the function exists.
Returns true if the function exists.
Attributes
Returns true if the function exists in the given database.
Returns true if the function exists in the given database.
Attributes
Returns the SHOW CREATE TABLE statement of a table or view; with asSerde, the Hive SerDe form when applicable (Spark 4.2+).
Returns the SHOW CREATE TABLE statement of a table or view; with asSerde, the Hive SerDe form when applicable (Spark 4.2+).
Attributes
Returns the database with the given name; throws if it does not exist.
Returns the database with the given name; throws if it does not exist.
Attributes
Returns the function with the given name; throws if it does not exist.
Returns the function with the given name; throws if it does not exist.
Attributes
Returns the function with the given name in the given database.
Returns the function with the given name in the given database.
Attributes
Returns the table or view with the given name; throws if it does not exist.
Returns the table or view with the given name; throws if it does not exist.
Attributes
Returns the table or view with the given name in the given database.
Returns the table or view with the given name in the given database.
Attributes
Returns all properties of a table or view, like SHOW TBLPROPERTIES (Spark 4.2+).
Returns all properties of a table or view, like SHOW TBLPROPERTIES (Spark 4.2+).
Attributes
Returns true if the table is cached in memory.
Returns true if the table is cached in memory.
Attributes
Returns a list of the catalogs available in this session.
Returns a list of the catalogs available in this session.
Attributes
Returns the catalogs whose name matches the SQL LIKE pattern.
Returns the catalogs whose name matches the SQL LIKE pattern.
Attributes
Returns the columns of the given table or view.
Returns the columns of the given table or view.
Attributes
Returns the columns of the given table or view in the given database.
Returns the columns of the given table or view in the given database.
Attributes
Returns a list of the databases (namespaces) in the current catalog.
Returns a list of the databases (namespaces) in the current catalog.
Attributes
Returns the databases whose name matches the SQL LIKE pattern.
Returns the databases whose name matches the SQL LIKE pattern.
Attributes
Returns the functions registered in the current database, including temporary ones.
Returns the functions registered in the current database, including temporary ones.
Attributes
Returns the functions registered in the given database, including temporary ones.
Returns the functions registered in the given database, including temporary ones.
Attributes
Returns the functions of dbName whose name matches the SQL LIKE pattern.
Returns the functions of dbName whose name matches the SQL LIKE pattern.
Attributes
Returns the partitions of a table, like SHOW PARTITIONS (Spark 4.2+).
Returns the partitions of a table, like SHOW PARTITIONS (Spark 4.2+).
Attributes
Returns the tables and views in the current database, including temporary views.
Returns the tables and views in the current database, including temporary views.
Attributes
Returns the tables and views in the given database, including temporary views.
Returns the tables and views in the given database, including temporary views.
Attributes
Returns the tables and views of dbName whose name matches the SQL LIKE pattern.
Returns the tables and views of dbName whose name matches the SQL LIKE pattern.
Attributes
Returns the views in the current database (Spark 4.2+).
Returns the views in the current database (Spark 4.2+).
Attributes
Returns the views in the given (possibly catalog-qualified) database (Spark 4.2+).
Returns the views in the given (possibly catalog-qualified) database (Spark 4.2+).
Attributes
Returns the views of dbName whose name matches the SQL LIKE pattern (Spark 4.2+).
Returns the views of dbName whose name matches the SQL LIKE pattern (Spark 4.2+).
Attributes
Recovers all the partitions of the table and updates the catalog.
Recovers all the partitions of the table and updates the catalog.
Attributes
Invalidates and refreshes the cached data of any Dataset that reads from path.
Invalidates and refreshes the cached data of any Dataset that reads from path.
Attributes
Invalidates and refreshes the cached data and metadata of the table.
Invalidates and refreshes the cached data and metadata of the table.
Attributes
Sets the current default catalog.
Sets the current default catalog.
Attributes
Sets the current default database.
Sets the current default database.
Attributes
Returns true if the table or view exists.
Returns true if the table or view exists.
Attributes
Returns true if the table or view exists in the given database.
Returns true if the table or view exists in the given database.
Attributes
Removes all rows from a table; not supported for views (Spark 4.2+).
Removes all rows from a table; not supported for views (Spark 4.2+).
Attributes
Removes the table from the in-memory cache.
Removes the table from the in-memory cache.
Attributes
Deprecated methods
Attributes
- Deprecated
- true
Attributes
- Deprecated
- true
Attributes
- Deprecated
- true
Attributes
- Deprecated
- true
Attributes
- Deprecated
- true
Attributes
- Deprecated
- true