jianguotian opened a new pull request, #73: URL: https://github.com/apache/paimon-mosaic/pull/73
## Purpose `MosaicWriter.write(VectorSchemaRoot)` exports incoming Arrow batches through the Arrow C Data interface. Arrow 15's `Data.exportVectorSchemaRoot` reloads the fields into a temporary root struct, which cannot reload buffers owned by an independent allocator root into the writer allocator. Support those batches without moving or reassociating their buffers: keep the existing same-root path, export cross-root fields directly, and retain temporary Arrow C Data metadata under the writer allocator. Make failed cross-root exports rollback-safe so an allocator OOM or partial child export does not retain input buffers. This is the focused upstream version of `jianguotian/paimon-mosaic#12`, squashed onto the current Apache `main` branch. ## Changes - Recursively validate that all top-level and nested input vectors share one input allocator root. - Keep same-root batches on the existing `Data.exportVectorSchemaRoot` path. - Export cross-root schemas and field arrays directly while charging temporary C Data metadata to the writer allocator. - Release all successfully exported children and temporary metadata when a later cross-root export step fails. - Document the synchronous batch lifetime, allocator-root requirement, and writer-owned metadata accounting. - Keep the native writer API, Rust codec, and on-disk format unchanged. ## Tests - JDK 8: 55 tests passed, 0 failed, 0 errors, 0 skipped. - JDK 11: 55 tests passed, 0 failed, 0 errors, 0 skipped. - Covered independent roots, same-root accounting, sequential roots, nested mixed-root validation, writer allocator OOM retry, and partial child-export rollback. - `cargo fmt --all -- --check` passed. - `git diff --check` passed. -- 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]
