@@ -136,6 +136,74 @@ public void testBoundedSenderMixedNullablePaddingPreservesRowsAndPacketLimit() t
136136 });
137137 }
138138
139+ @ Test
140+ public void testUnboundedSenderOmittedNullableAndNonNullableColumnsPreservesRows () throws Exception {
141+ assertMemoryLeak (() -> {
142+ List <ScenarioRow > rows = Arrays .asList (
143+ row ("t" , sender -> sender .table ("t" )
144+ .longColumn ("x" , 1 )
145+ .stringColumn ("s" , "alpha" )
146+ .symbol ("sym" , "one" )
147+ .atNow (),
148+ "x" , 1L ,
149+ "s" , "alpha" ,
150+ "sym" , "one" ),
151+ row ("t" , sender -> sender .table ("t" )
152+ .stringColumn ("s" , "beta" )
153+ .atNow (),
154+ "x" , Long .MIN_VALUE ,
155+ "s" , "beta" ,
156+ "sym" , null ),
157+ row ("t" , sender -> sender .table ("t" )
158+ .longColumn ("x" , 3 )
159+ .atNow (),
160+ "x" , 3L ,
161+ "s" , null ,
162+ "sym" , null )
163+ );
164+
165+ RunResult result = runScenario (rows , 0 );
166+
167+ Assert .assertEquals (1 , result .sendCount );
168+ assertRowsEqual (expectedRows (rows ), decodeRows (result .packets ));
169+ });
170+ }
171+
172+ @ Test
173+ public void testBoundedSenderOmittedNonNullableColumnsPreservesRowsAndPacketLimit () throws Exception {
174+ assertMemoryLeak (() -> {
175+ String alpha = repeat ('a' , 256 );
176+ String beta = repeat ('b' , 192 );
177+ String omega = repeat ('z' , 256 );
178+ List <ScenarioRow > rows = Arrays .asList (
179+ row ("mix" , sender -> sender .table ("mix" )
180+ .longColumn ("x" , 1 )
181+ .stringColumn ("msg" , alpha )
182+ .atNow (),
183+ "x" , 1L ,
184+ "msg" , alpha ),
185+ row ("mix" , sender -> sender .table ("mix" )
186+ .stringColumn ("msg" , beta )
187+ .atNow (),
188+ "x" , Long .MIN_VALUE ,
189+ "msg" , beta ),
190+ row ("mix" , sender -> sender .table ("mix" )
191+ .longColumn ("x" , 3 )
192+ .stringColumn ("msg" , omega )
193+ .atNow (),
194+ "x" , 3L ,
195+ "msg" , omega )
196+ );
197+
198+ int maxDatagramSize = fullPacketSize (rows ) - 1 ;
199+ RunResult result = runScenario (rows , maxDatagramSize );
200+
201+ Assert .assertTrue ("expected at least one auto-flush" , result .packets .size () > 1 );
202+ assertPacketsWithinLimit (result , maxDatagramSize );
203+ assertRowsEqual (expectedRows (rows ), decodeRows (result .packets ));
204+ });
205+ }
206+
139207 @ Test
140208 public void testBoundedSenderArrayReplayPreservesRowsAndPacketLimit () throws Exception {
141209 assertMemoryLeak (() -> {
@@ -552,6 +620,40 @@ public void testSchemaChangeAfterOutOfOrderExistingColumnsPreservesRows() throws
552620 });
553621 }
554622
623+ @ Test
624+ public void testBoundedSenderSchemaFlushThenOmittedNullableColumnsPreservesRows () throws Exception {
625+ assertMemoryLeak (() -> {
626+ List <ScenarioRow > rows = Arrays .asList (
627+ row ("schema" , sender -> sender .table ("schema" )
628+ .longColumn ("x" , 1 )
629+ .stringColumn ("s" , "alpha" )
630+ .atNow (),
631+ "x" , 1L ,
632+ "s" , "alpha" ),
633+ row ("schema" , sender -> sender .table ("schema" )
634+ .symbol ("sym" , "new" )
635+ .longColumn ("x" , 2 )
636+ .stringColumn ("s" , "beta" )
637+ .atNow (),
638+ "sym" , "new" ,
639+ "x" , 2L ,
640+ "s" , "beta" ),
641+ row ("schema" , sender -> sender .table ("schema" )
642+ .longColumn ("x" , 3 )
643+ .atNow (),
644+ "sym" , null ,
645+ "x" , 3L ,
646+ "s" , null )
647+ );
648+
649+ RunResult result = runScenario (rows , 1024 * 1024 );
650+
651+ Assert .assertEquals (2 , result .sendCount );
652+ assertPacketsWithinLimit (result , 1024 * 1024 );
653+ assertRowsEqual (expectedRows (rows ), decodeRows (result .packets ));
654+ });
655+ }
656+
555657 @ Test
556658 public void testSymbolBoundary16383To16384PreservesRowsAndPacketLimit () throws Exception {
557659 assertMemoryLeak (() -> {
0 commit comments