You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/09/13 18:37:45 UTC

[GitHub] [arrow] lidavidm opened a new issue, #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

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

   ### Describe the enhancement requested
   
   ListVector (or really, its abstract base class) adds an [overload of `setInitialCapacity`](https://github.com/apache/arrow/blob/15a8ac3ce4e3ac31f9f361770ad4a38c69102aa1/java/vector/src/main/java/org/apache/arrow/vector/complex/BaseRepeatedValueVector.java#L168-L206) that also preallocates the inner vector based on the "density" of the list items. However sometimes you know the number of inner elements up front, so it would be clearer (and less error-prone) to just tell the vector this fact. 
   
   You could do this by manipulating the inner vector directly but given we have the other overload, this one also makes sense.
   
   ### 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: issues-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow] lidavidm commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1725428441

   Fair point; we could give the latter a different name? Or we could cancel this and have @davisusanibar document how to explicitly set the list and child capacities separately.


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


[GitHub] [arrow] jduo commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1724098624

   take


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


[GitHub] [arrow] jduo commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1724505549

   This seems like adding a setInitialCapacity(int, int) overload for specifying the exact number of elements in each inner list.


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


[GitHub] [arrow] lidavidm commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1724133669

   There's a `setInitialCapacity` (linked above) that also sets the child vector's capacity at the same time, but only works off an estimate of the child vector's capacity; it would make sense to also have a version that is exact


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


[GitHub] [arrow] lidavidm commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1724523121

   Yes, except I think the latter parameter would be the total number of elements across all lists


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


[GitHub] [arrow] jduo commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1724566474

   Hmm, that seems error prone though. That there's a setInitialCapacity(int, double) where the last parameter is the density/elements per list and another that's setInitialCapacity(int, int) where the last parameter is the total number of elements across all lists.


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


[GitHub] [arrow] lidavidm closed issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity
URL: https://github.com/apache/arrow/issues/37703


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

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


[GitHub] [arrow] jduo commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1726189076

   I'm favoring creating a separate method setInitialTotalCapacity() or something along those lines.


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


[GitHub] [arrow] lidavidm commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1726193702

   Sounds good to me.


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


[GitHub] [arrow] jduo commented on issue #37703: [Java] Add ListVector#setInitialCapacity overload that takes an exact inner capacity

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on issue #37703:
URL: https://github.com/apache/arrow/issues/37703#issuecomment-1724100884

   Not sure if I follow this issue. There is already setInitialCapacity(int numRecords) on both BaseRepeatedValueVector and ListVector so I'm not clear on what's missing.


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