ParthChonkar opened a new issue, #35275:
URL: https://github.com/apache/arrow/issues/35275

   ### Describe the usage question you have. Please include as many useful 
details as  possible.
   
   
   Hi Arrow community, 
   
   In the VectorSchemaRoot::slice implementation it checks if the slice covers 
the entirety of the root and returns the reference to the same root if so.
   
   ```
       if (index == 0 && length == rowCount) {
         return this;
       }
   ```
   
   Looks like this is done as an optimization to prevent creating another root 
+ transferring to it.
   
   
   Doesn't this optimization make `slice` inconsistent? Sometimes you get back 
a _new_ resource that has to be separately closed and sometimes you get back 
the same root. 
   
   So if you want to calculate something based on a set of different slices of 
your root then you have to manually check whether the current slice you are 
requesting isn't the whole root to avoid closing the original root. 
   
   Since `splitAndTransfer` do no copying of the actual data, is this 
optimization worth this tradeoff? 
   
   
   
   ### Component(s)
   
   Java


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

Reply via email to