foosekis4j opened a new pull request, #11209:
URL: https://github.com/apache/paimon/pull/11209

   ### Purpose
   
   #9762 lets an external engine replace primary-key compaction through 
`CompactRewriterFactory`. The factory receives Paimon's default rewriter for 
the bucket, but not the `KeyValueFileWriterFactory` that rewriter writes 
through. That factory is a protected field of `MergeTreeCompactRewriter`. So a 
custom rewriter has to rebuild, for its partition and bucket, the file IO, the 
key and value types, and the per-level `DataFilePathFactory` that Paimon 
already built, just to find its input files and place its output where Paimon 
would.
   
   This PR adds `MergeTreeCompactRewriter#writerFactory()`, which returns that 
factory. It also adds a paragraph about it to the Java writing guide, next to 
the hook's contract. It does not change behaviour.
   
   We use it from an out-of-tree GPU rewriter, which today has to read the 
field from a class placed in Paimon's package.
   
   ### Tests
   
   
`CompactRewriterFactoryTest#testDefaultRewriterExposesItsBucketWriterFactory`: 
a factory takes the writer factory from the default rewriter. After a write, 
compaction and commit, the test checks that it has the table's value type and 
that its path factories locate every committed data file.
   
   ```bash
   mvn -pl paimon-core -Pflink1 -DwildcardSuites=none \
     -Dtest=CompactRewriterFactoryTest,MergeTreeCompactManagerFactoryTest \
     -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false install
   ```
   
   JDK 21: `CompactRewriterFactoryTest` 10/10, 
`MergeTreeCompactManagerFactoryTest` 4/4. Spotless, checkstyle and enforcer ran 
as part of the build.
   
   ---
   **AI Disclosure**
   - Model: Claude Opus 5.5
   - Platform/Tool: Claude Code
   - Human Oversight: partially reviewed
   - Prompt Summary: expose the default rewriter's writer factory to 
`CompactRewriterFactory` implementations, with a test and a docs note
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to