You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/08 20:19:23 UTC

[GitHub] [arrow] jjbskir opened a new pull request #9142: Add Java ListVector Documentation

jjbskir opened a new pull request #9142:
URL: https://github.com/apache/arrow/pull/9142


   Added documentation for the Java [ListVector](https://arrow.apache.org/docs/java/reference/org/apache/arrow/vector/complex/ListVector.html) class. I found using it to be difficult with out any concrete examples.  


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] liyafan82 commented on pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#issuecomment-761930945


   Merging. Thanks for your effort @jjbskir 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] jjbskir commented on a change in pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
jjbskir commented on a change in pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#discussion_r555825490



##########
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 9 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:
       Hey yea that is a possibility. We can always write in the docs that the values can be added in arbitrary order. Or instead of using a for loop to add the values we can have some predefined arrays we want to add in that have arbitrary order like: [[1, 2, 3], [3, 2, 1], [10, 30, 20]]. Also looking at the [tests for ListVector](https://github.com/apache/arrow/blob/25c736d48dc289f457e74d15d05db65f6d539447/java/vector/src/test/java/org/apache/arrow/vector/TestListVector.java) it looks like they all use ascending order. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] jjbskir commented on a change in pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
jjbskir commented on a change in pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#discussion_r555264027



##########
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:
       Hey, thanks for the catch, I will update the PR. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #9142: Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#issuecomment-756979343






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] liyafan82 commented on a change in pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on a change in pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#discussion_r555720151



##########
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 9 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:
       The values of each index can be in arbitrary orders. This example may confuse the readers?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] liyafan82 commented on a change in pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on a change in pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#discussion_r556215050



##########
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 9 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:
       Sure. I see you point. It makes sense. 
   Maybe here we should not stress that the values are in increasing order?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#issuecomment-756988361


   https://issues.apache.org/jira/browse/ARROW-11193


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] jjbskir commented on pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
jjbskir commented on pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#issuecomment-762928618


   Hey @liyafan82 wanted to check how often do you guys rebuild the docs for this page? https://arrow.apache.org/docs/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.

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



[GitHub] [arrow] kiszk commented on a change in pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [arrow] liyafan82 commented on pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
liyafan82 commented on pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#issuecomment-763363508


   > Hey @liyafan82 wanted to check how often do you guys rebuild the docs for this page? https://arrow.apache.org/docs/java/
   
   @jjbskir The website should be updated after the next release.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] jjbskir commented on a change in pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
jjbskir commented on a change in pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#discussion_r556574396



##########
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 9 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:
       Sounds good I will update the docs to reflect this. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #9142: Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9142:
URL: https://github.com/apache/arrow/pull/9142#issuecomment-756979343


   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   Thanks for opening a pull request!
   
   Could you open an issue for this pull request on JIRA?
   https://issues.apache.org/jira/browse/ARROW
   
   Then could you also rename pull request title in the following format?
   
       ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}
   
   See also:
   
     * [Other pull requests](https://github.com/apache/arrow/pulls/)
     * [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] liyafan82 closed pull request #9142: ARROW-11193: [Java][Documentation] Add Java ListVector Documentation

Posted by GitBox <gi...@apache.org>.
liyafan82 closed pull request #9142:
URL: https://github.com/apache/arrow/pull/9142


   


----------------------------------------------------------------
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:
users@infra.apache.org