Performance of clickhouse-client
is far better than clickhouse-jdbc
where we do have preparedStatment for batchInsert. But how can we do Batch insert using clickhouse-client
.
try (ClickHouseClient client = ClickHouseClient.newInstance(preferredProtocol);
ClickHouseResponse response = client.connect(server)
.format(preferredFormat)
.query("insert query")
.params("param for insert query").execute().get()) {
}
}
As http request is stateless and single but is there any other class or way to have batch insert OR we need to dynamically build insert query with multiple VALUES as parameters for query statement?