Implement GRPC protocol.#15111
Conversation
5d056cf to
f6a1954
Compare
f6a1954 to
49de752
Compare
6aed8d0 to
62a14e8
Compare
9790b74 to
8af548f
Compare
215fda4 to
c429ce0
Compare
95f5366 to
63e11d8
Compare
…d_unwind@GLIBC_PRIVATE and to fix shared build.
2c4c896 to
4b34889
Compare
|
|
| add_subdirectory (install) | ||
| add_subdirectory (git-import) | ||
|
|
||
| #add_subdirectory (grpc-client) |
There was a problem hiding this comment.
It's an old test which Maria used to test the grpc protocol for the first time. It cannot be build currently. I didn't fix it because grpc protocol can be invoked directly from python so we don't need a C++ client to test in our integration tests that grpc protocol works.
I didn't remove the sources of the target grpc-client because I was thinking about converting it into C++ client like clickhouse-client, but then I wrote a gRPC client in python, so now I don't think we need the target grpc-client and I suppose we can remove it.
| std::unique_ptr<GRPCConnection::GRPC::Stub> stub_; | ||
| }; | ||
|
|
||
| int main(int argc, char** argv) |
There was a problem hiding this comment.
Ok, it's just a test, maybe better move to tests subdirectory somewhere.
| <!-- gRPC protocol (see src/Server/grpc_protos/clickhouse_grpc.proto for the API) | ||
| <grpc_port>9001</grpc_port> | ||
| <grpc> | ||
| <enable_ssl>true</enable_ssl> --> |
There was a problem hiding this comment.
xml doesn't support nested comments.
There was a problem hiding this comment.
Yes, but it looks like you close this comment too early.
There was a problem hiding this comment.
It looks surprising to the reader, I'm sure almost no one will understand it from the first glance.
| @@ -0,0 +1,13 @@ | |||
| #pragma once | |||
There was a problem hiding this comment.
Accidentially committed?
| { | ||
| TCP = 1, | ||
| HTTP = 2, | ||
| GRPC = 3, |
There was a problem hiding this comment.
What about MySQL and PostgreSQL interfaces?
| @@ -0,0 +1,24 @@ | |||
| <yandex> | |||
| <grpc_port>9001</grpc_port> | |||
There was a problem hiding this comment.
Maybe change all ports to 9100?
Because 9001 is often used for second ClickHouse instance if multiple instances are run on the same server.
| <grpc_port>9001</grpc_port> | ||
| <grpc> | ||
| <enable_ssl>true</enable_ssl> --> | ||
|
|
|
There was a small mistake in error-handling in this python script, and you have to install grpcio-tools: |
|
Wow, it works! Does not look polished though: |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category:
Changelog entry:
Implement gRPC protocol in ClickHouse.
For the specification of the protocol see clickhouse_grpc.proto
To use the protocol first set
grpc_portin the main configuration file, and then you can either write a client in any of the programming languages supported by gRPC by using the provided schema or use the built-in client utils/grpc-client/clickhouse-grpc-client.py. The built-in client is operated very likely toclickhouse-client, for exampleand so on. Without parameters it runs the built-in client in the interactive mode.
The implementation of gRPC protocol also supports compression, SSL, getting progress and logs, authentication, parallel queries through the same channel, cancellation of queries, sessions, external tables.
performance comparison
This PR is to finish the work started by @mnkonkova (#10136)