Skip to content

Commit 789c23a

Browse files
committed
Fix serialization also in Insert test to match v1
1 parent da01bfd commit 789c23a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

performance/src/test/com/clickhouse/benchmark/clients/InsertClient.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,22 @@ public void insertV2RowBinary(DataState dataState) {
162162
try (InsertResponse response = clientV2.insert(dataState.tableNameEmpty, out -> {
163163
RowBinaryFormatWriter w = new RowBinaryFormatWriter(out, dataState.dataSet.getSchema(), ClickHouseFormat.RowBinary);
164164
List<ClickHouseColumn> columns = dataState.dataSet.getSchema().getColumns();
165-
for (Map<String, Object> row : dataState.dataSet.getRows()) {
166-
for (ClickHouseColumn column : columns) {
167-
w.setValue(column.getColumnName(),row.get(column.getColumnName()));
165+
for (List<Object> row : dataState.dataSet.getRowsOrdered()) {
166+
int index = 1;
167+
for (Object value : row) {
168+
w.setValue(index, value);
169+
index++;
168170
}
169171
w.commitRow();
170172
}
171173
out.flush();
172174

173-
}, ClickHouseFormat.RowBinaryWithDefaults, new InsertSettings()).get()) {
175+
}, ClickHouseFormat.RowBinaryWithDefaults, new InsertSettings().compressClientRequest(true)).get()) {
174176
response.getWrittenRows();
175177
}
176178
} catch (Exception e) {
177179
LOGGER.error("Error: ", e);
178180
}
179181
}
182+
180183
}

0 commit comments

Comments
 (0)