Managed Iceberg Tables within Unity Catalog's IRC using OSS Spark
Summary
- Apache Iceberg REST Catalog: Unity Catalog's built-in IRC allows any Apache Spark engine to read and write managed tables using simple connection strings and OAuth 2 tokens.
- Remote execution: Local OSS Spark SQL on your MacBook can query tables managed in Databricks Unity Catalog using only a connection string and OAuth 2 token, creating new tables and inserting data.
- Unified catalog access: The Iceberg REST Catalog connection works across any Spark engine, enabling data engineers to query Unity Catalog tables from external Spark instances without syncing data.
Managed Iceberg Tables within Unity Catalog's IRC using OSS Spark

Ryan Cicak, a solutions architect with Databricks, demonstrates how to use the Apache Iceberg REST Catalog (IRC) built into Unity Catalog (UC). He shows that any Apache Spark engine can easily connect to the IRC to read and write Spark tables managed by Unity Catalog. The demonstration uses Spark SQL running locally on a MacBook and connects to the catalog using an OAUTH 2 token.
🎯 What You'll Learn:
- How the Apache Iceberg REST Catalog (IRC) within Unity Catalog allows any engine to read and write managed Spark tables.
- How to configure Spark SQL with a connection string and an OAUTH 2 token to connect to the UC Iceberg REST Catalog.
- How to use a local, open-source Spark SQL instance to query tables managed in Databricks Unity Catalog.
- How to create new tables and insert data into Unity Catalog using a third-party OSS Spark engine.
⏱️ CHAPTERS:
Chapters
0:00Introduction to the Apache Iceberg REST Catalog (IRC) and Unity Catalog1:08Architecture and Connection String for IRC using an OAUTH 2 Token2:40Preparing the Local Demo Environment and Viewing Existing Tables in Databricks3:46Connecting Local Spark SQL to Unity Catalog and Querying Existing Tables5:14Creating a New Table in Unity Catalog via OSS Spark SQL6:17Inserting Data into the New Table and Final Verification
FAQs
What is Apache Iceberg REST Catalog?
The IRC built into Unity Catalog allows any Spark engine to read and write Databricks-managed tables. It uses REST APIs and OAuth 2 for simple authentication.
How do you configure local Spark?
Specify your workspace URL and IRC API version in a connection string with OAuth 2 credentials. Local Spark SQL connects to Databricks Unity Catalog transparently.
What is the Iceberg REST Catalog?
This video explains the Iceberg REST Catalog as a vendor-neutral metadata service enabling Iceberg tables to be accessed across tools and platforms. The Databricks Data and AI platform supports IRC enabling customers to adopt Iceberg without lock-in. REST APIs provide standard access patterns regardless of implementation.
How does Unity Catalog work with Iceberg REST catalog?
This video demonstrates Unity Catalog compatibility with Iceberg REST APIs enabling standardized governance across Iceberg deployments. The Databricks Data and AI platform bridges enterprise governance with open standards. This combination provides both flexibility and control organizations require.
How do I set up Unity Catalog with open-source Spark?
This video shows that Unity Catalog operates with open-source Spark enabling customers to run managed and self-managed deployments. The Databricks Data and AI platform provides managed experiences while remaining compatible with open tools. This flexibility supports diverse infrastructure strategies.
Full transcript
1:08 Architecture and Connection String for IRC using an OAUTH 2 Token
That I'll be using setting the proper permissions on that token. And really the focus is is using this Iceberg rest catalog that's just built into UC. And you can see it's as simple as specifying your workspace URL and the version of the API Unity Catalog Iceberg Rest. And that's pretty much it. You have to fill out the rest with the credential and such as we've done. And we're going to do that right now. This is basically what I've used for today if I zoom in a little.
Uh this is basically our connection string. The only thing I'm not including here is I'm not including the OAuth 2 token which is the client ID and client secret. Now what we're going to do is we're going to go into our workspace that's specified here that URL. And this workspace you can see we're inside of the catalog my personal catalog Chi Chat Test Catalog and then the schema is default. And if we say show tables uh this is the this is being run inside of Databricks and you can see we have a couple of tables uh that are listed here.
2:40 Preparing the Local Demo Environment and Viewing Existing Tables in Databricks
Um what I want to do is I want to pull up my terminal inside of my local machine as I said and I'm going to run Spark SQL. I'm I'm basically just going to run a bash script uh before we go into the bash script it's it's simple. It's it's taking the documentation I just showed you with the connection strings and I have already exported the connection strings via the document I already showed. And that's that's exactly what this script is doing.
Um it's just running Spark SQL with the export configurations. And you can see like I said this is running locally. And if I come into Spark OSS again running on my laptop, show tables, this is going to show me the same tables that I see in Databricks. And why is that? It's because it's using the Iceberg rest catalog that OAuth token. And in this case, it's a service principle. Uh when I run this uh query, if I would look at history, it would be the service principle that is, you know, using OSS Spark.
3:46 Connecting Local Spark SQL to Unity Catalog and Querying Existing Tables
And you can see there's a number of tables here, and they're poorly named, but if I do select star from ABCDEFG, you're going to see you're going to get some results back. I believe it's one or a few rows. And then we're going to run the exact same query. Um you can run this exact same query inside of Databricks. Where if I want to run selected, it's going to show those three rows that we just uh saw inside of Spark SQL running local.
And the magic again is that Iceberg rest catalog connection string that anyone can use. It's super simple to use, as you can see today. And I want to do a create table statement. Create table Let's call this test. One of the one of the best names around. And we'll do ID. Uh we'll do uh ID int, name string using Iceberg. And that table has just been created. Where it wasn't there before. If I go into the You can see here's test.
5:14 Creating a New Table in Unity Catalog via OSS Spark SQL
We just created test. Uh what? 11 or 12 seconds ago. And you can also see test was created from the owner. This is the service principle that's using that OAuth token. Uh that we specified in the IRC connection string. Whereas these typical you're typically going to see my username creating these tables if I created the table inside of Databricks workspace. As I'm logged in under my username. Now to hit this point across, we created this table.
6:17 Inserting Data into the New Table and Final Verification
Let's insert some data into this test table. So, insert into test values and then we'll say zero. Uh let's do. And then we'll do one. And then we'll say. And then that is going to spark OSS. OSS Spark, I should say, is going to insert those two records where there were no records before. And then we can see the those two results. And then if we go into test Um we could do the exact same thing if uh we want to view those as well.
And it's that simple to again use any engine where today we demonstrated OSS Spark, but really any third-party engine that is compatible using an Iceberg REST catalog where I can specify the URI or the whatever name you have to specify here. In this case, it's we we we talked about API 2. 1 Unity catalog Iceberg rest. This is the key essential component and then of course we're using the OIDC V1 token to pass this OAuth token, but really it's it it couldn't be any simpler.
You just provide the connection string, you're connecting and then you start creating tables, showing tables, describing tables, inserting data. The list goes on and on with the compatibilities of the things you can do with Iceberg. And that's all I have to show you today, short and sweet. I hope everybody enjoyed this and until next time. Thanks everybody. >>
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.