This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino-playground.git
The following commit(s) were added to refs/heads/main by this push:
new 418e99e Document Spark's lazy catalog initialization (#161)
418e99e is described below
commit 418e99e927eb984fc902798aa381e598e7ce6725
Author: Mark Hoerth <[email protected]>
AuthorDate: Sun Aug 23 18:47:52 2026 -0700
Document Spark's lazy catalog initialization (#161)
### What changes were proposed in this pull request?
Add a note to the Spark section explaining that Spark initializes a
catalog on first reference, so `SHOW CATALOGS` in a new spark-sql
session
lists only `spark_catalog`, with an example of bringing a catalog into
the
session and a contrast with how Trino enumerates.
### Why are the changes needed?
A new user opening spark-sql and running `SHOW CATALOGS` sees a single
entry and reasonably concludes the Gravitino wiring is not working, when
the configuration is correct and the catalogs appear as soon as they are
referenced. The same command in Trino lists everything, which makes the
difference look like a fault in the Spark setup.
### Does this PR introduce _any_ user-facing change?
Documentation only.
### How was this patch tested?
Verified in the playground: `SHOW CATALOGS` in a new spark-sql session
returned only `spark_catalog`, and returned `catalog_rest` as well after
`USE catalog_rest`.
Co-authored-by: Mark Hoerth <[email protected]>
---
README.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/README.md b/README.md
index e9c221a..b966e69 100644
--- a/README.md
+++ b/README.md
@@ -329,6 +329,15 @@ Then open the Spark SQL client:
cd /opt/spark && /bin/bash bin/spark-sql
```
+Spark initializes a catalog the first time a session references it, so `SHOW
CATALOGS` in a new session lists only `spark_catalog` even though the
playground configures more. Reference a catalog to bring it into the session,
then list again:
+
+```sql
+USE catalog_rest;
+SHOW CATALOGS;
+```
+
+Trino enumerates differently. Its Gravitino connector creates one Trino
catalog per Gravitino catalog at startup, so `SHOW CATALOGS` there lists them
all immediately. The two engines see the same metadata either way.
+
For a worked example of writing with Spark and reading the same table with
Trino, see the `gravitino-spark-trino-example.ipynb` notebook in the [Jupyter
Notebooks](#jupyter-notebooks) section.
## Iceberg REST Service