@@ -73,8 +73,8 @@ public void testAppendFixedWidthVector() {
7373 target .allocateNew (length1 );
7474 delta .allocateNew (length2 );
7575
76- ValueVectorDataPopulator .setVector (target , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 );
77- ValueVectorDataPopulator .setVector (delta , 10 , 11 , 12 , 13 , 14 );
76+ ValueVectorDataPopulator .setVector (target , 0 , 1 , 2 , 3 , 4 , 5 , 6 , null , 8 , 9 );
77+ ValueVectorDataPopulator .setVector (delta , null , 11 , 12 , 13 , 14 );
7878
7979 VectorAppender appender = new VectorAppender (target );
8080 delta .accept (appender , null );
@@ -83,7 +83,7 @@ public void testAppendFixedWidthVector() {
8383
8484 try (IntVector expected = new IntVector ("expected" , allocator )) {
8585 expected .allocateNew ();
86- ValueVectorDataPopulator .setVector (expected , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 );
86+ ValueVectorDataPopulator .setVector (expected , 0 , 1 , 2 , 3 , 4 , 5 , 6 , null , 8 , 9 , null , 11 , 12 , 13 , 14 );
8787 assertVectorsEqual (expected , target );
8888 }
8989 }
@@ -99,16 +99,16 @@ public void testAppendVariableWidthVector() {
9999 target .allocateNew (5 , length1 );
100100 delta .allocateNew (5 , length2 );
101101
102- ValueVectorDataPopulator .setVector (target , "a0" , "a1" , "a2" , "a3" , "a4" , "a5" , "a6" , "a7" , "a8" , "a9" );
103- ValueVectorDataPopulator .setVector (delta , "a10" , "a11" , "a12" , "a13" , "a14" );
102+ ValueVectorDataPopulator .setVector (target , "a0" , "a1" , "a2" , "a3" , null , "a5" , "a6" , "a7" , "a8" , "a9" );
103+ ValueVectorDataPopulator .setVector (delta , "a10" , "a11" , "a12" , "a13" , null );
104104
105105 VectorAppender appender = new VectorAppender (target );
106106 delta .accept (appender , null );
107107
108108 try (VarCharVector expected = new VarCharVector ("expected" , allocator )) {
109109 expected .allocateNew ();
110110 ValueVectorDataPopulator .setVector (expected ,
111- "a0" , "a1" , "a2" , "a3" , "a4" , "a5" , "a6" , "a7" , "a8" , "a9" , "a10" , "a11" , "a12" , "a13" , "a14" );
111+ "a0" , "a1" , "a2" , "a3" , null , "a5" , "a6" , "a7" , "a8" , "a9" , "a10" , "a11" , "a12" , "a13" , null );
112112 assertVectorsEqual (expected , target );
113113 }
114114 }
@@ -125,7 +125,7 @@ public void testAppendListVector() {
125125 ValueVectorDataPopulator .setVector (target ,
126126 Arrays .asList (0 , 1 ),
127127 Arrays .asList (2 , 3 ),
128- Arrays . asList ( 4 , 5 ) ,
128+ null ,
129129 Arrays .asList (6 , 7 ),
130130 Arrays .asList (8 , 9 ));
131131 assertEquals (length1 , target .getValueCount ());
@@ -147,8 +147,7 @@ public void testAppendListVector() {
147147 expected = Arrays .asList (2 , 3 );
148148 assertEquals (expected , target .getObject (1 ));
149149
150- expected = Arrays .asList (4 , 5 );
151- assertEquals (expected , target .getObject (2 ));
150+ assertTrue (target .isNull (2 ));
152151
153152 expected = Arrays .asList (6 , 7 );
154153 assertEquals (expected , target .getObject (3 ));
@@ -172,7 +171,7 @@ public void testAppendFixedSizeListVector() {
172171 target .allocateNew ();
173172 ValueVectorDataPopulator .setVector (target ,
174173 Arrays .asList (0 , 1 , 2 , 3 , 4 ),
175- Arrays . asList ( 5 , 6 , 7 , 8 , 9 ) );
174+ null );
176175 assertEquals (2 , target .getValueCount ());
177176
178177 delta .allocateNew ();
@@ -187,7 +186,7 @@ public void testAppendFixedSizeListVector() {
187186 assertEquals (4 , target .getValueCount ());
188187
189188 assertEquals (Arrays .asList (0 , 1 , 2 , 3 , 4 ), target .getObject (0 ));
190- assertEquals ( Arrays . asList ( 5 , 6 , 7 , 8 , 9 ), target .getObject (1 ));
189+ assertTrue ( target .isNull (1 ));
191190 assertEquals (Arrays .asList (10 , 11 , 12 , 13 , 14 ), target .getObject (2 ));
192191 assertEquals (Arrays .asList (15 , 16 , 17 , 18 , 19 ), target .getObject (3 ));
193192 }
@@ -204,15 +203,15 @@ public void testAppendStructVector() {
204203 VarCharVector targetChild2 = target .addOrGet ("f1" , FieldType .nullable (new ArrowType .Utf8 ()), VarCharVector .class );
205204 targetChild1 .allocateNew ();
206205 targetChild2 .allocateNew ();
207- ValueVectorDataPopulator .setVector (targetChild1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 );
208- ValueVectorDataPopulator .setVector (targetChild2 , "a0" , "a1" , "a2" , "a3" , "a4" , "a5" , "a6" , "a7" , "a8" , "a9" );
206+ ValueVectorDataPopulator .setVector (targetChild1 , 0 , 1 , 2 , 3 , 4 , null , 6 , 7 , 8 , 9 );
207+ ValueVectorDataPopulator .setVector (targetChild2 , "a0" , "a1" , "a2" , "a3" , "a4" , "a5" , "a6" , null , "a8" , "a9" );
209208 target .setValueCount (length1 );
210209
211210 IntVector deltaChild1 = delta .addOrGet ("f0" , FieldType .nullable (new ArrowType .Int (32 , true )), IntVector .class );
212211 VarCharVector deltaChild2 = delta .addOrGet ("f1" , FieldType .nullable (new ArrowType .Utf8 ()), VarCharVector .class );
213212 deltaChild1 .allocateNew ();
214213 deltaChild2 .allocateNew ();
215- ValueVectorDataPopulator .setVector (deltaChild1 , 10 , 11 , 12 , 13 , 14 );
214+ ValueVectorDataPopulator .setVector (deltaChild1 , 10 , 11 , 12 , null , 14 );
216215 ValueVectorDataPopulator .setVector (deltaChild2 , "a10" , "a11" , "a12" , "a13" , "a14" );
217216 delta .setValueCount (length2 );
218217
@@ -228,9 +227,9 @@ public void testAppendStructVector() {
228227 expected1 .allocateNew ();
229228 expected2 .allocateNew ();
230229
231- ValueVectorDataPopulator .setVector (expected1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 );
230+ ValueVectorDataPopulator .setVector (expected1 , 0 , 1 , 2 , 3 , 4 , null , 6 , 7 , 8 , 9 , 10 , 11 , 12 , null , 14 );
232231 ValueVectorDataPopulator .setVector (expected2 ,
233- "a0" , "a1" , "a2" , "a3" , "a4" , "a5" , "a6" , "a7" , "a8" , "a9" , "a10" , "a11" , "a12" , "a13" , "a14" );
232+ "a0" , "a1" , "a2" , "a3" , "a4" , "a5" , "a6" , null , "a8" , "a9" , "a10" , "a11" , "a12" , "a13" , "a14" );
234233
235234 assertVectorsEqual (expected1 , target .getChild ("f0" ));
236235 assertVectorsEqual (expected2 , target .getChild ("f1" ));
0 commit comments