<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Catalog_plugin_API_(Spark)</id>
	<title>Catalog plugin API (Spark) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Catalog_plugin_API_(Spark)"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Catalog_plugin_API_(Spark)&amp;action=history"/>
	<updated>2026-12-06T00:07:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=Catalog_plugin_API_(Spark)&amp;diff=130&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@7c9abaa</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Catalog_plugin_API_(Spark)&amp;diff=130&amp;oldid=prev"/>
		<updated>2026-11-25T00:52:36Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@7c9abaa&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox concept&lt;br /&gt;
| name            = Catalog plugin API&lt;br /&gt;
| also_known_as   = CatalogPlugin, Spark multi-catalog API, DSV2 catalog API&lt;br /&gt;
| field           = Metadata management in query engines&lt;br /&gt;
| key_parts       = CatalogPlugin, TableCatalog, SupportsNamespaces, StagingTableCatalog, FunctionCatalog, ViewCatalog, ProcedureCatalog, CatalogExtension&lt;br /&gt;
| implementations = [[Apache Spark]]; catalogs from [[Apache Iceberg]], [[Delta Lake]], [[Unity Catalog]]&lt;br /&gt;
| related         = [[Data Source V2]], [[Data catalog]], [[Hive Metastore]], [[Iceberg REST catalog]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-23|the v4.3.0 tag of apache/spark (CatalogPlugin.java, TableCatalog.java, CatalogExtension.java, DelegatingCatalogExtension.java, SQLConf.scala, docs/sql-v2-data-sources.md), the Spark 3.0.0 release notes, Apache Iceberg 1.12.0 Spark docs and source, Delta Lake v4.4.1 source and docs, the Unity Catalog 0.7.0 Spark connector docs and source, and the Spark versions supported by Delta Lake 4.4.1 and Unity Catalog 0.7.0 (release notes) and Apache Iceberg 1.12.0 (Maven Central runtime artifacts)}}&lt;br /&gt;
&lt;br /&gt;
In [[Apache Spark]], the &amp;#039;&amp;#039;&amp;#039;catalog plugin API&amp;#039;&amp;#039;&amp;#039; is the part of [[Data Source V2]] that lets an external catalog register under a name and serve namespaces, tables, views, functions and procedures to Spark SQL; its root interface is &amp;lt;code&amp;gt;org.apache.spark.sql.connector.catalog.CatalogPlugin&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;plugin&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/CatalogPlugin.java |title=CatalogPlugin.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; It is how [[Apache Iceberg]], [[Delta Lake]] and [[Unity Catalog]] plug into Spark,&amp;lt;ref name=&amp;quot;icecfg&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;deltabatch&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;ucspark&amp;quot; /&amp;gt; and it allows one Spark session to query tables from several catalogs with three-part names such as &amp;lt;code&amp;gt;catalog.schema.table&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== What is CatalogPlugin? ==&lt;br /&gt;
&amp;lt;code&amp;gt;CatalogPlugin&amp;lt;/code&amp;gt; is a marker interface with three methods: &amp;lt;code&amp;gt;initialize(name, options)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;name()&amp;lt;/code&amp;gt; and a default &amp;lt;code&amp;gt;defaultNamespace()&amp;lt;/code&amp;gt;. Spark loads the class through a required public no-argument constructor and then calls &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt; once.&amp;lt;ref name=&amp;quot;plugin&amp;quot; /&amp;gt; The interface has been part of Spark since 3.0.0 and is annotated &amp;lt;code&amp;gt;@Evolving&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;plugin&amp;quot; /&amp;gt; The Spark 3.0.0 release notes list it as &amp;quot;Catalog plugin API&amp;quot; (SPARK-31121).&amp;lt;ref name=&amp;quot;r300&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/releases/spark-release-3-0-0.html |title=Spark Release 3.0.0 |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How is a catalog registered? ==&lt;br /&gt;
A catalog is registered with the configuration key &amp;lt;code&amp;gt;spark.sql.catalog.&amp;amp;lt;name&amp;amp;gt;&amp;lt;/code&amp;gt;, whose value is the implementing class. Every key of the form &amp;lt;code&amp;gt;spark.sql.catalog.&amp;amp;lt;name&amp;amp;gt;.&amp;amp;lt;key&amp;amp;gt;&amp;lt;/code&amp;gt; is passed to &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt; in a case-insensitive map with the prefix removed.&amp;lt;ref name=&amp;quot;plugin&amp;quot; /&amp;gt; For example, &amp;lt;code&amp;gt;spark.sql.catalog.lake.type=rest&amp;lt;/code&amp;gt; reaches the catalog named &amp;lt;code&amp;gt;lake&amp;lt;/code&amp;gt; as the option &amp;lt;code&amp;gt;type=rest&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Two settings control defaults. &amp;lt;code&amp;gt;spark.sql.defaultCatalog&amp;lt;/code&amp;gt; names the current catalog when none has been set, and defaults to &amp;lt;code&amp;gt;spark_catalog&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;sqlconf&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala |title=SQLConf.scala (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; &amp;lt;code&amp;gt;spark.sql.catalog.spark_catalog&amp;lt;/code&amp;gt; sets the implementation of the built-in session catalog; its default, &amp;lt;code&amp;gt;builtin&amp;lt;/code&amp;gt;, is Spark&amp;#039;s own &amp;lt;code&amp;gt;V2SessionCatalog&amp;lt;/code&amp;gt;, and a replacement must stay consistent with the built-in catalog, typically by extending &amp;lt;code&amp;gt;CatalogExtension&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;sqlconf&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What does TableCatalog add? ==&lt;br /&gt;
A plugin gains abilities by implementing more interfaces. &amp;lt;code&amp;gt;TableCatalog&amp;lt;/code&amp;gt; extends &amp;lt;code&amp;gt;CatalogPlugin&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;listTables&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;loadTable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;createTable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;alterTable&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dropTable&amp;lt;/code&amp;gt; and related methods, and returns &amp;lt;code&amp;gt;Table&amp;lt;/code&amp;gt; objects that Spark reads and writes through Data Source V2.&amp;lt;ref name=&amp;quot;dsv2doc&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/sql-v2-data-sources.html |title=Data Source V2 (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TableCatalog&amp;lt;/code&amp;gt; also carries [[Time travel (SQL)|time travel]]. Overloads &amp;lt;code&amp;gt;loadTable(ident, String version)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;loadTable(ident, long timestamp)&amp;lt;/code&amp;gt;, with the timestamp in microseconds since the Unix epoch, return a table at a past state; the default implementations throw a &amp;quot;no such table&amp;quot; error, so a catalog supports time travel only if it overrides them.&amp;lt;ref name=&amp;quot;tablecatalog&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableCatalog.java |title=TableCatalog.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; An overload that receives the write privileges a statement needs was added in 3.5.3.&amp;lt;ref name=&amp;quot;tablecatalog&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Interface !! Adds !! Since&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;TableCatalog&amp;lt;/code&amp;gt; || Table lifecycle: list, load, create, alter, drop || 3.0.0&amp;lt;ref name=&amp;quot;tablecatalog&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SupportsNamespaces&amp;lt;/code&amp;gt; || Namespace (database or schema) DDL || 3.0.0&amp;lt;ref name=&amp;quot;ns&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsNamespaces.java |title=SupportsNamespaces.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;StagingTableCatalog&amp;lt;/code&amp;gt; || Atomic &amp;lt;code&amp;gt;CREATE TABLE AS SELECT&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;REPLACE TABLE AS SELECT&amp;lt;/code&amp;gt; through staged tables || 3.0.0&amp;lt;ref name=&amp;quot;staging&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/StagingTableCatalog.java |title=StagingTableCatalog.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CatalogExtension&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;DelegatingCatalogExtension&amp;lt;/code&amp;gt; || Wrap the built-in session catalog and delegate to it || 3.0.0&amp;lt;ref name=&amp;quot;ext&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/CatalogExtension.java |title=CatalogExtension.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FunctionCatalog&amp;lt;/code&amp;gt; || List and load user-defined functions || 3.2.0&amp;lt;ref name=&amp;quot;func&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/FunctionCatalog.java |title=FunctionCatalog.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ProcedureCatalog&amp;lt;/code&amp;gt; || Stored procedures called with &amp;lt;code&amp;gt;CALL&amp;lt;/code&amp;gt; || 4.0.0&amp;lt;ref name=&amp;quot;proc&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/ProcedureCatalog.java |title=ProcedureCatalog.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ViewCatalog&amp;lt;/code&amp;gt; || View DDL and view reads || 4.2.0&amp;lt;ref name=&amp;quot;view&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/ViewCatalog.java |title=ViewCatalog.java (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The built-in session catalog is not a &amp;lt;code&amp;gt;ViewCatalog&amp;lt;/code&amp;gt;; views in &amp;lt;code&amp;gt;spark_catalog&amp;lt;/code&amp;gt; still use the V1, Hive-compatible code path, and V2 view support applies to catalogs registered under their own names.&amp;lt;ref name=&amp;quot;dsv2doc&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How do Iceberg, Delta Lake and Unity Catalog register catalogs? ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Apache Iceberg&amp;#039;&amp;#039;&amp;#039; provides two classes. &amp;lt;code&amp;gt;org.apache.iceberg.spark.SparkCatalog&amp;lt;/code&amp;gt; is a standalone catalog backed by a Hive, Hadoop, REST, Glue, JDBC or Nessie catalog, selected with an option such as &amp;lt;code&amp;gt;type=rest&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;org.apache.iceberg.spark.SparkSessionCatalog&amp;lt;/code&amp;gt; replaces &amp;lt;code&amp;gt;spark_catalog&amp;lt;/code&amp;gt;, serves Iceberg tables itself and delegates other tables to Spark&amp;#039;s built-in catalog.&amp;lt;ref name=&amp;quot;icecfg&amp;quot;&amp;gt;{{Cite web |url=https://iceberg.apache.org/docs/latest/spark-configuration/ |title=Spark Configuration (Apache Iceberg 1.12.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; In the Iceberg 1.12.0 source, &amp;lt;code&amp;gt;SparkSessionCatalog&amp;lt;/code&amp;gt; implements &amp;lt;code&amp;gt;CatalogExtension&amp;lt;/code&amp;gt;, and the shared base class of both implements &amp;lt;code&amp;gt;StagingTableCatalog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProcedureCatalog&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SupportsNamespaces&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;icessc&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java |title=SparkSessionCatalog.java (apache-iceberg-1.12.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;icebase&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/BaseCatalog.java |title=BaseCatalog.java (apache-iceberg-1.12.0) |publisher=Apache Software Foundation |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Delta Lake&amp;#039;&amp;#039;&amp;#039; replaces the session catalog. Its documentation sets &amp;lt;code&amp;gt;spark.sql.catalog.spark_catalog&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;org.apache.spark.sql.delta.catalog.DeltaCatalog&amp;lt;/code&amp;gt;, together with &amp;lt;code&amp;gt;spark.sql.extensions=io.delta.sql.DeltaSparkSessionExtension&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;deltabatch&amp;quot;&amp;gt;{{Cite web |url=https://docs.delta.io/latest/delta-batch.html |title=Table batch reads and writes |publisher=Delta Lake (Linux Foundation) |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; In the Delta Lake v4.4.1 source, &amp;lt;code&amp;gt;DeltaCatalog&amp;lt;/code&amp;gt; derives from &amp;lt;code&amp;gt;AbstractDeltaCatalog&amp;lt;/code&amp;gt;, which extends Spark&amp;#039;s &amp;lt;code&amp;gt;DelegatingCatalogExtension&amp;lt;/code&amp;gt;, so non-Delta tables fall through to the built-in catalog.&amp;lt;ref name=&amp;quot;deltasrc&amp;quot;&amp;gt;{{Cite web |url=https://github.com/delta-io/delta/blob/v4.4.1/spark/src/main/scala/org/apache/spark/sql/delta/catalog/AbstractDeltaCatalog.scala |title=AbstractDeltaCatalog.scala (v4.4.1) |publisher=Delta Lake (Linux Foundation) |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Unity Catalog&amp;#039;&amp;#039;&amp;#039; OSS registers a named catalog with &amp;lt;code&amp;gt;io.unitycatalog.spark.UCSingleCatalog&amp;lt;/code&amp;gt;, plus &amp;lt;code&amp;gt;uri&amp;lt;/code&amp;gt; and authentication options under the same prefix, and its guide makes that catalog the default with &amp;lt;code&amp;gt;spark.sql.defaultCatalog&amp;lt;/code&amp;gt;. The same guide also configures Delta Lake&amp;#039;s extension and &amp;lt;code&amp;gt;DeltaCatalog&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;ucspark&amp;quot;&amp;gt;{{Cite web |url=https://unitycatalog.io/docs/integrations/unity-catalog-spark/ |title=Unity Catalog Apache Spark integration |publisher=Unity Catalog (LF AI &amp;amp; Data) |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; In the 0.7.0 source, &amp;lt;code&amp;gt;UCSingleCatalog&amp;lt;/code&amp;gt; implements &amp;lt;code&amp;gt;StagingTableCatalog&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SupportsNamespaces&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;ucsrc&amp;quot;&amp;gt;{{Cite web |url=https://github.com/unitycatalog/unitycatalog/blob/v0.7.0/connectors/spark/src/main/scala/io/unitycatalog/spark/UCSingleCatalog.scala |title=UCSingleCatalog.scala (v0.7.0) |publisher=Unity Catalog (LF AI &amp;amp; Data) |access-date=2026-11-23}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The connector releases cited on this page do not all support Spark 4.3. Delta Lake 4.4.1 is built for Spark 4.0.1, 4.1.0 and 4.2.0,&amp;lt;ref name=&amp;quot;delta441&amp;quot;&amp;gt;{{Cite web |url=https://github.com/delta-io/delta/releases/tag/v4.4.1 |title=Delta Lake 4.4.1 |publisher=delta-io on GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; Unity Catalog 0.7.0 publishes Spark connectors for Spark 4.0.x, 4.1.x and 4.2.x,&amp;lt;ref name=&amp;quot;uc070&amp;quot;&amp;gt;{{Cite web |url=https://github.com/unitycatalog/unitycatalog/releases/tag/v0.7.0 |title=Unity Catalog v0.7.0 |publisher=unitycatalog on GitHub |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; and Iceberg 1.12.0 publishes Spark runtimes for Spark 3.5, 4.0 and 4.1.&amp;lt;ref name=&amp;quot;icemvn&amp;quot;&amp;gt;{{Cite web |url=https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-spark-runtime-4.1_2.13/1.12.0/ |title=iceberg-spark-runtime-4.1_2.13 1.12.0 |publisher=Maven Central |access-date=2026-11-23}}&amp;lt;/ref&amp;gt; The newest Spark line that all three support is therefore 4.1.&lt;br /&gt;
&lt;br /&gt;
The following PySpark session targets Spark 4.1 with Scala 2.13. It puts Delta Lake in the session catalog and adds an Iceberg REST catalog named &amp;lt;code&amp;gt;lake&amp;lt;/code&amp;gt; and a Unity Catalog catalog named &amp;lt;code&amp;gt;unity&amp;lt;/code&amp;gt;. Class names and option keys follow the cited project docs.&amp;lt;ref name=&amp;quot;icecfg&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;deltabatch&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;ucspark&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from pyspark.sql import SparkSession&lt;br /&gt;
&lt;br /&gt;
spark = (&lt;br /&gt;
    SparkSession.builder&lt;br /&gt;
    # Spark 4.1, Scala 2.13&lt;br /&gt;
    .config(&amp;quot;spark.jars.packages&amp;quot;, &amp;quot;,&amp;quot;.join([&lt;br /&gt;
        &amp;quot;io.delta:delta-spark_4.1_2.13:4.4.1&amp;quot;,&lt;br /&gt;
        &amp;quot;org.apache.iceberg:iceberg-spark-runtime-4.1_2.13:1.12.0&amp;quot;,&lt;br /&gt;
        &amp;quot;io.unitycatalog:unitycatalog-spark_4.1_2.13:0.7.0&amp;quot;,&lt;br /&gt;
    ]))&lt;br /&gt;
    .config(&amp;quot;spark.sql.extensions&amp;quot;, &amp;quot;io.delta.sql.DeltaSparkSessionExtension&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.spark_catalog&amp;quot;,&lt;br /&gt;
            &amp;quot;org.apache.spark.sql.delta.catalog.DeltaCatalog&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.lake&amp;quot;, &amp;quot;org.apache.iceberg.spark.SparkCatalog&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.lake.type&amp;quot;, &amp;quot;rest&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.lake.uri&amp;quot;, &amp;quot;http://localhost:8181&amp;quot;)  # Iceberg REST server&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.unity&amp;quot;, &amp;quot;io.unitycatalog.spark.UCSingleCatalog&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.unity.uri&amp;quot;, &amp;quot;http://localhost:8080&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.unity.auth.type&amp;quot;, &amp;quot;static&amp;quot;)&lt;br /&gt;
    .config(&amp;quot;spark.sql.catalog.unity.auth.token&amp;quot;, &amp;quot;&amp;lt;token&amp;gt;&amp;quot;)&lt;br /&gt;
    .getOrCreate()&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
spark.sql(&amp;quot;SELECT * FROM lake.sales.orders LIMIT 10&amp;quot;).show()&lt;br /&gt;
spark.sql(&amp;quot;SHOW NAMESPACES IN unity&amp;quot;).show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Catalog plugin vs. Hive Metastore ==&lt;br /&gt;
The catalog plugin API is an interface inside Spark; a [[Hive Metastore]] is a metadata service. Spark&amp;#039;s built-in &amp;lt;code&amp;gt;spark_catalog&amp;lt;/code&amp;gt; can be backed by a Hive Metastore, and plugins such as Iceberg&amp;#039;s &amp;lt;code&amp;gt;SparkCatalog&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;type=hive&amp;lt;/code&amp;gt; can use one as their store, but the plugin decides how names map to tables.&amp;lt;ref name=&amp;quot;icecfg&amp;quot; /&amp;gt; See [[Data catalog]] for the broader term.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Data Source V2]]&lt;br /&gt;
* [[Unity Catalog]]&lt;br /&gt;
* [[Iceberg REST catalog]]&lt;br /&gt;
* [[Hive Metastore]]&lt;br /&gt;
* [[Data catalog]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;br /&gt;
[[Category:Catalogs]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>