I use clickhouse server in docker with just 1 table and several rows in it. I can request all the data in default format with clickhouse client (over TCP) or with some GUI tool like DBeaver (over HTTP).
SELECT * FROM some_table;
Also I can change format to something special:
SELECT * FROM some_table FORMAT Pretty;
I want to request data from clickhouse in protobuf format. Query looks like this:
SELECT * FROM some_table FORMAT Protobuf SETTINGS format_schema = 'proto_file:ProtoStructure';
I have the proto_file.proto
in the same directory with clickhouse-client, so I can made TCP request throw it (successful).
But I don't know data structure of TCP request to reproduce it in my program by myself. So I tried to execute the same request in HTTP (through DBeaver) to intercept request and reproduce it. Unfortunately I can't execute script in DBeaver properly, because it complains on proto_file.proto
(File not found
, I don't know where to place it to make it work). The only thing I known, that format is specified by X-Clickhouse-Format
HTTP header, but I don't know and can't find any info about where in HTTP request I should place content of proto file.
So, the main question: Is there any examples of pure HTTP request to clickhouse for protobuf data output format?