gszadovszky opened a new issue, #132:
URL: https://github.com/apache/arrow-java/issues/132

   ### Describe the usage question you have. Please include as many useful 
details as  possible.
   
   
   I'd like to store list of maps. Not sure if I am doing it wrong or there is 
a bug in the implementation.
   Here is my example:
   ```java
   try (ListVector listVector = ListVector.empty("sourceVector", allocator)) {
   
         UnionListWriter listWriter = listVector.getWriter();
   
         listWriter.allocate();
   
         /*
          * [{"one" -> 1, "two" -> 2}, {"three" -> 3}, null, {"four" -> null, 
"five" -> 5}]
          */
   
         listWriter.setPosition(0);
         listWriter.startList();
   
         listWriter.map().startMap(); // <-- exception is thrown from here
         listWriter.map().startEntry();
         listWriter.map().key().varChar().writeVarChar("one");
         listWriter.map().key().integer().writeInt(1);
         listWriter.map().endEntry();
         listWriter.map().startEntry();
         listWriter.map().key().varChar().writeVarChar("two");
         listWriter.map().key().integer().writeInt(2);
         listWriter.map().endEntry();
         listWriter.map().endMap();
   
         listWriter.map().startMap();
         listWriter.map().startEntry();
         listWriter.map().key().varChar().writeVarChar("three");
         listWriter.map().key().integer().writeInt(3);
         listWriter.map().endEntry();
         listWriter.map().endMap();
   
         listWriter.writeNull();
   
         listWriter.map().startMap();
         listWriter.map().startEntry();
         listWriter.map().key().varChar().writeVarChar("four");
         listWriter.map().key().integer().writeNull();
         listWriter.map().endEntry();
         listWriter.map().startEntry();
         listWriter.map().key().varChar().writeVarChar("five");
         listWriter.map().key().integer().writeInt(5);
         listWriter.map().endEntry();
         listWriter.map().endMap();
   
         listWriter.endList();
   ```
   
   When I execute this I'm getting the following exception:
   ```
   java.lang.UnsupportedOperationException: Cannot get simple type for type MAP
        at 
org.apache.arrow.vector/org.apache.arrow.vector.types.Types$MinorType.getType(Types.java:807)
        at 
org.apache.arrow.vector/org.apache.arrow.vector.complex.impl.PromotableWriter.getWriter(PromotableWriter.java:275)
        at 
org.apache.arrow.vector/org.apache.arrow.vector.complex.impl.AbstractPromotableFieldWriter.getWriter(AbstractPromotableFieldWriter.java:80)
        at 
org.apache.arrow.vector/org.apache.arrow.vector.complex.impl.AbstractPromotableFieldWriter.startMap(AbstractPromotableFieldWriter.java:114)
        at 
org.apache.arrow.vector/org.apache.arrow.vector.complex.impl.PromotableWriter.startMap(PromotableWriter.java:53)
   ```
   
   ### 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-unsubscr...@arrow.apache.org.apache.org

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

Reply via email to