ClickHouse / ClickHouse/clickhouse-java

How to use ClientV2 and ExternalTable

Đang mở
#2,397 2 bình luận 0 reaction 1 người được giao Được @chernser nhận Xem trên GitHub
client-api-v2 question v2-feedback
Ngôn ngữ chính
Java
Star
1.6k
Fork
636
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
29

Mô tả

I need an example how to use ClientV2 and ExternalTable

For example I have a simple query `select * from numbers(10) where number in ExternalTable;`

```java
final Client client = new Client.Builder().setUsername("default").setPassword("").addEndpoint("http://localhost:8123/")
.build();

final String sql = "select * from numbers(10) where number in ExternalTable";
QueryResponse response = client.query(sql).get(3, TimeUnit.SECONDS);
ClickHouseBinaryFormatReader reader = client.newBinaryFormatReader(response);
while (reader.hasNext()) {
reader.next();
System.out.println(reader.getLong("number"));
}
```

And I need to pass `1\n\2\n3` as `ExternalTable`.

Like here https://github.com/ClickHouse/clickhouse-java/blob/bed84eecaf34fd959ef10df35ec73912991d5047/clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java#L570

Or here https://github.com/ClickHouse/clickhouse-java/issues/891

https://clickhouse.com/docs/engines/table-engines/special/external-data

I need it because I want to pass a list with 200k values and a query size (SQL length) without using the external data is bigger than 1Mb.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.