You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ParthChonkar (via GitHub)" <gi...@apache.org> on 2023/05/08 15:08:38 UTC

[GitHub] [arrow] ParthChonkar commented on a diff in pull request #35476: GH-35275: [Java] Ensure VectorSchemaRoot slice returns a new root

ParthChonkar commented on code in PR #35476:
URL: https://github.com/apache/arrow/pull/35476#discussion_r1187562298


##########
java/vector/src/main/java/org/apache/arrow/vector/VectorSchemaRoot.java:
##########
@@ -327,10 +327,6 @@ public VectorSchemaRoot slice(int index, int length) {
     Preconditions.checkArgument(index + length <= rowCount,
         "index + length should <= rowCount");
 
-    if (index == 0 && length == rowCount) {
-      return this;

Review Comment:
   For each vector `splitAndTransfer` will derive a new ArrowBuffer (unlike `transfer`) for the vector's underlying buffer(s) so it won't invalidate the original root. But both will point to the same memory location. 



-- 
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: github-unsubscribe@arrow.apache.org

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