Skip to content

Commit 31cbcde

Browse files
committed
Merge branch 'main' into feat_compression_support
2 parents 4971f35 + 5a49f48 commit 31cbcde

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

client-v2/src/test/java/com/clickhouse/client/query/QueryTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ ClickHouseFormat[] getRowBinaryFormats() {
215215
@Test(groups = {"integration"}, dataProvider = "rowBinaryFormats")
216216
public void testRowBinaryQueries(ClickHouseFormat format)
217217
throws ExecutionException, InterruptedException {
218-
final int rows = 1;
218+
final int rows = 3;
219219
// TODO: replace with dataset with all primitive types of data
220220
// TODO: reusing same table name may lead to a conflict in tests?
221221

@@ -229,11 +229,15 @@ public void testRowBinaryQueries(ClickHouseFormat format)
229229
ClickHouseBinaryFormatReader reader = createBinaryFormatReader(queryResponse, settings, tableSchema);
230230

231231
Iterator<Map<String, Object>> dataIterator = data.iterator();
232+
int rowsCount = 0;
232233
while (dataIterator.hasNext()) {
233234
Map<String, Object> expectedRecord = dataIterator.next();
234235
Map<String, Object> actualRecord = reader.next();
235236
Assert.assertEquals(actualRecord, expectedRecord);
237+
rowsCount++;
236238
}
239+
240+
Assert.assertEquals(rowsCount, rows);
237241
}
238242

239243
private static ClickHouseBinaryFormatReader createBinaryFormatReader(QueryResponse response, QuerySettings settings,
@@ -272,6 +276,7 @@ public void testBinaryStreamReader() throws Exception {
272276
schema.addColumn("col3", "String");
273277
schema.addColumn("host", "String");
274278
ClickHouseBinaryFormatReader reader = createBinaryFormatReader(queryResponse, settings, schema);
279+
int rowsCount = 0;
275280
while (reader.next() != null) {
276281
String hostName = reader.readValue("host");
277282
Long col1 = reader.readValue("col1");
@@ -282,8 +287,9 @@ public void testBinaryStreamReader() throws Exception {
282287
Assert.assertEquals(reader.readValue(1), col1);
283288
Assert.assertEquals(reader.readValue(2), col3);
284289
Assert.assertEquals(reader.readValue(3), hostName);
290+
rowsCount++;
285291
}
286-
292+
Assert.assertEquals(rowsCount, 10);
287293
Assert.assertFalse(reader.hasNext());
288294
Assert.assertNull(reader.next());
289295
}

0 commit comments

Comments
 (0)