ClickHouse / ClickHouse/clickhouse-java

Example of migration from ClickHouseRowBinaryStream

オープン
#2,239 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
client-api-v2 enhancement question
主要言語
Java
スター
1.6k
フォーク
636
平均マージ
2日 23時間
マージ済み PR(30日)
29

説明

### Use case
For users, migrating from old client

### Describe the solution you'd like
...

### Describe the alternatives you've considered
...

### Additional context
I have code, that insert `(UUID, UUID, UUID, byte[])` objects with `clickhouse-jdbc:0.3.1-patch`:
```java
@Override
protected ProcessorResult send(List events) throws BackendServiceFailedException {
var sentEvents = new LinkedList();
try (ClickHouseStatement statement = this.connection.createStatement()) {
statement.write().send(
"INSERT INTO tracing_spans_local (trace_id, parent_span_id, span_id, payload)",
stream -> {
for (var event : events) {
write(stream, sinkEvent.getInternalEvent())
}
},
ClickHouseFormat.RowBinary);

@Override
protected boolean write(ClickHouseRowBinaryStream stream, Event event) throws IOException {
// ...
stream.writeUUID(traceId.get());
stream.writeUUID(parentSpanId.orElse(DEFAULT_UUID));
stream.writeUUID(spanId.get());
stream.writeUnsignedLeb128(event.getBytes().length);
stream.writeBytes(event.getBytes());
```

Now I'm trying to updage to `client-v2:0.8.2` and have no idea how to rewrite this. Tried to use `RowBinaryFormatWriter`, but it looks very complex and have no docs. Probably, it's not for client use?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by comparing the old ClickHouseRowBinaryStream usage with the client-v2 RowBinaryFormatWriter entry point and the JDBC client API mentioned in the issue. Document the equivalent migration for UUIDs, the length-prefixed payload, and byte data, with a complete example showing how the insert is sent.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
clickhouse, java
領域
api, documentation
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。