-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP API for query #2241
Comments
nice RFC! a few small things:
Regards! |
One common way to cancel a http query is to send another kill query command with the previous query id. |
+1, it would be more restful: creating a query by POST verb created a Query resource like |
clickhouse support it by default (if wait_end_of_query is not set)by return chunked body,for user it is like reading a socket file. pagination is another way |
return raw data as a whole is convenient when use the data to draw graph, no/less additional processing in middle. |
Summary
Support query with sql over http API like clickhouse HTTP Interface.
why we need it
more deal coming soon,after discussing face to face
what is NOT discussed here
the first 2 cases need many rest endpoints, it can take full advantage of rest api. we can discuss it in another issue if needed.
query api need a few endspoints and is more complicated.
a brief summary of clickhouse http API
clickhouse HTTP Interface.
2 kind of endpoints
http body is raw data (or sql with data in request), with specified format
sync response
begin receiving data when buffer_size is reached
session
other features
The problem with clickhouse http API
clickhouse HTTP apiis special since it sends raw data in the body instead of embeding in json. This is efficient, straight forward, and works well in most queries, but leads to some problems.
https://github.com/ClickHouse/ClickHouse/labels/comp-http
if we want to get result early(!wait_end_of_query), error may occur after the response code 200 is sent. currently err message is appended to data. solutions in issues:
from the discussions in issues they are swing to grpc instead of solving these problems.
possible metadatas
http api of other databases
Most db only use http api for management, only a few support query with sql via http.
snowflake
presto (trino, treasure data)
kylin
google bigquery and spanner
very different features from clickhouse:
body is json and data as its field, both in req and resp
async and pagination (both return a handler for further fetch)
Async if long time no result
pros
cons:
multi statements in a request (snowflake only) i.e. batching
example scenarios
pros
cons:
unique requestID to ensure idempotent behavior for queries
features for discussion
we can start with a MVP, but need to make these decisions soon or later.
Some already discussed above.
The text was updated successfully, but these errors were encountered: