Interface CatalogPlugin
- All Known Subinterfaces:
CatalogExtension
,FunctionCatalog
,StagingTableCatalog
,SupportsNamespaces
,TableCatalog
,ViewCatalog
- All Known Implementing Classes:
DelegatingCatalogExtension
Implementations can provide catalog functions by implementing additional interfaces for tables, views, and functions.
Catalog implementations must implement this marker interface to be loaded by
Catalogs.load(String, SQLConf)
. The loader will instantiate catalog classes using the
required public no-arg constructor. After creating an instance, it will be configured by calling
initialize(String, CaseInsensitiveStringMap)
.
Catalog implementations are registered to a name by adding a configuration option to Spark:
spark.sql.catalog.catalog-name=com.example.YourCatalogClass
. All configuration properties
in the Spark configuration that share the catalog name prefix,
spark.sql.catalog.catalog-name.(key)=(value)
will be passed in the case insensitive
string map of options in initialization with the prefix removed.
name
, is also passed and is the catalog's name; in this case, "catalog-name".
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault String[]
Return a default namespace for the catalog.void
initialize
(String name, CaseInsensitiveStringMap options) Called to initialize configuration.name()
Called to get this catalog's name.
-
Method Details
-
initialize
Called to initialize configuration.This method is called once, just after the provider is instantiated.
- Parameters:
name
- the name used to identify and load this catalogoptions
- a case-insensitive string map of configuration
-
name
String name()Called to get this catalog's name.This method is only called after
initialize(String, CaseInsensitiveStringMap)
is called to pass the catalog's name. -
defaultNamespace
Return a default namespace for the catalog.When this catalog is set as the current catalog, the namespace returned by this method will be set as the current namespace.
The namespace returned by this method is not required to exist.
- Returns:
- a multi-part namespace
-