ClickHouse / ClickHouse/clickhouse-java

Query Parameters Refactor

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

説明

**Description:**

In the current implementation, clickhouse-java manually parses query parameters, supporting both traditional question marks and named parameters. We propose refactoring this process to leverage ClickHouse's [parameters binding capabilities](https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters) for a more streamlined and efficient parameter parsing.

This refactoring aligns with the methods used by other connectors, including:

- [Python client](https://github.com/ClickHouse/clickhouse-connect/blob/6928aed5845c944007b6bf93e806313a96a93fbc/clickhouse_connect/driver/query.py#L370)
- [JS client](https://github.com/ClickHouse/clickhouse-js/blob/bc310bb529763d503ec75609d2b569956ad3b73f/packages/client-common/src/utils/url.ts#L65)
- [Go client](https://github.com/ClickHouse/clickhouse-go/blob/main/query_parameters.go#L33)

All of these clients have comprehensive test suites ([Python](https://github.com/ClickHouse/clickhouse-connect/blob/99681d98eeb2106a54c298a6d320906977d3e4cc/tests/integration_tests/test_params.py), [JS](https://github.com/ClickHouse/clickhouse-js/blob/927ca276d4d41d44e6b36b4315c5143a3467258a/packages/client-common/__tests__/unit/format_query_params.test.ts), and [Go](https://github.com/ClickHouse/clickhouse-go/blob/main/tests/query_parameters_test.go)) that can serve as valuable references for testing the proposed refactoring.

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

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

調査の方向性

clickhouse-java における現在のクエリパラメーターの解析および binding の実装から始めてください。この issue ではローカルファイルが指定されていません。Python query.py、JS url.ts、Go query_parameters.go と動作を比較し、その後、リンクされたパラメーターテストファイルを参照として使用してください。従来型パラメーターと名前付きパラメーターが ClickHouse binding を通じて処理され、それに対応する Java のテストカバレッジが存在すれば完了です。

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

評価

技術スタック
java
領域
databases
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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