Commit Graph

83717 Commits

Author SHA1 Message Date
Robert Schulze
514d4d2187
Implement ProtobufList - fixes ClickHouse#16436
Introduce IO format "ProtobufList" with protobuf schema

    // schemafile.proto
    message Envelope {
      message MessageType {
        uint32 colA = 1;
        string colB = 2;
      }
      repeated MessageType mt = 1;
    }

where "Envelope" is a hard-coded/expected top-level message and
"MessageType" is a message with user-provided name containing the table
fields to export/import, e.g.

    SELECT * FROM db1.tab1 FORMAT ProtobufList SETTINGS format_schema =
    'schemafile:MessageType'

As a result, the new format wraps a list of messages (one per row) into
a single, containing message. Compare that to the schema of the existing
IO formats "Protobuf" and "ProtobufSingle":

    message MessageType {
      uint32 colA = 1;
      string colB = 2;
    }

The new format does not save space compared to the existing formats, but
it is conceptually a bit more beautiful and also more convenenient.

Implementation details:

- Created new files ProtobufList(Input|Output)Format which use the
  existing ProtobufSerializer mechanism. The goal was to reuse as much
  code as possible and avoid copypasta.

- I was torn between inheriting from I(Input|Output)Format vs.
  IRow(Input|Output)Format for ProtobufList(Input|Output)Format. The
  former is chunk-based which can be better for performance. Since the
  ProtobufSerializer mechanism is row-based but data is generally passed
  around in chunks, I decided for the latter to leverage the existing
  chunk <--> row mapping code in IRow(InputOutput)Format.

- A new ProtobufSerializer called ProtobufSerializerEnvelope was
  introduced (--> ProtobufSerializer.cpp). It represents the top-level
  message which encloses the list of inner nested messages, i.e. the
  rows.

- With the new format, parsing the schema file and matching the fields in
  the schema file to table column works like for the old formats. The only
  difference is that parsing starts one level below the "Envelope" (-->
  ProtobufSchema.cpp). This is more natural than forcing customers to
  have table columns start with "Envelope".

- Creation of the ProtobufSerializer tree also works like before. What
  is different is that we finally add a ProtobufSerializerEnvelope as
  new root of the tree. It's only purpose is to write/read the top-level
  message for the first/last row to write/read.

Caveats:

- The low-level serialization code in ProtobufWriter uses an internal
  buffer which is flushed to the output file only in endMessage().
  In the existing "Protobuf" format, this happens once per row, in the
  new format this happens only at the end of the serialization
  since row-level messages now call start/endNestedMessage(). As a
  future TODO to, the buffer should be flushed also in
  start/endNestedMessage() to reduce memory consumption.
