lxy-9602 opened a new pull request, #260: URL: https://github.com/apache/paimon-cpp/pull/260
<!-- PR titles must follow Conventional Commits: <type>(<optional-scope>): <description> --> ### Purpose <!-- Linking this pull request to the issue --> Linked issue: close #259 Arrow and ORC buffers may be allocated from memory-pool adaptors owned by BatchReader. Because these buffers still access their allocator when they are released, Paimon previously required the BatchReader to outlive every ReadBatch returned by it. This lifetime constraint couples readers with their returned batches and makes integration with downstream engines inconvenient and error-prone, as described in [alibaba/paimon-cpp#126](https://github.com/alibaba/paimon-cpp/issues/126). This PR removes that lifetime constraint for batches represented through the Arrow C Data Interface. The memory-pool resources used by a batch, including Arrow and ORC pools, are retained by the root ArrowArray. They remain alive until the corresponding ArrowArray::release callback finishes. Therefore, a returned batch can safely outlive its BatchReader. Consumers must treat the root ArrowArray as a complete ownership unit: keep, move, and release the entire structure through the Arrow C Data Interface. Moving individual child arrays out of the root ArrowArray is unsupported because those children do not independently retain the batch’s memory-pool lifetime. <!-- What is the purpose of the change --> ### Tests <!-- List UT and IT cases to verify this change --> ### API and Format API impact: - `TableRead::CreateReader(const std::vector<std::shared_ptr<Split>>&)` is now pure virtual, so concrete TableRead implementations must implement it. - The BatchReader and ReaderBuilder lifetime contracts are explicitly documented. <!-- Does this change affect API in include dir or storage format or protocol --> ### Documentation <!-- Does this change introduce a new feature --> ### Generative AI tooling Generated-by: Codex (GPT-5) <!-- If generative AI tooling has been used in the process of authoring this patch, please include the phrase: 'Generated-by: ' followed by the name of the tool and its version. If no, write 'No'. Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details. --> -- 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]
