ClickHouse / ClickHouse/clickhouse-rs

Feature Support: Generic Query, How to get schema and data while query?

Open
#53 5 comments 2 reactions 0 assignees View on GitHub
need-example
Dominant language
Rust
Stars
559
Forks
172
Avg merge
1d 19h
Merged PRs (30d)
3

Description

Hi,
Clickhouse is an OLAP database and I want to make a generic query engine where users can enter any query SQL and return query results, including returning schema and data, and then the application layer displays the data. When querying, the user does not have to specify the data type.

The query result is a two-dimensional data, where one array is the column name and the other data is also a two-dimensional data, e.g., but the schema is not fixed

```json
{
"schema": ["id","name", "age","birthday"],
"data": [
["20", ”james1, "18", "2000-01-01"],
["21", ”james2, "19", "2000-01-01"],
["22", ”james2, "10", "2000-01-01"],
["23", ”james4, "30", "2000-01-01"],
["24", ”james5, "26", "2000-01-01"]
...
]
}
```

How to do that? thanks.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the repository’s query API and how ClickHouse responses expose column names and rows. Determine whether arbitrary SQL can return both schema and two-dimensional data without caller-supplied types, then define the API shape and completion criteria; the issue names no files or tests, so repository exploration is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.