2022-03-14 08:04:58 +01:00
Robert Schulze
f0ba39b071
Clean up some header includes and make formatting more consistent 2022-03-13 20:24:12 +01:00
Filatenkov Artur
af4362e40a
Improve certificate reloader (#34887)
* add ec support

* Add test

* fix tests and improve code style
2022-02-28 21:30:02 +03:00
Kseniia Sumarokova
3881f6a806
Merge pull request #34923 from azat/client-stop-multiquery-on-SIGINT
Stop processing multiqueries in clickhouse-client/local on SIGINT
2022-02-28 15:57:44 +01:00
Kruglov Pavel
011813957d
Merge pull request #34938 from azat/create-as-ignore-ttl
Ignore per-column TTL in CREATE TABLE AS if new table engine does not support it
2022-02-28 16:58:15 +03:00
Vladimir C
1149a49d79
Merge pull request #34902 from snar/freebsd-memory-tracking 2022-02-28 13:58:33 +01:00
Vladimir C
9bceba5aa8
Merge pull request #34907 from kssenii/sqlite-db-allow-no-existing-db 2022-02-28 12:21:43 +01:00
Kseniia Sumarokova
7edef29f78
Merge pull request #34935 from xlwh/fix_comments_style
Fix some code comments style
2022-02-28 12:12:47 +01:00
Azat Khuzhin
f66ad2ee48 Stop processing multiqueries in clickhouse-client/local on SIGINT
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 12:19:13 +03:00
Azat Khuzhin
895c40686c Tiny cleanup of ClientBase
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 12:19:13 +03:00
Azat Khuzhin
067df156eb Use proper exit value on exit by signal (like in glibc)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 12:19:13 +03:00
Hongbin
c9bc442114
fix comments 2022-02-28 16:44:35 +08:00
Hongbin
d117ce4893
fix comments 2022-02-28 16:31:58 +08:00
Azat Khuzhin
644f9168fa Ignore per-column TTL in CREATE TABLE AS if new table engine does not support it
Follow-up for: #6968
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-28 10:29:26 +03:00
Hongbin
99bd56e2de
Fix some code comments style 2022-02-28 08:15:37 +08:00
Mikhail f. Shiryaev
d31af7f343
Merge pull request #34901 from vdimir/ci-release-py
Add check_prerequisites to release.py
2022-02-27 21:05:39 +01:00
Kseniia Sumarokova
ba6032a353
Update src/Databases/SQLite/SQLiteUtils.cpp
Co-authored-by: Vladimir C <vdimir@clickhouse.com>
2022-02-26 01:31:04 +01:00
Vladimir C
ba9150abb0
Merge pull request #34910 from kssenii/fix-datetime64-postgres 2022-02-25 21:14:54 +01:00
Vladimir C
3b8ab38671
Merge pull request #34913 from ClickHouse/auto/v22.1.4.30-stable 2022-02-25 21:12:45 +01:00
alexey-milovidov
c624a530cc
Update style.md 2022-02-25 21:51:39 +03:00
alexey-milovidov
22a01c077a
Update style.md 2022-02-25 21:49:24 +03:00
alexey-milovidov
2a062d414b
Update style.md 2022-02-25 21:48:18 +03:00
robot-clickhouse
c231fdf930 Update version_date.tsv after v22.1.4.30-stable 2022-02-25 17:27:56 +00:00
kssenii
92d2cff045 Fix 2022-02-25 16:04:11 +01:00
kssenii
40075d4c6b Fix 2022-02-25 15:04:14 +01:00
Alexandre Snarskii
4a14b25ca6 use getPageSize, correct typo 2022-02-25 17:02:49 +03:00
alexey-milovidov
c39efd8006
Update README.md 2022-02-25 16:13:32 +03:00
Vladimir C
45b157f909
Use SYSTEM_ERROR in MemoryStatisticsOS for FreeBSD 2022-02-25 12:37:12 +01:00
vdimir
9032cc6c3d
Fix stylecheck for tests/ci/release.py 2022-02-25 11:17:45 +00:00
vdimir
5c38203f7d
Argument --commit for release.py is required 2022-02-25 11:06:58 +00:00
Alexandre Snarskii
93de1b1c99 Implement MemoryStatisticsOS for FreeBSD 2022-02-25 14:05:00 +03:00
vdimir
ef3cbdcf6a
Add check_prerequisites to release.py 2022-02-25 10:53:21 +00:00
Vladimir C
30fb72a1ba
Merge pull request #34898 from ClickHouse/auto/v22.2.3.5-stable 2022-02-25 11:29:31 +01:00
vdimir
a50d44bd69 Update version_date.tsv after v22.2.3.5-stable 2022-02-25 10:26:24 +00:00
Vladimir C
1e1f1081f6
Merge pull request #34894 from den-crane/patch-3 2022-02-25 10:38:35 +01:00
Vladimir C
9ba0cb547a
Merge pull request #34836 from vdimir/issue-34810 2022-02-25 09:58:28 +01:00
Denny Crane
f3f6602180
Update array.md 2022-02-24 20:47:24 -04:00
Denny Crane
2e9434c2a2
Update array.md 2022-02-24 20:44:12 -04:00
alexey-milovidov
1f92fb5b40
Merge pull request #34852 from ClickHouse/blog-post-22.2
Blog post about the release 22.2
2022-02-24 20:48:01 +03:00
alexey-milovidov
170f8fbc00
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:47:35 +03:00
alexey-milovidov
8fc66a6441
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:47:28 +03:00
alexey-milovidov
b3a4e4ead2
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:47:15 +03:00
alexey-milovidov
d0050f6ff4
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:47:07 +03:00
alexey-milovidov
8c38c51d33
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:46:57 +03:00
alexey-milovidov
fecf0ad086
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:46:14 +03:00
alexey-milovidov
e77d907cc0
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:46:04 +03:00
alexey-milovidov
b792812b61
Update website/blog/en/2022/clickhouse-v22.2-released.md
Co-authored-by: Christoph Wurm <christoph@clickhouse.com>
2022-02-24 20:45:44 +03:00
Vladimir C
68cb2534fb
Merge pull request #34845 from tangjiangling/update-datetimes-range-in-doc 2022-02-24 15:15:03 +01:00
Maksim Kita
bfd2ad4e9a
Merge pull request #34857 from kashwy/doc_array_join_en
Doc array join en
2022-02-24 14:36:34 +01:00
Nikolay Degterinsky
d055e68b1d
Merge pull request #34822 from cnmade/PR202202231120
Translate zh/faq/general/who-use
2022-02-24 14:43:25 +03:00