liyafan82 commented on pull request #8214:
URL: https://github.com/apache/arrow/pull/8214#issuecomment-695873809


   @josiahyan Thank you for the additional details. 
   
   I think one of your concern is that, the underlying buffers can be changed 
unintentionally, which lefts the vector in an inconsistent state (Please 
correct me if my understanding is incorrect, or if I have missed something). 
   
   IMO, we encourage users to manipulate vectors through standard APIs (e.g. 
get/set/setSafe, etc. ). However, unintended manipulations are always possible, 
because the getXXXBuffer APIs are there. More fundamentally, the buffers are 
all based on off-heap memory, so if the user has the memory address, they can 
manipulate the buffer data at will. 
   
   So I think what we should do is to design and implement the APIs to try 
making vectors in a consistent state, and if the vector falls into an 
inconsistent state, we should trap it with minimal cost. 
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to