Skip to content

Commit 5b6ee22

Browse files
authored
GH-447: Port fix from apache/arrow that was missed (#475)
apache/arrow@ded148c was merged after the migration. Fixes #447.
1 parent 8a08ecf commit 5b6ee22

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)