[feature](paimon) Paimon JNI write support v1#65364
Closed
suxiaogang223 wants to merge 11 commits into
Closed
Conversation
This document covers: - Paimon Java SDK vs Rust write path analysis - Doris external table write framework analysis - IPaimonWriteBackend abstraction layer design - Dual backend (JNI + FFI) interchangeable architecture - Structured Thrift CommitMessage design - v1 implementation plan with 7 steps Co-Authored-By: Claude <noreply@anthropic.com>
Add TPaimonTableSink, TPaimonCommitMessage, TPaimonWriteBackendType, TPaimonWriteMode to DataSinks.thrift. Register PAIMON_TABLE_SINK in TDataSinkType and TDataSink. Co-Authored-By: Claude <noreply@anthropic.com>
- Add IPaimonWriteBackend/IPaimonWriter/IPaimonCommitter interfaces - Implement JniPaimonWriteBackend (full JNI bridge with Arrow IPC) - Add FfiPaimonWriteBackend stub (returns NotSupported for all ops) - Add VPaimonTableWriter (AsyncResultWriter, buffer management) - Register PaimonTableSinkOperatorX in pipeline_fragment_context - Add RuntimeState::add_paimon_commit_messages() for commit coordination The abstraction layer ensures Rust FFI backend can be added in v2 without changing upper-layer code (VPaimonTableWriter, Pipeline Operator). Co-Authored-By: Claude <noreply@anthropic.com>
- Add paimon_commit_messages field to TReportExecStatusParams - Wire RuntimeState::paimon_commit_messages() into RPC params - VPaimonTableWriter::close() collects TPaimonCommitMessage and forwards them to RuntimeState Co-Authored-By: Claude <noreply@anthropic.com>
Add Nereids plan nodes and planner support for Paimon write: - LogicalPaimonTableSink and PhysicalPaimonTableSink - LogicalPaimonTableSinkToPhysicalPaimonTableSink implementation rule - PaimonTableSink planner (generates TPaimonTableSink Thrift) - PlanType, SinkVisitor, RuleType enum entries NOTE: FE compilation could not be verified due to Maven repository connectivity issues. The following wiring remains for a complete build: - BindSink.java: add bindPaimonTableSink method - PhysicalPlanTranslator.java: add visitPhysicalPaimonTableSink - UnboundPaimonTableSink.java: create stub/analyzer node - PaimonTransaction.java: FE-side commit coordinator Co-Authored-By: Claude <noreply@anthropic.com>
Implement the Java-side JNI entry point for Paimon write: - open(): load table, init writer with bucket mode and spill support - write(): Arrow IPC Stream -> VectorSchemaRoot -> Paimon InternalRow - prepareCommit(): flush, serialize CommitMessage via DPCM framing - abort()/close(): resource cleanup Supported types: all Paimon primitives, DECIMAL, TIMESTAMP, ARRAY, MAP, STRUCT. Supports fixed-bucket mode via RowKeyExtractor. v1 explicitly rejects HASH_DYNAMIC, KEY_DYNAMIC, and POSTPONE_MODE. Added arrow-vector dependency for Arrow IPC deserialization. Co-Authored-By: Claude <noreply@anthropic.com>
Add Paimon transaction support: - PaimonTransaction: receives TPaimonCommitMessage from BE, deserializes DPCM payloads, executes StreamTableCommit.filterAndCommit() for idempotent commit, supports rollback via committer.abort() - PaimonTransactionManager + PaimonInsertExecutor: plug into the existing transaction framework (same pattern as Iceberg) - Wire paimon_commit_messages in Coordinator and LoadProcessor - Wire PaimonInsertExecutor in InsertIntoTableCommand - Add PAIMON to TransactionType enum Co-Authored-By: Claude <noreply@anthropic.com>
Add missing Nereids integration pieces: - UnboundPaimonTableSink: unbound analyzer node for INSERT INTO paimon - BindSink: add bindPaimonTableSink() method and binding rule - PhysicalPlanTranslator: add visitPhysicalPaimonTableSink() - SinkVisitor: add visitUnboundPaimonTableSink() method - PlanType: add LOGICAL_UNBOUND_PAIMON_TABLE_SINK - RuleType: add BINDING_INSERT_PAIMON_TABLE Also adds missing imports for Paimon types across SinkVisitor, BindSink, and PhysicalPlanTranslator. Verified compilation: fe-thrift + paimon-scanner both pass. Co-Authored-By: Claude <noreply@anthropic.com>
Fix import ordering, NeedBraces, DeclarationOrder, MissingJavadoc across all Paimon FE files. Zero checkstyle violations across all Paimon-related modules (fe-core, fe-connector-paimon, etc.). Verified: mvn compile passes checkstyle phase for all Paimon code. Remaining compilation errors in fe-core are pre-existing master issues unrelated to this change. Co-Authored-By: Claude <noreply@anthropic.com>
Remove Section 12 (v1 implementation plan) since all implementation steps have been completed. Update version and status. v1 implementation: 30+ files, ~4000 lines of code across: - Thrift definitions (DataSinks.thrift, FrontendService.thrift) - BE abstraction layer (IPaimonWriteBackend + JNI + FFI stub) - BE VPaimonTableWriter + Pipeline Operator - BE->FE RPC commit message transport - FE Planner (Nereids integration) - Java PaimonJniWriter (Arrow IPC deserialization + Paimon SDK) - FE Transaction coordinator (PaimonTransaction) - All checkstyle violations fixed (0 errors) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the v1 of Paimon JNI write support for Doris, based on the architecture design in
PAIMON_WRITE_DESIGN.md.Architecture
The implementation follows a layered architecture with an abstraction layer (
IPaimonWriteBackend) that allows future Rust FFI backend to be plugged in without changing upper-layer code.Changes (10 commits, 30+ files, ~4000 lines)
Verified
Design Highlights
🤖 Generated with Claude Code