vibhatha commented on code in PR #41731:
URL: https://github.com/apache/arrow/pull/41731#discussion_r1609854779
##########
java/vector/src/test/java/org/apache/arrow/vector/TestStructVector.java:
##########
@@ -82,6 +89,44 @@ public void testMakeTransferPair() {
}
}
+ @Test
+ public void testStructVectorWithExtensionTypes() {
+ TestExtensionType.UuidType uuidType = new TestExtensionType.UuidType();
+ Field uuidField = new Field("struct_child", FieldType.nullable(uuidType),
null);
+ Field structField = new Field("struct", FieldType.nullable(new
ArrowType.Struct()), List.of(uuidField));
+ StructVector s1 = new StructVector(structField, allocator, null);
+ StructVector s2 = (StructVector) structField.createVector(allocator);
+ s1.close();
+ s2.close();
+ }
+
+ @Test
+ public void testStructVectorTransferPairWithExtensionType() {
+ TestExtensionType.UuidType uuidType = new TestExtensionType.UuidType();
+ Field uuidField = new Field("uuid_child", FieldType.nullable(uuidType),
null);
+ Field structField = new Field("struct", FieldType.nullable(new
ArrowType.Struct()), List.of(uuidField));
+
+ StructVector s1 = (StructVector) structField.createVector(allocator);
+ TestExtensionType.UuidVector uuidVector =
+ s1.addOrGet("uuid_child", FieldType.nullable(uuidType),
TestExtensionType.UuidVector.class);
+ s1.setValueCount(1);
+ uuidVector.set(0, new UUID(1, 2));
+ s1.setIndexDefined(0);
+
+ TransferPair tp = s1.getTransferPair(structField, allocator);
+ final StructVector toVector = (StructVector) tp.getTo();
+ assertEquals(s1.getField(), toVector.getField());
+ assertEquals(s1.getField().getChildren().get(0),
toVector.getField().getChildren().get(0));
+ // also fails but probably another issue
Review Comment:
Yes, I also debugged the code. It seems the copy didn't work properly. I
guess you're still not finished with this work, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]