ClickHouse / ClickHouse/clickhouse-rs

User-Agent: product info added by `clickhouse-ext-arrow` ends up ahead of the application's product info

Open
#469 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
559
Forks
172
Avg merge
1d 19h
Merged PRs (30d)
3

Description

### Describe the bug

`clickhouse-ext-arrow` adds `clickhouse-ext-arrow/` to the product info inside `fetch_arrow()` (and the Arrow insert paths). Because `clickhouse` renders product info last-added-first, this tag lands **in front of the application's own product info**. The application appears first on plain statements and second on Arrow statements, so the `/ / …` convention breaks and `system.query_log.http_user_agent` is hard to filter on.

There is no way for the application (or a driver like `adbc_clickhouse`) to fix this from the outside: `fetch_arrow` consumes the `Query` and sends it right away, and the `User-Agent` header is written last, so `with_header` cannot override it.

### Steps to reproduce
1. `Client::default().with_product_info("myapp", "1.0")`
2. Run a `CREATE TABLE` (or any non-Arrow statement) and a `SELECT … .fetch_arrow()`
3. Compare `http_user_agent` for both in `system.query_log`

### Expected behaviour

The application's product info is first on every statement, library tags follow:

```
myapp/1.0 clickhouse-ext-arrow/0.1.0 clickhouse-rs/0.15.2 (lv:rust/1.89.0; os:macos)
```

### Query log

Same session, grouped by statement type (application here is dbt through `adbc_clickhouse`):

```
-- CREATE / INSERT / DROP / ALTER …
dbt/2.0.0-rc.1 adbc_clickhouse/0.1.1 clickhouse-rs/0.15.2 (lv:rust/1.89.0; os:macos)

-- SELECT / DESCRIBE via fetch_arrow()
clickhouse-ext-arrow/0.1.0 dbt/2.0.0-rc.1 adbc_clickhouse/0.1.1 clickhouse-rs/0.15.2 (lv:rust/1.89.0; os:macos)
```

### Configuration
#### Environment
* Client version: `clickhouse` 0.15.2, `clickhouse-ext-arrow` 0.1.0
* OS: macOS

#### ClickHouse server
* ClickHouse Server version: 26.3.12.3

Contributor guide

Open the contributing guide

Research direction

Start at fetch_arrow() and the Arrow insert paths that add product information, then inspect how Query is consumed and how the User-Agent header is assembled. Reproduce the plain-statement and Arrow requests from the issue and compare system.query_log.http_user_agent. Done means the application product info remains first while clickhouse-ext-arrow follows consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.