@@ -175,6 +175,32 @@ public void testSerializeArray() throws IOException {
175
175
0x63 , 0 , 2 , 1 , 0 ));
176
176
}
177
177
178
+ @ Test (groups = { "unit" })
179
+ public void testSerializeBoolean () throws IOException {
180
+ ClickHouseConfig config = new ClickHouseConfig ();
181
+
182
+ ClickHouseValue value = ClickHouseArrayValue .of (new Boolean [][] { new Boolean [] { true , false } });
183
+ ByteArrayOutputStream bas = new ByteArrayOutputStream ();
184
+ ClickHouseOutputStream out = ClickHouseOutputStream .of (bas );
185
+ ClickHouseRowBinaryProcessor .getMappedFunctions ().serialize (value , config ,
186
+ ClickHouseColumn .of ("a" , "Array(Array(Boolean))" ), out );
187
+ out .flush ();
188
+ Assert .assertEquals (bas .toByteArray (), BinaryStreamUtilsTest .generateBytes (1 , 2 , 1 , 0 ));
189
+
190
+ boolean [] nativeBoolArray = new boolean [3 ];
191
+ nativeBoolArray [0 ] = true ;
192
+ nativeBoolArray [1 ] = false ;
193
+ nativeBoolArray [2 ] = true ;
194
+
195
+ ClickHouseValue value2 = ClickHouseArrayValue .of (new boolean [][]{nativeBoolArray });
196
+ ByteArrayOutputStream bas2 = new ByteArrayOutputStream ();
197
+ ClickHouseOutputStream out2 = ClickHouseOutputStream .of (bas2 );
198
+ ClickHouseRowBinaryProcessor .getMappedFunctions ().serialize (value2 , config ,
199
+ ClickHouseColumn .of ("a" , "Array(Array(boolean))" ), out2 );
200
+ out2 .flush ();
201
+ Assert .assertEquals (bas2 .toByteArray (), BinaryStreamUtilsTest .generateBytes (1 , 3 , 1 , 0 , 1 ));
202
+ }
203
+
178
204
@ Test (groups = { "unit" })
179
205
public void testDeserializeMap () throws IOException {
180
206
ClickHouseConfig config = new ClickHouseConfig ();
0 commit comments