File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
vector/src/test/java/org/apache/arrow/vector/complex/impl Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -805,4 +805,29 @@ public void testExtensionType() throws Exception {
805805 assertEquals (u2 , uuidVector .getObject (1 ));
806806 }
807807 }
808+
809+ @ Test
810+ public void testExtensionTypeForList () throws Exception {
811+ try (final ListVector container = ListVector .empty (EMPTY_SCHEMA_PATH , allocator );
812+ final UuidVector v =
813+ (UuidVector ) container .addOrGetVector (FieldType .nullable (new UuidType ())).getVector ();
814+ final PromotableWriter writer = new PromotableWriter (v , container )) {
815+ UUID u1 = UUID .randomUUID ();
816+ UUID u2 = UUID .randomUUID ();
817+ container .allocateNew ();
818+ container .setValueCount (1 );
819+ writer .addExtensionTypeWriterFactory (new UuidWriterFactory ());
820+
821+ writer .setPosition (0 );
822+ writer .writeExtension (u1 );
823+ writer .setPosition (1 );
824+ writer .writeExtension (u2 );
825+
826+ container .setValueCount (2 );
827+
828+ UuidVector uuidVector = (UuidVector ) container .getDataVector ();
829+ assertEquals (u1 , uuidVector .getObject (0 ));
830+ assertEquals (u2 , uuidVector .getObject (1 ));
831+ }
832+ }
808833}
You can’t perform that action at this time.
0 commit comments