[
https://issues.apache.org/jira/browse/ARROW-2199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16386481#comment-16386481
]
ASF GitHub Bot commented on ARROW-2199:
---------------------------------------
siddharthteotia commented on a change in pull request #1646: ARROW-2199: [JAVA]
Control the memory allocated for inner vectors in containers.
URL: https://github.com/apache/arrow/pull/1646#discussion_r172281369
##########
File path: java/vector/src/main/codegen/templates/UnionVector.java
##########
@@ -282,6 +282,7 @@ private void reallocTypeBuffer() {
long newAllocationSize = baseSize * 2L;
newAllocationSize = BaseAllocator.nextPowerOfTwo(newAllocationSize);
+ newAllocationSize = Math.max(newAllocationSize, 1);
Review comment:
The only thing we want to ensure is that if realloc is starting with
existing capacity as 0, the caller should not run into an infinite loop and
that's why we do max and set it to 1 if needed. Adding an assertion sounds fine
but that implicitly asks for removing the setting to math.max (blah, 1). I am
suggesting to keep the max setting but I don't have a strong opinion
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [JAVA] Follow up fixes for ARROW-2019. Ensure density driven capacity is
> never less than 1 and propagate density throughout the vector tree
> -------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ARROW-2199
> URL: https://issues.apache.org/jira/browse/ARROW-2199
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Java - Vectors
> Reporter: Siddharth Teotia
> Assignee: Siddharth Teotia
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.9.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)