Skip to content

Commit

Permalink
Try fix for JNI test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Dec 4, 2024
1 parent 450410a commit bb71157
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,9 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
// DenseUnion
List<Field> childFields = new ArrayList<>();
childFields.add(
new Field(
"int-child", new FieldType(false, new ArrowType.Int(32, true), null, null), null));
new Field("int-child", FieldType.notNullable(new ArrowType.Int(32, true)), null));
Field structField =
new Field(
"struct", new FieldType(true, ArrowType.Struct.INSTANCE, null, null), childFields);
new Field("struct", FieldType.nullable(ArrowType.Struct.INSTANCE), childFields);
Field[] fields =
new Field[] {
Field.nullablePrimitive("null", ArrowType.Null.INSTANCE),
Expand Down Expand Up @@ -239,7 +237,11 @@ private VectorSchemaRoot generateAllTypesVector(BufferAllocator allocator) {
largeListWriter.integer().writeInt(1);
largeListWriter.endList();

((StructVector) root.getVector("struct")).getChild("int-child", IntVector.class).set(1, 1);
var intChildVector =
((StructVector) root.getVector("struct")).getChild("int-child", IntVector.class);
// set a non-null value at index 0 since the field is not nullable
intChildVector.set(0, 0);
intChildVector.set(1, 1);
return root;
}

Expand Down

0 comments on commit bb71157

Please sign in to comment.