Guidelines for AI coding assistants working with the Apache Paimon codebase.
Identify the table mode before explaining storage, reads, updates, or compaction. Paimon shares schema, snapshot, and manifest metadata across different data layouts; it must not be described as universally LSM-based.
| Mode | Data organization and read semantics |
|---|---|
| Ordinary append table | Stores inserted rows without primary-key merging. |
| Primary-key table | Uses an LSM-based layout to reconcile record versions by key. |
| Data Evolution append table | Aligns column files by row-ID range and selects current column values by file version, independently of primary-key LSM merging. |
Data Evolution requires data-evolution.enabled=true, row-tracking.enabled=true, no primary
key, and bucket=-1. It supports partial-column updates that retain files for untouched columns.
Its column merging and compaction must not be explained as primary-key LSM merging. A
bucket-0 directory, sequence-number metadata, or compaction alone does not imply an LSM layout.
For architecture and file-layout comparisons, cover Data Evolution explicitly rather than using the primary-key layout as the model for all Paimon tables. Distinguish table metadata and row reconstruction from the configurable physical file format.
Start with Basic Concepts,
Data Evolution, and
File Layout and Reads.
Verify implementation details in AppendOnlyFileStoreTable, DataEvolutionSplitRead,
DataEvolutionReadPlanner, and SchemaValidation under paimon-core/src/main/java/org/apache/paimon/.
- Based on JDK 8 and Scala 2.12, higher version syntax features must not be used.
Prefer the smallest possible build/test scope and use the speedup techniques below to keep feedback loops fast.
- Compile a single module:
mvn -pl <module> -DskipTests compile - Compile multiple modules:
mvn -pl <module1>,<module2> -DskipTests compile
Prefer running the narrowest tests.
- Single method:
mvn -pl <module> -DwildcardSuites=none -Dtest=TestClassName#methodName test - Single class:
mvn -pl <module> -DwildcardSuites=none -Dtest=TestClassName test
Scala tests use scalatest-maven-plugin, not surefire. Use -DwildcardSuites and -Dtest=none:
mvn -pl paimon-spark/paimon-spark-ut -am -Pfast-build -DfailIfNoTests=false \
-DwildcardSuites=org.apache.paimon.spark.sql.WriteMergeSchemaTest \
-Dtest=none test- Spark tests: add
-Pspark3or-Pspark4 - Flink tests: add
-Pflink1or-Pflink2
For example, run a Java test in the Spark UT with Spark 3:
mvn -pl paimon-spark/paimon-spark-ut -am -Pfast-build -Pspark3 \
-DwildcardSuites=none \
-DfailIfNoTests=false \
-Dtest=SparkChainTableITCase#testChainTable testUse -Pfast-build to skip checkstyle, spotless, enforcer, and rat checks (not for final verification):
mvn -pl <module> -Pfast-build -Dtest=TestClassName#methodName testUse -am if your target module depends on locally changed modules. Add -DfailIfNoTests=false to avoid failures for modules without tests:
mvn -pl <module> -am -Pfast-build -DfailIfNoTests=false -Dtest=TestClassName#methodName test