Help Center/ AI DataLake/ devg/ Iceberg Development Guide/ Iceberg on Spark/ Interconnecting Spark with Iceberg Catalog
Updated on 2026-11-06 GMT+08:00

Interconnecting Spark with Iceberg Catalog

AI DataLake Spark allows you to use LakeFormation to manage metadata and authentication (row and column permissions) for Paimon and Iceberg tables. This simplifies data lake governance, enabling unified metadata management, fine-grained permission control, and transactional guarantees. Spark reads and writes to Paimon and Iceberg tables through data catalogs. You can select a data catalog based on your business scenarios.

Notes and Constraints

  • A LakeFormation instance has been created with metadata planned.

    LakeFormation Catalog must be located in the same region as the AI DataLake workspace. Otherwise, they cannot be associated in subsequent processes.

  • After a Paimon or Iceberg data catalog is configured, the job-level configurations take precedence over endpoint-level configurations. In addition, endpoint-level configurations take effect only after the endpoint is restarted.

Configuring a Data Catalog

Using the Default Data Catalog

Iceberg is used as the default data catalog for AI Data Lake Spark jobs. The system is pre-configured with spark.aidatalake.lakehouse.default.format=iceberg, so no manual configuration is required.

Using a Custom Data Catalog

  • Iceberg does not support user-defined functions (UDFs).
  • If a non-customized catalog is selected, the system uses the configured default data catalog (specified by spark.aidatalake.lakehouse.default.format).

To use a custom data catalog, configure spark.sql.catalog.{iceberg_catalog_name}=org.apache.iceberg.spark.SparkCatalog, where iceberg_catalog_name should be replaced with your target data catalog name.

Configuration methods:

  • Configuration via parameters in spark_config of the API
    For details about the API, see RunSparkJob or RunSparkSql. Example API request:
    "endpoint_name": "spark-sql-test",
      "catalog_context": {
        "catalog_name": "iceberg_catalog_name",//The catalog name must be the same as that in the configuration. This catalog can be used only for Iceberg.
        "database_name": "default"
      },
      "statement": "SELECT * FROM iceberg_catalog_name.db.your_table LIMIT 10",//Three-part naming configuration is supported.
      "spark_config": {
        "spark.sql.catalog.iceberg_catalog_name": "org.apache.iceberg.spark.SparkCatalog"
      }
    }
  • Configuration via the endpoint creation or modification page
    • Configuration via the endpoint creation page
      Figure 1 Configuring on the endpoint creation page
    • Configuration via the endpoint modification page
      Figure 2 Configuring on the endpoint modification page