Skip to content

[Improvement] Decouple ReadBatch lifetime from BatchReader #259

Description

@lxy-9602

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Paimon C++ currently requires a BatchReader to outlive its returned ReadBatch, because batch buffers may use Arrow or ORC memory pools owned by the reader. This lifetime coupling is inconvenient for downstream engines and can cause invalid memory access if the reader is destroyed first.

Solution

Retain the required memory-pool smart pointers in the root ArrowArray, so the batch can safely outlive its reader.
Consumers must keep, move, and release the complete root ArrowArray. Moving individual child arrays out of it is unsupported because child arrays do not retain the memory-pool lifetime independently.

Anything else?

Related discussion: alibaba/paimon-cpp#126

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions