This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-java.git
The following commit(s) were added to refs/heads/main by this push:
new 5b6ee220 GH-447: Port fix from apache/arrow that was missed (#475)
5b6ee220 is described below
commit 5b6ee220175bebcd4585314cc7af88017b74451c
Author: David Li <[email protected]>
AuthorDate: Fri Jan 3 20:26:06 2025 -0500
GH-447: Port fix from apache/arrow that was missed (#475)
https://github.com/apache/arrow/commit/ded148c2ef5dd441a3b6ab9496d0ed0aeb940f71
was merged after the migration.
Fixes #447.
---
.../src/test/java/org/apache/arrow/dataset/TestAllTypes.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java
b/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java
index 0edc4282..79800f35 100644
--- a/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java
+++ b/dataset/src/test/java/org/apache/arrow/dataset/TestAllTypes.java
@@ -95,10 +95,9 @@ public class TestAllTypes extends TestDataset {
// DenseUnion
List<Field> childFields = new ArrayList<>();
childFields.add(
- new Field("int-child", new FieldType(true, 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),
@@ -238,7 +237,11 @@ public class TestAllTypes extends TestDataset {
largeListWriter.integer().writeInt(1);
largeListWriter.endList();
- ((StructVector) root.getVector("struct")).getChild("int-child",
IntVector.class).set(1, 1);
+ IntVector intChildVector =
+ ((StructVector) root.getVector("struct")).getChild("int-child",
IntVector.class);
+ // Non-nullable vector, make sure to fill all slots
+ intChildVector.set(0, 0);
+ intChildVector.set(1, 1);
return root;
}