@@ -95,10 +95,9 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
9595 // DenseUnion
9696 List <Field > childFields = new ArrayList <>();
9797 childFields .add (
98- new Field ("int-child" , new FieldType ( true , new ArrowType .Int (32 , true ), null , null ), null ));
98+ new Field ("int-child" , FieldType . notNullable ( new ArrowType .Int (32 , true )), null ));
9999 Field structField =
100- new Field (
101- "struct" , new FieldType (true , ArrowType .Struct .INSTANCE , null , null ), childFields );
100+ new Field ("struct" , FieldType .nullable (ArrowType .Struct .INSTANCE ), childFields );
102101 Field [] fields =
103102 new Field [] {
104103 Field .nullablePrimitive ("null" , ArrowType .Null .INSTANCE ),
@@ -238,7 +237,11 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
238237 largeListWriter .integer ().writeInt (1 );
239238 largeListWriter .endList ();
240239
241- ((StructVector ) root .getVector ("struct" )).getChild ("int-child" , IntVector .class ).set (1 , 1 );
240+ IntVector intChildVector =
241+ ((StructVector ) root .getVector ("struct" )).getChild ("int-child" , IntVector .class );
242+ // Non-nullable vector, make sure to fill all slots
243+ intChildVector .set (0 , 0 );
244+ intChildVector .set (1 , 1 );
242245 return root ;
243246 }
244247
0 commit comments