kiszk commented on a change in pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#discussion_r554915754
##########
File path: docs/source/java/vector.rst
##########
@@ -217,6 +217,55 @@ to be declared is that writer/reader is not as efficient
as direct access
}
}
+Building ListVector
+==================
+
+A :class:`ListVector` is a vector that holds a list of values for each index.
Working with one you need to handle the same steps as mentioned above (create >
allocate > mutate > set value count > access > clear), but the details of how
you accomplish this are slightly different since you need to both create the
vector and set the list of values for each index.
+
+For example, the code below shows how to build a :class:`ListVector` of int's
using the writer :class:`UnionListWriter`. We build a vector from 0 to 10 and
each index contains a list with increasing values [[0, 0, 0, 0, 0], [0, 1, 2,
3, 4], [0, 2, 4, 6, 8], …, [0, 9, 18, 27, 36]].
Review comment:
nit: `0 to 10` -> `0 to 9` ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]