@@ -95,10 +95,9 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
95
95
// DenseUnion
96
96
List <Field > childFields = new ArrayList <>();
97
97
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 ));
99
99
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 );
102
101
Field [] fields =
103
102
new Field [] {
104
103
Field .nullablePrimitive ("null" , ArrowType .Null .INSTANCE ),
@@ -238,7 +237,11 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
238
237
largeListWriter .integer ().writeInt (1 );
239
238
largeListWriter .endList ();
240
239
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 );
242
245
return root ;
243
246
}
244
247
0 commit comments