Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#13560] docs: Document Paimon Iceberg visibility for primary-key tables (#14994)

Yuhui67b152fcb10e
diff --git a/docs/iceberg-rest-service.md b/docs/iceberg-rest-service.md
index 34bc8860f9..a2b28e63ae 100644
--- a/docs/iceberg-rest-service.md
+++ b/docs/iceberg-rest-service.md
@@ -18,6 +18,11 @@ The Iceberg REST server and the main Gravitino server expose different interface
| Interfaces | [Iceberg REST API spec](https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml) | [Gravitino unified interfaces](https://gravitino.apache.org/docs/latest/api/rest/gravitino-rest-api) |
| Managed table type | Iceberg table only | JDBC, Hive, Iceberg, Hudi, Paimon, etc |
+Tables created by other engines that publish Iceberg metadata through this service, for example Paimon
+tables with `metadata.iceberg.storage` set to `rest-catalog`, are served as the producing engine published
+them, so that engine's visibility rules still apply. For Paimon primary-key tables, see
+[Iceberg compatibility](./lakehouse-paimon-catalog.md#iceberg-compatibility).
+
### Capabilities
The Iceberg REST server provides:
diff --git a/docs/lakehouse-paimon-catalog.md b/docs/lakehouse-paimon-catalog.md
index 0b7c9f9fb0..48a2d0b56a 100644
--- a/docs/lakehouse-paimon-catalog.md
+++ b/docs/lakehouse-paimon-catalog.md
@@ -320,6 +320,43 @@ Rename cannot be combined with other changes in a single `alterView` call. Submi
Refer to [Manage view metadata using Gravitino](./manage-view-metadata-using-gravitino.md) for more details.
+## Iceberg Compatibility
+
+Paimon can maintain Iceberg metadata for a table by setting the `metadata.iceberg.storage` table property
+(see [Paimon Iceberg metadata](https://paimon.apache.org/docs/master/iceberg/)). When it is set to
+`rest-catalog`, Paimon publishes the table's Iceberg metadata through the Iceberg REST service named by
+`metadata.iceberg.rest.uri`, and `metadata.iceberg.rest.warehouse` selects which Gravitino catalog stores
+that metadata (see
+[Client Catalog Selection](./iceberg-rest-service.md#client-catalog-selection)). An Iceberg client pointed
+at the same service can then read the Paimon table.
+
+:::info
+Gravitino's Iceberg REST service serves table metadata as the producing engine published it, so the
+visibility rules of that engine still apply.
+:::
+
+For **primary-key** tables, Paimon's publication rule decides what Iceberg readers can see. Iceberg readers
+cannot merge LSM files, so for incremental commits Paimon publishes only the data files that have been
+merged to the highest LSM level, while a plain `INSERT` writes its files below that level. Such writes are
+committed to the Paimon table, and are visible to Paimon readers, but they do not appear in the Iceberg
+metadata until a full compaction moves the merged result to the highest level. The first commit of a table
+is an exception, because it publishes a full snapshot, so the first write is visible immediately.
+
+Run a full compaction to establish the visibility boundary:
+
+```sql
+CALL paimon_catalog.sys.compact(`table` => 'db.tbl', compact_strategy => 'full');
+```
+
+Alternatively, let Paimon compact periodically with `compaction.optimization-interval` or
+`full-compaction.delta-commits`. Deletion-vector mode (`metadata.iceberg.format-version` = `3`,
+`deletion-vectors.enabled` = `true`, `deletion-vectors.bitmap64` = `true`, read by an Iceberg client with
+v3 support) publishes files above level 0 as well, which shortens the delay but still excludes the newest
+level-0 files.
+
+See [Primary Key Tables](https://paimon.apache.org/docs/master/iceberg/primary-key-table/) in the Paimon
+documentation for the full publication rules.
+
## HDFS Configuration
Place `core-site.xml` and `hdfs-site.xml` in the `catalogs/lakehouse-paimon/conf` directory to automatically load as the default HDFS configuration.