davisusanibar commented on code in PR #318:
URL: https://github.com/apache/arrow-cookbook/pull/318#discussion_r1308869910
##########
java/source/data.rst:
##########
@@ -23,6 +23,69 @@ Recipes related to compare, filtering or transforming data.
.. contents::
+Append VectorSchemaRoots
+========================
+
+In some cases, VectorSchemaRoot needs to be modeled as a container. To
accomplish
+this, you can use ``VectorSchemaRootAppender.append``. The following code
reads a
+Parquet file with three row groups, gets the three vectors separately, and then
+appends the three vectors together:
Review Comment:
Updated
##########
java/source/data.rst:
##########
@@ -23,6 +23,69 @@ Recipes related to compare, filtering or transforming data.
.. contents::
+Append VectorSchemaRoots
+========================
+
+In some cases, VectorSchemaRoot needs to be modeled as a container. To
accomplish
+this, you can use ``VectorSchemaRootAppender.append``. The following code
reads a
+Parquet file with three row groups, gets the three vectors separately, and then
+appends the three vectors together:
+
+There will be another cases of integration w
+
+.. testcode::
+
+ import org.apache.arrow.memory.BufferAllocator;
+ import org.apache.arrow.memory.RootAllocator;
+ import org.apache.arrow.vector.IntVector;
+ import org.apache.arrow.vector.VectorSchemaRoot;
+ import org.apache.arrow.vector.util.VectorSchemaRootAppender;
+
+ try (
+ BufferAllocator allocator = new RootAllocator()
+ ) {
+ VectorSchemaRoot result = null;
+ try (
+ IntVector appenderOne = new IntVector("column",
+ allocator);
+ IntVector appenderTwo = new IntVector("column",
+ allocator)
+ ) {
+ appenderOne.allocateNew(2);
+ appenderOne.set(0, 100);
+ appenderOne.set(1, 20);
+ appenderOne.setValueCount(2);
+ appenderTwo.allocateNew(2);
+ appenderTwo.set(0, 34);
+ appenderTwo.set(1, 75);
+ appenderTwo.setValueCount(2);
+ try (
+ final VectorSchemaRoot rootOne = new VectorSchemaRoot(
+ Collections.singletonList(appenderOne));
+ final VectorSchemaRoot rootTwo = new VectorSchemaRoot(
+ Collections.singletonList(appenderTwo))
+ ) {
Review Comment:
Updated
##########
java/source/data.rst:
##########
@@ -23,6 +23,69 @@ Recipes related to compare, filtering or transforming data.
.. contents::
+Append VectorSchemaRoots
+========================
+
+In some cases, VectorSchemaRoot needs to be modeled as a container. To
accomplish
+this, you can use ``VectorSchemaRootAppender.append``. The following code
reads a
+Parquet file with three row groups, gets the three vectors separately, and then
+appends the three vectors together:
+
+There will be another cases of integration w
Review Comment:
Deleted
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]