You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "davisusanibar (via GitHub)" <gi...@apache.org> on 2024/02/29 10:45:38 UTC

[I] [Java][ListView] Implementation of the ListView [arrow]

davisusanibar opened a new issue, #40289:
URL: https://github.com/apache/arrow/issues/40289

   ### Describe the enhancement requested
   
   C++, Go, and Python all support ListView. The goal of this enhancement is to expand the Arrow Java format input for ListView. 
   
   This could be an initial proposal for ListViewVector based on current LisVector implementation:
   
   **Using ListViewVector:**
   ````
   ...
   // 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], []]
   ...
   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); // (0=index, 0=offset)
   listViewVector.endValue(0, 3); //(0=index, 3=number of items)
   
   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], []]");
   ````
   
   **Using Writers:**
   ````
   // 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], []]
   ...
   UnionListViewWriter writer = inVector.getWriter();
   writer.allocate();
   
   writer.setPosition(0);
   writer.startList(0); // (0=offset)
   writer.bigInt().writeBigInt(12);
   writer.bigInt().writeBigInt(-7);
   writer.bigInt().writeBigInt(25);
   writer.endList(3); // (3=number of items)
   
   
   writer.setPosition(2);
   writer.startList(3);
   writer.bigInt().writeBigInt(0);
   writer.bigInt().writeBigInt(-127);
   writer.bigInt().writeBigInt(127);
   writer.bigInt().writeBigInt(50);
   writer.endList(4);
   
   writer.setPosition(3);
   writer.startList(0);
   writer.endList(0);
   
   writer.setValueCount(4);
   
   ...
   
   assertEquals(inVector.getDataVector().toString(), "[12, -7, 25, 0, -127, 127, 50]");
   assertEquals(inVector.toString(), "[[12,-7,25], null, [0,-127,127,50], []]");
   ````
   
   
   ### Component(s)
   
   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.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

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


Re: [I] [Java][ListView] Implementation of the ListView [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha closed issue #40289: [Java][ListView] Implementation of the ListView
URL: https://github.com/apache/arrow/issues/40289


-- 
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: issues-unsubscribe@arrow.apache.org

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


Re: [I] [Java][ListView] Implementation of the ListView [arrow]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #40289: [Java][ListView] Implementation of the ListView
URL: https://github.com/apache/arrow/issues/40289


-- 
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: issues-unsubscribe@arrow.apache.org

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


Re: [I] [Java][ListView] Implementation of the ListView [arrow]

Posted by "vibhatha (via GitHub)" <gi...@apache.org>.
vibhatha commented on issue #40289:
URL: https://github.com/apache/arrow/issues/40289#issuecomment-2063691567

   Closing this issue in favor of https://github.com/apache/arrow/issues/41271


-- 
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: github-unsubscribe@arrow.apache.org

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