Interconnecting Spark with Paimon Catalog
AI DataLake Spark allows you to use LakeFormation to manage metadata and authentication (row and column permissions) for Paimon tables. This simplifies data lake governance, enabling unified metadata management, fine-grained permission control, and transactional guarantees. Spark reads and writes to Paimon 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.
Ensure that LakeFormation catalog is located in the same region as the AI Data Lake workspace. Otherwise, they cannot be associated in subsequent processes.
- After a Paimon 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 automatically pre-configures spark.aidatalake.lakehouse.default.format to iceberg.
To set Paimon as the default data directory, set spark.aidatalake.lakehouse.default.format to paimon.
- 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": "your_catalog_name",// Any catalog. "database_name": "default" }, "statement": "SELECT * FROM your_table LIMIT 10", "spark_config": { "spark.aidatalake.lakehouse.default.format": "paimon" } } - 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
- Configuration via the endpoint creation page
Using a Custom Data Catalog
- Paimon does not support views or 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 Paimon catalog, configure spark.sql.catalog.{paimon_catalog_name}=org.apache.paimon.spark.SparkCatalog, where paimon_catalog_name needs to be replaced with your target catalog name.
Configuration methods:
- Configuration via parameters in spark_config of the API For details about the API, see RunSparkJob or RunSparkSql. The following is an example API request:
"endpoint_name": "spark-sql-test", "catalog_context": { "catalog_name": "paimon_catalog_name",//The catalog name must be the same as that in the configuration. This catalog can be used only for Paimon. "database_name": "default" }, "statement": "SELECT * FROM paimon_catalog_name.db.your_table LIMIT 10",//Three-part naming configuration is supported. "spark_config": { "spark.sql.catalog.paimon_catalog_name": "org.apache.paimon.spark.SparkCatalog" } } - Configuration via the endpoint creation or modification page
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot

