| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Provides shareCopy (shared memory), transferCopy (move ownership), and deepCopy (independent clone) for both FieldVector and VectorSchemaRoot, implemented purely via getFieldBuffers/loadFieldBuffers without depending on TransferPair.
…semantics Use the new VectorOps.shareCopy to fix the unsafe shared-reference bug in addVector/removeVector while preserving the original intended semantics: both source and result roots remain usable with the same data, and memory is only released when all sharing roots are closed. Also applies Spotless formatting fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thank you for opening a pull request! Please label the PR with one or more of:
Also, add the 'breaking-change' label if appropriate. See CONTRIBUTING.md for details. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Introduces VectorOps, a new utility class in org.apache.arrow.vector.util that provides three generic whole-vector operations:
These operations work generically across all vector types via getFieldBuffers()/loadFieldBuffers(), requiring no per-type implementation -- unlike TransferPair, which must be implemented by every vector type. VectorOps can replace TransferPair for whole-vector operations; TransferPair remains necessary for sub-range splitting/slicing (splitAndTransfer).
This PR also uses shareCopy to fix the unsafe shared-reference bug in VectorSchemaRoot.addVector() and removeVector() (see #1142). The original implementation shared raw object references between source and result roots, meaning closing one would invalidate the other. The fix preserves the original intended semantics (both roots remain readable) while making it safe through proper reference counting.
Closes #1142
Test plan
Made with Cursor