Re: [Java] Question About Vector Allocation

2019-11-14 Thread Micah Kornfield
ValueCount include both null and not null values. Perhaps a better name for the method would have been setSize or setLength. On Thursday, November 14, 2019, azim afroozeh wrote: > Thanks for your answer. I have one more question. In this test function for > example ( > https://github.com/apache

Re: [Java] Question About Vector Allocation

2019-11-14 Thread azim afroozeh
Thanks for your answer. I have one more question. In this test function for example ( https://github.com/apache/arrow/blob/master/java/vector/src/test/java/org/apache/arrow/vector/TestValueVector.java#L1524) : there is a for loop which tries to fill in some values but not all values. It leaves som

Re: [Java] Question About Vector Allocation

2019-11-14 Thread Fan Liya
Hi Azim, According to the current API, after filling in some values, you have to set the value count manually (through the setValueCount method). Otherwise, the value count remains 0. Best, Liya Fan On Thu, Nov 14, 2019 at 6:33 PM azim afroozeh wrote: > Thanks for your answer. So the valueCou

Re: [Java] Question About Vector Allocation

2019-11-14 Thread azim afroozeh
Thanks for your answer. So the valueCount shows the number of data filled in the vector. Then I would like to ask you why the valueCount after setting some values is 0? for example: ( https://github.com/apache/arrow/blob/3fbbcdaf77a9e354b6bd07ec1fd1dac005a505c9/java/vector/src/test/java/org/apache

Re: [Java] Question About Vector Allocation

2019-11-08 Thread Fan Liya
Hi Azim, I think we should be aware of two distinct concepts: 1. vector capacity: the max number of values that can be stored in the vector, without reallocation 2. vector length: the number of values actually filled in the vector For any valid vector, we always have vector length <= vector capa

[Java] Question About Vector Allocation

2019-11-08 Thread azim afroozeh
Hi everyone, I have a question about the Java implementation of Apache Arrow. Should we always call setValueCount after creating a vector with allocateNew()? I can see that in some tests where setValueCount is called immediately after allocateNew. For example here: https://github.com/apache/arrow