nbruno commented on a change in pull request #9151:
URL: https://github.com/apache/arrow/pull/9151#discussion_r565605138



##########
File path: java/vector/src/main/codegen/templates/StructWriters.java
##########
@@ -64,6 +64,11 @@
       case LIST:
         list(child.getName());
         break;
+      case MAP:{
+        org.apache.arrow.vector.types.pojo.ArrowType.Map arrowType = 
(org.apache.arrow.vector.types.pojo.ArrowType.Map) child.getType();

Review comment:
       Done, I think I saw somewhere else fully-qualifying these imports, but 
yes it's imported and unnecessary, so I removed it.

##########
File path: java/vector/src/main/codegen/templates/StructWriters.java
##########
@@ -184,6 +189,44 @@ public ListWriter list(String name) {
     return writer;
   }
 
+  @Override
+  public MapWriter map(String name) {
+    // returns existing writer
+    final FieldWriter writer = fields.get(handleCase(name));
+    Preconditions.checkNotNull(writer);
+    return writer;
+  }
+
+  @Override
+  public MapWriter map(String name, boolean keysSorted) {
+    FieldWriter writer = fields.get(handleCase(name));
+    if(writer == null) {
+      ValueVector vector;
+      ValueVector currentVector = container.getChild(name);
+      MapVector v = container.addOrGet(name,
+          new FieldType(addVectorAsNullable,
+            new org.apache.arrow.vector.types.pojo.ArrowType.Map(keysSorted)

Review comment:
       Done

##########
File path: 
java/vector/src/test/java/org/apache/arrow/vector/complex/writer/TestComplexWriter.java
##########
@@ -546,6 +548,54 @@ private void checkUnionList(ListVector listVector) {
     }
   }
 
+  @Test
+  public void testListMapType() {
+    try (ListVector listVector = ListVector.empty("list", allocator)) {
+      listVector.allocateNew();
+      UnionListWriter listWriter = new UnionListWriter(listVector);
+      MapWriter innerMapWriter = listWriter.map(true);

Review comment:
       Done




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


Reply via email to