ClickHouse / ClickHouse/clickhouse-java

[client-v2] Allow QuerySettings in POJO queryAll overloads

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

説明

Hi! This is my first issue in this repository, so apologies if I did not formulate the idea perfectly.

I'm also not completely sure whether this API change is technically appropriate or possible. There may be a reason why `QuerySettings` cannot or should not be passed to the POJO `queryAll` overloads. If so, I would be happy to understand the reasoning.

### Description

The experimental POJO `queryAll` API currently does not provide an overload that accepts `QuerySettings`.

Current overloads:

```java
queryAll(String sqlQuery, Class clazz, TableSchema schema)

queryAll(
String sqlQuery,
Class clazz,
TableSchema schema,
Supplier allocator
)
```

Internally, the method creates its own QuerySettings:

```java
QuerySettings settings =
new QuerySettings()
.setFormat(ClickHouseFormat.RowBinaryWithNamesAndTypes);
```

Because of that, callers cannot provide query/server settings such as:

- limit
- page
- max_execution_time
- query id
- database
- other operation-level server settings

At the same time, queryAll for GenericRecord already accepts QuerySettings and copies the supplied settings while forcing the response format to RowBinaryWithNamesAndTypes.

It would be useful if the POJO overloads supported the same behavior.

Proposed API

For example:
```java

public List queryAll(
String sqlQuery,
Class clazz,
TableSchema schema,
QuerySettings settings
)

public List queryAll(
String sqlQuery,
Class clazz,
TableSchema schema,
QuerySettings settings,
Supplier allocator
)

```
The response format should still be controlled internally by queryAll, since POJO deserialization depends on RowBinaryWithNamesAndTypes.

In other words, the provided settings could be copied and then:

```java
requestSettings.setFormat(
ClickHouseFormat.RowBinaryWithNamesAndTypes
);
```

This would keep POJO deserialization safe while allowing callers to use settings such as pagination, execution limits, query id, database, etc.

Why

This would make the POJO queryAll API consistent with the existing GenericRecord queryAll API and would avoid forcing callers to reimplement the POJO deserialization path only to pass custom QuerySettings.

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

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

調査の方向性

Locate the experimental client-v2 POJO queryAll overloads and the existing GenericRecord queryAll overload that accepts QuerySettings. Read those entry points first, then inspect the surrounding queryAll tests. Done means both proposed POJO overloads accept copied settings while still forcing RowBinaryWithNamesAndTypes, with coverage for the supported settings and deserialization behavior.

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

評価

技術スタック
clickhouse, java
領域
api
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

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

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