davisusanibar opened a new pull request, #40290: URL: https://github.com/apache/arrow/pull/40290
### Rationale for this change Arrow Java implementation for https://github.com/apache/arrow/pull/37877 ### What changes are included in this PR? **As a proposal:** Create ListViewVector that inherits from ListVector, mainly for adding new sizes buffer, then allocating nullability, offsetbuffer, sizesbuffer, and child data vector. ListViewVector overrides functionality such as: allocateNew, startNewValue, endValue, setValueCount, getObject, and getWriter. **These are the main activities:** - [x] Add ListViewVector datatype support - [x] Add builders support using Vector - [x] Add builders support using Writer - [ ] Improve error handling rules (ie 0 <= offsets[i] + size[i] <= length of the child array) - [ ] Add operations to supportTransferPair - [ ] Add operations to support Nested ListViewVector - [ ] Add LargeListViewVector datatype support - [x] Unit test for builders support using Vector - [x] Unit test for builders support using Writers - [ ] Increase coverage unit test - [ ] Update documentation ### Are these changes tested? Every commit adding new functionality is accompanied by unit tests. ```` public void testListView() throws Exception { // values = [12, -7, 25, 0, -127, 127, 50] // offsets = [0, 7, 3, 0] // sizes = [3, 0, 4, 0] // data to get thru listview: [[12,-7,25], null, [0,-127,127,50], []] try (ListViewVector listViewVector = ListViewVector.empty("input", allocator); IntVector inVector = (IntVector) listViewVector.addOrGetVector(FieldType.nullable(Types.MinorType.INT.getType())) .getVector()) { listViewVector.allocateNew(); inVector.allocateNew(); inVector.setSafe(0, 12); inVector.setSafe(1, -7); inVector.setSafe(2, 25); inVector.setSafe(3, 0); inVector.setSafe(4, -127); inVector.setSafe(5, 127); inVector.setSafe(6, 50); listViewVector.startNewValue(0, 0); listViewVector.endValue(0, 3); listViewVector.setNull(1); listViewVector.startNewValue(2, 3); listViewVector.endValue(2, 4); listViewVector.startNewValue(3, 0); listViewVector.endValue(3, 0); listViewVector.setValueCount(4); assertEquals(inVector.toString(), "[12, -7, 25, 0, -127, 127, 50]"); assertEquals(listViewVector.toString(), "[[12,-7,25], null, [0,-127,127,50], []]"); } } ```` ### Are there any user-facing changes? No -- 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]
