[ 
https://issues.apache.org/jira/browse/ARROW-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16236324#comment-16236324
 ] 

ASF GitHub Bot commented on ARROW-1663:
---------------------------------------

BryanCutler commented on a change in pull request #1193: ARROW-1663: use 
consistent name for null and not-null in FixedSizeLis…
URL: https://github.com/apache/arrow/pull/1193#discussion_r148620454
 
 

 ##########
 File path: 
java/vector/src/test/java/org/apache/arrow/vector/pojo/TestConvert.java
 ##########
 @@ -65,6 +71,43 @@ public void complex() {
   }
 
   @Test
+  public void list() throws Exception {
+    ImmutableList.Builder<Field> childrenBuilder = ImmutableList.builder();
+    try (BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
+         ListVector writeVector = ListVector.empty("list", allocator)) {
+      Field listVectorField = writeVector.getField();
+      childrenBuilder.add(listVectorField);
+    }
+    try (BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE);
+         FixedSizeListVector writeVector = 
FixedSizeListVector.empty("fixedlist", 5, allocator)) {
+      Field listVectorField = writeVector.getField();
+      childrenBuilder.add(listVectorField);
+    }
+
+    Field initialField = new Field("a", FieldType.nullable(Struct.INSTANCE), 
childrenBuilder.build());
+    ImmutableList.Builder<Field> parentBuilder = ImmutableList.builder();
+    parentBuilder.add(initialField);
+    FlatBufferBuilder builder = new FlatBufferBuilder();
+    builder.finish(initialField.getField(builder));
+    org.apache.arrow.flatbuf.Field flatBufField = 
org.apache.arrow.flatbuf.Field.getRootAsField(builder.dataBuffer());
+    Field finalField = Field.convertField(flatBufField);
+    assertEquals(initialField, finalField);
+    assertTrue(!finalField.toString().contains(Field.ZEROVECTOR_OLD_NAME));
+
+
+    Schema initialSchema = new Schema(parentBuilder.build());
+    String jsonSchema = initialSchema.toJson();
+    String modifiedSchema = jsonSchema.replace("$data$", "[DEFAULT]");
+
+    Schema tempSchema = Schema.fromJSON(modifiedSchema);
+    FlatBufferBuilder schemaBuilder = new FlatBufferBuilder();
+    org.apache.arrow.vector.types.pojo.Schema schema = new 
org.apache.arrow.vector.types.pojo.Schema(tempSchema.getFields());
+    schemaBuilder.finish(schema.getSchema(schemaBuilder));
+    Schema finalSchema = 
Schema.deserialize(ByteBuffer.wrap(schemaBuilder.sizedByteArray()));
+    assertTrue(!finalSchema.toString().contains(Field.ZEROVECTOR_OLD_NAME));
 
 Review comment:
   assertFalse instead

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> [Java] Follow up on ARROW-1347 and make schema backward compatible
> ------------------------------------------------------------------
>
>                 Key: ARROW-1663
>                 URL: https://issues.apache.org/jira/browse/ARROW-1663
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Java - Vectors
>            Reporter: Yuliya Feldman
>            Assignee: Yuliya Feldman
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>
> ARROW-1347 covered ListVector to have name of the field $data$ instead of 
> [DEFAULT]
> We left FixedSizeListVector behind.
> Another case is backward compatibility - if schema was created before 
> ARROW-1347 was in place  application may still suffer from side effects as it 
> would not be updated based on new code.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to