From 768c0c32bbaf155f5e203e701c018ca0e8bf7336 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 15 Oct 2018 11:56:29 +0300 Subject: [PATCH 001/297] CLICKHOUSE-4063: less manual html @ index.md --- docs/en/index.md | 10 +++++----- docs/fa/index.md | 10 ++++------ docs/ru/index.md | 8 +++----- docs/zh/index.md | 8 +++----- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/docs/en/index.md b/docs/en/index.md index 9794746e9b7..49540048253 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -77,9 +77,8 @@ See the difference? For example, the query "count the number of records for each advertising platform" requires reading one "advertising platform ID" column, which takes up 1 byte uncompressed. If most of the traffic was not from advertising platforms, you can expect at least 10-fold compression of this column. When using a quick compression algorithm, data decompression is possible at a speed of at least several gigabytes of uncompressed data per second. In other words, this query can be processed at a speed of approximately several billion rows per second on a single server. This speed is actually achieved in practice. -
Example -

-

+
Example +``` $ clickhouse-client ClickHouse client version 0.0.52053. Connecting to localhost:9000. @@ -120,9 +119,10 @@ LIMIT 20 20 rows in set. Elapsed: 0.153 sec. Processed 1.00 billion rows, 4.00 GB (6.53 billion rows/s., 26.10 GB/s.) -:)
+:) +``` -

+ ### CPU diff --git a/docs/fa/index.md b/docs/fa/index.md index aa93081b948..3403835cf3b 100644 --- a/docs/fa/index.md +++ b/docs/fa/index.md @@ -84,9 +84,8 @@ ClickHouse یک مدیریت دیتابیس (DBMS) ستون گرا برای پر برای مثال، query "تعداد رکوردها به ازای هر بستر نیازمندی" نیازمند خواندن ستون "آیدی بستر آگهی"، که 1 بایت بدون فشرده طول می کشد، خواهد بود. اگر بیشتر ترافیک مربوط به بستر های نیازمندی نبود، شما می توانید انتظار حداقل 10 برابر فشرده سازی این ستون را داشته باشید. زمانی که از الگوریتم فشرده سازی quick استفاده می کنید، عملیات decompression داده ها با سرعت حداقل چندین گیگابایت در ثانیه انجام می شود. به عبارت دیگر، این query توانایی پردازش تقریبا چندین میلیارد رکورد در ثانیه به ازای یک سرور را دارد. این سرعت در عمل واقعی و دست یافتنی است. -
مثال -

-

+
مثال +``` $ clickhouse-client ClickHouse client version 0.0.52053. Connecting to localhost:9000. @@ -128,8 +127,7 @@ LIMIT 20 20 rows in set. Elapsed: 0.153 sec. Processed 1.00 billion rows, 4.00 GB (6.53 billion rows/s., 26.10 GB/s.) :) -
-

+```
### CPU @@ -146,4 +144,4 @@ LIMIT 20 توجه کنید که برای کارایی CPU، query language باید SQL یا MDX باشد، یا حداقل یک بردارد (J, K) باشد. query برای بهینه سازی باید فقط دارای حلقه های implicit باشد. - \ No newline at end of file + diff --git a/docs/ru/index.md b/docs/ru/index.md index f93ba69574f..487465f7c95 100644 --- a/docs/ru/index.md +++ b/docs/ru/index.md @@ -78,9 +78,8 @@ ClickHouse - столбцовая система управления базам Для примера, для запроса "посчитать количество записей для каждой рекламной системы", требуется прочитать один столбец "идентификатор рекламной системы", который занимает 1 байт в несжатом виде. Если большинство переходов было не с рекламных систем, то можно рассчитывать хотя бы на десятикратное сжатие этого столбца. При использовании быстрого алгоритма сжатия, возможно разжатие данных со скоростью более нескольких гигабайт несжатых данных в секунду. То есть, такой запрос может выполняться со скоростью около нескольких миллиардов строк в секунду на одном сервере. На практике, такая скорость действительно достигается. -
Пример -

-

+
Пример +``` $ clickhouse-client ClickHouse client version 0.0.52053. Connecting to localhost:9000. @@ -122,8 +121,7 @@ LIMIT 20 20 rows in set. Elapsed: 0.153 sec. Processed 1.00 billion rows, 4.00 GB (6.53 billion rows/s., 26.10 GB/s.) :) -
-

+```
### По вычислениям diff --git a/docs/zh/index.md b/docs/zh/index.md index 3eb9756a64e..22cc4ab4d93 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -78,9 +78,8 @@ ClickHouse是一个用于联机分析(OLAP)的列式数据库管理系统(DBMS) 例如,查询“统计每个广告平台的记录数量”需要读取“广告平台ID”这一列,它在未压缩的情况下需要1个字节进行存储。如果大部分流量不是来自广告平台,那么这一列至少可以以十倍的压缩率被压缩。当采用快速压缩算法,它的解压速度最少在十亿字节(未压缩数据)每秒。换句话说,这个查询可以在单个服务器上以每秒大约几十亿行的速度进行处理。这实际上是当前实现的速度。 -
示例 -

-

+
示例 +``` $ clickhouse-client ClickHouse client version 0.0.52053. Connecting to localhost:9000. @@ -122,8 +121,7 @@ LIMIT 20 20 rows in set. Elapsed: 0.153 sec. Processed 1.00 billion rows, 4.00 GB (6.53 billion rows/s., 26.10 GB/s.) :) -
-

+```
### CPU From 57c9f3a97ee44a9ac6c6c3d40af55767dbc19685 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 15 Oct 2018 12:04:25 +0300 Subject: [PATCH 002/297] CLICKHOUSE-4063: recommend markdown="1" in README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 716ce6ba6cd..fbc371d0d26 100644 --- a/docs/README.md +++ b/docs/README.md @@ -48,7 +48,7 @@ Some additional configuration has to be done to actually make new language live * Inline piece of code is `in backticks`. * Multiline code block are ```in triple backtick quotes ```. * Brightly highlighted block of text starts with `!!! info "Header"`, on next line 4 spaces and content. Instead of `info` can be `warning`. -* Hide block to be opened by click: `
Header hidden content
`. +* Hide block to be opened by click: `
Header hidden content
`. * Colored text: `text`. * Additional anchor to be linked to: ``, for headers fully in English they are created automatically like `"FoO Bar" -> "foo-bar"`. * Table: From 5384ce0d8dea4efda8359048db6aa732836b7468 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 15 Oct 2018 12:15:30 +0300 Subject: [PATCH 003/297] CLICKHOUSE-4003: manually purge custom.css for now --- docs/tools/build.py | 3 ++- docs/tools/mkdocs-material-theme/base.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/tools/build.py b/docs/tools/build.py index aedfc41700f..6630ff68913 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -11,6 +11,7 @@ import shutil import subprocess import sys import tempfile +import time from mkdocs import config from mkdocs import exceptions @@ -62,7 +63,7 @@ def build_for_lang(lang, args): 'static_templates': ['404.html'], 'extra': { 'single_page': False, - 'now': datetime.datetime.now() # TODO better way to avoid caching + 'now': int(time.mktime(datetime.datetime.now().timetuple())) # TODO better way to avoid caching } } diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index 53e855a19ed..adbb17c2796 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -63,7 +63,7 @@ {% endblock %} {% for path in extra_css %} - + {% endfor %} {% block extrahead %}{% endblock %} From c48492c7b4c390aaa8583fccab8b41bd4720a67c Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 15 Oct 2018 12:56:36 +0300 Subject: [PATCH 004/297] CLICKHOUSE-4064: expand
before any print (including to pdf) --- docs/tools/mkdocs-material-theme/base.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index adbb17c2796..849b096f06d 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -231,6 +231,20 @@ base: "{{ base_url }}" } }); + var beforePrint = function() { + var details = document.getElementsByTagName("details"); + for (var i = 0; i < details.length; ++i) { + details[i].open = 1; + } + }; + if (window.matchMedia) { + window.matchMedia('print').addListener(function(q) { + if (q.matches) { + beforePrint(); + } + }); + } + window.onbeforeprint = beforePrint; }); From 231c1196942b4272e85ef64cc2c28b6503bcba17 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 15 Oct 2018 13:22:54 +0300 Subject: [PATCH 005/297] CLICKHOUSE-3927: rearrange interfaces/formats.md a bit --- docs/en/interfaces/formats.md | 279 ++++++++++++++++----------------- docs/fa/interfaces/formats.md | 249 +++++++++++++++--------------- docs/ru/interfaces/formats.md | 280 +++++++++++++++++----------------- 3 files changed, 405 insertions(+), 403 deletions(-) diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index 2d08acf9cca..c13832c0b6a 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -32,31 +32,131 @@ The table below lists supported formats and how they can be used in `INSERT` and | [XML](#xml) | ✗ | ✔ | | [CapnProto](#capnproto) | ✔ | ✔ | - + -## CapnProto +## TabSeparated -Cap'n Proto is a binary message format similar to Protocol Buffers and Thrift, but not like JSON or MessagePack. +In TabSeparated format, data is written by row. Each row contains values separated by tabs. Each value is follow by a tab, except the last value in the row, which is followed by a line feed. Strictly Unix line feeds are assumed everywhere. The last row also must contain a line feed at the end. Values are written in text format, without enclosing quotation marks, and with special characters escaped. -Cap'n Proto messages are strictly typed and not self-describing, meaning they need an external schema description. The schema is applied on the fly and cached for each query. +This format is also available under the name `TSV`. + +The `TabSeparated` format is convenient for processing data using custom programs and scripts. It is used by default in the HTTP interface, and in the command-line client's batch mode. This format also allows transferring data between different DBMSs. For example, you can get a dump from MySQL and upload it to ClickHouse, or vice versa. + +The `TabSeparated` format supports outputting total values (when using WITH TOTALS) and extreme values (when 'extremes' is set to 1). In these cases, the total values and extremes are output after the main data. The main result, total values, and extremes are separated from each other by an empty line. Example: ```sql -SELECT SearchPhrase, count() AS c FROM test.hits - GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -Where `schema.capnp` looks like this: +```text +2014-03-17 1406958 +2014-03-18 1383658 +2014-03-19 1405797 +2014-03-20 1353623 +2014-03-21 1245779 +2014-03-22 1031592 +2014-03-23 1046491 -``` -struct Message { - SearchPhrase @0 :Text; - c @1 :Uint64; -} +0000-00-00 8873898 + +2014-03-17 1031592 +2014-03-23 1406958 ``` -Schema files are in the file that is located in the directory specified in [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) in the server configuration. +### Data formatting + +Integer numbers are written in decimal form. Numbers can contain an extra "+" character at the beginning (ignored when parsing, and not recorded when formatting). Non-negative numbers can't contain the negative sign. When reading, it is allowed to parse an empty string as a zero, or (for signed types) a string consisting of just a minus sign as a zero. Numbers that do not fit into the corresponding data type may be parsed as a different number, without an error message. + +Floating-point numbers are written in decimal form. The dot is used as the decimal separator. Exponential entries are supported, as are 'inf', '+inf', '-inf', and 'nan'. An entry of floating-point numbers may begin or end with a decimal point. +During formatting, accuracy may be lost on floating-point numbers. +During parsing, it is not strictly required to read the nearest machine-representable number. + +Dates are written in YYYY-MM-DD format and parsed in the same format, but with any characters as separators. +Dates with times are written in the format YYYY-MM-DD hh:mm:ss and parsed in the same format, but with any characters as separators. +This all occurs in the system time zone at the time the client or server starts (depending on which one formats data). For dates with times, daylight saving time is not specified. So if a dump has times during daylight saving time, the dump does not unequivocally match the data, and parsing will select one of the two times. +During a read operation, incorrect dates and dates with times can be parsed with natural overflow or as null dates and times, without an error message. + +As an exception, parsing dates with times is also supported in Unix timestamp format, if it consists of exactly 10 decimal digits. The result is not time zone-dependent. The formats YYYY-MM-DD hh:mm:ss and NNNNNNNNNN are differentiated automatically. + +Strings are output with backslash-escaped special characters. The following escape sequences are used for output: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\'`, `\\`. Parsing also supports the sequences `\a`, `\v`, and `\xHH` (hex escape sequences) and any `\c` sequences, where `c` is any character (these sequences are converted to `c`). Thus, reading data supports formats where a line feed can be written as `\n` or `\`, or as a line feed. For example, the string `Hello world` with a line feed between the words instead of a space can be parsed in any of the following variations: + +```text +Hello\nworld + +Hello\ +world +``` + +The second variant is supported because MySQL uses it when writing tab-separated dumps. + +The minimum set of characters that you need to escape when passing data in TabSeparated format: tab, line feed (LF) and backslash. + +Only a small set of symbols are escaped. You can easily stumble onto a string value that your terminal will ruin in output. + +Arrays are written as a list of comma-separated values in square brackets. Number items in the array are fomratted as normally, but dates, dates with times, and strings are written in single quotes with the same escaping rules as above. + +[NULL](../query_language/syntax.md#null-literal) is formatted as `\N`. + + + +## TabSeparatedRaw + +Differs from `TabSeparated` format in that the rows are written without escaping. +This format is only appropriate for outputting a query result, but not for parsing (retrieving data to insert in a table). + +This format is also available under the name `TSVRaw`. + + +## TabSeparatedWithNames + +Differs from the `TabSeparated` format in that the column names are written in the first row. +During parsing, the first row is completely ignored. You can't use column names to determine their position or to check their correctness. +(Support for parsing the header row may be added in the future.) + +This format is also available under the name `TSVWithNames`. + + +## TabSeparatedWithNamesAndTypes + +Differs from the `TabSeparated` format in that the column names are written to the first row, while the column types are in the second row. +During parsing, the first and second rows are completely ignored. + +This format is also available under the name `TSVWithNamesAndTypes`. + + +## TSKV + +Similar to TabSeparated, but outputs a value in name=value format. Names are escaped the same way as in TabSeparated format, and the = symbol is also escaped. + +```text +SearchPhrase= count()=8267016 +SearchPhrase=bathroom interior design count()=2166 +SearchPhrase=yandex count()=1655 +SearchPhrase=2014 spring fashion count()=1549 +SearchPhrase=freeform photos count()=1480 +SearchPhrase=angelina jolie count()=1245 +SearchPhrase=omsk count()=1112 +SearchPhrase=photos of dog breeds count()=1091 +SearchPhrase=curtain designs count()=1064 +SearchPhrase=baku count()=1000 +``` + +[NULL](../query_language/syntax.md#null-literal) is formatted as `\N`. + +```sql +SELECT * FROM t_null FORMAT TSKV +``` + +``` +x=1 y=\N +``` + +When there is a large number of small columns, this format is ineffective, and there is generally no reason to use it. It is used in some departments of Yandex. + +Both data output and parsing are supported in this format. For parsing, any order is supported for the values of different columns. It is acceptable for some values to be omitted – they are treated as equal to their default values. In this case, zeros and blank rows are used as default values. Complex values that could be specified in the table are not supported as defaults. + +Parsing allows the presence of the additional field `tskv` without the equal sign or a value. This field is ignored. -Deserialization is effective and usually doesn't increase the system load. ## CSV @@ -359,131 +459,6 @@ Array is represented as a varint length (unsigned [LEB128](https://en.wikipedia. For [NULL](../query_language/syntax.md#null-literal) support, an additional byte containing 1 or 0 is added before each [Nullable](../data_types/nullable.md#data_type-nullable) value. If 1, then the value is `NULL` and this byte is interpreted as a separate value. If 0, the value after the byte is not `NULL`. - - -## TabSeparated - -In TabSeparated format, data is written by row. Each row contains values separated by tabs. Each value is follow by a tab, except the last value in the row, which is followed by a line feed. Strictly Unix line feeds are assumed everywhere. The last row also must contain a line feed at the end. Values are written in text format, without enclosing quotation marks, and with special characters escaped. - -This format is also available under the name `TSV`. - -The `TabSeparated` format is convenient for processing data using custom programs and scripts. It is used by default in the HTTP interface, and in the command-line client's batch mode. This format also allows transferring data between different DBMSs. For example, you can get a dump from MySQL and upload it to ClickHouse, or vice versa. - -The `TabSeparated` format supports outputting total values (when using WITH TOTALS) and extreme values (when 'extremes' is set to 1). In these cases, the total values and extremes are output after the main data. The main result, total values, and extremes are separated from each other by an empty line. Example: - -```sql -SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` -``` - -```text -2014-03-17 1406958 -2014-03-18 1383658 -2014-03-19 1405797 -2014-03-20 1353623 -2014-03-21 1245779 -2014-03-22 1031592 -2014-03-23 1046491 - -0000-00-00 8873898 - -2014-03-17 1031592 -2014-03-23 1406958 -``` - -## Data formatting - -Integer numbers are written in decimal form. Numbers can contain an extra "+" character at the beginning (ignored when parsing, and not recorded when formatting). Non-negative numbers can't contain the negative sign. When reading, it is allowed to parse an empty string as a zero, or (for signed types) a string consisting of just a minus sign as a zero. Numbers that do not fit into the corresponding data type may be parsed as a different number, without an error message. - -Floating-point numbers are written in decimal form. The dot is used as the decimal separator. Exponential entries are supported, as are 'inf', '+inf', '-inf', and 'nan'. An entry of floating-point numbers may begin or end with a decimal point. -During formatting, accuracy may be lost on floating-point numbers. -During parsing, it is not strictly required to read the nearest machine-representable number. - -Dates are written in YYYY-MM-DD format and parsed in the same format, but with any characters as separators. -Dates with times are written in the format YYYY-MM-DD hh:mm:ss and parsed in the same format, but with any characters as separators. -This all occurs in the system time zone at the time the client or server starts (depending on which one formats data). For dates with times, daylight saving time is not specified. So if a dump has times during daylight saving time, the dump does not unequivocally match the data, and parsing will select one of the two times. -During a read operation, incorrect dates and dates with times can be parsed with natural overflow or as null dates and times, without an error message. - -As an exception, parsing dates with times is also supported in Unix timestamp format, if it consists of exactly 10 decimal digits. The result is not time zone-dependent. The formats YYYY-MM-DD hh:mm:ss and NNNNNNNNNN are differentiated automatically. - -Strings are output with backslash-escaped special characters. The following escape sequences are used for output: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\'`, `\\`. Parsing also supports the sequences `\a`, `\v`, and `\xHH` (hex escape sequences) and any `\c` sequences, where `c` is any character (these sequences are converted to `c`). Thus, reading data supports formats where a line feed can be written as `\n` or `\`, or as a line feed. For example, the string `Hello world` with a line feed between the words instead of a space can be parsed in any of the following variations: - -```text -Hello\nworld - -Hello\ -world -``` - -The second variant is supported because MySQL uses it when writing tab-separated dumps. - -The minimum set of characters that you need to escape when passing data in TabSeparated format: tab, line feed (LF) and backslash. - -Only a small set of symbols are escaped. You can easily stumble onto a string value that your terminal will ruin in output. - -Arrays are written as a list of comma-separated values in square brackets. Number items in the array are fomratted as normally, but dates, dates with times, and strings are written in single quotes with the same escaping rules as above. - -[NULL](../query_language/syntax.md#null-literal) is formatted as `\N`. - - - -## TabSeparatedRaw - -Differs from `TabSeparated` format in that the rows are written without escaping. -This format is only appropriate for outputting a query result, but not for parsing (retrieving data to insert in a table). - -This format is also available under the name `TSVRaw`. - - -## TabSeparatedWithNames - -Differs from the `TabSeparated` format in that the column names are written in the first row. -During parsing, the first row is completely ignored. You can't use column names to determine their position or to check their correctness. -(Support for parsing the header row may be added in the future.) - -This format is also available under the name `TSVWithNames`. - - -## TabSeparatedWithNamesAndTypes - -Differs from the `TabSeparated` format in that the column names are written to the first row, while the column types are in the second row. -During parsing, the first and second rows are completely ignored. - -This format is also available under the name `TSVWithNamesAndTypes`. - - -## TSKV - -Similar to TabSeparated, but outputs a value in name=value format. Names are escaped the same way as in TabSeparated format, and the = symbol is also escaped. - -```text -SearchPhrase= count()=8267016 -SearchPhrase=bathroom interior design count()=2166 -SearchPhrase=yandex count()=1655 -SearchPhrase=2014 spring fashion count()=1549 -SearchPhrase=freeform photos count()=1480 -SearchPhrase=angelina jolie count()=1245 -SearchPhrase=omsk count()=1112 -SearchPhrase=photos of dog breeds count()=1091 -SearchPhrase=curtain designs count()=1064 -SearchPhrase=baku count()=1000 -``` - -[NULL](../query_language/syntax.md#null-literal) is formatted as `\N`. - -```sql -SELECT * FROM t_null FORMAT TSKV -``` - -``` -x=1 y=\N -``` - -When there is a large number of small columns, this format is ineffective, and there is generally no reason to use it. It is used in some departments of Yandex. - -Both data output and parsing are supported in this format. For parsing, any order is supported for the values of different columns. It is acceptable for some values to be omitted – they are treated as equal to their default values. In this case, zeros and blank rows are used as default values. Complex values that could be specified in the table are not supported as defaults. - -Parsing allows the presence of the additional field `tskv` without the equal sign or a value. This field is ignored. - ## Values Prints every row in brackets. Rows are separated by commas. There is no comma after the last row. The values inside the brackets are also comma-separated. Numbers are output in decimal format without quotes. Arrays are output in square brackets. Strings, dates, and dates with times are output in quotes. Escaping rules and parsing are similar to the [TabSeparated](#tabseparated) format. During formatting, extra spaces aren't inserted, but during parsing, they are allowed and skipped (except for spaces inside array values, which are not allowed). [NULL](../query_language/syntax.md#null-literal) is represented as `NULL`. @@ -620,3 +595,29 @@ Just as for JSON, invalid UTF-8 sequences are changed to the replacement charact In string values, the characters `<` and `&` are escaped as `<` and `&`. Arrays are output as `HelloWorld...`,and tuples as `HelloWorld...`. + + + +## CapnProto + +Cap'n Proto is a binary message format similar to Protocol Buffers and Thrift, but not like JSON or MessagePack. + +Cap'n Proto messages are strictly typed and not self-describing, meaning they need an external schema description. The schema is applied on the fly and cached for each query. + +```sql +SELECT SearchPhrase, count() AS c FROM test.hits + GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +``` + +Where `schema.capnp` looks like this: + +``` +struct Message { + SearchPhrase @0 :Text; + c @1 :Uint64; +} +``` + +Schema files are in the file that is located in the directory specified in [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) in the server configuration. + +Deserialization is effective and usually doesn't increase the system load. diff --git a/docs/fa/interfaces/formats.md b/docs/fa/interfaces/formats.md index c2aaf851434..3aeaef02150 100644 --- a/docs/fa/interfaces/formats.md +++ b/docs/fa/interfaces/formats.md @@ -34,39 +34,117 @@ Format | INSERT | SELECT [XML](formats.md#xml) | ✗ | ✔ | [CapnProto](formats.md#capnproto) | ✔ | ✔ | - -## CapnProto +## TabSeparated -Cap'n Proto یک فرمت پیام باینری شبیه به Protocol Buffer و Thrift می باشد، اما شبیه به JSON یا MessagePack نیست. +در فرمت TabSeparated، داده ها به صورت سطر نوشته می شوند. هر سطر شامل مقادیر جدا شده با tab می باشد. هر مقدار با یک tab دنبال می شود، به جز آخرین مقدار یک سطر، که با line feed دنبال می شود. line feed unix در همه جا مورد تسافده قرار می گیرد. آخرین سطر از خروجی هم باید شامل line feed در انتها باشد. مقادیر در فرمت متنی بدون enclose با کوتیشون، و یا escape با کاراکترهای ویژه، نوشته می شوند. -پیغام های Cap'n Proto به صورت self-describing نیستند، به این معنی که آنها نیاز دارند که به صورت external، schema آنها شرح داده شود. schema به صورت on the fly اضافه می شود و برای هر query، cache می شود. +اعداد Integer با فرم decimal نوشته می شوند. اعداد می توانند شامل کاراکتر اضافه "+" در ابتدای خود باشند. (در هنگام پارس کردن نادیده گرفته می شوند، و در هنگام فرمت کردن، ثبت نمی شوند). اعداد غیر منفی نمیتوانند شامل علامت منفی باشند. در هنگام خواندن، اجازه داده می شود که رشته خالی را به عنوان صفر، پارس کرد، یا (برای تایپ های sign) یک رشته که شامل فقط یک علامت منفی است به عنوان صفر پارس کرد. اعدادی که در data type مربوطه فیت نشوند ممکن است به عددی متفاوت تبدیل شوند و پیغام خطایی هم نمایش ندهند. + +اعداد Floating-point به فرم decimal نوشته می شوند. از دات به عنوان جدا کننده decimal استفاده می شود. نوشته های نمایشی مثل 'inf'، '+inf'، '-inf' و 'nan' پشتیبانی می شوند. ورودی اعداد floating-point می تواند با یه نقطه اعشار شروع یا پایان یابد. در هنگام فرمت، دقت اعداد floating-point ممکن است گم شوند. در هنگام پارس کردن، دقیقا نیازی به خواندن نزدیکترین عدد machine-representable نیست. + +Dates با فرمت YYY-MM-DD نوشته می شوند و به همین حالت پارس می شوند، اما با هر کاراکتری به عنوان جدا کننده. Dates به همراه زمان با فرمت YYYY-MM-DD hh:mm:ss نوشته می شوند و با همین فرمت پارس می شوند، اما با هر کاراکتری به عنوان جداکننده. این در منطقه زمان سیستم در زمانی که کلاینت یا سرور شروع می شود (بسته به اینکه کدام یک از داده ها را تشکیل می دهد) رخ می دهد. برای تاریخ همراه با زمان DST مشخص نمی شود. پس اگر یک دامپ دارای زمان DST باشد، دامپ، داده ها را به طور غیرمستقیم مطابقت نمی دهد و پارسینگ، یکی از دو ساعت را انتخاب خواهد کرد. در طول عملیات خواندن، تاریخ ها و تاریخ و ساعت های نادرست می توانند به صورت null و یا natural overflow پارس شوند، بدون اینکه پیغام خطایی نمایش دهند. + +به عنوان یک استثنا، پارس کردن تاریخ به همراه ساعت، اگر مقدار دقیقا شامل 10 عدد decimal باشد، به عنوان فرمت unix timestamp پشتیبانی خواهد کرد. خروجی وابسته به time-zone نمی باشد. فرمت های YYYY-MM-DD hh: mm: ss و NNNNNNNNNN به صورت خودکار تمایز می یابند. + +رشته های دارای کاراکتر های ویژه backslash-escaped چاپ می شوند. escape های در ادامه برای خروجی استفاده می شوند: `\b`، `\f`، `\r`، `\n`، `\t`، `\0`, `\'`، `\\`. پارسر همچنین از `\a`، `\v`، و `\xHH` (hex escape) و هر `\c` پشتیبانی می کند. بدین ترتیب خواندن داده ها از فرمت line feed که می تواند به صورت `\n` یا `\` نوشته شود پشتیبانی می کند. برای مثال، رشته ی `Hello world` به همراه line feed بین کلمات به جای space می تواند به هر یک از حالات زیر پارس شود:: + + + +```text +Hello\nworld + +Hello\ +world +``` + +
+ +نوع دوم به دلیل پشتیبانی MySQL در هنگام نوشتن دامپ به صورت tab-separate، پشتیبانی می شود. + +حداقل مجموعه از کاراکترهایی که در هنگام پاس دادن داده در فرمت TabSeperate نیاز به escape آن دارید: tab، line feed (LF) بک اسلش. + +فقط مجموعه ی کمی از نماد ها escape می شوند. شما به راحتی می توانید بر روی مقدار رشته که در ترمینال شما در خروجی نمایش داده می شود حرکت کنید. + +آرایه ها به صورت لیستی از مقادیر که به comma از هم جدا شده اند و در داخل براکت قرار گرفته اند نوشته می شوند. آیتم های عددی در آرای به صورت نرمال فرمت می شوند، اما تاریخ و تاریخ با ساعت و رشته ها در داخل تک کوتیشن به همراه قوانین escape که بالا اشاره شد، نوشته می شوند. + +فرمت TabSeparate برای پردازش داده ها با استفاده از برنامه های شخصی سازی شده و اسکریپت ها مناسب است. TabSeparate به صورت پیش فرض در HTTP interface و در حالت batch کلاینت command-line مورد استفاده قرار می گیرد. همچنین این فرمت اجازه ی انتقال داده ها بین DBMS های مختلف را می دهد. برای مثال، شما می توانید از MySQL با این روش دامپ بگیرید و آن را در ClickHouse یا vice versa آپلود کنید. + +فرمت TabSeparated از خروحی total values (هنگام استفاده از WITH TOTALS) و extreme values (در هنگامی که 'extreme' برابر با 1 است) پشتیبانی می کند. در این موارد، total value و extreme بعد از داده های اصلی در خروجی می آیند. نتایج اصلی، total values و extreme همگی با یک empty line از هم جدا می شوند. مثال:
```sql -SELECT SearchPhrase, count() AS c FROM test.hits - GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` +``` + +```text +2014-03-17 1406958 +2014-03-18 1383658 +2014-03-19 1405797 +2014-03-20 1353623 +2014-03-21 1245779 +2014-03-22 1031592 +2014-03-23 1046491 + +0000-00-00 8873898 + +2014-03-17 1031592 +2014-03-23 1406958 ```
-جایی که `schema.capnp` شبیه این است: +این فرمت نیز تحت نام `TSV` موجود است. + + + +## TabSeparatedRaw + +تفاوت آن با `TabSeperated` در این است که در این فرمت سطرها بدون escape نوشته می شوند. این فرمت فقط مناسب خروجی نتایج query ها می باشد، نه برای پارس کردن (دریافت داده ها و درج آن در جدول). + +همچنین این فرمت تحت عنوان ` TSVRaw`وجود دارد. + +## TabSeparatedWithNames + +تفاوت آن با فرمت `TabSeparated` در این است که، در این فرمت نام ستون ها در سطر اول قرار می گیرد. در طول پارس کردن، سطر اول به طور کامل نادیده گرفته می شود. شما نمی توانید نام ستون ها را برای تعیین موقعیت آنها یا بررسی صحت آنها استفاده کنید. (پشتیبانی از پارس کردن سطر header ممکن است در آینده اضافه شود.) + +همچنین این فرمت تحت عنوان ` TSVWithNames`وجود دارد. + +## TabSeparatedWithNamesAndTypes + +تفاوت آن با `TabSeparated` در این است که در این فرمت نام ستون ها در سطر اول نوشته می شود، و type ستون ها در سطر دوم نوشته می شود. در طی پارسینگ، سطر اول و دوم به طور کامل نادیده گرفته می شوند. + +همچنین این فرمت تحت عنوان ` TSVWithNamesAndTypes`وجود دارد. + +## TSKV + +مشابه فرمت TabSeparated، اما خروجی به صورت name=value می باشد. نام ها مشابه روش TabSeparated، escape می شوند، و همچنین = symbol هم escape می شود.
-``` -struct Message { - SearchPhrase @0 :Text; - c @1 :Uint64; -} +```text +SearchPhrase= count()=8267016 +SearchPhrase=bathroom interior design count()=2166 +SearchPhrase=yandex count()=1655 +SearchPhrase=spring 2014 fashion count()=1549 +SearchPhrase=freeform photos count()=1480 +SearchPhrase=angelina jolia count()=1245 +SearchPhrase=omsk count()=1112 +SearchPhrase=photos of dog breeds count()=1091 +SearchPhrase=curtain design count()=1064 +SearchPhrase=baku count()=1000 ```
-فایل های Schema در فایلی قرار دارند که این فایل در دایرکتوری مشخص شده کانفیگ [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) قرار گرفته اند. +وقتی تعداد زیادی از ستون ها وجود دارد، این فرمت بی فایده است، و در حالت کلی دلیلی بر استفاده از این فرمت در این مواقع وجود ندارد. این فرمت در بعضی از دپارتمان های Yandex استفاده می شد. -عملیات Deserialization موثر است و معمولا لود سیستم را افزایش نمی دهد. +خروجی داده ها و پارس کردن هر دو در این فرمت پشتیبانی می شوند. برای پارس کردن، هر ترتیبی برای مقادیر ستون های مختلف پشتیبانی می شود. حذف بعضی از مقادیر قابل قبول است. این مقادیر با مقادیر پیش فرض خود برابر هستند. در این مورد، صفر و سطر خالی، توسط مقادیر پیش فرض پر می شوند. مقادیر پیچیده ای که می تواند در جدول مشخص شود به عنوان پیش فرض در این فرمت پشتیبانی نمیشوند. + +پارس کردن، اجازه می دهد که فیلد اضافه ی `tskv` بدون علامت و مقدار وجود داشته باشد. این فیلد نادیده گرفته می شود. + + ## CSV @@ -347,115 +425,6 @@ watch -n1 "clickhouse-client --query='SELECT event, value FROM system.events FOR آرایه به عنوان variant length نشان داده می شود (unsigned [LEB128](https://en.wikipedia.org/wiki/LEB128))، دنباله ای از عانصر پیوسته آرایه -## TabSeparated - -در فرمت TabSeparated، داده ها به صورت سطر نوشته می شوند. هر سطر شامل مقادیر جدا شده با tab می باشد. هر مقدار با یک tab دنبال می شود، به جز آخرین مقدار یک سطر، که با line feed دنبال می شود. line feed unix در همه جا مورد تسافده قرار می گیرد. آخرین سطر از خروجی هم باید شامل line feed در انتها باشد. مقادیر در فرمت متنی بدون enclose با کوتیشون، و یا escape با کاراکترهای ویژه، نوشته می شوند. - -اعداد Integer با فرم decimal نوشته می شوند. اعداد می توانند شامل کاراکتر اضافه "+" در ابتدای خود باشند. (در هنگام پارس کردن نادیده گرفته می شوند، و در هنگام فرمت کردن، ثبت نمی شوند). اعداد غیر منفی نمیتوانند شامل علامت منفی باشند. در هنگام خواندن، اجازه داده می شود که رشته خالی را به عنوان صفر، پارس کرد، یا (برای تایپ های sign) یک رشته که شامل فقط یک علامت منفی است به عنوان صفر پارس کرد. اعدادی که در data type مربوطه فیت نشوند ممکن است به عددی متفاوت تبدیل شوند و پیغام خطایی هم نمایش ندهند. - -اعداد Floating-point به فرم decimal نوشته می شوند. از دات به عنوان جدا کننده decimal استفاده می شود. نوشته های نمایشی مثل 'inf'، '+inf'، '-inf' و 'nan' پشتیبانی می شوند. ورودی اعداد floating-point می تواند با یه نقطه اعشار شروع یا پایان یابد. در هنگام فرمت، دقت اعداد floating-point ممکن است گم شوند. در هنگام پارس کردن، دقیقا نیازی به خواندن نزدیکترین عدد machine-representable نیست. - -Dates با فرمت YYY-MM-DD نوشته می شوند و به همین حالت پارس می شوند، اما با هر کاراکتری به عنوان جدا کننده. Dates به همراه زمان با فرمت YYYY-MM-DD hh:mm:ss نوشته می شوند و با همین فرمت پارس می شوند، اما با هر کاراکتری به عنوان جداکننده. این در منطقه زمان سیستم در زمانی که کلاینت یا سرور شروع می شود (بسته به اینکه کدام یک از داده ها را تشکیل می دهد) رخ می دهد. برای تاریخ همراه با زمان DST مشخص نمی شود. پس اگر یک دامپ دارای زمان DST باشد، دامپ، داده ها را به طور غیرمستقیم مطابقت نمی دهد و پارسینگ، یکی از دو ساعت را انتخاب خواهد کرد. در طول عملیات خواندن، تاریخ ها و تاریخ و ساعت های نادرست می توانند به صورت null و یا natural overflow پارس شوند، بدون اینکه پیغام خطایی نمایش دهند. - -به عنوان یک استثنا، پارس کردن تاریخ به همراه ساعت، اگر مقدار دقیقا شامل 10 عدد decimal باشد، به عنوان فرمت unix timestamp پشتیبانی خواهد کرد. خروجی وابسته به time-zone نمی باشد. فرمت های YYYY-MM-DD hh: mm: ss و NNNNNNNNNN به صورت خودکار تمایز می یابند. - -رشته های دارای کاراکتر های ویژه backslash-escaped چاپ می شوند. escape های در ادامه برای خروجی استفاده می شوند: `\b`، `\f`، `\r`، `\n`، `\t`، `\0`, `\'`، `\\`. پارسر همچنین از `\a`، `\v`، و `\xHH` (hex escape) و هر `\c` پشتیبانی می کند. بدین ترتیب خواندن داده ها از فرمت line feed که می تواند به صورت `\n` یا `\` نوشته شود پشتیبانی می کند. برای مثال، رشته ی `Hello world` به همراه line feed بین کلمات به جای space می تواند به هر یک از حالات زیر پارس شود:: - -
- -```text -Hello\nworld - -Hello\ -world -``` - -
- -نوع دوم به دلیل پشتیبانی MySQL در هنگام نوشتن دامپ به صورت tab-separate، پشتیبانی می شود. - -حداقل مجموعه از کاراکترهایی که در هنگام پاس دادن داده در فرمت TabSeperate نیاز به escape آن دارید: tab، line feed (LF) بک اسلش. - -فقط مجموعه ی کمی از نماد ها escape می شوند. شما به راحتی می توانید بر روی مقدار رشته که در ترمینال شما در خروجی نمایش داده می شود حرکت کنید. - -آرایه ها به صورت لیستی از مقادیر که به comma از هم جدا شده اند و در داخل براکت قرار گرفته اند نوشته می شوند. آیتم های عددی در آرای به صورت نرمال فرمت می شوند، اما تاریخ و تاریخ با ساعت و رشته ها در داخل تک کوتیشن به همراه قوانین escape که بالا اشاره شد، نوشته می شوند. - -فرمت TabSeparate برای پردازش داده ها با استفاده از برنامه های شخصی سازی شده و اسکریپت ها مناسب است. TabSeparate به صورت پیش فرض در HTTP interface و در حالت batch کلاینت command-line مورد استفاده قرار می گیرد. همچنین این فرمت اجازه ی انتقال داده ها بین DBMS های مختلف را می دهد. برای مثال، شما می توانید از MySQL با این روش دامپ بگیرید و آن را در ClickHouse یا vice versa آپلود کنید. - -فرمت TabSeparated از خروحی total values (هنگام استفاده از WITH TOTALS) و extreme values (در هنگامی که 'extreme' برابر با 1 است) پشتیبانی می کند. در این موارد، total value و extreme بعد از داده های اصلی در خروجی می آیند. نتایج اصلی، total values و extreme همگی با یک empty line از هم جدا می شوند. مثال: - -
- -```sql -SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` -``` - -```text -2014-03-17 1406958 -2014-03-18 1383658 -2014-03-19 1405797 -2014-03-20 1353623 -2014-03-21 1245779 -2014-03-22 1031592 -2014-03-23 1046491 - -0000-00-00 8873898 - -2014-03-17 1031592 -2014-03-23 1406958 -``` - -
- -این فرمت نیز تحت نام `TSV` موجود است. - - - -## TabSeparatedRaw - -تفاوت آن با `TabSeperated` در این است که در این فرمت سطرها بدون escape نوشته می شوند. این فرمت فقط مناسب خروجی نتایج query ها می باشد، نه برای پارس کردن (دریافت داده ها و درج آن در جدول). - -همچنین این فرمت تحت عنوان ` TSVRaw`وجود دارد. - -## TabSeparatedWithNames - -تفاوت آن با فرمت `TabSeparated` در این است که، در این فرمت نام ستون ها در سطر اول قرار می گیرد. در طول پارس کردن، سطر اول به طور کامل نادیده گرفته می شود. شما نمی توانید نام ستون ها را برای تعیین موقعیت آنها یا بررسی صحت آنها استفاده کنید. (پشتیبانی از پارس کردن سطر header ممکن است در آینده اضافه شود.) - -همچنین این فرمت تحت عنوان ` TSVWithNames`وجود دارد. - -## TabSeparatedWithNamesAndTypes - -تفاوت آن با `TabSeparated` در این است که در این فرمت نام ستون ها در سطر اول نوشته می شود، و type ستون ها در سطر دوم نوشته می شود. در طی پارسینگ، سطر اول و دوم به طور کامل نادیده گرفته می شوند. - -همچنین این فرمت تحت عنوان ` TSVWithNamesAndTypes`وجود دارد. - -## TSKV - -مشابه فرمت TabSeparated، اما خروجی به صورت name=value می باشد. نام ها مشابه روش TabSeparated، escape می شوند، و همچنین = symbol هم escape می شود. - -
- -```text -SearchPhrase= count()=8267016 -SearchPhrase=bathroom interior design count()=2166 -SearchPhrase=yandex count()=1655 -SearchPhrase=spring 2014 fashion count()=1549 -SearchPhrase=freeform photos count()=1480 -SearchPhrase=angelina jolia count()=1245 -SearchPhrase=omsk count()=1112 -SearchPhrase=photos of dog breeds count()=1091 -SearchPhrase=curtain design count()=1064 -SearchPhrase=baku count()=1000 -``` - -
- -وقتی تعداد زیادی از ستون ها وجود دارد، این فرمت بی فایده است، و در حالت کلی دلیلی بر استفاده از این فرمت در این مواقع وجود ندارد. این فرمت در بعضی از دپارتمان های Yandex استفاده می شد. - -خروجی داده ها و پارس کردن هر دو در این فرمت پشتیبانی می شوند. برای پارس کردن، هر ترتیبی برای مقادیر ستون های مختلف پشتیبانی می شود. حذف بعضی از مقادیر قابل قبول است. این مقادیر با مقادیر پیش فرض خود برابر هستند. در این مورد، صفر و سطر خالی، توسط مقادیر پیش فرض پر می شوند. مقادیر پیچیده ای که می تواند در جدول مشخص شود به عنوان پیش فرض در این فرمت پشتیبانی نمیشوند. - -پارس کردن، اجازه می دهد که فیلد اضافه ی `tskv` بدون علامت و مقدار وجود داشته باشد. این فیلد نادیده گرفته می شود. - ## Values هر سطر داخل براکت چاپ می شود. سطر ها توسط comma جدا می شوند. برای آخرین سطر comma وجود ندارد. مقادیر داخل براکت همچنین توسط comma جدا می شوند. اعداد با فرمت decimal و بدون کوتیشن چاپ می شوند. آرایه ها در براکت ها چاپ می شوند. رشته ها، تاریخ و تاریخ با ساعت داخل کوتیشن قرار می گیرند. قوانین escape و پارس کردن شبیه به فرمت TabSeparated انجام می شود. در طول فرمت، extra spaces درج نمی شوند، اما در هنگام پارس کردن، آنها مجاز و skip می شوند. (به جز space های داخل مقادیر آرایه، که مجاز نیستند). @@ -579,4 +548,38 @@ test: string with \'quotes\' and \t with some special \n characters آرایه ها به شکل `HelloWorld...` و tuple ها به صورت `HelloWorld...` در خروجی می آیند. + + +## CapnProto + +Cap'n Proto یک فرمت پیام باینری شبیه به Protocol Buffer و Thrift می باشد، اما شبیه به JSON یا MessagePack نیست. + +پیغام های Cap'n Proto به صورت self-describing نیستند، به این معنی که آنها نیاز دارند که به صورت external، schema آنها شرح داده شود. schema به صورت on the fly اضافه می شود و برای هر query، cache می شود. + +
+ +```sql +SELECT SearchPhrase, count() AS c FROM test.hits + GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +``` + +
+ +جایی که `schema.capnp` شبیه این است: + +
+ +``` +struct Message { + SearchPhrase @0 :Text; + c @1 :Uint64; +} +``` + +
+ +فایل های Schema در فایلی قرار دارند که این فایل در دایرکتوری مشخص شده کانفیگ [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) قرار گرفته اند. + +عملیات Deserialization موثر است و معمولا لود سیستم را افزایش نمی دهد. +
diff --git a/docs/ru/interfaces/formats.md b/docs/ru/interfaces/formats.md index 6944713c995..c87ed059143 100644 --- a/docs/ru/interfaces/formats.md +++ b/docs/ru/interfaces/formats.md @@ -32,32 +32,130 @@ ClickHouse может принимать (`INSERT`) и отдавать (`SELECT [XML](#xml) | ✗ | ✔ | [CapnProto](#capnproto) | ✔ | ✔ | - + -## CapnProto +## TabSeparated -Cap'n Proto - формат бинарных сообщений, похож на Protocol Buffers и Thrift, но не похож на JSON или MessagePack. +В TabSeparated формате данные пишутся по строкам. Каждая строчка содержит значения, разделённые табами. После каждого значения идёт таб, кроме последнего значения в строке, после которого идёт перевод строки. Везде подразумеваются исключительно unix-переводы строк. Последняя строка также обязана содержать перевод строки на конце. Значения пишутся в текстовом виде, без обрамляющих кавычек, с экранированием служебных символов. -Сообщения Cap'n Proto строго типизированы и не самоописывающиеся, т.е. нуждаются во внешнем описании схемы. Схема применяется "на лету" и кешируется для каждого запроса. +Этот формат также доступен под именем `TSV`. + +Формат `TabSeparated` удобен для обработки данных произвольными программами и скриптами. Он используется по умолчанию в HTTP-интерфейсе, а также в batch-режиме клиента командной строки. Также формат позволяет переносить данные между разными СУБД. Например, вы можете получить дамп из MySQL и загрузить его в ClickHouse, или наоборот. + +Формат `TabSeparated` поддерживает вывод тотальных значений (при использовании WITH TOTALS) и экстремальных значений (при настройке extremes выставленной в 1). В этих случаях, после основных данных выводятся тотальные значения, и экстремальные значения. Основной результат, тотальные значения и экстремальные значения, отделяются друг от друга пустой строкой. Пример: ```sql -SELECT SearchPhrase, count() AS c FROM test.hits - GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -Где `schema.capnp` выглядит следующим образом: +```text +2014-03-17 1406958 +2014-03-18 1383658 +2014-03-19 1405797 +2014-03-20 1353623 +2014-03-21 1245779 +2014-03-22 1031592 +2014-03-23 1046491 -``` -struct Message { - SearchPhrase @0 :Text; - c @1 :Uint64; -} +0000-00-00 8873898 + +2014-03-17 1031592 +2014-03-23 1406958 ``` +### Форматирование данных -Файлы со схемами находятся в файле, который находится в каталоге указанном в параметре [format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) конфигурации сервера. +Целые числа пишутся в десятичной форме. Числа могут содержать лишний символ "+" в начале (игнорируется при парсинге, а при форматировании не пишется). Неотрицательные числа не могут содержать знак отрицания. При чтении допустим парсинг пустой строки, как числа ноль, или (для знаковых типов) строки, состоящей из одного минуса, как числа ноль. Числа, не помещающиеся в соответствующий тип данных, могут парсится, как некоторое другое число, без сообщения об ошибке. + +Числа с плавающей запятой пишутся в десятичной форме. При этом, десятичный разделитель - точка. Поддерживается экспоненциальная запись, а также inf, +inf, -inf, nan. Запись числа с плавающей запятой может начинаться или заканчиваться на десятичную точку. +При форматировании возможна потеря точности чисел с плавающей запятой. +При парсинге, допустимо чтение не обязательно наиболее близкого к десятичной записи машинно-представимого числа. + +Даты выводятся в формате YYYY-MM-DD, парсятся в том же формате, но с любыми символами в качестве разделителей. +Даты-с-временем выводятся в формате YYYY-MM-DD hh:mm:ss, парсятся в том же формате, но с любыми символами в качестве разделителей. +Всё это происходит в системном часовом поясе на момент старта клиента (если клиент занимается форматированием данных) или сервера. Для дат-с-временем не указывается, действует ли daylight saving time. То есть, если в дампе есть времена во время перевода стрелок назад, то дамп не соответствует данным однозначно, и при парсинге будет выбрано какое-либо из двух времён. +При парсинге, некорректные даты и даты-с-временем могут парситься с естественным переполнением или как нулевые даты/даты-с-временем без сообщения об ошибке. + +В качестве исключения, поддерживается также парсинг даты-с-временем в формате unix timestamp, если он состоит ровно из 10 десятичных цифр. Результат не зависит от часового пояса. Различение форматов YYYY-MM-DD hh:mm:ss и NNNNNNNNNN делается автоматически. + +Строки выводятся с экранированием спец-символов с помощью обратного слеша. При выводе, используются следующие escape-последовательности: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\'`, `\\`. При парсинге, также поддерживаются последовательности `\a`, `\v`, а также `\xHH` (hex escape-последовательности) и любые последовательности вида `\c`, где `c` - любой символ - такие последовательности преобразуется в `c`. Таким образом, при чтении поддерживаются форматы, где перевод строки может быть записан как `\n` и как `\` и перевод строки. Например, строка `Hello world`, где между словами вместо пробела стоит перевод строки, может быть считана в любом из следующих вариантов: + +```text +Hello\nworld + +Hello\ +world +``` + +Второй вариант поддерживается, так как его использует MySQL при записи tab-separated дампа. + +Минимальный набор символов, которых вам необходимо экранировать при передаче в TabSeparated формате: таб, перевод строки (LF) и обратный слеш. + +Экранируется лишь небольшой набор символов. Вы можете легко наткнуться на строковое значение, которое испортит ваш терминал при выводе в него. + +Массивы форматируются в виде списка значений через запятую в квадратных скобках. Элементы массива - числа форматируются как обычно, а даты, даты-с-временем и строки - в одинарных кавычках с такими же правилами экранирования, как указано выше. + +[NULL](../query_language/syntax.md#null-literal) форматируется в виде `\N`. + + + +## TabSeparatedRaw + +Отличается от формата `TabSeparated` тем, что строки выводятся без экранирования. +Этот формат подходит только для вывода результата выполнения запроса, но не для парсинга (приёма данных для вставки в таблицу). + +Этот формат также доступен под именем `TSVRaw`. + + +## TabSeparatedWithNames + +Отличается от формата `TabSeparated` тем, что в первой строке пишутся имена столбцов. +При парсинге, первая строка полностью игнорируется: вы не можете использовать имена столбцов, чтобы указать их порядок расположения, или чтобы проверить их корректность. +(Поддержка обработки заголовка при парсинге может быть добавлена в будущем.) + +Этот формат также доступен под именем `TSVWithNames`. + + +## TabSeparatedWithNamesAndTypes + +Отличается от формата `TabSeparated` тем, что в первой строке пишутся имена столбцов, а во второй - типы столбцов. +При парсинге, первая и вторая строка полностью игнорируется. + +Этот формат также доступен под именем `TSVWithNamesAndTypes`. + + +## TSKV + +Похож на TabSeparated, но выводит значения в формате name=value. Имена экранируются так же, как строки в формате TabSeparated и, дополнительно, экранируется также символ =. + +```text +SearchPhrase= count()=8267016 +SearchPhrase=интерьер ванной комнаты count()=2166 +SearchPhrase=яндекс count()=1655 +SearchPhrase=весна 2014 мода count()=1549 +SearchPhrase=фриформ фото count()=1480 +SearchPhrase=анджелина джоли count()=1245 +SearchPhrase=омск count()=1112 +SearchPhrase=фото собак разных пород count()=1091 +SearchPhrase=дизайн штор count()=1064 +SearchPhrase=баку count()=1000 +``` + +[NULL](../query_language/syntax.md#null-literal) форматируется в виде `\N`. + +```sql +SELECT * FROM t_null FORMAT TSKV +``` +``` +x=1 y=\N +``` + +При большом количестве маленьких столбцов, этот формат существенно неэффективен, и обычно нет причин его использовать. Он реализован, так как используется в некоторых отделах Яндекса. + +Поддерживается как вывод, так и парсинг данных в этом формате. При парсинге, поддерживается расположение значений разных столбцов в произвольном порядке. Допустимо отсутствие некоторых значений - тогда они воспринимаются как равные значениям по умолчанию. При этом, в качестве значений по умолчанию используются нули, пустые строки и не поддерживаются сложные значения по умолчанию, которые могут быть заданы в таблице. + +При парсинге, в качестве дополнительного поля, может присутствовать `tskv` без знака равенства и без значения. Это поле игнорируется. -Десериализация эффективна и обычно не повышает нагрузку на систему. ## CSV @@ -359,133 +457,6 @@ Array представлены как длина в формате varint (unsig Для поддержки [NULL](../query_language/syntax.md#null-literal) перед каждым значением типа [Nullable](../data_types/nullable.md#data_type-nullable) в строке добавлен дополнительный байт, который содержит 1 или 0. Если 1, то значение — `NULL` и этот байт трактуется как отдельное значение. Если 0, то после байта идёт не `NULL`-значение. - - -## TabSeparated - -В TabSeparated формате данные пишутся по строкам. Каждая строчка содержит значения, разделённые табами. После каждого значения идёт таб, кроме последнего значения в строке, после которого идёт перевод строки. Везде подразумеваются исключительно unix-переводы строк. Последняя строка также обязана содержать перевод строки на конце. Значения пишутся в текстовом виде, без обрамляющих кавычек, с экранированием служебных символов. - -Этот формат также доступен под именем `TSV`. - -Формат `TabSeparated` удобен для обработки данных произвольными программами и скриптами. Он используется по умолчанию в HTTP-интерфейсе, а также в batch-режиме клиента командной строки. Также формат позволяет переносить данные между разными СУБД. Например, вы можете получить дамп из MySQL и загрузить его в ClickHouse, или наоборот. - -Формат `TabSeparated` поддерживает вывод тотальных значений (при использовании WITH TOTALS) и экстремальных значений (при настройке extremes выставленной в 1). В этих случаях, после основных данных выводятся тотальные значения, и экстремальные значения. Основной результат, тотальные значения и экстремальные значения, отделяются друг от друга пустой строкой. Пример: - -```sql -SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` -``` - -```text -2014-03-17 1406958 -2014-03-18 1383658 -2014-03-19 1405797 -2014-03-20 1353623 -2014-03-21 1245779 -2014-03-22 1031592 -2014-03-23 1046491 - -0000-00-00 8873898 - -2014-03-17 1031592 -2014-03-23 1406958 -``` - - - -## Форматирование данных - -Целые числа пишутся в десятичной форме. Числа могут содержать лишний символ "+" в начале (игнорируется при парсинге, а при форматировании не пишется). Неотрицательные числа не могут содержать знак отрицания. При чтении допустим парсинг пустой строки, как числа ноль, или (для знаковых типов) строки, состоящей из одного минуса, как числа ноль. Числа, не помещающиеся в соответствующий тип данных, могут парсится, как некоторое другое число, без сообщения об ошибке. - -Числа с плавающей запятой пишутся в десятичной форме. При этом, десятичный разделитель - точка. Поддерживается экспоненциальная запись, а также inf, +inf, -inf, nan. Запись числа с плавающей запятой может начинаться или заканчиваться на десятичную точку. -При форматировании возможна потеря точности чисел с плавающей запятой. -При парсинге, допустимо чтение не обязательно наиболее близкого к десятичной записи машинно-представимого числа. - -Даты выводятся в формате YYYY-MM-DD, парсятся в том же формате, но с любыми символами в качестве разделителей. -Даты-с-временем выводятся в формате YYYY-MM-DD hh:mm:ss, парсятся в том же формате, но с любыми символами в качестве разделителей. -Всё это происходит в системном часовом поясе на момент старта клиента (если клиент занимается форматированием данных) или сервера. Для дат-с-временем не указывается, действует ли daylight saving time. То есть, если в дампе есть времена во время перевода стрелок назад, то дамп не соответствует данным однозначно, и при парсинге будет выбрано какое-либо из двух времён. -При парсинге, некорректные даты и даты-с-временем могут парситься с естественным переполнением или как нулевые даты/даты-с-временем без сообщения об ошибке. - -В качестве исключения, поддерживается также парсинг даты-с-временем в формате unix timestamp, если он состоит ровно из 10 десятичных цифр. Результат не зависит от часового пояса. Различение форматов YYYY-MM-DD hh:mm:ss и NNNNNNNNNN делается автоматически. - -Строки выводятся с экранированием спец-символов с помощью обратного слеша. При выводе, используются следующие escape-последовательности: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\'`, `\\`. При парсинге, также поддерживаются последовательности `\a`, `\v`, а также `\xHH` (hex escape-последовательности) и любые последовательности вида `\c`, где `c` - любой символ - такие последовательности преобразуется в `c`. Таким образом, при чтении поддерживаются форматы, где перевод строки может быть записан как `\n` и как `\` и перевод строки. Например, строка `Hello world`, где между словами вместо пробела стоит перевод строки, может быть считана в любом из следующих вариантов: - -```text -Hello\nworld - -Hello\ -world -``` - -Второй вариант поддерживается, так как его использует MySQL при записи tab-separated дампа. - -Минимальный набор символов, которых вам необходимо экранировать при передаче в TabSeparated формате: таб, перевод строки (LF) и обратный слеш. - -Экранируется лишь небольшой набор символов. Вы можете легко наткнуться на строковое значение, которое испортит ваш терминал при выводе в него. - -Массивы форматируются в виде списка значений через запятую в квадратных скобках. Элементы массива - числа форматируются как обычно, а даты, даты-с-временем и строки - в одинарных кавычках с такими же правилами экранирования, как указано выше. - -[NULL](../query_language/syntax.md#null-literal) форматируется в виде `\N`. - - - -## TabSeparatedRaw - -Отличается от формата `TabSeparated` тем, что строки выводятся без экранирования. -Этот формат подходит только для вывода результата выполнения запроса, но не для парсинга (приёма данных для вставки в таблицу). - -Этот формат также доступен под именем `TSVRaw`. - - -## TabSeparatedWithNames - -Отличается от формата `TabSeparated` тем, что в первой строке пишутся имена столбцов. -При парсинге, первая строка полностью игнорируется: вы не можете использовать имена столбцов, чтобы указать их порядок расположения, или чтобы проверить их корректность. -(Поддержка обработки заголовка при парсинге может быть добавлена в будущем.) - -Этот формат также доступен под именем `TSVWithNames`. - - -## TabSeparatedWithNamesAndTypes - -Отличается от формата `TabSeparated` тем, что в первой строке пишутся имена столбцов, а во второй - типы столбцов. -При парсинге, первая и вторая строка полностью игнорируется. - -Этот формат также доступен под именем `TSVWithNamesAndTypes`. - - -## TSKV - -Похож на TabSeparated, но выводит значения в формате name=value. Имена экранируются так же, как строки в формате TabSeparated и, дополнительно, экранируется также символ =. - -```text -SearchPhrase= count()=8267016 -SearchPhrase=интерьер ванной комнаты count()=2166 -SearchPhrase=яндекс count()=1655 -SearchPhrase=весна 2014 мода count()=1549 -SearchPhrase=фриформ фото count()=1480 -SearchPhrase=анджелина джоли count()=1245 -SearchPhrase=омск count()=1112 -SearchPhrase=фото собак разных пород count()=1091 -SearchPhrase=дизайн штор count()=1064 -SearchPhrase=баку count()=1000 -``` - -[NULL](../query_language/syntax.md#null-literal) форматируется в виде `\N`. - -```sql -SELECT * FROM t_null FORMAT TSKV -``` -``` -x=1 y=\N -``` - -При большом количестве маленьких столбцов, этот формат существенно неэффективен, и обычно нет причин его использовать. Он реализован, так как используется в некоторых отделах Яндекса. - -Поддерживается как вывод, так и парсинг данных в этом формате. При парсинге, поддерживается расположение значений разных столбцов в произвольном порядке. Допустимо отсутствие некоторых значений - тогда они воспринимаются как равные значениям по умолчанию. При этом, в качестве значений по умолчанию используются нули, пустые строки и не поддерживаются сложные значения по умолчанию, которые могут быть заданы в таблице. - -При парсинге, в качестве дополнительного поля, может присутствовать `tskv` без знака равенства и без значения. Это поле игнорируется. - - ## Values Выводит каждую строку в скобках. Строки разделены запятыми. После последней строки запятой нет. Значения внутри скобок также разделены запятыми. Числа выводятся в десятичном виде без кавычек. Массивы выводятся в квадратных скобках. Строки, даты, даты-с-временем выводятся в кавычках. Правила экранирования и особенности парсинга аналогичны формату [TabSeparated](#tabseparated). При форматировании, лишние пробелы не ставятся, а при парсинге - допустимы и пропускаются (за исключением пробелов внутри значений типа массив, которые недопустимы). [NULL](../query_language/syntax.md#null-literal) представляется как `NULL`. @@ -619,3 +590,30 @@ test: string with \'quotes\' and \t with some special \n characters Массивы выводятся как `HelloWorld...`, а кортежи как `HelloWorld...`. + + + +## CapnProto + +Cap'n Proto - формат бинарных сообщений, похож на Protocol Buffers и Thrift, но не похож на JSON или MessagePack. + +Сообщения Cap'n Proto строго типизированы и не самоописывающиеся, т.е. нуждаются во внешнем описании схемы. Схема применяется "на лету" и кешируется для каждого запроса. + +```sql +SELECT SearchPhrase, count() AS c FROM test.hits + GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +``` + +Где `schema.capnp` выглядит следующим образом: + +``` +struct Message { + SearchPhrase @0 :Text; + c @1 :Uint64; +} +``` + + +Файлы со схемами находятся в файле, который находится в каталоге указанном в параметре [format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) конфигурации сервера. + +Десериализация эффективна и обычно не повышает нагрузку на систему. From d69aa5e75d1ae9f8b26e3c1d209d8f73691b1ee3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 15 Oct 2018 14:04:42 +0300 Subject: [PATCH 006/297] CLICKHOUSE-3306: add few http headers --- website/nginx/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/nginx/nginx.conf b/website/nginx/nginx.conf index 0227b86114f..24bfc1cca3b 100644 --- a/website/nginx/nginx.conf +++ b/website/nginx/nginx.conf @@ -32,6 +32,10 @@ http { gzip_comp_level 5; gzip_min_length 256; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options DENY; + add_header X-XSS-Protection "1; mode=block"; + include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } From 9fad43839c3bb4e6a90591d494405202a452affb Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 10:01:12 +0300 Subject: [PATCH 007/297] Remove copy-paste introduced in #3392 --- docs/tools/build.py | 8 +- .../assets/stylesheets/custom_zh.css | 172 ------------------ 2 files changed, 1 insertion(+), 179 deletions(-) delete mode 100644 docs/tools/mkdocs-material-theme/assets/stylesheets/custom_zh.css diff --git a/docs/tools/build.py b/docs/tools/build.py index bb11358175b..41cd9842346 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -36,12 +36,6 @@ def autoremoved_file(path): finally: os.unlink(path) - -def select_css_lang(lang): - if lang == 'zh': - return ['assets/stylesheets/custom_zh.css'] - return ['assets/stylesheets/custom.css'] - def build_for_lang(lang, args): logging.info('Building %s docs' % lang) @@ -92,7 +86,7 @@ def build_for_lang(lang, args): repo_name='yandex/ClickHouse', repo_url='https://github.com/yandex/ClickHouse/', edit_uri='edit/master/docs/%s' % lang, - extra_css=select_css_lang(lang), + extra_css=['assets/stylesheets/custom.css'], markdown_extensions=[ 'admonition', 'attr_list', diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom_zh.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom_zh.css deleted file mode 100644 index e10095a4f22..00000000000 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom_zh.css +++ /dev/null @@ -1,172 +0,0 @@ -@font-face { - font-family: 'Yandex Sans Text Web'; - src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot); - src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/CYblzLEXzCqQIvrYs7QKQe2omRk.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/pUcnOdRwl83MvPPzrNomhyletnA.woff) format('woff'), - url(https://yastatic.net/adv-www/_/vNFEmXOcGYKJ4AAidUprHWoXrLU.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/0w7OcWZM_QLP8x-LQUXFOgXO6dE.svg#YandexSansTextWeb-Bold) format('svg'); - font-weight: 700; - font-style: normal; - font-stretch: normal -} - -@font-face { - font-family: 'Yandex Sans Text Web'; - src: url(https://yastatic.net/adv-www/_/LI6l3L2RqcgxBe2pXmuUha37czQ.eot); - src: url(https://yastatic.net/adv-www/_/LI6l3L2RqcgxBe2pXmuUha37czQ.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/z3MYElcut0R2MF_Iw1RDNrstgYs.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/1jvKJ_-hCXl3s7gmFl-y_-UHTaI.woff) format('woff'), - url(https://yastatic.net/adv-www/_/9nzjfpCR2QHvK1EzHpDEIoVFGuY.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/gwyBTpxSwkFCF1looxqs6JokKls.svg#YandexSansTextWeb-Regular) format('svg'); - font-weight: 400; - font-style: normal; - font-stretch: normal -} - -@font-face { - font-family: 'Yandex Sans Text Web'; - src: url(https://yastatic.net/adv-www/_/ayAFYoY8swgBLhq_I56tKj2JftU.eot); - src: url(https://yastatic.net/adv-www/_/ayAFYoY8swgBLhq_I56tKj2JftU.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/lGQcYklLVV0hyvz1HFmFsUTj8_0.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/f0AAJ9GJ4iiwEmhG-7PWMHk6vUY.woff) format('woff'), - url(https://yastatic.net/adv-www/_/4UDe4nlVvgEJ-VmLWNVq3SxCsA.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/EKLr1STNokPqxLAQa_RyN82pL98.svg#YandexSansTextWeb-Light) format('svg'); - font-weight: 300; - font-style: normal; - font-stretch: normal -} - -@font-face { - font-family: 'Yandex Sans Display Web'; - src: url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot); - src: url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/sUYVCPUAQE7ExrvMS7FoISoO83s.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/v2Sve_obH3rKm6rKrtSQpf-eB7U.woff) format('woff'), - url(https://yastatic.net/adv-www/_/PzD8hWLMunow5i3RfJ6WQJAL7aI.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/lF_KG5g4tpQNlYIgA0e77fBSZ5s.svg#YandexSansDisplayWeb-Regular) format('svg'); - font-weight: 400; - font-style: normal; - font-stretch: normal -} - -@font-face { - font-family: 'Yandex Sans Display Web'; - src: url(https://yastatic.net/adv-www/_/g8_MyyKVquSZ3xEL6tarK__V9Vw.eot); - src: url(https://yastatic.net/adv-www/_/g8_MyyKVquSZ3xEL6tarK__V9Vw.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/LGiRvlfqQHlWR9YKLhsw5e7KGNA.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/40vXwNl4eYYMgteIVgLP49dwmfc.woff) format('woff'), - url(https://yastatic.net/adv-www/_/X6zG5x_wO8-AtwJ-vDLJcKC5228.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/ZKhaR0m08c8CRRL77GtFKoHcLYA.svg#YandexSansDisplayWeb-Light) format('svg'); - font-weight: 300; - font-style: normal; - font-stretch: normal -} - -body { - font-family: Lato,-apple-system,BlinkMacSystemFont,Helvetica,"Segoe UI","Hiragino Sans GB","Noto Sans CJK SC",Arial,Ubuntu,sans-serif,"Apple Color Emoji"; -} - -a:link, a:visited { - color: #08f; - text-decoration: none; -} - -.md-nav__link { - color: #000 !important; -} - -.md-nav__link[data-md-state='blur'] { - color: #888 !important; -} - - -.md-nav__link:hover, .md-nav__link:active { - color: #08f !important; - text-decoration: none; -} - -a:hover, a:active { - color: #f00; - text-decoration: underline; -} - -.md-typeset pre { - font: 13px/18px monospace, "Courier New"; - display: block; - padding: 1rem 3rem 1rem 1rem; - overflow: scroll; -} - -h1, h2, h3, .md-logo { - font-family: Lato,-apple-system,BlinkMacSystemFont,Helvetica,"Segoe UI","Hiragino Sans GB","Noto Sans CJK SC",Arial,Ubuntu,sans-serif,"Apple Color Emoji"; - color: #000 !important; -} - -.md-logo { - padding: 0; -} - -.md-header { - border-bottom: 1px solid #efefef; -} - -.md-header-nav__title { - font-size: 3rem; - font-family: Lato,-apple-system,BlinkMacSystemFont,Helvetica,"Segoe UI","Hiragino Sans GB","Noto Sans CJK SC",Arial,Ubuntu,sans-serif,"Apple Color Emoji"; -} - -.md-content__icon:hover { - text-decoration: none !important; - color: #08f !important; -} - -.md-content{ - -webkit-text-size-adjust: 100%; - line-height: 1.5; - color: #24292e; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - font-size: 16px; - word-wrap: break-word; -} - -.md-search-result__link { - text-decoration: none !important; -} - -.md-hide { - display: none; -} - -#md-extra-nav { - background: #efefef; - padding: 0.5rem 0; -} - -.grey { - color: #666; -} - -.md-alt-lang:hover { - text-decoration: none; -} - -.md-alt-lang>svg { - width: 36px; - height: 24px; - margin: 1.3rem 0; - filter: brightness(96%) grayscale(90%); -} - -.md-alt-lang:hover>svg { - filter: brightness(96%) grayscale(5%); -} - -.md-current-lang>svg { - filter: brightness(96%) grayscale(0%) !important; -} -@media only screen and (min-width: 60em) { - #md-sidebar-flags { - display: none; - } -} From 6643f40fb5e08ec00f8aca28a27806d15e014bfa Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 10:28:21 +0300 Subject: [PATCH 008/297] Hopefully better chinese fonts #3392 --- .../tools/mkdocs-material-theme/assets/stylesheets/custom.css | 4 ++++ docs/tools/mkdocs-material-theme/base.html | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css index 5b53c8f6967..d2eeaa3792f 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css @@ -67,6 +67,10 @@ body { font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; } +body.md-lang-zh { + font: 300 14pt/200% 'Yandex Sans Text Web', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; +} + a:link, a:visited { color: #08f; text-decoration: none; diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index 849b096f06d..b3d3ae2d0e4 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -71,9 +71,9 @@ {% if palette.primary or palette.accent %} {% set primary = palette.primary | replace(" ", "-") | lower %} {% set accent = palette.accent | replace(" ", "-") | lower %} - + {% else %} - + {% endif %} From 49b812544f75d84460d487e947553e913f856576 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 10:28:49 +0300 Subject: [PATCH 009/297] get rid of tabs @ custom.css --- .../assets/stylesheets/custom.css | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css index d2eeaa3792f..3af2b99db71 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css @@ -1,74 +1,74 @@ @font-face { - font-family: 'Yandex Sans Text Web'; - src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot); - src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/CYblzLEXzCqQIvrYs7QKQe2omRk.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/pUcnOdRwl83MvPPzrNomhyletnA.woff) format('woff'), - url(https://yastatic.net/adv-www/_/vNFEmXOcGYKJ4AAidUprHWoXrLU.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/0w7OcWZM_QLP8x-LQUXFOgXO6dE.svg#YandexSansTextWeb-Bold) format('svg'); - font-weight: 700; - font-style: normal; - font-stretch: normal + font-family: 'Yandex Sans Text Web'; + src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot); + src: url(https://yastatic.net/adv-www/_/yy5JveR58JFkc97waf-xp0i6_jM.eot?#iefix) format('embedded-opentype'), + url(https://yastatic.net/adv-www/_/CYblzLEXzCqQIvrYs7QKQe2omRk.woff2) format('woff2'), + url(https://yastatic.net/adv-www/_/pUcnOdRwl83MvPPzrNomhyletnA.woff) format('woff'), + url(https://yastatic.net/adv-www/_/vNFEmXOcGYKJ4AAidUprHWoXrLU.ttf) format('truetype'), + url(https://yastatic.net/adv-www/_/0w7OcWZM_QLP8x-LQUXFOgXO6dE.svg#YandexSansTextWeb-Bold) format('svg'); + font-weight: 700; + font-style: normal; + font-stretch: normal } @font-face { - font-family: 'Yandex Sans Text Web'; - src: url(https://yastatic.net/adv-www/_/LI6l3L2RqcgxBe2pXmuUha37czQ.eot); - src: url(https://yastatic.net/adv-www/_/LI6l3L2RqcgxBe2pXmuUha37czQ.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/z3MYElcut0R2MF_Iw1RDNrstgYs.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/1jvKJ_-hCXl3s7gmFl-y_-UHTaI.woff) format('woff'), - url(https://yastatic.net/adv-www/_/9nzjfpCR2QHvK1EzHpDEIoVFGuY.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/gwyBTpxSwkFCF1looxqs6JokKls.svg#YandexSansTextWeb-Regular) format('svg'); - font-weight: 400; - font-style: normal; - font-stretch: normal + font-family: 'Yandex Sans Text Web'; + src: url(https://yastatic.net/adv-www/_/LI6l3L2RqcgxBe2pXmuUha37czQ.eot); + src: url(https://yastatic.net/adv-www/_/LI6l3L2RqcgxBe2pXmuUha37czQ.eot?#iefix) format('embedded-opentype'), + url(https://yastatic.net/adv-www/_/z3MYElcut0R2MF_Iw1RDNrstgYs.woff2) format('woff2'), + url(https://yastatic.net/adv-www/_/1jvKJ_-hCXl3s7gmFl-y_-UHTaI.woff) format('woff'), + url(https://yastatic.net/adv-www/_/9nzjfpCR2QHvK1EzHpDEIoVFGuY.ttf) format('truetype'), + url(https://yastatic.net/adv-www/_/gwyBTpxSwkFCF1looxqs6JokKls.svg#YandexSansTextWeb-Regular) format('svg'); + font-weight: 400; + font-style: normal; + font-stretch: normal } @font-face { - font-family: 'Yandex Sans Text Web'; - src: url(https://yastatic.net/adv-www/_/ayAFYoY8swgBLhq_I56tKj2JftU.eot); - src: url(https://yastatic.net/adv-www/_/ayAFYoY8swgBLhq_I56tKj2JftU.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/lGQcYklLVV0hyvz1HFmFsUTj8_0.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/f0AAJ9GJ4iiwEmhG-7PWMHk6vUY.woff) format('woff'), - url(https://yastatic.net/adv-www/_/4UDe4nlVvgEJ-VmLWNVq3SxCsA.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/EKLr1STNokPqxLAQa_RyN82pL98.svg#YandexSansTextWeb-Light) format('svg'); - font-weight: 300; - font-style: normal; - font-stretch: normal + font-family: 'Yandex Sans Text Web'; + src: url(https://yastatic.net/adv-www/_/ayAFYoY8swgBLhq_I56tKj2JftU.eot); + src: url(https://yastatic.net/adv-www/_/ayAFYoY8swgBLhq_I56tKj2JftU.eot?#iefix) format('embedded-opentype'), + url(https://yastatic.net/adv-www/_/lGQcYklLVV0hyvz1HFmFsUTj8_0.woff2) format('woff2'), + url(https://yastatic.net/adv-www/_/f0AAJ9GJ4iiwEmhG-7PWMHk6vUY.woff) format('woff'), + url(https://yastatic.net/adv-www/_/4UDe4nlVvgEJ-VmLWNVq3SxCsA.ttf) format('truetype'), + url(https://yastatic.net/adv-www/_/EKLr1STNokPqxLAQa_RyN82pL98.svg#YandexSansTextWeb-Light) format('svg'); + font-weight: 300; + font-style: normal; + font-stretch: normal } @font-face { - font-family: 'Yandex Sans Display Web'; - src: url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot); - src: url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/sUYVCPUAQE7ExrvMS7FoISoO83s.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/v2Sve_obH3rKm6rKrtSQpf-eB7U.woff) format('woff'), - url(https://yastatic.net/adv-www/_/PzD8hWLMunow5i3RfJ6WQJAL7aI.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/lF_KG5g4tpQNlYIgA0e77fBSZ5s.svg#YandexSansDisplayWeb-Regular) format('svg'); - font-weight: 400; - font-style: normal; - font-stretch: normal + font-family: 'Yandex Sans Display Web'; + src: url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot); + src: url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot?#iefix) format('embedded-opentype'), + url(https://yastatic.net/adv-www/_/sUYVCPUAQE7ExrvMS7FoISoO83s.woff2) format('woff2'), + url(https://yastatic.net/adv-www/_/v2Sve_obH3rKm6rKrtSQpf-eB7U.woff) format('woff'), + url(https://yastatic.net/adv-www/_/PzD8hWLMunow5i3RfJ6WQJAL7aI.ttf) format('truetype'), + url(https://yastatic.net/adv-www/_/lF_KG5g4tpQNlYIgA0e77fBSZ5s.svg#YandexSansDisplayWeb-Regular) format('svg'); + font-weight: 400; + font-style: normal; + font-stretch: normal } @font-face { - font-family: 'Yandex Sans Display Web'; - src: url(https://yastatic.net/adv-www/_/g8_MyyKVquSZ3xEL6tarK__V9Vw.eot); - src: url(https://yastatic.net/adv-www/_/g8_MyyKVquSZ3xEL6tarK__V9Vw.eot?#iefix) format('embedded-opentype'), - url(https://yastatic.net/adv-www/_/LGiRvlfqQHlWR9YKLhsw5e7KGNA.woff2) format('woff2'), - url(https://yastatic.net/adv-www/_/40vXwNl4eYYMgteIVgLP49dwmfc.woff) format('woff'), - url(https://yastatic.net/adv-www/_/X6zG5x_wO8-AtwJ-vDLJcKC5228.ttf) format('truetype'), - url(https://yastatic.net/adv-www/_/ZKhaR0m08c8CRRL77GtFKoHcLYA.svg#YandexSansDisplayWeb-Light) format('svg'); - font-weight: 300; - font-style: normal; - font-stretch: normal + font-family: 'Yandex Sans Display Web'; + src: url(https://yastatic.net/adv-www/_/g8_MyyKVquSZ3xEL6tarK__V9Vw.eot); + src: url(https://yastatic.net/adv-www/_/g8_MyyKVquSZ3xEL6tarK__V9Vw.eot?#iefix) format('embedded-opentype'), + url(https://yastatic.net/adv-www/_/LGiRvlfqQHlWR9YKLhsw5e7KGNA.woff2) format('woff2'), + url(https://yastatic.net/adv-www/_/40vXwNl4eYYMgteIVgLP49dwmfc.woff) format('woff'), + url(https://yastatic.net/adv-www/_/X6zG5x_wO8-AtwJ-vDLJcKC5228.ttf) format('truetype'), + url(https://yastatic.net/adv-www/_/ZKhaR0m08c8CRRL77GtFKoHcLYA.svg#YandexSansDisplayWeb-Light) format('svg'); + font-weight: 300; + font-style: normal; + font-stretch: normal } body { - font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; + font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; } body.md-lang-zh { - font: 300 14pt/200% 'Yandex Sans Text Web', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font: 300 14pt/200% 'Yandex Sans Text Web', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } a:link, a:visited { @@ -77,7 +77,7 @@ a:link, a:visited { } .md-nav__link { - color: #000 !important; + color: #000 !important; } .md-nav__link[data-md-state='blur'] { @@ -104,11 +104,11 @@ a:hover, a:active { h1, h2, h3, .md-logo { font-family: 'Yandex Sans Display Web', Arial, sans-serif; - color: #000 !important; + color: #000 !important; } .md-logo { - padding: 0; + padding: 0; } .md-header { From 93189cec1ba9f791463c30ac3da6d3693862af9b Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 10:36:15 +0300 Subject: [PATCH 010/297] Apply comments and patch from #3384 --- docs/toc_zh.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index d8d201c6048..d3d0d7b4dfa 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -1,11 +1,11 @@ nav: - '介绍': - - 'Overview': 'index.md' - - 'Distinctive features of ClickHouse': 'introduction/distinctive_features.md' - - 'ClickHouse features that can be considered disadvantages': 'introduction/features_considered_disadvantages.md' - - 'Performance': 'introduction/performance.md' - - 'The Yandex.Metrica task': 'introduction/ya_metrika_task.md' + - '概貌': 'index.md' + - 'ClickHouse的独特功能': 'introduction/distinctive_features.md' + - 'ClickHouse功能可被视为缺点': 'introduction/features_considered_disadvantages.md' + - '性能': 'introduction/performance.md' + - 'Yandex.Metrica使用案例': 'introduction/ya_metrika_task.md' - '起步': - '部署运行': 'getting_started/index.md' @@ -28,7 +28,7 @@ nav: - '输入输出格式': 'interfaces/formats.md' - '数据类型': - - 'Introduction': 'data_types/index.md' + - '介绍': 'data_types/index.md' - 'UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64': 'data_types/int_uint.md' - 'Float32, Float64': 'data_types/float.md' - 'Decimal': 'data_types/decimal.md' @@ -51,7 +51,7 @@ nav: - 'Set': 'data_types/special_data_types/set.md' - 'Nothing': 'data_types/special_data_types/nothing.md' -- 'SQL 语法': +- 'SQL语法': - 'hidden': 'query_language/index.md' - 'SELECT': 'query_language/select.md' - 'INSERT INTO': 'query_language/insert_into.md' @@ -166,9 +166,9 @@ nav: - 'clickhouse-local': 'operations/utils/clickhouse-local.md' - '常见问题': - - 'General questions': 'faq/general.md' + - '一般的问题': 'faq/general.md' -- '开发': +- '开发者指南': - 'hidden': 'development/index.md' - 'Overview of ClickHouse architecture': 'development/architecture.md' - 'How to build ClickHouse on Linux': 'development/build.md' @@ -177,6 +177,6 @@ nav: - 'How to run ClickHouse tests': 'development/tests.md' - '新功能特性': - - 'Roadmap': 'roadmap.md' - - 'Changelog': 'changelog.md' - - 'Security changelog': 'security_changelog.md' + - '路线图': 'roadmap.md' + - '更新日志': 'changelog.md' + - '安全更改日志': 'security_changelog.md' From fcebbf709f7607bf80521457dacc1ab0ee4630ae Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 11:02:14 +0300 Subject: [PATCH 011/297] Add jdbc.md to ToC and some translation, though it still looks badly incomplete --- .../en/query_language/table_functions/jdbc.md | 23 +++++++++++++++++++ .../fa/query_language/table_functions/jdbc.md | 1 + .../ru/query_language/table_functions/jdbc.md | 4 ++-- docs/toc_en.yml | 1 + docs/toc_fa.yml | 1 + docs/toc_ru.yml | 1 + docs/toc_zh.yml | 1 + .../zh/query_language/table_functions/jdbc.md | 1 + 8 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 docs/en/query_language/table_functions/jdbc.md create mode 120000 docs/fa/query_language/table_functions/jdbc.md create mode 120000 docs/zh/query_language/table_functions/jdbc.md diff --git a/docs/en/query_language/table_functions/jdbc.md b/docs/en/query_language/table_functions/jdbc.md new file mode 100644 index 00000000000..6a7f29b2301 --- /dev/null +++ b/docs/en/query_language/table_functions/jdbc.md @@ -0,0 +1,23 @@ + + +# jdbc + +`jdbc(jdbc_connection_uri, schema, table)` - returns table that is connected via JDBC driver. + +This table function requires separate `clickhouse-jdbc-bridge` program to be running. +It supports Nullable types (based on DDL of remote table that is queried). + + +**Examples** + +```sql +SELECT * FROM jdbc('jdbc:mysql://localhost:3306/?user=root&password=root', 'schema', 'table') +``` + +```sql +SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', 'table') +``` + +```sql +SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table') +``` diff --git a/docs/fa/query_language/table_functions/jdbc.md b/docs/fa/query_language/table_functions/jdbc.md new file mode 120000 index 00000000000..73bec80ca58 --- /dev/null +++ b/docs/fa/query_language/table_functions/jdbc.md @@ -0,0 +1 @@ +../../../en/query_language/table_functions/jdbc.md \ No newline at end of file diff --git a/docs/ru/query_language/table_functions/jdbc.md b/docs/ru/query_language/table_functions/jdbc.md index 8a7ca2c4acd..60bcb27f27b 100644 --- a/docs/ru/query_language/table_functions/jdbc.md +++ b/docs/ru/query_language/table_functions/jdbc.md @@ -5,7 +5,7 @@ `jdbc(jdbc_connection_uri, schema, table)` - возвращает таблицу, соединение с которой происходит через JDBC-драйвер. Для работы этой табличной функциии требуется отдельно запускать приложение clickhouse-jdbc-bridge. -В отличии от табличной функции `odbc`, данная функция поддерживает Nullable типы (на основании DDL таблицы к которой происходит запрос). +Данная функция поддерживает Nullable типы (на основании DDL таблицы к которой происходит запрос). **Пример** @@ -20,4 +20,4 @@ SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', ```sql SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table') -``` \ No newline at end of file +``` diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 8b191b165f9..e6e63095dd8 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -100,6 +100,7 @@ nav: - 'numbers': 'query_language/table_functions/numbers.md' - 'remote': 'query_language/table_functions/remote.md' - 'url': 'query_language/table_functions/url.md' + - 'jdbc': 'query_language/table_functions/jdbc.md' - 'Dictionaries': - 'Introduction': 'query_language/dicts/index.md' - 'External dictionaries': diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 9970325f495..780d9747931 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -97,6 +97,7 @@ nav: - 'numbers': 'query_language/table_functions/numbers.md' - 'remote': 'query_language/table_functions/remote.md' - 'url': 'query_language/table_functions/url.md' + - 'jdbc': 'query_language/table_functions/jdbc.md' - 'Dictionaries': - 'Introduction': 'query_language/dicts/index.md' - 'External dictionaries': diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 8272e1b1186..9c5ee2db74f 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -101,6 +101,7 @@ nav: - 'numbers': 'query_language/table_functions/numbers.md' - 'remote': 'query_language/table_functions/remote.md' - 'url': 'query_language/table_functions/url.md' + - 'jdbc': 'query_language/table_functions/jdbc.md' - 'Словари': - 'Введение': 'query_language/dicts/index.md' - 'Внешние словари': diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index d3d0d7b4dfa..7a3bf5de7f0 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -100,6 +100,7 @@ nav: - 'numbers': 'query_language/table_functions/numbers.md' - 'remote': 'query_language/table_functions/remote.md' - 'url': 'query_language/table_functions/url.md' + - 'jdbc': 'query_language/table_functions/jdbc.md' - 'Dictionaries': - 'Introduction': 'query_language/dicts/index.md' - 'External dictionaries': diff --git a/docs/zh/query_language/table_functions/jdbc.md b/docs/zh/query_language/table_functions/jdbc.md new file mode 120000 index 00000000000..73bec80ca58 --- /dev/null +++ b/docs/zh/query_language/table_functions/jdbc.md @@ -0,0 +1 @@ +../../../en/query_language/table_functions/jdbc.md \ No newline at end of file From 73d412d2aff0707542b0509cf7f7c2cedebbaf8d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 11:11:29 +0300 Subject: [PATCH 012/297] minor punctuation --- docs/ru/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/index.md b/docs/ru/index.md index 487465f7c95..54e6b172342 100644 --- a/docs/ru/index.md +++ b/docs/ru/index.md @@ -52,7 +52,7 @@ ClickHouse - столбцовая система управления базам - транзакции отсутствуют; - низкие требования к консистентности данных; - в запросе одна большая таблица, все таблицы кроме одной маленькие; -- результат выполнения запроса существенно меньше исходных данных - то есть, данные фильтруются или агрегируются; результат выполнения помещается в оперативку на одном сервере; +- результат выполнения запроса существенно меньше исходных данных - то есть, данные фильтруются или агрегируются; результат выполнения помещается в оперативку на одном сервере. Легко видеть, что OLAP сценарий работы существенно отличается от других распространённых сценариев работы (например, OLTP или Key-Value сценариев работы). Таким образом, не имеет никакого смысла пытаться использовать OLTP или Key-Value БД для обработки аналитических запросов, если вы хотите получить приличную производительность ("выше плинтуса"). Например, если вы попытаетесь использовать для аналитики MongoDB или Redis - вы получите анекдотически низкую производительность по сравнению с OLAP-СУБД. From ce208ce2917e58cb74885b1481ca6d733925985f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 12:10:07 +0300 Subject: [PATCH 013/297] Add some backlinks to official website from mirrors that just blindly take markdown sources --- docs/en/data_types/array.md | 2 ++ docs/en/data_types/boolean.md | 2 ++ docs/en/data_types/date.md | 2 ++ docs/en/data_types/datetime.md | 2 ++ docs/en/data_types/decimal.md | 2 ++ docs/en/data_types/enum.md | 2 ++ docs/en/data_types/fixedstring.md | 2 ++ docs/en/data_types/float.md | 2 ++ docs/en/data_types/index.md | 2 ++ docs/en/data_types/int_uint.md | 2 ++ .../aggregatefunction.md | 2 ++ .../nested_data_structures/index.md | 2 ++ .../nested_data_structures/nested.md | 2 ++ docs/en/data_types/nullable.md | 2 ++ .../special_data_types/expression.md | 2 ++ .../en/data_types/special_data_types/index.md | 2 ++ .../data_types/special_data_types/nothing.md | 2 ++ docs/en/data_types/special_data_types/set.md | 2 ++ docs/en/data_types/string.md | 2 ++ docs/en/data_types/tuple.md | 2 ++ docs/en/development/architecture.md | 2 ++ docs/en/development/build.md | 2 ++ docs/en/development/build_osx.md | 2 ++ docs/en/development/index.md | 2 ++ docs/en/development/style.md | 2 ++ docs/en/development/tests.md | 2 ++ docs/en/faq/general.md | 2 ++ .../example_datasets/amplab_benchmark.md | 2 ++ .../example_datasets/criteo.md | 2 ++ .../example_datasets/nyc_taxi.md | 2 ++ .../example_datasets/ontime.md | 2 ++ .../example_datasets/star_schema.md | 2 ++ .../example_datasets/wikistat.md | 2 ++ docs/en/getting_started/index.md | 2 ++ docs/en/index.md | 2 ++ docs/en/interfaces/cli.md | 2 ++ docs/en/interfaces/formats.md | 2 ++ docs/en/interfaces/http_interface.md | 2 ++ docs/en/interfaces/index.md | 2 ++ docs/en/interfaces/jdbc.md | 2 ++ docs/en/interfaces/tcp.md | 2 ++ .../third-party_client_libraries.md | 2 ++ docs/en/interfaces/third-party_gui.md | 2 ++ docs/en/introduction/distinctive_features.md | 2 ++ .../features_considered_disadvantages.md | 2 ++ docs/en/introduction/performance.md | 2 ++ docs/en/introduction/ya_metrika_task.md | 2 ++ docs/en/operations/access_rights.md | 2 ++ docs/en/operations/configuration_files.md | 2 ++ docs/en/operations/index.md | 2 ++ docs/en/operations/quotas.md | 2 ++ docs/en/operations/server_settings/index.md | 2 ++ .../en/operations/server_settings/settings.md | 2 ++ docs/en/operations/settings/index.md | 2 ++ .../operations/settings/query_complexity.md | 2 ++ docs/en/operations/settings/settings.md | 2 ++ .../operations/settings/settings_profiles.md | 2 ++ docs/en/operations/system_tables.md | 2 ++ .../table_engines/aggregatingmergetree.md | 2 ++ docs/en/operations/table_engines/buffer.md | 2 ++ .../table_engines/collapsingmergetree.md | 2 ++ .../table_engines/custom_partitioning_key.md | 2 ++ .../en/operations/table_engines/dictionary.md | 2 ++ .../operations/table_engines/distributed.md | 2 ++ .../operations/table_engines/external_data.md | 2 ++ docs/en/operations/table_engines/file.md | 2 ++ .../table_engines/graphitemergetree.md | 2 ++ docs/en/operations/table_engines/index.md | 2 ++ docs/en/operations/table_engines/join.md | 2 ++ docs/en/operations/table_engines/kafka.md | 2 ++ docs/en/operations/table_engines/log.md | 2 ++ .../table_engines/materializedview.md | 2 ++ docs/en/operations/table_engines/memory.md | 2 ++ docs/en/operations/table_engines/merge.md | 2 ++ docs/en/operations/table_engines/mergetree.md | 2 ++ docs/en/operations/table_engines/mysql.md | 2 ++ docs/en/operations/table_engines/null.md | 2 ++ .../table_engines/replacingmergetree.md | 2 ++ .../operations/table_engines/replication.md | 2 ++ docs/en/operations/table_engines/set.md | 2 ++ .../table_engines/summingmergetree.md | 2 ++ docs/en/operations/table_engines/tinylog.md | 2 ++ docs/en/operations/table_engines/url.md | 2 ++ docs/en/operations/table_engines/view.md | 2 ++ docs/en/operations/tips.md | 2 ++ docs/en/operations/utils/clickhouse-copier.md | 2 ++ docs/en/operations/utils/clickhouse-local.md | 2 ++ docs/en/operations/utils/index.md | 2 ++ .../agg_functions/combinators.md | 2 ++ docs/en/query_language/agg_functions/index.md | 2 ++ .../agg_functions/parametric_functions.md | 2 ++ .../query_language/agg_functions/reference.md | 2 ++ docs/en/query_language/alter.md | 2 ++ docs/en/query_language/create.md | 2 ++ .../en/query_language/dicts/external_dicts.md | 2 ++ .../dicts/external_dicts_dict.md | 2 ++ .../dicts/external_dicts_dict_layout.md | 2 ++ .../dicts/external_dicts_dict_lifetime.md | 2 ++ .../dicts/external_dicts_dict_sources.md | 2 ++ .../dicts/external_dicts_dict_structure.md | 2 ++ docs/en/query_language/dicts/index.md | 2 ++ .../en/query_language/dicts/internal_dicts.md | 2 ++ .../functions/arithmetic_functions.md | 2 ++ .../functions/array_functions.md | 2 ++ .../en/query_language/functions/array_join.md | 2 ++ .../query_language/functions/bit_functions.md | 2 ++ .../functions/comparison_functions.md | 2 ++ .../functions/conditional_functions.md | 2 ++ .../functions/date_time_functions.md | 2 ++ .../functions/encoding_functions.md | 2 ++ .../functions/ext_dict_functions.md | 2 ++ .../functions/functions_for_nulls.md | 2 ++ docs/en/query_language/functions/geo.md | 2 ++ .../functions/hash_functions.md | 2 ++ .../functions/higher_order_functions.md | 2 ++ .../query_language/functions/in_functions.md | 2 ++ docs/en/query_language/functions/index.md | 2 ++ .../functions/ip_address_functions.md | 2 ++ .../functions/json_functions.md | 2 ++ .../functions/logical_functions.md | 2 ++ .../functions/math_functions.md | 2 ++ .../functions/other_functions.md | 2 ++ .../functions/random_functions.md | 2 ++ .../functions/rounding_functions.md | 2 ++ .../functions/splitting_merging_functions.md | 3 ++- .../functions/string_functions.md | 2 ++ .../functions/string_replace_functions.md | 2 ++ .../functions/string_search_functions.md | 2 ++ .../functions/type_conversion_functions.md | 2 ++ .../query_language/functions/url_functions.md | 2 ++ .../functions/ym_dict_functions.md | 2 ++ docs/en/query_language/index.md | 2 ++ docs/en/query_language/insert_into.md | 2 ++ docs/en/query_language/misc.md | 2 ++ docs/en/query_language/operators.md | 2 ++ docs/en/query_language/select.md | 2 ++ docs/en/query_language/syntax.md | 2 ++ .../en/query_language/table_functions/file.md | 2 ++ .../query_language/table_functions/index.md | 2 ++ .../en/query_language/table_functions/jdbc.md | 2 ++ .../query_language/table_functions/merge.md | 2 ++ .../query_language/table_functions/numbers.md | 2 ++ .../query_language/table_functions/remote.md | 2 ++ docs/en/query_language/table_functions/url.md | 2 ++ docs/en/roadmap.md | 2 ++ docs/en/security_changelog.md | 2 ++ docs/fa/data_types/array.md | 3 ++- docs/fa/data_types/boolean.md | 2 ++ docs/fa/data_types/date.md | 3 ++- docs/fa/data_types/datetime.md | 2 ++ docs/fa/data_types/enum.md | 3 ++- docs/fa/data_types/fixedstring.md | 3 ++- docs/fa/data_types/float.md | 3 ++- docs/fa/data_types/index.md | 2 ++ docs/fa/data_types/int_uint.md | 3 ++- .../aggregatefunction.md | 3 ++- .../nested_data_structures/index.md | 2 ++ .../nested_data_structures/nested.md | 3 ++- .../special_data_types/expression.md | 3 ++- .../fa/data_types/special_data_types/index.md | 3 ++- docs/fa/data_types/special_data_types/set.md | 3 ++- docs/fa/data_types/string.md | 3 ++- docs/fa/data_types/tuple.md | 3 ++- .../example_datasets/amplab_benchmark.md | 2 ++ .../example_datasets/criteo.md | 2 ++ .../example_datasets/nyc_taxi.md | 3 ++- .../example_datasets/ontime.md | 2 ++ .../example_datasets/star_schema.md | 2 ++ .../example_datasets/wikistat.md | 2 ++ docs/fa/getting_started/index.md | 3 ++- docs/fa/index.md | 2 ++ docs/fa/interfaces/cli.md | 2 ++ docs/fa/interfaces/formats.md | 2 ++ docs/fa/interfaces/http_interface.md | 2 ++ docs/fa/interfaces/index.md | 3 ++- docs/fa/interfaces/jdbc.md | 3 ++- docs/fa/interfaces/tcp.md | 3 ++- .../third-party_client_libraries.md | 3 ++- docs/fa/interfaces/third-party_gui.md | 3 ++- docs/fa/introduction/distinctive_features.md | 3 ++- .../features_considered_disadvantages.md | 2 ++ docs/fa/introduction/performance.md | 3 ++- docs/fa/introduction/ya_metrika_task.md | 3 ++- docs/ru/data_types/array.md | 2 ++ docs/ru/data_types/boolean.md | 2 ++ docs/ru/data_types/date.md | 2 ++ docs/ru/data_types/datetime.md | 2 ++ docs/ru/data_types/decimal.md | 2 ++ docs/ru/data_types/enum.md | 2 ++ docs/ru/data_types/fixedstring.md | 2 ++ docs/ru/data_types/float.md | 2 ++ docs/ru/data_types/index.md | 3 ++- docs/ru/data_types/int_uint.md | 2 ++ .../aggregatefunction.md | 2 ++ .../nested_data_structures/index.md | 3 ++- .../nested_data_structures/nested.md | 2 ++ docs/ru/data_types/nullable.md | 2 ++ .../special_data_types/expression.md | 2 ++ .../ru/data_types/special_data_types/index.md | 2 ++ .../data_types/special_data_types/nothing.md | 2 ++ docs/ru/data_types/special_data_types/set.md | 2 ++ docs/ru/data_types/string.md | 2 ++ docs/ru/data_types/tuple.md | 2 ++ docs/ru/development/style.md | 2 ++ docs/ru/faq/general.md | 3 ++- .../example_datasets/amplab_benchmark.md | 2 ++ .../example_datasets/criteo.md | 2 ++ .../example_datasets/nyc_taxi.md | 2 ++ .../example_datasets/ontime.md | 2 ++ .../example_datasets/star_schema.md | 2 ++ .../example_datasets/wikistat.md | 2 ++ docs/ru/getting_started/index.md | 2 ++ docs/ru/index.md | 2 ++ docs/ru/interfaces/cli.md | 3 ++- docs/ru/interfaces/formats.md | 2 ++ docs/ru/interfaces/http_interface.md | 2 ++ docs/ru/interfaces/index.md | 2 ++ docs/ru/interfaces/jdbc.md | 2 ++ docs/ru/interfaces/tcp.md | 2 ++ .../third-party_client_libraries.md | 2 ++ docs/ru/interfaces/third-party_gui.md | 2 ++ docs/ru/introduction/distinctive_features.md | 2 ++ .../features_considered_disadvantages.md | 2 ++ docs/ru/introduction/performance.md | 2 ++ docs/ru/introduction/ya_metrika_task.md | 2 ++ docs/ru/operations/access_rights.md | 2 ++ docs/ru/operations/configuration_files.md | 2 ++ docs/ru/operations/index.md | 2 ++ docs/ru/operations/quotas.md | 2 ++ docs/ru/operations/server_settings/index.md | 2 ++ .../ru/operations/server_settings/settings.md | 2 ++ docs/ru/operations/settings/index.md | 2 ++ .../operations/settings/query_complexity.md | 2 ++ docs/ru/operations/settings/settings.md | 2 ++ .../operations/settings/settings_profiles.md | 2 ++ docs/ru/operations/system_tables.md | 2 ++ .../table_engines/aggregatingmergetree.md | 2 ++ docs/ru/operations/table_engines/buffer.md | 2 ++ .../table_engines/collapsingmergetree.md | 2 ++ .../table_engines/custom_partitioning_key.md | 2 ++ .../ru/operations/table_engines/dictionary.md | 2 ++ .../operations/table_engines/distributed.md | 2 ++ .../operations/table_engines/external_data.md | 2 ++ docs/ru/operations/table_engines/file.md | 2 ++ .../table_engines/graphitemergetree.md | 2 ++ docs/ru/operations/table_engines/index.md | 2 ++ docs/ru/operations/table_engines/join.md | 2 ++ docs/ru/operations/table_engines/kafka.md | 2 ++ docs/ru/operations/table_engines/log.md | 2 ++ .../table_engines/materializedview.md | 2 ++ docs/ru/operations/table_engines/memory.md | 2 ++ docs/ru/operations/table_engines/merge.md | 2 ++ docs/ru/operations/table_engines/mergetree.md | 2 ++ docs/ru/operations/table_engines/mysql.md | 2 ++ docs/ru/operations/table_engines/null.md | 2 ++ .../table_engines/replacingmergetree.md | 2 ++ .../operations/table_engines/replication.md | 2 ++ docs/ru/operations/table_engines/set.md | 2 ++ .../table_engines/summingmergetree.md | 2 ++ docs/ru/operations/table_engines/tinylog.md | 2 ++ docs/ru/operations/table_engines/url.md | 2 ++ docs/ru/operations/table_engines/view.md | 2 ++ docs/ru/operations/tips.md | 2 ++ docs/ru/operations/utils/clickhouse-copier.md | 2 ++ docs/ru/operations/utils/clickhouse-local.md | 2 ++ docs/ru/operations/utils/index.md | 2 ++ .../agg_functions/combinators.md | 2 ++ docs/ru/query_language/agg_functions/index.md | 2 ++ .../agg_functions/parametric_functions.md | 2 ++ .../query_language/agg_functions/reference.md | 2 ++ docs/ru/query_language/alter.md | 2 ++ docs/ru/query_language/create.md | 2 ++ .../ru/query_language/dicts/external_dicts.md | 2 ++ .../dicts/external_dicts_dict.md | 2 ++ .../dicts/external_dicts_dict_layout.md | 2 ++ .../dicts/external_dicts_dict_lifetime.md | 2 ++ .../dicts/external_dicts_dict_sources.md | 2 ++ .../dicts/external_dicts_dict_structure.md | 2 ++ docs/ru/query_language/dicts/index.md | 2 ++ .../ru/query_language/dicts/internal_dicts.md | 2 ++ .../functions/arithmetic_functions.md | 2 ++ .../functions/array_functions.md | 2 ++ .../ru/query_language/functions/array_join.md | 2 ++ .../query_language/functions/bit_functions.md | 2 ++ .../functions/comparison_functions.md | 2 ++ .../functions/conditional_functions.md | 2 ++ .../functions/date_time_functions.md | 2 ++ .../functions/encoding_functions.md | 2 ++ .../functions/ext_dict_functions.md | 2 ++ .../functions/functions_for_nulls.md | 2 ++ docs/ru/query_language/functions/geo.md | 2 ++ .../functions/hash_functions.md | 2 ++ .../functions/higher_order_functions.md | 2 ++ .../query_language/functions/in_functions.md | 2 ++ docs/ru/query_language/functions/index.md | 2 ++ .../functions/ip_address_functions.md | 2 ++ .../functions/json_functions.md | 2 ++ .../functions/logical_functions.md | 2 ++ .../functions/math_functions.md | 2 ++ .../functions/other_functions.md | 2 ++ .../functions/random_functions.md | 2 ++ .../functions/rounding_functions.md | 2 ++ .../functions/splitting_merging_functions.md | 3 ++- .../functions/string_functions.md | 2 ++ .../functions/string_replace_functions.md | 2 ++ .../functions/string_search_functions.md | 2 ++ .../functions/type_conversion_functions.md | 2 ++ .../query_language/functions/url_functions.md | 2 ++ .../functions/ym_dict_functions.md | 2 ++ docs/ru/query_language/index.md | 2 ++ docs/ru/query_language/insert_into.md | 2 ++ docs/ru/query_language/misc.md | 2 ++ docs/ru/query_language/operators.md | 2 ++ docs/ru/query_language/select.md | 2 ++ docs/ru/query_language/syntax.md | 2 ++ .../ru/query_language/table_functions/file.md | 2 ++ .../query_language/table_functions/index.md | 2 ++ .../ru/query_language/table_functions/jdbc.md | 2 ++ .../query_language/table_functions/merge.md | 2 ++ .../query_language/table_functions/numbers.md | 2 ++ .../query_language/table_functions/remote.md | 2 ++ docs/ru/query_language/table_functions/url.md | 2 ++ docs/ru/roadmap.md | 2 ++ docs/ru/security_changelog.md | 3 ++- docs/tools/build.py | 16 ++++++++++++++ docs/tools/mdx_clickhouse.py | 22 +++++++++++++++++++ docs/zh/faq/general.md | 2 ++ docs/zh/index.md | 2 ++ docs/zh/interfaces/cli.md | 2 ++ docs/zh/interfaces/formats.md | 2 ++ docs/zh/interfaces/http_interface.md | 2 ++ docs/zh/interfaces/index.md | 2 ++ docs/zh/interfaces/jdbc.md | 2 ++ docs/zh/interfaces/tcp.md | 2 ++ .../third-party_client_libraries.md | 2 ++ docs/zh/interfaces/third-party_gui.md | 2 ++ 336 files changed, 706 insertions(+), 30 deletions(-) create mode 100755 docs/tools/mdx_clickhouse.py diff --git a/docs/en/data_types/array.md b/docs/en/data_types/array.md index 8bb8d2200c7..f8d909cfae5 100644 --- a/docs/en/data_types/array.md +++ b/docs/en/data_types/array.md @@ -83,3 +83,5 @@ Code: 386. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception 0 rows in set. Elapsed: 0.246 sec. ``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/array/) diff --git a/docs/en/data_types/boolean.md b/docs/en/data_types/boolean.md index 14cde15910c..52d2c8e320c 100644 --- a/docs/en/data_types/boolean.md +++ b/docs/en/data_types/boolean.md @@ -2,3 +2,5 @@ There isn't a separate type for boolean values. They use the UInt8 type, restricted to the values 0 or 1. + +[Original article](https://clickhouse.yandex/docs/en/data_types/boolean/) diff --git a/docs/en/data_types/date.md b/docs/en/data_types/date.md index cb179c0d8c4..b5bac572a73 100644 --- a/docs/en/data_types/date.md +++ b/docs/en/data_types/date.md @@ -5,3 +5,5 @@ The minimum value is output as 0000-00-00. The date is stored without the time zone. + +[Original article](https://clickhouse.yandex/docs/en/data_types/date/) diff --git a/docs/en/data_types/datetime.md b/docs/en/data_types/datetime.md index 584a0048554..c87eacbc644 100644 --- a/docs/en/data_types/datetime.md +++ b/docs/en/data_types/datetime.md @@ -13,3 +13,5 @@ By default, the client switches to the timezone of the server when it connects. So when working with a textual date (for example, when saving text dumps), keep in mind that there may be ambiguity during changes for daylight savings time, and there may be problems matching data if the time zone changed. + +[Original article](https://clickhouse.yandex/docs/en/data_types/datetime/) diff --git a/docs/en/data_types/decimal.md b/docs/en/data_types/decimal.md index fe321ee99a4..101b59adaec 100644 --- a/docs/en/data_types/decimal.md +++ b/docs/en/data_types/decimal.md @@ -95,3 +95,5 @@ SELECT toDecimal32(1, 8) < 100 ``` DB::Exception: Can't compare. ``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/decimal/) diff --git a/docs/en/data_types/enum.md b/docs/en/data_types/enum.md index a3f44ca99bb..7faeecf5b4c 100644 --- a/docs/en/data_types/enum.md +++ b/docs/en/data_types/enum.md @@ -113,3 +113,5 @@ The Enum type can be changed without cost using ALTER, if only the set of values Using ALTER, it is possible to change an Enum8 to an Enum16 or vice versa, just like changing an Int8 to Int16. + +[Original article](https://clickhouse.yandex/docs/en/data_types/enum/) diff --git a/docs/en/data_types/fixedstring.md b/docs/en/data_types/fixedstring.md index d83b0087057..5e158ccd2e0 100644 --- a/docs/en/data_types/fixedstring.md +++ b/docs/en/data_types/fixedstring.md @@ -8,3 +8,5 @@ Note that this behavior differs from MySQL behavior for the CHAR type (where str Fewer functions can work with the FixedString(N) type than with String, so it is less convenient to use. + +[Original article](https://clickhouse.yandex/docs/en/data_types/fixedstring/) diff --git a/docs/en/data_types/float.md b/docs/en/data_types/float.md index d05758b0e8a..1c95cc48c2e 100644 --- a/docs/en/data_types/float.md +++ b/docs/en/data_types/float.md @@ -69,3 +69,5 @@ SELECT 0 / 0 See the rules for `NaN` sorting in the section [ORDER BY clause](../query_language/select.md#query_language-queries-order_by). + +[Original article](https://clickhouse.yandex/docs/en/data_types/float/) diff --git a/docs/en/data_types/index.md b/docs/en/data_types/index.md index ecab86c25e0..9acd30e11f2 100644 --- a/docs/en/data_types/index.md +++ b/docs/en/data_types/index.md @@ -6,3 +6,5 @@ ClickHouse can store various types of data in table cells. This section describes the supported data types and special considerations when using and/or implementing them, if any. + +[Original article](https://clickhouse.yandex/docs/en/data_types/) diff --git a/docs/en/data_types/int_uint.md b/docs/en/data_types/int_uint.md index cd940f28742..75a0d7bbde9 100644 --- a/docs/en/data_types/int_uint.md +++ b/docs/en/data_types/int_uint.md @@ -18,3 +18,5 @@ Fixed-length integers, with or without a sign. - UInt32 - [0 : 4294967295] - UInt64 - [0 : 18446744073709551615] + +[Original article](https://clickhouse.yandex/docs/en/data_types/int_uint/) diff --git a/docs/en/data_types/nested_data_structures/aggregatefunction.md b/docs/en/data_types/nested_data_structures/aggregatefunction.md index 33e7b4f316c..1db3bb9e079 100644 --- a/docs/en/data_types/nested_data_structures/aggregatefunction.md +++ b/docs/en/data_types/nested_data_structures/aggregatefunction.md @@ -2,3 +2,5 @@ The intermediate state of an aggregate function. To get it, use aggregate functions with the '-State' suffix. For more information, see "AggregatingMergeTree". + +[Original article](https://clickhouse.yandex/docs/en/data_types/nested_data_structures/aggregatefunction/) diff --git a/docs/en/data_types/nested_data_structures/index.md b/docs/en/data_types/nested_data_structures/index.md index 53acd5b558d..1c4d2c902a8 100644 --- a/docs/en/data_types/nested_data_structures/index.md +++ b/docs/en/data_types/nested_data_structures/index.md @@ -1,2 +1,4 @@ # Nested Data Structures + +[Original article](https://clickhouse.yandex/docs/en/data_types/nested_data_structures/) diff --git a/docs/en/data_types/nested_data_structures/nested.md b/docs/en/data_types/nested_data_structures/nested.md index 8a4bd4297fb..3083d0f915c 100644 --- a/docs/en/data_types/nested_data_structures/nested.md +++ b/docs/en/data_types/nested_data_structures/nested.md @@ -96,3 +96,5 @@ For a DESCRIBE query, the columns in a nested data structure are listed separate The ALTER query is very limited for elements in a nested data structure. + +[Original article](https://clickhouse.yandex/docs/en/data_types/nested_data_structures/nested/) diff --git a/docs/en/data_types/nullable.md b/docs/en/data_types/nullable.md index 5cddb4c5173..87d0ac0c337 100644 --- a/docs/en/data_types/nullable.md +++ b/docs/en/data_types/nullable.md @@ -53,3 +53,5 @@ FROM t_null 2 rows in set. Elapsed: 0.144 sec. ``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/nullable/) diff --git a/docs/en/data_types/special_data_types/expression.md b/docs/en/data_types/special_data_types/expression.md index 0fec4b71578..0bc7f635a0b 100644 --- a/docs/en/data_types/special_data_types/expression.md +++ b/docs/en/data_types/special_data_types/expression.md @@ -2,3 +2,5 @@ Used for representing lambda expressions in high-order functions. + +[Original article](https://clickhouse.yandex/docs/en/data_types/special_data_types/expression/) diff --git a/docs/en/data_types/special_data_types/index.md b/docs/en/data_types/special_data_types/index.md index 2c4b62deaa8..c66857cf5df 100644 --- a/docs/en/data_types/special_data_types/index.md +++ b/docs/en/data_types/special_data_types/index.md @@ -2,3 +2,5 @@ Special data type values can't be saved to a table or output in results, but are used as the intermediate result of running a query. + +[Original article](https://clickhouse.yandex/docs/en/data_types/special_data_types/) diff --git a/docs/en/data_types/special_data_types/nothing.md b/docs/en/data_types/special_data_types/nothing.md index 525142fd3ac..5b916b05557 100644 --- a/docs/en/data_types/special_data_types/nothing.md +++ b/docs/en/data_types/special_data_types/nothing.md @@ -20,3 +20,5 @@ SELECT toTypeName([]) 1 rows in set. Elapsed: 0.062 sec. ``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/special_data_types/nothing/) diff --git a/docs/en/data_types/special_data_types/set.md b/docs/en/data_types/special_data_types/set.md index 346fe51e2bb..d2d61e7ac62 100644 --- a/docs/en/data_types/special_data_types/set.md +++ b/docs/en/data_types/special_data_types/set.md @@ -2,3 +2,5 @@ Used for the right half of an IN expression. + +[Original article](https://clickhouse.yandex/docs/en/data_types/special_data_types/set/) diff --git a/docs/en/data_types/string.md b/docs/en/data_types/string.md index 5386be28c96..5e2fe8e1807 100644 --- a/docs/en/data_types/string.md +++ b/docs/en/data_types/string.md @@ -12,3 +12,5 @@ If you need to store texts, we recommend using UTF-8 encoding. At the very least Similarly, certain functions for working with strings have separate variations that work under the assumption that the string contains a set of bytes representing a UTF-8 encoded text. For example, the 'length' function calculates the string length in bytes, while the 'lengthUTF8' function calculates the string length in Unicode code points, assuming that the value is UTF-8 encoded. + +[Original article](https://clickhouse.yandex/docs/en/data_types/string/) diff --git a/docs/en/data_types/tuple.md b/docs/en/data_types/tuple.md index 98e548fe837..592e5537bdb 100644 --- a/docs/en/data_types/tuple.md +++ b/docs/en/data_types/tuple.md @@ -52,3 +52,5 @@ SELECT 1 rows in set. Elapsed: 0.002 sec. ``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/tuple/) diff --git a/docs/en/development/architecture.md b/docs/en/development/architecture.md index 0f443538292..e20dc2eeb6d 100644 --- a/docs/en/development/architecture.md +++ b/docs/en/development/architecture.md @@ -193,3 +193,5 @@ In addition, each replica stores its state in ZooKeeper as the set of parts and > The ClickHouse cluster consists of independent shards, and each shard consists of replicas. The cluster is not elastic, so after adding a new shard, data is not rebalanced between shards automatically. Instead, the cluster load will be uneven. This implementation gives you more control, and it is fine for relatively small clusters such as tens of nodes. But for clusters with hundreds of nodes that we are using in production, this approach becomes a significant drawback. We should implement a table engine that will span its data across the cluster with dynamically replicated regions that could be split and balanced between clusters automatically. + +[Original article](https://clickhouse.yandex/docs/en/development/architecture/) diff --git a/docs/en/development/build.md b/docs/en/development/build.md index d2470cf2f79..bb434ae5b54 100644 --- a/docs/en/development/build.md +++ b/docs/en/development/build.md @@ -95,3 +95,5 @@ cd .. To create an executable, run `ninja clickhouse`. This will create the `dbms/programs/clickhouse` executable, which can be used with `client` or `server` arguments. + +[Original article](https://clickhouse.yandex/docs/en/development/build/) diff --git a/docs/en/development/build_osx.md b/docs/en/development/build_osx.md index 4e2aa2a6ff1..7de659e7ccd 100644 --- a/docs/en/development/build_osx.md +++ b/docs/en/development/build_osx.md @@ -79,3 +79,5 @@ Reboot. To check if it's working, you can use `ulimit -n` command. + +[Original article](https://clickhouse.yandex/docs/en/development/build_osx/) diff --git a/docs/en/development/index.md b/docs/en/development/index.md index a7b046fd22d..d9095f383b3 100644 --- a/docs/en/development/index.md +++ b/docs/en/development/index.md @@ -1,2 +1,4 @@ # ClickHouse Development + +[Original article](https://clickhouse.yandex/docs/en/development/) diff --git a/docs/en/development/style.md b/docs/en/development/style.md index d80f535e125..edfda73a7eb 100644 --- a/docs/en/development/style.md +++ b/docs/en/development/style.md @@ -834,3 +834,5 @@ function( const & RangesInDataParts ranges, size_t limit) ``` + +[Original article](https://clickhouse.yandex/docs/en/development/style/) diff --git a/docs/en/development/tests.md b/docs/en/development/tests.md index ee2402aedc7..5455a234ae3 100644 --- a/docs/en/development/tests.md +++ b/docs/en/development/tests.md @@ -249,3 +249,5 @@ In Travis CI due to limit on time and computational power we can afford only sub In Jenkins we run functional tests for each commit and for each pull request from trusted users; the same under ASan; we also run quorum tests, dictionary tests, Metrica B2B tests. We use Jenkins to prepare and publish releases. Worth to note that we are not happy with Jenkins at all. One of our goals is to provide reliable testing infrastructure that will be available to community. + +[Original article](https://clickhouse.yandex/docs/en/development/tests/) diff --git a/docs/en/faq/general.md b/docs/en/faq/general.md index 2b19d6f35bf..f5b9d29b5bd 100644 --- a/docs/en/faq/general.md +++ b/docs/en/faq/general.md @@ -11,3 +11,5 @@ Distributed sorting is one of the main causes of reduced performance when runnin Most MapReduce implementations allow you to execute arbitrary code on a cluster. But a declarative query language is better suited to OLAP in order to run experiments quickly. For example, Hadoop has Hive and Pig. Also consider Cloudera Impala or Shark (outdated) for Spark, as well as Spark SQL, Presto, and Apache Drill. Performance when running such tasks is highly sub-optimal compared to specialized systems, but relatively high latency makes it unrealistic to use these systems as the backend for a web interface. + +[Original article](https://clickhouse.yandex/docs/en/faq/general/) diff --git a/docs/en/getting_started/example_datasets/amplab_benchmark.md b/docs/en/getting_started/example_datasets/amplab_benchmark.md index 49265d5da85..ef067ee4dd9 100644 --- a/docs/en/getting_started/example_datasets/amplab_benchmark.md +++ b/docs/en/getting_started/example_datasets/amplab_benchmark.md @@ -119,3 +119,5 @@ ORDER BY totalRevenue DESC LIMIT 1 ``` + +[Original article](https://clickhouse.yandex/docs/en/getting_started/example_datasets/amplab_benchmark/) diff --git a/docs/en/getting_started/example_datasets/criteo.md b/docs/en/getting_started/example_datasets/criteo.md index 8544c0da9c0..9dd4a545056 100644 --- a/docs/en/getting_started/example_datasets/criteo.md +++ b/docs/en/getting_started/example_datasets/criteo.md @@ -71,3 +71,5 @@ INSERT INTO criteo SELECT date, clicked, int1, int2, int3, int4, int5, int6, int DROP TABLE criteo_log; ``` + +[Original article](https://clickhouse.yandex/docs/en/getting_started/example_datasets/criteo/) diff --git a/docs/en/getting_started/example_datasets/nyc_taxi.md b/docs/en/getting_started/example_datasets/nyc_taxi.md index 19cf5e242ee..8211944aa38 100644 --- a/docs/en/getting_started/example_datasets/nyc_taxi.md +++ b/docs/en/getting_started/example_datasets/nyc_taxi.md @@ -364,3 +364,5 @@ We ran queries using a client located in a Yandex datacenter in Finland on a clu | 3 | 0.212 | 0.438 | 0.733 | 1.241 | | 140 | 0.028 | 0.043 | 0.051 | 0.072 | + +[Original article](https://clickhouse.yandex/docs/en/getting_started/example_datasets/nyc_taxi/) diff --git a/docs/en/getting_started/example_datasets/ontime.md b/docs/en/getting_started/example_datasets/ontime.md index bceab083d43..84e68f9f798 100644 --- a/docs/en/getting_started/example_datasets/ontime.md +++ b/docs/en/getting_started/example_datasets/ontime.md @@ -317,3 +317,5 @@ This performance test was created by Vadim Tkachenko. See: - - + +[Original article](https://clickhouse.yandex/docs/en/getting_started/example_datasets/ontime/) diff --git a/docs/en/getting_started/example_datasets/star_schema.md b/docs/en/getting_started/example_datasets/star_schema.md index 6c1585bd6b0..235c361d167 100644 --- a/docs/en/getting_started/example_datasets/star_schema.md +++ b/docs/en/getting_started/example_datasets/star_schema.md @@ -83,3 +83,5 @@ cat customer.tbl | sed 's/$/2000-01-01/' | clickhouse-client --query "INSERT INT cat lineorder.tbl | clickhouse-client --query "INSERT INTO lineorder FORMAT CSV" ``` + +[Original article](https://clickhouse.yandex/docs/en/getting_started/example_datasets/star_schema/) diff --git a/docs/en/getting_started/example_datasets/wikistat.md b/docs/en/getting_started/example_datasets/wikistat.md index fee0a56b52c..250ecfccac9 100644 --- a/docs/en/getting_started/example_datasets/wikistat.md +++ b/docs/en/getting_started/example_datasets/wikistat.md @@ -25,3 +25,5 @@ cat links.txt | while read link; do wget http://dumps.wikimedia.org/other/pageco ls -1 /opt/wikistat/ | grep gz | while read i; do echo $i; gzip -cd /opt/wikistat/$i | ./wikistat-loader --time="$(echo -n $i | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2})([0-9]{2})([0-9]{2})\.gz/\1-\2-\3 \4-00-00/')" | clickhouse-client --query="INSERT INTO wikistat FORMAT TabSeparated"; done ``` + +[Original article](https://clickhouse.yandex/docs/en/getting_started/example_datasets/wikistat/) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index a4a18e5ab12..d66d7eba3b5 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -137,3 +137,5 @@ SELECT 1 To continue experimenting, you can try to download from the test data sets. + +[Original article](https://clickhouse.yandex/docs/en/getting_started/) diff --git a/docs/en/index.md b/docs/en/index.md index 49540048253..450b14181c1 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -138,3 +138,5 @@ There are two ways to do this: This is not done in "normal" databases, because it doesn't make sense when running simple queries. However, there are exceptions. For example, MemSQL uses code generation to reduce latency when processing SQL queries. (For comparison, analytical DBMSs require optimization of throughput, not latency.) Note that for CPU efficiency, the query language must be declarative (SQL or MDX), or at least a vector (J, K). The query should only contain implicit loops, allowing for optimization. + +[Original article](https://clickhouse.yandex/docs/en/) diff --git a/docs/en/interfaces/cli.md b/docs/en/interfaces/cli.md index f3824e3951e..c042a87ee00 100644 --- a/docs/en/interfaces/cli.md +++ b/docs/en/interfaces/cli.md @@ -113,3 +113,5 @@ Example of a config file: ``` + +[Original article](https://clickhouse.yandex/docs/en/interfaces/cli/) diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index c13832c0b6a..1a5d02db975 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -621,3 +621,5 @@ struct Message { Schema files are in the file that is located in the directory specified in [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) in the server configuration. Deserialization is effective and usually doesn't increase the system load. + +[Original article](https://clickhouse.yandex/docs/en/interfaces/formats/) diff --git a/docs/en/interfaces/http_interface.md b/docs/en/interfaces/http_interface.md index 4b20f2a0b65..e514f0c4969 100644 --- a/docs/en/interfaces/http_interface.md +++ b/docs/en/interfaces/http_interface.md @@ -218,3 +218,5 @@ curl -sS 'http://localhost:8123/?max_result_bytes=4000000&buffer_size=3000000&wa Use buffering to avoid situations where a query processing error occurred after the response code and HTTP headers were sent to the client. In this situation, an error message is written at the end of the response body, and on the client side, the error can only be detected at the parsing stage. + +[Original article](https://clickhouse.yandex/docs/en/interfaces/http_interface/) diff --git a/docs/en/interfaces/index.md b/docs/en/interfaces/index.md index e43f4474271..9f445d45229 100644 --- a/docs/en/interfaces/index.md +++ b/docs/en/interfaces/index.md @@ -4,3 +4,5 @@ To explore the system's capabilities, download data to tables, or make manual queries, use the clickhouse-client program. + +[Original article](https://clickhouse.yandex/docs/en/interfaces/) diff --git a/docs/en/interfaces/jdbc.md b/docs/en/interfaces/jdbc.md index a8808770fa9..8454881dfb7 100644 --- a/docs/en/interfaces/jdbc.md +++ b/docs/en/interfaces/jdbc.md @@ -3,3 +3,5 @@ - [Official driver](https://github.com/yandex/clickhouse-jdbc). - Third-party driver from [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC). + +[Original article](https://clickhouse.yandex/docs/en/interfaces/jdbc/) diff --git a/docs/en/interfaces/tcp.md b/docs/en/interfaces/tcp.md index c9813823bc8..86ef118e882 100644 --- a/docs/en/interfaces/tcp.md +++ b/docs/en/interfaces/tcp.md @@ -2,3 +2,5 @@ The native interface is used in the "clickhouse-client" command-line client for interaction between servers with distributed query processing, and also in C++ programs. We will only cover the command-line client. + +[Original article](https://clickhouse.yandex/docs/en/interfaces/tcp/) diff --git a/docs/en/interfaces/third-party_client_libraries.md b/docs/en/interfaces/third-party_client_libraries.md index a11992efc10..0778983cbc6 100644 --- a/docs/en/interfaces/third-party_client_libraries.md +++ b/docs/en/interfaces/third-party_client_libraries.md @@ -47,3 +47,5 @@ We have not tested the libraries listed below. - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) + +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party_client_libraries/) diff --git a/docs/en/interfaces/third-party_gui.md b/docs/en/interfaces/third-party_gui.md index decb97856e2..280b0bee218 100644 --- a/docs/en/interfaces/third-party_gui.md +++ b/docs/en/interfaces/third-party_gui.md @@ -45,3 +45,5 @@ Key features: - Query development with syntax highlight. - Table preview. - Autocompletion. + +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party_gui/) diff --git a/docs/en/introduction/distinctive_features.md b/docs/en/introduction/distinctive_features.md index eff79191bbc..3354a75c54b 100644 --- a/docs/en/introduction/distinctive_features.md +++ b/docs/en/introduction/distinctive_features.md @@ -60,3 +60,5 @@ ClickHouse provides various ways to trade accuracy for performance: Uses asynchronous multimaster replication. After being written to any available replica, data is distributed to all the remaining replicas in the background. The system maintains identical data on different replicas. Recovery after most failures is performed automatically, and in complex cases — semi-automatically. For more information, see the section [Data replication](../operations/table_engines/replication.md#table_engines-replication). + +[Original article](https://clickhouse.yandex/docs/en/introduction/distinctive_features/) diff --git a/docs/en/introduction/features_considered_disadvantages.md b/docs/en/introduction/features_considered_disadvantages.md index 55fecaf123a..5071c9b9b8d 100644 --- a/docs/en/introduction/features_considered_disadvantages.md +++ b/docs/en/introduction/features_considered_disadvantages.md @@ -3,3 +3,5 @@ 1. No full-fledged transactions. 2. Lack of ability to modify or delete already inserted data with high rate and low latency. There are batch deletes and updates available to clean up or modify data, for example to comply with [GDPR](https://gdpr-info.eu). 3. The sparse index makes ClickHouse not really suitable for point queries retrieving single rows by their keys. + +[Original article](https://clickhouse.yandex/docs/en/introduction/features_considered_disadvantages/) diff --git a/docs/en/introduction/performance.md b/docs/en/introduction/performance.md index d9796d26388..47d4a3b946d 100644 --- a/docs/en/introduction/performance.md +++ b/docs/en/introduction/performance.md @@ -21,3 +21,5 @@ Under the same conditions, ClickHouse can handle several hundred queries per sec ## Performance When Inserting Data We recommend inserting data in packets of at least 1000 rows, or no more than a single request per second. When inserting to a MergeTree table from a tab-separated dump, the insertion speed will be from 50 to 200 MB/s. If the inserted rows are around 1 Kb in size, the speed will be from 50,000 to 200,000 rows per second. If the rows are small, the performance will be higher in rows per second (on Banner System data -`>` 500,000 rows per second; on Graphite data -`>` 1,000,000 rows per second). To improve performance, you can make multiple INSERT queries in parallel, and performance will increase linearly. + +[Original article](https://clickhouse.yandex/docs/en/introduction/performance/) diff --git a/docs/en/introduction/ya_metrika_task.md b/docs/en/introduction/ya_metrika_task.md index db173e17817..9acbdc0989e 100644 --- a/docs/en/introduction/ya_metrika_task.md +++ b/docs/en/introduction/ya_metrika_task.md @@ -46,3 +46,5 @@ OLAPServer worked well for non-aggregated data, but it had many restrictions tha To remove the limitations of OLAPServer and solve the problem of working with non-aggregated data for all reports, we developed the ClickHouse DBMS. + +[Original article](https://clickhouse.yandex/docs/en/introduction/ya_metrika_task/) diff --git a/docs/en/operations/access_rights.md b/docs/en/operations/access_rights.md index 3064da75108..451be2c7322 100644 --- a/docs/en/operations/access_rights.md +++ b/docs/en/operations/access_rights.md @@ -99,3 +99,5 @@ The user can get a list of all databases and tables in them by using `SHOW` quer Database access is not related to the [readonly](settings/query_complexity.md#query_complexity_readonly) setting. You can't grant full access to one database and `readonly` access to another one. + +[Original article](https://clickhouse.yandex/docs/en/operations/access_rights/) diff --git a/docs/en/operations/configuration_files.md b/docs/en/operations/configuration_files.md index d55cf7c2001..a7cdfb124ee 100644 --- a/docs/en/operations/configuration_files.md +++ b/docs/en/operations/configuration_files.md @@ -40,3 +40,5 @@ $ cat /etc/clickhouse-server/users.d/alice.xml For each config file, the server also generates `file-preprocessed.xml` files when starting. These files contain all the completed substitutions and overrides, and they are intended for informational use. If ZooKeeper substitutions were used in the config files but ZooKeeper is not available on the server start, the server loads the configuration from the preprocessed file. The server tracks changes in config files, as well as files and ZooKeeper nodes that were used when performing substitutions and overrides, and reloads the settings for users and clusters on the fly. This means that you can modify the cluster, users, and their settings without restarting the server. + +[Original article](https://clickhouse.yandex/docs/en/operations/configuration_files/) diff --git a/docs/en/operations/index.md b/docs/en/operations/index.md index 9073e2a2a78..63cb19bb639 100644 --- a/docs/en/operations/index.md +++ b/docs/en/operations/index.md @@ -1,2 +1,4 @@ # Operations + +[Original article](https://clickhouse.yandex/docs/en/operations/) diff --git a/docs/en/operations/quotas.md b/docs/en/operations/quotas.md index e8b603ff11a..e8cde130828 100644 --- a/docs/en/operations/quotas.md +++ b/docs/en/operations/quotas.md @@ -104,3 +104,5 @@ For distributed query processing, the accumulated amounts are stored on the requ When the server is restarted, quotas are reset. + +[Original article](https://clickhouse.yandex/docs/en/operations/quotas/) diff --git a/docs/en/operations/server_settings/index.md b/docs/en/operations/server_settings/index.md index 5631d131a43..88f11c48f4b 100644 --- a/docs/en/operations/server_settings/index.md +++ b/docs/en/operations/server_settings/index.md @@ -10,3 +10,5 @@ Other settings are described in the "[Settings](../settings/index.md#settings)" Before studying the settings, read the [Configuration files](../configuration_files.md#configuration_files) section and note the use of substitutions (the `incl` and `optional` attributes). + +[Original article](https://clickhouse.yandex/docs/en/operations/server_settings/) diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index 7f52f9bb845..8e10969ed6b 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -717,3 +717,5 @@ For more information, see the section "[Replication](../../operations/table_engi ``` + +[Original article](https://clickhouse.yandex/docs/en/operations/server_settings/settings/) diff --git a/docs/en/operations/settings/index.md b/docs/en/operations/settings/index.md index 1c03340670f..5676796fd10 100644 --- a/docs/en/operations/settings/index.md +++ b/docs/en/operations/settings/index.md @@ -22,3 +22,5 @@ Similarly, you can use ClickHouse sessions in the HTTP protocol. To do this, you Settings that can only be made in the server config file are not covered in this section. + +[Original article](https://clickhouse.yandex/docs/en/operations/settings/) diff --git a/docs/en/operations/settings/query_complexity.md b/docs/en/operations/settings/query_complexity.md index 2132557d699..9e49dc58ca3 100644 --- a/docs/en/operations/settings/query_complexity.md +++ b/docs/en/operations/settings/query_complexity.md @@ -193,3 +193,5 @@ Maximum number of bytes (uncompressed data) that can be passed to a remote serve ## transfer_overflow_mode What to do when the amount of data exceeds one of the limits: 'throw' or 'break'. By default, throw. + +[Original article](https://clickhouse.yandex/docs/en/operations/settings/query_complexity/) diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index 67673cab042..8afea8e5d35 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -417,3 +417,5 @@ See also the following parameters: - [insert_quorum](#setting-insert_quorum) - [insert_quorum_timeout](#setting-insert_quorum_timeout) + +[Original article](https://clickhouse.yandex/docs/en/operations/settings/settings/) diff --git a/docs/en/operations/settings/settings_profiles.md b/docs/en/operations/settings/settings_profiles.md index 3e3175bc9fb..31b8016ccf4 100644 --- a/docs/en/operations/settings/settings_profiles.md +++ b/docs/en/operations/settings/settings_profiles.md @@ -63,3 +63,5 @@ The example specifies two profiles: `default` and `web`. The `default` profile Settings profiles can inherit from each other. To use inheritance, indicate the `profile` setting before the other settings that are listed in the profile. + +[Original article](https://clickhouse.yandex/docs/en/operations/settings/settings_profiles/) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index abd6e819373..77d96990d6d 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -435,3 +435,5 @@ numChildren: 7 pzxid: 987021252247 path: /clickhouse/tables/01-08/visits/replicas ``` + +[Original article](https://clickhouse.yandex/docs/en/operations/system_tables/) diff --git a/docs/en/operations/table_engines/aggregatingmergetree.md b/docs/en/operations/table_engines/aggregatingmergetree.md index 0f99da076b6..2f3b0fb9638 100644 --- a/docs/en/operations/table_engines/aggregatingmergetree.md +++ b/docs/en/operations/table_engines/aggregatingmergetree.md @@ -85,3 +85,5 @@ You can create a materialized view like this and assign a normal view to it that Note that in most cases, using `AggregatingMergeTree` is not justified, since queries can be run efficiently enough on non-aggregated data. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/aggregatingmergetree/) diff --git a/docs/en/operations/table_engines/buffer.md b/docs/en/operations/table_engines/buffer.md index 2098c5f19da..8ce007843a2 100644 --- a/docs/en/operations/table_engines/buffer.md +++ b/docs/en/operations/table_engines/buffer.md @@ -52,3 +52,5 @@ A Buffer table is used when too many INSERTs are received from a large number of Note that it doesn't make sense to insert data one row at a time, even for Buffer tables. This will only produce a speed of a few thousand rows per second, while inserting larger blocks of data can produce over a million rows per second (see the section "Performance"). + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/buffer/) diff --git a/docs/en/operations/table_engines/collapsingmergetree.md b/docs/en/operations/table_engines/collapsingmergetree.md index c0d0f33d39e..c2a67cd9212 100644 --- a/docs/en/operations/table_engines/collapsingmergetree.md +++ b/docs/en/operations/table_engines/collapsingmergetree.md @@ -36,3 +36,5 @@ There are several ways to get completely "collapsed" data from a `CollapsingMerg 1. Write a query with GROUP BY and aggregate functions that accounts for the sign. For example, to calculate quantity, write 'sum(Sign)' instead of 'count()'. To calculate the sum of something, write 'sum(Sign * x)' instead of 'sum(x)', and so on, and also add 'HAVING sum(Sign) `>` 0'. Not all amounts can be calculated this way. For example, the aggregate functions 'min' and 'max' can't be rewritten. 2. If you must extract data without aggregation (for example, to check whether rows are present whose newest values match certain conditions), you can use the FINAL modifier for the FROM clause. This approach is significantly less efficient. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/collapsingmergetree/) diff --git a/docs/en/operations/table_engines/custom_partitioning_key.md b/docs/en/operations/table_engines/custom_partitioning_key.md index bcfe8c8c410..ef4ca2a2ee1 100644 --- a/docs/en/operations/table_engines/custom_partitioning_key.md +++ b/docs/en/operations/table_engines/custom_partitioning_key.md @@ -45,3 +45,5 @@ The partition ID is its string identifier (human-readable, if possible) that is For more examples, see the tests [`00502_custom_partitioning_local`](https://github.com/yandex/ClickHouse/blob/master/dbms/tests/queries/0_stateless/00502_custom_partitioning_local.sql) and [`00502_custom_partitioning_replicated_zookeeper`](https://github.com/yandex/ClickHouse/blob/master/dbms/tests/queries/0_stateless/00502_custom_partitioning_replicated_zookeeper.sql). + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/custom_partitioning_key/) diff --git a/docs/en/operations/table_engines/dictionary.md b/docs/en/operations/table_engines/dictionary.md index 6bf606ffa12..e1f16670b04 100644 --- a/docs/en/operations/table_engines/dictionary.md +++ b/docs/en/operations/table_engines/dictionary.md @@ -108,3 +108,5 @@ LIMIT 1 1 rows in set. Elapsed: 0.006 sec. ``` + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/dictionary/) diff --git a/docs/en/operations/table_engines/distributed.md b/docs/en/operations/table_engines/distributed.md index 0bb55bc2603..a33fa6dd942 100644 --- a/docs/en/operations/table_engines/distributed.md +++ b/docs/en/operations/table_engines/distributed.md @@ -122,3 +122,5 @@ If the server ceased to exist or had a rough restart (for example, after a devic When the max_parallel_replicas option is enabled, query processing is parallelized across all replicas within a single shard. For more information, see the section "Settings, max_parallel_replicas". + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/distributed/) diff --git a/docs/en/operations/table_engines/external_data.md b/docs/en/operations/table_engines/external_data.md index efb1f3c4fc4..ea27c9f0e1c 100644 --- a/docs/en/operations/table_engines/external_data.md +++ b/docs/en/operations/table_engines/external_data.md @@ -60,3 +60,5 @@ curl -F 'passwd=@passwd.tsv;' 'http://localhost:8123/?query=SELECT+shell,+count( For distributed query processing, the temporary tables are sent to all the remote servers. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/external_data/) diff --git a/docs/en/operations/table_engines/file.md b/docs/en/operations/table_engines/file.md index 8e31e346031..9a49583dc0e 100644 --- a/docs/en/operations/table_engines/file.md +++ b/docs/en/operations/table_engines/file.md @@ -76,3 +76,5 @@ $ echo -e "1,2\n3,4" | clickhouse-local -q "CREATE TABLE table (a Int64, b Int64 - `SELECT ... SAMPLE` - Indices - Replication + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/file/) diff --git a/docs/en/operations/table_engines/graphitemergetree.md b/docs/en/operations/table_engines/graphitemergetree.md index d1aaeca6aed..e102a58f200 100644 --- a/docs/en/operations/table_engines/graphitemergetree.md +++ b/docs/en/operations/table_engines/graphitemergetree.md @@ -84,3 +84,5 @@ Example of settings: ``` + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/graphitemergetree/) diff --git a/docs/en/operations/table_engines/index.md b/docs/en/operations/table_engines/index.md index eba6fffe37d..21909e3ce26 100644 --- a/docs/en/operations/table_engines/index.md +++ b/docs/en/operations/table_engines/index.md @@ -14,3 +14,5 @@ The table engine (type of table) determines: When reading, the engine is only required to output the requested columns, but in some cases the engine can partially process data when responding to the request. For most serious tasks, you should use engines from the `MergeTree` family. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/) diff --git a/docs/en/operations/table_engines/join.md b/docs/en/operations/table_engines/join.md index 1aff89ca887..4a33eefe27c 100644 --- a/docs/en/operations/table_engines/join.md +++ b/docs/en/operations/table_engines/join.md @@ -15,3 +15,5 @@ You can use INSERT to add data to the table, similar to the Set engine. For ANY, Storing data on the disk is the same as for the Set engine. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/join/) diff --git a/docs/en/operations/table_engines/kafka.md b/docs/en/operations/table_engines/kafka.md index eb79599e214..aa8626f6389 100644 --- a/docs/en/operations/table_engines/kafka.md +++ b/docs/en/operations/table_engines/kafka.md @@ -136,3 +136,5 @@ Similar to GraphiteMergeTree, the Kafka engine supports extended configuration u ``` For a list of possible configuration options, see the [librdkafka configuration reference](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md). Use the underscore (`_`) instead of a dot in the ClickHouse configuration. For example, `check.crcs=true` will be `true`. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/kafka/) diff --git a/docs/en/operations/table_engines/log.md b/docs/en/operations/table_engines/log.md index 406f94bd0d0..fffc5a11aca 100644 --- a/docs/en/operations/table_engines/log.md +++ b/docs/en/operations/table_engines/log.md @@ -4,3 +4,5 @@ Log differs from TinyLog in that a small file of "marks" resides with the column For concurrent data access, the read operations can be performed simultaneously, while write operations block reads and each other. The Log engine does not support indexes. Similarly, if writing to a table failed, the table is broken, and reading from it returns an error. The Log engine is appropriate for temporary data, write-once tables, and for testing or demonstration purposes. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/log/) diff --git a/docs/en/operations/table_engines/materializedview.md b/docs/en/operations/table_engines/materializedview.md index e2eb857aca7..c13a1ac8710 100644 --- a/docs/en/operations/table_engines/materializedview.md +++ b/docs/en/operations/table_engines/materializedview.md @@ -2,3 +2,5 @@ Used for implementing materialized views (for more information, see [CREATE TABLE](../../query_language/create.md#query_language-queries-create_table)). For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/materializedview/) diff --git a/docs/en/operations/table_engines/memory.md b/docs/en/operations/table_engines/memory.md index 113e4aa9f11..d68ae923684 100644 --- a/docs/en/operations/table_engines/memory.md +++ b/docs/en/operations/table_engines/memory.md @@ -9,3 +9,5 @@ Normally, using this table engine is not justified. However, it can be used for The Memory engine is used by the system for temporary tables with external query data (see the section "External data for processing a query"), and for implementing GLOBAL IN (see the section "IN operators"). + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/memory/) diff --git a/docs/en/operations/table_engines/merge.md b/docs/en/operations/table_engines/merge.md index e04dace12e0..e8de53bc286 100644 --- a/docs/en/operations/table_engines/merge.md +++ b/docs/en/operations/table_engines/merge.md @@ -65,3 +65,5 @@ The `Merge` type table contains a virtual `_table` column of the `String` type. If the `WHERE/PREWHERE` clause contains conditions for the `_table` column that do not depend on other table columns (as one of the conjunction elements, or as an entire expression), these conditions are used as an index. The conditions are performed on a data set of table names to read data from, and the read operation will be performed from only those tables that the condition was triggered on. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/merge/) diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index 3863c63b40e..297779de03a 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -182,3 +182,5 @@ For concurrent table access, we use multi-versioning. In other words, when a tab Reading from a table is automatically parallelized. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/mergetree/) diff --git a/docs/en/operations/table_engines/mysql.md b/docs/en/operations/table_engines/mysql.md index 06c0fd6b622..b9e419b5ac0 100644 --- a/docs/en/operations/table_engines/mysql.md +++ b/docs/en/operations/table_engines/mysql.md @@ -26,3 +26,5 @@ The rest of the conditions and the `LIMIT` sampling constraint are executed in C The `MySQL` engine does not support the [Nullable](../../data_types/nullable.md#data_type-nullable) data type, so when reading data from MySQL tables, `NULL` is converted to default values for the specified column type (usually 0 or an empty string). + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/mysql/) diff --git a/docs/en/operations/table_engines/null.md b/docs/en/operations/table_engines/null.md index 49850ec9864..58d3552d19d 100644 --- a/docs/en/operations/table_engines/null.md +++ b/docs/en/operations/table_engines/null.md @@ -4,3 +4,5 @@ When writing to a Null table, data is ignored. When reading from a Null table, t However, you can create a materialized view on a Null table. So the data written to the table will end up in the view. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/null/) diff --git a/docs/en/operations/table_engines/replacingmergetree.md b/docs/en/operations/table_engines/replacingmergetree.md index 92f2ffb34bf..b2b7890670c 100644 --- a/docs/en/operations/table_engines/replacingmergetree.md +++ b/docs/en/operations/table_engines/replacingmergetree.md @@ -16,3 +16,5 @@ Thus, `ReplacingMergeTree` is suitable for clearing out duplicate data in the b *This engine is not used in Yandex.Metrica, but it has been applied in other Yandex projects.* + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/replacingmergetree/) diff --git a/docs/en/operations/table_engines/replication.md b/docs/en/operations/table_engines/replication.md index 705dabe8e1b..09978a48ab4 100644 --- a/docs/en/operations/table_engines/replication.md +++ b/docs/en/operations/table_engines/replication.md @@ -180,3 +180,5 @@ After this, you can launch the server, create a `MergeTree` table, move the data ## Recovery When Metadata in The ZooKeeper Cluster is Lost or Damaged If the data in ZooKeeper was lost or damaged, you can save data by moving it to an unreplicated table as described above. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/replication/) diff --git a/docs/en/operations/table_engines/set.md b/docs/en/operations/table_engines/set.md index d207fe0d79e..75c1f3072d4 100644 --- a/docs/en/operations/table_engines/set.md +++ b/docs/en/operations/table_engines/set.md @@ -9,3 +9,5 @@ Data is always located in RAM. For INSERT, the blocks of inserted data are also For a rough server restart, the block of data on the disk might be lost or damaged. In the latter case, you may need to manually delete the file with damaged data. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/set/) diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index c75d09aae96..6ce3d5f09df 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -45,3 +45,5 @@ For nested data structures, you don't need to specify the columns as a list of c This table engine is not particularly useful. Remember that when saving just pre-aggregated data, you lose some of the system's advantages. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/summingmergetree/) diff --git a/docs/en/operations/table_engines/tinylog.md b/docs/en/operations/table_engines/tinylog.md index 577596e2d96..6ec1cb8173a 100644 --- a/docs/en/operations/table_engines/tinylog.md +++ b/docs/en/operations/table_engines/tinylog.md @@ -17,3 +17,5 @@ The situation when you have a large number of small tables guarantees poor produ In Yandex.Metrica, TinyLog tables are used for intermediary data that is processed in small batches. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/tinylog/) diff --git a/docs/en/operations/table_engines/url.md b/docs/en/operations/table_engines/url.md index 9bd79ac1000..02f45c00377 100644 --- a/docs/en/operations/table_engines/url.md +++ b/docs/en/operations/table_engines/url.md @@ -71,3 +71,5 @@ SELECT * FROM url_engine_table - `ALTER` and `SELECT...SAMPLE` operations. - Indexes. - Replication. + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/url/) diff --git a/docs/en/operations/table_engines/view.md b/docs/en/operations/table_engines/view.md index 91f0ce9fdb3..c74eab262e4 100644 --- a/docs/en/operations/table_engines/view.md +++ b/docs/en/operations/table_engines/view.md @@ -2,3 +2,5 @@ Used for implementing views (for more information, see the `CREATE VIEW query`). It does not store data, but only stores the specified `SELECT` query. When reading from a table, it runs this query (and deletes all unnecessary columns from the query). + +[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/view/) diff --git a/docs/en/operations/tips.md b/docs/en/operations/tips.md index fe2e9670130..cf32216e9d5 100644 --- a/docs/en/operations/tips.md +++ b/docs/en/operations/tips.md @@ -255,3 +255,5 @@ script end script ``` + +[Original article](https://clickhouse.yandex/docs/en/operations/tips/) diff --git a/docs/en/operations/utils/clickhouse-copier.md b/docs/en/operations/utils/clickhouse-copier.md index 3109044724f..361834a681d 100644 --- a/docs/en/operations/utils/clickhouse-copier.md +++ b/docs/en/operations/utils/clickhouse-copier.md @@ -159,3 +159,5 @@ Parameters: `clickhouse-copier` tracks the changes in `/task/path/description` and applies them on the fly. For instance, if you change the value of `max_workers`, the number of processes running tasks will also change. + +[Original article](https://clickhouse.yandex/docs/en/operations/utils/clickhouse-copier/) diff --git a/docs/en/operations/utils/clickhouse-local.md b/docs/en/operations/utils/clickhouse-local.md index bfa612569f3..4b20473cb42 100644 --- a/docs/en/operations/utils/clickhouse-local.md +++ b/docs/en/operations/utils/clickhouse-local.md @@ -71,3 +71,5 @@ Read 186 rows, 4.15 KiB in 0.035 sec., 5302 rows/sec., 118.34 KiB/sec. ├──────────┼──────────┤ ... ``` + +[Original article](https://clickhouse.yandex/docs/en/operations/utils/clickhouse-local/) diff --git a/docs/en/operations/utils/index.md b/docs/en/operations/utils/index.md index 24faf79faa6..6406b486cc8 100644 --- a/docs/en/operations/utils/index.md +++ b/docs/en/operations/utils/index.md @@ -3,3 +3,5 @@ * [clickhouse-local](clickhouse-local.md#utils-clickhouse-local) — Allows running SQL queries on data without stopping the ClickHouse server, similar to how `awk` does this. * [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) — Copies (and reshards) data from one cluster to another cluster. + +[Original article](https://clickhouse.yandex/docs/en/operations/utils/) diff --git a/docs/en/query_language/agg_functions/combinators.md b/docs/en/query_language/agg_functions/combinators.md index 3b7e372b324..cf4f73fc11a 100644 --- a/docs/en/query_language/agg_functions/combinators.md +++ b/docs/en/query_language/agg_functions/combinators.md @@ -38,3 +38,5 @@ Merges the intermediate aggregation states in the same way as the -Merge combina Converts an aggregate function for tables into an aggregate function for arrays that aggregates the corresponding array items and returns an array of results. For example, `sumForEach` for the arrays `[1, 2]`, `[3, 4, 5]`and`[6, 7]`returns the result `[10, 13, 5]` after adding together the corresponding array items. + +[Original article](https://clickhouse.yandex/docs/en/query_language/agg_functions/combinators/) diff --git a/docs/en/query_language/agg_functions/index.md b/docs/en/query_language/agg_functions/index.md index 0f9cefc7b95..a3cb2132ed8 100644 --- a/docs/en/query_language/agg_functions/index.md +++ b/docs/en/query_language/agg_functions/index.md @@ -61,3 +61,5 @@ FROM t_null_big `groupArray` does not include `NULL` in the resulting array. + +[Original article](https://clickhouse.yandex/docs/en/query_language/agg_functions/) diff --git a/docs/en/query_language/agg_functions/parametric_functions.md b/docs/en/query_language/agg_functions/parametric_functions.md index 18f519035b0..50918704e48 100644 --- a/docs/en/query_language/agg_functions/parametric_functions.md +++ b/docs/en/query_language/agg_functions/parametric_functions.md @@ -155,3 +155,5 @@ Usage example: Problem: Generate a report that shows only keywords that produced at least 5 unique users. Solution: Write in the GROUP BY query SearchPhrase HAVING uniqUpTo(4)(UserID) >= 5 ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/agg_functions/parametric_functions/) diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md index dcf69256981..125d10f0420 100644 --- a/docs/en/query_language/agg_functions/reference.md +++ b/docs/en/query_language/agg_functions/reference.md @@ -350,3 +350,5 @@ Calculates the value of `Σ((x - x̅)(y - y̅)) / n`. Calculates the Pearson correlation coefficient: `Σ((x - x̅)(y - y̅)) / sqrt(Σ((x - x̅)^2) * Σ((y - y̅)^2))`. + +[Original article](https://clickhouse.yandex/docs/en/query_language/agg_functions/reference/) diff --git a/docs/en/query_language/alter.md b/docs/en/query_language/alter.md index 8a6b0eb0874..a5428944329 100644 --- a/docs/en/query_language/alter.md +++ b/docs/en/query_language/alter.md @@ -272,3 +272,5 @@ The table contains information about mutations of MergeTree tables and their pro **is_done** - Is the mutation done? Note that even if `parts_to_do = 0` it is possible that a mutation of a replicated table is not done yet because of a long-running INSERT that will create a new data part that will need to be mutated. + +[Original article](https://clickhouse.yandex/docs/en/query_language/alter/) diff --git a/docs/en/query_language/create.md b/docs/en/query_language/create.md index 9369c3a5536..6daed08ca11 100644 --- a/docs/en/query_language/create.md +++ b/docs/en/query_language/create.md @@ -152,3 +152,5 @@ The execution of `ALTER` queries on materialized views has not been fully develo Views look the same as normal tables. For example, they are listed in the result of the `SHOW TABLES` query. There isn't a separate query for deleting views. To delete a view, use `DROP TABLE`. + +[Original article](https://clickhouse.yandex/docs/en/query_language/create/) diff --git a/docs/en/query_language/dicts/external_dicts.md b/docs/en/query_language/dicts/external_dicts.md index 7f1063a04e6..8840218e49f 100644 --- a/docs/en/query_language/dicts/external_dicts.md +++ b/docs/en/query_language/dicts/external_dicts.md @@ -41,3 +41,5 @@ See also "[Functions for working with external dictionaries](../functions/ext_di !!! attention You can convert values for a small dictionary by describing it in a `SELECT` query (see the [transform](../functions/other_functions.md#other_functions-transform) function). This functionality is not related to external dictionaries. + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts/) diff --git a/docs/en/query_language/dicts/external_dicts_dict.md b/docs/en/query_language/dicts/external_dicts_dict.md index daf00ce0250..ca070c8084b 100644 --- a/docs/en/query_language/dicts/external_dicts_dict.md +++ b/docs/en/query_language/dicts/external_dicts_dict.md @@ -31,3 +31,5 @@ The dictionary configuration has the following structure: - [layout](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) — Dictionary layout in memory. - [structure](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) — Structure of the dictionary . A key and attributes that can be retrieved by this key. - [lifetime](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) — Frequency of dictionary updates. + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts_dict/) diff --git a/docs/en/query_language/dicts/external_dicts_dict_layout.md b/docs/en/query_language/dicts/external_dicts_dict_layout.md index d6802c4ccbf..932d90db605 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/en/query_language/dicts/external_dicts_dict_layout.md @@ -292,3 +292,5 @@ dictGetString('prefix', 'asn', tuple(IPv6StringToNum('2001:db8::1'))) Other types are not supported yet. The function returns the attribute for the prefix that corresponds to this IP address. If there are overlapping prefixes, the most specific one is returned. Data is stored in a `trie`. It must completely fit into RAM. + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts_dict_layout/) diff --git a/docs/en/query_language/dicts/external_dicts_dict_lifetime.md b/docs/en/query_language/dicts/external_dicts_dict_lifetime.md index 2fadfa51e0e..c04829fce10 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_lifetime.md +++ b/docs/en/query_language/dicts/external_dicts_dict_lifetime.md @@ -57,3 +57,5 @@ Example of settings: ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts_dict_lifetime/) diff --git a/docs/en/query_language/dicts/external_dicts_dict_sources.md b/docs/en/query_language/dicts/external_dicts_dict_sources.md index 4c30852c770..bd5e6f4e7ac 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/en/query_language/dicts/external_dicts_dict_sources.md @@ -427,3 +427,5 @@ Setting fields: - `password` – Password of the MongoDB user. - `db` – Name of the database. - `collection` – Name of the collection. + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts_dict_sources/) diff --git a/docs/en/query_language/dicts/external_dicts_dict_structure.md b/docs/en/query_language/dicts/external_dicts_dict_structure.md index 06ab8e812ce..b499a474a4d 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_structure.md +++ b/docs/en/query_language/dicts/external_dicts_dict_structure.md @@ -115,3 +115,5 @@ Configuration fields: - `hierarchical` – Hierarchical support. Mirrored to the parent identifier. By default, ` false`. - `injective` – Whether the `id -> attribute` image is injective. If ` true`, then you can optimize the ` GROUP BY` clause. By default, `false`. - `is_object_id` – Whether the query is executed for a MongoDB document by `ObjectID`. + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts_dict_structure/) diff --git a/docs/en/query_language/dicts/index.md b/docs/en/query_language/dicts/index.md index 862dd686f2c..1c61a6534f6 100644 --- a/docs/en/query_language/dicts/index.md +++ b/docs/en/query_language/dicts/index.md @@ -11,3 +11,5 @@ ClickHouse supports: - [Built-in dictionaries](internal_dicts.md#internal_dicts) with a specific [set of functions](../functions/ym_dict_functions.md#ym_dict_functions). - [Plug-in (external) dictionaries](external_dicts.md#dicts-external_dicts) with a [set of functions](../functions/ext_dict_functions.md#ext_dict_functions). + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/) diff --git a/docs/en/query_language/dicts/internal_dicts.md b/docs/en/query_language/dicts/internal_dicts.md index 9849bd21fb2..2b38ffe61f1 100644 --- a/docs/en/query_language/dicts/internal_dicts.md +++ b/docs/en/query_language/dicts/internal_dicts.md @@ -46,3 +46,5 @@ Dictionary updates (other than loading at first use) do not block queries. Durin We recommend periodically updating the dictionaries with the geobase. During an update, generate new files and write them to a separate location. When everything is ready, rename them to the files used by the server. There are also functions for working with OS identifiers and Yandex.Metrica search engines, but they shouldn't be used. + +[Original article](https://clickhouse.yandex/docs/en/query_language/dicts/internal_dicts/) diff --git a/docs/en/query_language/functions/arithmetic_functions.md b/docs/en/query_language/functions/arithmetic_functions.md index e457fe6684e..6e63d90d2e1 100644 --- a/docs/en/query_language/functions/arithmetic_functions.md +++ b/docs/en/query_language/functions/arithmetic_functions.md @@ -73,3 +73,5 @@ An exception is thrown when dividing by zero or when dividing a minimal negative Returns the least common multiple of the numbers. An exception is thrown when dividing by zero or when dividing a minimal negative number by minus one. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/arithmetic_functions/) diff --git a/docs/en/query_language/functions/array_functions.md b/docs/en/query_language/functions/array_functions.md index e250479e5b8..efef18cb153 100644 --- a/docs/en/query_language/functions/array_functions.md +++ b/docs/en/query_language/functions/array_functions.md @@ -396,3 +396,5 @@ If you want to get a list of unique items in an array, you can use arrayReduce(' ## arrayJoin(arr) A special function. See the section ["ArrayJoin function"](array_join.md#functions_arrayjoin). + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/array_functions/) diff --git a/docs/en/query_language/functions/array_join.md b/docs/en/query_language/functions/array_join.md index 6e18f8203c0..16cef78a665 100644 --- a/docs/en/query_language/functions/array_join.md +++ b/docs/en/query_language/functions/array_join.md @@ -29,3 +29,5 @@ SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src └─────┴───────────┴─────────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/array_join/) diff --git a/docs/en/query_language/functions/bit_functions.md b/docs/en/query_language/functions/bit_functions.md index 523413f200a..1664664a6cf 100644 --- a/docs/en/query_language/functions/bit_functions.md +++ b/docs/en/query_language/functions/bit_functions.md @@ -16,3 +16,5 @@ The result type is an integer with bits equal to the maximum bits of its argumen ## bitShiftRight(a, b) + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/bit_functions/) diff --git a/docs/en/query_language/functions/comparison_functions.md b/docs/en/query_language/functions/comparison_functions.md index 9b95966ba84..39987ef2893 100644 --- a/docs/en/query_language/functions/comparison_functions.md +++ b/docs/en/query_language/functions/comparison_functions.md @@ -29,3 +29,5 @@ Note. Up until version 1.1.54134, signed and unsigned numbers were compared the ## greaterOrEquals, `>= operator` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/comparison_functions/) diff --git a/docs/en/query_language/functions/conditional_functions.md b/docs/en/query_language/functions/conditional_functions.md index abd8c96e498..b5c7ce583cc 100644 --- a/docs/en/query_language/functions/conditional_functions.md +++ b/docs/en/query_language/functions/conditional_functions.md @@ -46,3 +46,5 @@ Run the query `SELECT multiIf(isNull(y) x, y < 3, y, NULL) FROM t_null`. Result: │ ᴺᵁᴸᴸ │ └────────────────────────────────────────────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/conditional_functions/) diff --git a/docs/en/query_language/functions/date_time_functions.md b/docs/en/query_language/functions/date_time_functions.md index 8be3c14ffba..5596151eaac 100644 --- a/docs/en/query_language/functions/date_time_functions.md +++ b/docs/en/query_language/functions/date_time_functions.md @@ -182,3 +182,5 @@ Supported modifiers for Format: |%y|Year, last two digits (00-99)|18| |%Y|Year|2018| |%%|a % sign|%| + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/date_time_functions/) diff --git a/docs/en/query_language/functions/encoding_functions.md b/docs/en/query_language/functions/encoding_functions.md index 27ba1554a15..74ef53f82f7 100644 --- a/docs/en/query_language/functions/encoding_functions.md +++ b/docs/en/query_language/functions/encoding_functions.md @@ -25,3 +25,5 @@ Accepts an integer. Returns a string containing the list of powers of two that t Accepts an integer. Returns an array of UInt64 numbers containing the list of powers of two that total the source number when summed. Numbers in the array are in ascending order. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/encoding_functions/) diff --git a/docs/en/query_language/functions/ext_dict_functions.md b/docs/en/query_language/functions/ext_dict_functions.md index 68f5eaab7aa..ea692769404 100644 --- a/docs/en/query_language/functions/ext_dict_functions.md +++ b/docs/en/query_language/functions/ext_dict_functions.md @@ -45,3 +45,5 @@ The same as the `dictGetT` functions, but the default value is taken from the fu - Check whether the dictionary has the key. Returns a UInt8 value equal to 0 if there is no key and 1 if there is a key. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/ext_dict_functions/) diff --git a/docs/en/query_language/functions/functions_for_nulls.md b/docs/en/query_language/functions/functions_for_nulls.md index d52d0c840ec..2b088b5321e 100644 --- a/docs/en/query_language/functions/functions_for_nulls.md +++ b/docs/en/query_language/functions/functions_for_nulls.md @@ -293,3 +293,5 @@ SELECT toTypeName(toNullable(10)) └────────────────────────────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/functions_for_nulls/) diff --git a/docs/en/query_language/functions/geo.md b/docs/en/query_language/functions/geo.md index 91d07c3644a..f34361b43ca 100644 --- a/docs/en/query_language/functions/geo.md +++ b/docs/en/query_language/functions/geo.md @@ -99,3 +99,5 @@ SELECT pointInPolygon((3., 3.), [(6, 0), (8, 4), (5, 8), (0, 2)]) AS res └─────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/geo/) diff --git a/docs/en/query_language/functions/hash_functions.md b/docs/en/query_language/functions/hash_functions.md index 42107ce5999..ffffe5584fc 100644 --- a/docs/en/query_language/functions/hash_functions.md +++ b/docs/en/query_language/functions/hash_functions.md @@ -64,3 +64,5 @@ A fast, decent-quality non-cryptographic hash function for a string obtained fro `URLHash(s, N)` – Calculates a hash from a string up to the N level in the URL hierarchy, without one of the trailing symbols `/`,`?` or `#` at the end, if present. Levels are the same as in URLHierarchy. This function is specific to Yandex.Metrica. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/hash_functions/) diff --git a/docs/en/query_language/functions/higher_order_functions.md b/docs/en/query_language/functions/higher_order_functions.md index a80d5708e11..ef26a62bea1 100644 --- a/docs/en/query_language/functions/higher_order_functions.md +++ b/docs/en/query_language/functions/higher_order_functions.md @@ -113,3 +113,5 @@ Returns an array as result of sorting the elements of `arr1` in descending order + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/higher_order_functions/) diff --git a/docs/en/query_language/functions/in_functions.md b/docs/en/query_language/functions/in_functions.md index 27ac483cdb5..b9295cac7d1 100644 --- a/docs/en/query_language/functions/in_functions.md +++ b/docs/en/query_language/functions/in_functions.md @@ -16,3 +16,5 @@ A function that allows getting a column from a tuple. 'N' is the column index, starting from 1. N must be a constant. 'N' must be a constant. 'N' must be a strict postive integer no greater than the size of the tuple. There is no cost to execute the function. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/in_functions/) diff --git a/docs/en/query_language/functions/index.md b/docs/en/query_language/functions/index.md index 3700a277975..2e3c46779db 100644 --- a/docs/en/query_language/functions/index.md +++ b/docs/en/query_language/functions/index.md @@ -63,3 +63,5 @@ Another example is the `hostName` function, which returns the name of the server If a function in a query is performed on the requestor server, but you need to perform it on remote servers, you can wrap it in an 'any' aggregate function or add it to a key in `GROUP BY`. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/) diff --git a/docs/en/query_language/functions/ip_address_functions.md b/docs/en/query_language/functions/ip_address_functions.md index f83f75319c7..f4d559aeb13 100644 --- a/docs/en/query_language/functions/ip_address_functions.md +++ b/docs/en/query_language/functions/ip_address_functions.md @@ -113,3 +113,5 @@ LIMIT 10 The reverse function of IPv6NumToString. If the IPv6 address has an invalid format, it returns a string of null bytes. HEX can be uppercase or lowercase. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/ip_address_functions/) diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md index 70f66d86b61..ffe4e5d9fc5 100644 --- a/docs/en/query_language/functions/json_functions.md +++ b/docs/en/query_language/functions/json_functions.md @@ -55,3 +55,5 @@ visitParamExtractString('{"abc":"hello}', 'abc') = '' There is currently no support for code points in the format `\uXXXX\uYYYY` that are not from the basic multilingual plane (they are converted to CESU-8 instead of UTF-8). + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/json_functions/) diff --git a/docs/en/query_language/functions/logical_functions.md b/docs/en/query_language/functions/logical_functions.md index 4ef0fe5fd32..45c722f52d7 100644 --- a/docs/en/query_language/functions/logical_functions.md +++ b/docs/en/query_language/functions/logical_functions.md @@ -12,3 +12,5 @@ Zero as an argument is considered "false," while any non-zero value is considere ## xor + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/logical_functions/) diff --git a/docs/en/query_language/functions/math_functions.md b/docs/en/query_language/functions/math_functions.md index 0ae7eb8427c..deb96686a27 100644 --- a/docs/en/query_language/functions/math_functions.md +++ b/docs/en/query_language/functions/math_functions.md @@ -97,3 +97,5 @@ The arc tangent. ## pow(x, y) Takes two numeric arguments x and y. Returns a Float64 number close to x to the power of y. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/math_functions/) diff --git a/docs/en/query_language/functions/other_functions.md b/docs/en/query_language/functions/other_functions.md index f3299bd5796..c58495db616 100644 --- a/docs/en/query_language/functions/other_functions.md +++ b/docs/en/query_language/functions/other_functions.md @@ -559,3 +559,5 @@ SELECT replicate(1, ['a', 'b', 'c']) └───────────────────────────────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/other_functions/) diff --git a/docs/en/query_language/functions/random_functions.md b/docs/en/query_language/functions/random_functions.md index 915155f4af2..eca7e3279aa 100644 --- a/docs/en/query_language/functions/random_functions.md +++ b/docs/en/query_language/functions/random_functions.md @@ -16,3 +16,5 @@ Uses a linear congruential generator. Returns a pseudo-random UInt64 number, evenly distributed among all UInt64-type numbers. Uses a linear congruential generator. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/random_functions/) diff --git a/docs/en/query_language/functions/rounding_functions.md b/docs/en/query_language/functions/rounding_functions.md index 916dd0a5082..75a94415197 100644 --- a/docs/en/query_language/functions/rounding_functions.md +++ b/docs/en/query_language/functions/rounding_functions.md @@ -66,3 +66,5 @@ Accepts a number. If the number is less than one, it returns 0. Otherwise, it ro Accepts a number. If the number is less than 18, it returns 0. Otherwise, it rounds the number down to a number from the set: 18, 25, 35, 45, 55. This function is specific to Yandex.Metrica and used for implementing the report on user age. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/rounding_functions/) diff --git a/docs/en/query_language/functions/splitting_merging_functions.md b/docs/en/query_language/functions/splitting_merging_functions.md index e2fb62ac479..0e1cf98ee20 100644 --- a/docs/en/query_language/functions/splitting_merging_functions.md +++ b/docs/en/query_language/functions/splitting_merging_functions.md @@ -26,4 +26,5 @@ SELECT alphaTokens('abca1abc') ┌─alphaTokens('abca1abc')─┐ │ ['abca','abc'] │ └─────────────────────────┘ -``` \ No newline at end of file +``` +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/splitting_merging_functions/) diff --git a/docs/en/query_language/functions/string_functions.md b/docs/en/query_language/functions/string_functions.md index 61e33040aa5..251fbd53a9b 100644 --- a/docs/en/query_language/functions/string_functions.md +++ b/docs/en/query_language/functions/string_functions.md @@ -74,3 +74,5 @@ If the 's' string is non-empty and does not contain the 'c' character at the end Returns the string 's' that was converted from the encoding in 'from' to the encoding in 'to'. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_functions/) diff --git a/docs/en/query_language/functions/string_replace_functions.md b/docs/en/query_language/functions/string_replace_functions.md index d3773504278..59e7d6e8e04 100644 --- a/docs/en/query_language/functions/string_replace_functions.md +++ b/docs/en/query_language/functions/string_replace_functions.md @@ -77,3 +77,5 @@ SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res └─────────────────────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_replace_functions/) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index a038162c023..182152e36ed 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -52,3 +52,5 @@ For other regular expressions, the code is the same as for the 'match' function. The same thing as 'like', but negative. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_search_functions/) diff --git a/docs/en/query_language/functions/type_conversion_functions.md b/docs/en/query_language/functions/type_conversion_functions.md index 02014987e80..43819dcb489 100644 --- a/docs/en/query_language/functions/type_conversion_functions.md +++ b/docs/en/query_language/functions/type_conversion_functions.md @@ -137,3 +137,5 @@ SELECT toTypeName(CAST(x, 'Nullable(UInt16)')) FROM t_null └─────────────────────────────────────────┘ ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/type_conversion_functions/) diff --git a/docs/en/query_language/functions/url_functions.md b/docs/en/query_language/functions/url_functions.md index ef0c7e08158..afaaf0495f1 100644 --- a/docs/en/query_language/functions/url_functions.md +++ b/docs/en/query_language/functions/url_functions.md @@ -119,3 +119,5 @@ Removes the query string and fragment identifier. The question mark and number s Removes the 'name' URL parameter, if present. This function works under the assumption that the parameter name is encoded in the URL exactly the same way as in the passed argument. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/url_functions/) diff --git a/docs/en/query_language/functions/ym_dict_functions.md b/docs/en/query_language/functions/ym_dict_functions.md index 7ba7e7012cf..385a0ceff32 100644 --- a/docs/en/query_language/functions/ym_dict_functions.md +++ b/docs/en/query_language/functions/ym_dict_functions.md @@ -123,3 +123,5 @@ Accepts a UInt32 number – the region ID from the Yandex geobase. A string with `ua` and `uk` both mean Ukrainian. + +[Original article](https://clickhouse.yandex/docs/en/query_language/functions/ym_dict_functions/) diff --git a/docs/en/query_language/index.md b/docs/en/query_language/index.md index dcb59cbe6ad..bc8b8cfd876 100644 --- a/docs/en/query_language/index.md +++ b/docs/en/query_language/index.md @@ -6,3 +6,5 @@ * [ALTER](alter.md#query_language_queries_alter) * [Other types of queries](misc.md#miscellanous-queries) + +[Original article](https://clickhouse.yandex/docs/en/query_language/) diff --git a/docs/en/query_language/insert_into.md b/docs/en/query_language/insert_into.md index 99e11123507..5019af5fff4 100644 --- a/docs/en/query_language/insert_into.md +++ b/docs/en/query_language/insert_into.md @@ -66,3 +66,5 @@ Performance will not decrease if: - Data is added in real time. - You upload data that is usually sorted by time. + +[Original article](https://clickhouse.yandex/docs/en/query_language/insert_into/) diff --git a/docs/en/query_language/misc.md b/docs/en/query_language/misc.md index 253c1d59ef4..7c580248496 100644 --- a/docs/en/query_language/misc.md +++ b/docs/en/query_language/misc.md @@ -212,3 +212,5 @@ The response contains the `kill_status` column, which can take the following val 3. The other values ​​explain why the query can't be stopped. A test query (`TEST`) only checks the user's rights and displays a list of queries to stop. + +[Original article](https://clickhouse.yandex/docs/en/query_language/misc/) diff --git a/docs/en/query_language/operators.md b/docs/en/query_language/operators.md index 5d3b6df4ca6..08aee7296b1 100644 --- a/docs/en/query_language/operators.md +++ b/docs/en/query_language/operators.md @@ -171,3 +171,5 @@ WHERE isNotNull(y) 1 rows in set. Elapsed: 0.002 sec. ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/operators/) diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index 39f261ec2ab..ae1b4c3f265 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -964,3 +964,5 @@ You can put an asterisk in any part of a query instead of an expression. When th - In subqueries (since columns that aren't needed for the external query are excluded from subqueries). In all other cases, we don't recommend using the asterisk, since it only gives you the drawbacks of a columnar DBMS instead of the advantages. In other words using the asterisk is not recommended. + +[Original article](https://clickhouse.yandex/docs/en/query_language/select/) diff --git a/docs/en/query_language/syntax.md b/docs/en/query_language/syntax.md index 11ffb2e6a91..d40dd58442d 100644 --- a/docs/en/query_language/syntax.md +++ b/docs/en/query_language/syntax.md @@ -119,3 +119,5 @@ An expression is a function, identifier, literal, application of an operator, ex A list of expressions is one or more expressions separated by commas. Functions and operators, in turn, can have expressions as arguments. + +[Original article](https://clickhouse.yandex/docs/en/query_language/syntax/) diff --git a/docs/en/query_language/table_functions/file.md b/docs/en/query_language/table_functions/file.md index 67eb5742988..85aef565546 100644 --- a/docs/en/query_language/table_functions/file.md +++ b/docs/en/query_language/table_functions/file.md @@ -16,3 +16,5 @@ structure - table structure in 'UserID UInt64, URL String' format. Determines c -- getting the first 10 lines of a table that contains 3 columns of UInt32 type from a CSV file SELECT * FROM file('test.csv', 'CSV', 'column1 UInt32, column2 UInt32, column3 UInt32') LIMIT 10 ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/file/) diff --git a/docs/en/query_language/table_functions/index.md b/docs/en/query_language/table_functions/index.md index fd479dd3faf..f694c5e3518 100644 --- a/docs/en/query_language/table_functions/index.md +++ b/docs/en/query_language/table_functions/index.md @@ -4,3 +4,5 @@ Table functions can be specified in the FROM clause instead of the database and Table functions can only be used if 'readonly' is not set. Table functions aren't related to other functions. + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/) diff --git a/docs/en/query_language/table_functions/jdbc.md b/docs/en/query_language/table_functions/jdbc.md index 6a7f29b2301..1ea6e1e3cd7 100644 --- a/docs/en/query_language/table_functions/jdbc.md +++ b/docs/en/query_language/table_functions/jdbc.md @@ -21,3 +21,5 @@ SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', ```sql SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table') ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/jdbc/) diff --git a/docs/en/query_language/table_functions/merge.md b/docs/en/query_language/table_functions/merge.md index d1ddc12dc97..37a206d36a5 100644 --- a/docs/en/query_language/table_functions/merge.md +++ b/docs/en/query_language/table_functions/merge.md @@ -4,3 +4,5 @@ The table structure is taken from the first table encountered that matches the regular expression. + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/merge/) diff --git a/docs/en/query_language/table_functions/numbers.md b/docs/en/query_language/table_functions/numbers.md index 4486fece3d1..f3f64cf6399 100644 --- a/docs/en/query_language/table_functions/numbers.md +++ b/docs/en/query_language/table_functions/numbers.md @@ -20,3 +20,5 @@ Examples: select toDate('2010-01-01') + number as d FROM numbers(365); ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/numbers/) diff --git a/docs/en/query_language/table_functions/remote.md b/docs/en/query_language/table_functions/remote.md index 425c6f81a7d..a45a1c1bbae 100644 --- a/docs/en/query_language/table_functions/remote.md +++ b/docs/en/query_language/table_functions/remote.md @@ -73,3 +73,5 @@ The `remote` table function can be useful in the following cases: If the user is not specified, `default` is used. If the password is not specified, an empty password is used. + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/remote/) diff --git a/docs/en/query_language/table_functions/url.md b/docs/en/query_language/table_functions/url.md index 7e30936bd45..8f6b9619140 100644 --- a/docs/en/query_language/table_functions/url.md +++ b/docs/en/query_language/table_functions/url.md @@ -17,3 +17,5 @@ structure - table structure in `'UserID UInt64, Name String'` format. Determines -- getting the first 3 lines of a table that contains columns of String and UInt32 type from HTTP-server which answers in CSV format. SELECT * FROM url('http://127.0.0.1:12345/', CSV, 'column1 String, column2 UInt32') LIMIT 3 ``` + +[Original article](https://clickhouse.yandex/docs/en/query_language/table_functions/url/) diff --git a/docs/en/roadmap.md b/docs/en/roadmap.md index 51b6df94107..056ce76192d 100644 --- a/docs/en/roadmap.md +++ b/docs/en/roadmap.md @@ -18,3 +18,5 @@ - Predicate pushdown through join - Resource pools for more precise distribution of cluster capacity between users + +[Original article](https://clickhouse.yandex/docs/en/roadmap/) diff --git a/docs/en/security_changelog.md b/docs/en/security_changelog.md index 11e0557a8b8..62e98614ef2 100644 --- a/docs/en/security_changelog.md +++ b/docs/en/security_changelog.md @@ -19,3 +19,5 @@ Credits: Andrey Krasichkov and Evgeny Sidorov of Yandex Information Security Tea Incorrect configuration in deb package could lead to unauthorized use of the database. Credits: the UK's National Cyber Security Centre (NCSC) + +[Original article](https://clickhouse.yandex/docs/en/security_changelog/) diff --git a/docs/fa/data_types/array.md b/docs/fa/data_types/array.md index 9b7c70618a3..e14f698f6ed 100644 --- a/docs/fa/data_types/array.md +++ b/docs/fa/data_types/array.md @@ -4,4 +4,5 @@ آرایه ای از عناصر با تایپ T. تایپ T می تواند هر Type باشد، از جمله یک آرایه. ما توصیه به استفاده از آرایه های multidimensional نمی کنیم، چون آنها به خوبی پشتیبانی نمی شوند (برای مثال، شما نمی تونید در جداولی که موتور آنها MergeTree است، آرایه های multidimensional ذخیره سازی کنید). - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/array/) diff --git a/docs/fa/data_types/boolean.md b/docs/fa/data_types/boolean.md index 7fe6763ecc7..90f540468c7 100644 --- a/docs/fa/data_types/boolean.md +++ b/docs/fa/data_types/boolean.md @@ -5,3 +5,5 @@ type مخصوص مقادیر boolean وجود ندارد. از Uint8 و محدود شده به 0 و 1 می توان استفاده کرد. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/boolean/) diff --git a/docs/fa/data_types/date.md b/docs/fa/data_types/date.md index 3b77e5ce0c5..2a71cbd24bd 100644 --- a/docs/fa/data_types/date.md +++ b/docs/fa/data_types/date.md @@ -6,4 +6,5 @@ Date، دو بایت به ازای هر تاریخ که به صورت عددی Date بدون time zone ذخیره می شود. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/date/) diff --git a/docs/fa/data_types/datetime.md b/docs/fa/data_types/datetime.md index 6731b1bea6c..d36243f7a4f 100644 --- a/docs/fa/data_types/datetime.md +++ b/docs/fa/data_types/datetime.md @@ -13,3 +13,5 @@ پس در هنگام کار با تاریخ متنی (برای مثال زمانی که دامپ text می گیرید)، به خاطر داشته باشید که ممکن است به دلیل تغییرات DST، نتایج مبهمی در خروجی ببینید، و ممکن است در صورت تغییر time zone مشکلی با مطابقت خروجی با داده ها وجود داشته باشد. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/datetime/) diff --git a/docs/fa/data_types/enum.md b/docs/fa/data_types/enum.md index bf678647e8e..60dd120f19e 100644 --- a/docs/fa/data_types/enum.md +++ b/docs/fa/data_types/enum.md @@ -30,4 +30,5 @@ Enum8('hello' = 1, 'world' = 2) استفاده از ALTER برای تبدیل Enum8 به Enum16 یا برعکس، ممکن است، دقیقا شبیه به Int8 به Int16. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/enum/) diff --git a/docs/fa/data_types/fixedstring.md b/docs/fa/data_types/fixedstring.md index f337fe0ef46..96234069307 100644 --- a/docs/fa/data_types/fixedstring.md +++ b/docs/fa/data_types/fixedstring.md @@ -6,4 +6,5 @@ توابع کمتری نسبت به String برای FixedString(N) وجود دارد، و برای استفاده کمتر مناسب است. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/fixedstring/) diff --git a/docs/fa/data_types/float.md b/docs/fa/data_types/float.md index 60fb9fb380a..a61210e39fb 100644 --- a/docs/fa/data_types/float.md +++ b/docs/fa/data_types/float.md @@ -86,4 +86,5 @@ SELECT 0 / 0 قوانین مربوط به مرتب سازی ` Nan ` را در بخش [ORDER BY clause](../query_language/select.md#query_language-queries-order_by) ببینید. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/float/) diff --git a/docs/fa/data_types/index.md b/docs/fa/data_types/index.md index acd91711ba6..5ffabb4344c 100644 --- a/docs/fa/data_types/index.md +++ b/docs/fa/data_types/index.md @@ -9,3 +9,5 @@ ClickHouse قابلیت ذخیره سازی انواع type های مختلف ب این بخش انواع data type های قابل پشتیبانی در ClickHouse را شرح می دهد، همچنین ملاحطات آنها در هنگام استفاده آنها را شرح می دهد. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/) diff --git a/docs/fa/data_types/int_uint.md b/docs/fa/data_types/int_uint.md index fee85d72f33..0a1bbfe4a82 100644 --- a/docs/fa/data_types/int_uint.md +++ b/docs/fa/data_types/int_uint.md @@ -19,4 +19,5 @@ - UInt32 - [0 : 4294967295] - UInt64 - [0 : 18446744073709551615] - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/int_uint/) diff --git a/docs/fa/data_types/nested_data_structures/aggregatefunction.md b/docs/fa/data_types/nested_data_structures/aggregatefunction.md index 8d56156390e..d57a3eddba0 100644 --- a/docs/fa/data_types/nested_data_structures/aggregatefunction.md +++ b/docs/fa/data_types/nested_data_structures/aggregatefunction.md @@ -4,4 +4,5 @@ حالت متوسط از توابع aggregate. برای دریافت آن، از توابع aggregate به همراه پسوند '-State' استفاده کنید. برای اطلاعات بیشتر قسمت "AggregatingMergeTree" را ببینید. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/nested_data_structures/aggregatefunction/) diff --git a/docs/fa/data_types/nested_data_structures/index.md b/docs/fa/data_types/nested_data_structures/index.md index def4991e5bc..b5a3818646a 100644 --- a/docs/fa/data_types/nested_data_structures/index.md +++ b/docs/fa/data_types/nested_data_structures/index.md @@ -3,3 +3,5 @@ # Nested data structures + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/nested_data_structures/) diff --git a/docs/fa/data_types/nested_data_structures/nested.md b/docs/fa/data_types/nested_data_structures/nested.md index a02aec74872..1a52a90f239 100644 --- a/docs/fa/data_types/nested_data_structures/nested.md +++ b/docs/fa/data_types/nested_data_structures/nested.md @@ -110,4 +110,5 @@ LIMIT 10 دستور ALTER برای عناصر داخل nested بسیار محدود است. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/nested_data_structures/nested/) diff --git a/docs/fa/data_types/special_data_types/expression.md b/docs/fa/data_types/special_data_types/expression.md index 69ac90a3976..ada0eb0856e 100644 --- a/docs/fa/data_types/special_data_types/expression.md +++ b/docs/fa/data_types/special_data_types/expression.md @@ -4,4 +4,5 @@ برای نشان دادن توابع لامبدا در توابع high-order استفاده می شود. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/special_data_types/expression/) diff --git a/docs/fa/data_types/special_data_types/index.md b/docs/fa/data_types/special_data_types/index.md index 88f32012867..257b7508753 100644 --- a/docs/fa/data_types/special_data_types/index.md +++ b/docs/fa/data_types/special_data_types/index.md @@ -4,4 +4,5 @@ مقادیر نوع داده special، نمیتوانند در در جدول ذخیره و یا در نتایج خروجی قرار بگیرند، اما در نتایج متوسط (intermediate) یک query در حال اجرا استفاده می شوند. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/special_data_types/) diff --git a/docs/fa/data_types/special_data_types/set.md b/docs/fa/data_types/special_data_types/set.md index e518997271b..f2332e9eb86 100644 --- a/docs/fa/data_types/special_data_types/set.md +++ b/docs/fa/data_types/special_data_types/set.md @@ -4,4 +4,5 @@ برای نصف سمت راست IN استفاده می شود. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/special_data_types/set/) diff --git a/docs/fa/data_types/string.md b/docs/fa/data_types/string.md index 51734007388..71685574cc3 100644 --- a/docs/fa/data_types/string.md +++ b/docs/fa/data_types/string.md @@ -8,4 +8,5 @@ String یک type برای قرار دادن رشته با طول دلخواه م ClickHouse مفهومی به نام encoding ندارد. String ها می توانند شامل مجموعه ای بایت ها باشند که با همان شکل که نوشته می شوند به همان شکل هم در خروجی دیده شوند. اگر شما نیاز به ذخیره سازی متن دارید، توصیه می کنیم از UTF-8 استفاده کنید. حداقل اگر ترمینال شما از UTF-8 (پیشنهاد شده)، استفاده می کند، شما می توانید به راحتی مقادیر خود را نوشته و بخوانید.به طور مشابه توابع خاصی برای کار با رشته های متنوع وجود دارند که تخل این فرضیه عمل می کنند که رشته شامل مجوعه ای از بایت ها می باشند که نماینده ی متن های UTF-8 هستند. برای مثال تابع 'length' برای محاسبه طول رشته براساس بایت است، در حالی که تابع 'lengthUTF8' برای محاسبه طول رشته بر اساس UNICODE می باشد. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/string/) diff --git a/docs/fa/data_types/tuple.md b/docs/fa/data_types/tuple.md index 1acb21fb2fd..3d0a22cb16c 100644 --- a/docs/fa/data_types/tuple.md +++ b/docs/fa/data_types/tuple.md @@ -6,4 +6,5 @@ Tuple ها نمیتوانند در جدول نوشته شوند (به غیر ج Tuple می توانند در خروجی نتیجه query در حال اجرا باشند. در این مورد، برای فرمت های text به غیر از JSON\*، مقادیر به صورت comma-separate داخل براکت قرار میگیرند. در فرمت های JSON\* مقادیر tuple به صورت آرایه در خروجی می آیند. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/tuple/) diff --git a/docs/fa/getting_started/example_datasets/amplab_benchmark.md b/docs/fa/getting_started/example_datasets/amplab_benchmark.md index acdf6dc8704..04c22d39967 100644 --- a/docs/fa/getting_started/example_datasets/amplab_benchmark.md +++ b/docs/fa/getting_started/example_datasets/amplab_benchmark.md @@ -134,3 +134,5 @@ GROUP BY sourceIP ORDER BY totalRevenue DESC LIMIT 1 ``` + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/example_datasets/amplab_benchmark/) diff --git a/docs/fa/getting_started/example_datasets/criteo.md b/docs/fa/getting_started/example_datasets/criteo.md index 57f4007efa9..9e8cb4196d4 100644 --- a/docs/fa/getting_started/example_datasets/criteo.md +++ b/docs/fa/getting_started/example_datasets/criteo.md @@ -87,3 +87,5 @@ INSERT INTO criteo SELECT date, clicked, int1, int2, int3, int4, int5, int6, int DROP TABLE criteo_log; ``` + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/example_datasets/criteo/) diff --git a/docs/fa/getting_started/example_datasets/nyc_taxi.md b/docs/fa/getting_started/example_datasets/nyc_taxi.md index bf478583304..cb5db536f32 100644 --- a/docs/fa/getting_started/example_datasets/nyc_taxi.md +++ b/docs/fa/getting_started/example_datasets/nyc_taxi.md @@ -408,4 +408,5 @@ Q4: 0.072 ثانیه. | 3 | 0.212 | 0.438 | 0.733 | 1.241 | | 140 | 0.028 | 0.043 | 0.051 | 0.072 | - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/example_datasets/nyc_taxi/) diff --git a/docs/fa/getting_started/example_datasets/ontime.md b/docs/fa/getting_started/example_datasets/ontime.md index f5bf5b865af..4acc22d6063 100644 --- a/docs/fa/getting_started/example_datasets/ontime.md +++ b/docs/fa/getting_started/example_datasets/ontime.md @@ -391,3 +391,5 @@ SELECT OriginCityName, count() AS c FROM ontime GROUP BY OriginCityName ORDER BY - + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/example_datasets/ontime/) diff --git a/docs/fa/getting_started/example_datasets/star_schema.md b/docs/fa/getting_started/example_datasets/star_schema.md index 8d09090f35e..bc61cc9137c 100644 --- a/docs/fa/getting_started/example_datasets/star_schema.md +++ b/docs/fa/getting_started/example_datasets/star_schema.md @@ -96,3 +96,5 @@ CREATE TABLE partd AS part ENGINE = Distributed(perftest_3shards_1replicas, defa cat customer.tbl | sed 's/$/2000-01-01/' | clickhouse-client --query "INSERT INTO customer FORMAT CSV" cat lineorder.tbl | clickhouse-client --query "INSERT INTO lineorder FORMAT CSV" ``` + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/example_datasets/star_schema/) diff --git a/docs/fa/getting_started/example_datasets/wikistat.md b/docs/fa/getting_started/example_datasets/wikistat.md index 543a41901ab..3cc9a28d586 100644 --- a/docs/fa/getting_started/example_datasets/wikistat.md +++ b/docs/fa/getting_started/example_datasets/wikistat.md @@ -33,3 +33,5 @@ for i in {2007..2016}; do for j in {01..12}; do echo $i-$j >&2; curl -sSL "http: cat links.txt | while read link; do wget http://dumps.wikimedia.org/other/pagecounts-raw/$(echo $link | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})[0-9]{2}-[0-9]+\.gz/\1/')/$(echo $link | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})[0-9]{2}-[0-9]+\.gz/\1-\2/')/$link; done ls -1 /opt/wikistat/ | grep gz | while read i; do echo $i; gzip -cd /opt/wikistat/$i | ./wikistat-loader --time="$(echo -n $i | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2})([0-9]{2})([0-9]{2})\.gz/\1-\2-\3 \4-00-00/')" | clickhouse-client --query="INSERT INTO wikistat FORMAT TabSeparated"; done ``` + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/example_datasets/wikistat/) diff --git a/docs/fa/getting_started/index.md b/docs/fa/getting_started/index.md index 8d5a0bcfa11..002473ef1f5 100644 --- a/docs/fa/getting_started/index.md +++ b/docs/fa/getting_started/index.md @@ -167,4 +167,5 @@ SELECT 1 برای ادامه آزمایشات، شما میتوانید دیتاست های تستی را دریافت و امتحان کنید. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/getting_started/) diff --git a/docs/fa/index.md b/docs/fa/index.md index 3403835cf3b..d5f6c20d2a4 100644 --- a/docs/fa/index.md +++ b/docs/fa/index.md @@ -145,3 +145,5 @@ LIMIT 20 توجه کنید که برای کارایی CPU، query language باید SQL یا MDX باشد، یا حداقل یک بردارد (J, K) باشد. query برای بهینه سازی باید فقط دارای حلقه های implicit باشد. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/) diff --git a/docs/fa/interfaces/cli.md b/docs/fa/interfaces/cli.md index 6c7372c8363..b4c0bc7e0de 100644 --- a/docs/fa/interfaces/cli.md +++ b/docs/fa/interfaces/cli.md @@ -120,3 +120,5 @@ command line برا پایه 'readline' (و 'history' یا 'libedit'، یه بد ``` + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/cli/) diff --git a/docs/fa/interfaces/formats.md b/docs/fa/interfaces/formats.md index 3aeaef02150..c461f062734 100644 --- a/docs/fa/interfaces/formats.md +++ b/docs/fa/interfaces/formats.md @@ -583,3 +583,5 @@ struct Message { عملیات Deserialization موثر است و معمولا لود سیستم را افزایش نمی دهد. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/formats/) diff --git a/docs/fa/interfaces/http_interface.md b/docs/fa/interfaces/http_interface.md index 3251b2d4ccd..418a92f4daf 100644 --- a/docs/fa/interfaces/http_interface.md +++ b/docs/fa/interfaces/http_interface.md @@ -280,3 +280,5 @@ curl -sS 'http://localhost:8123/?max_result_bytes=4000000&buffer_size=3000000&wa از بافرینگ به منظور اجتناب از شرایطی که یک خطای پردازش query رخ داده بعد از response کد و هدر های ارسال شده به کلاینت استفاده کنید. در این شرایط، پیغام خطا در انتهای بنده response نوشته می شود، و در سمت کلاینت، پیغام خطا فقط از طریق مرحله پارس کردن قابل شناسایی است. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/http_interface/) diff --git a/docs/fa/interfaces/index.md b/docs/fa/interfaces/index.md index 4d4600bd26f..d06c8ec8fd0 100644 --- a/docs/fa/interfaces/index.md +++ b/docs/fa/interfaces/index.md @@ -6,4 +6,5 @@ برای کشف قابلیت های سیستم، دانلو داده ها به جداول، یا ساخت query های دستی، از برنامه clikhouse-client استفاده کنید. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/) diff --git a/docs/fa/interfaces/jdbc.md b/docs/fa/interfaces/jdbc.md index dc0acb15994..e72b5504c06 100644 --- a/docs/fa/interfaces/jdbc.md +++ b/docs/fa/interfaces/jdbc.md @@ -11,4 +11,5 @@ JDBC drivers implemented by other organizations: - [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC) - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/jdbc/) diff --git a/docs/fa/interfaces/tcp.md b/docs/fa/interfaces/tcp.md index 963555b5400..5e767b876f8 100644 --- a/docs/fa/interfaces/tcp.md +++ b/docs/fa/interfaces/tcp.md @@ -4,4 +4,5 @@ native interface در محیط ترمینال "clickhouse-client" برای تعامل بین سرور با پردازش query توزیع شده مورد استفاده قرار می گیرد. همچنین native interface در برنامه های C++ مورد استفاده قرار می گیرد. ما فقط کلاینت command-line را پوشش میدیم. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/tcp/) diff --git a/docs/fa/interfaces/third-party_client_libraries.md b/docs/fa/interfaces/third-party_client_libraries.md index 2fb5de3cc9b..3f6536ccf22 100644 --- a/docs/fa/interfaces/third-party_client_libraries.md +++ b/docs/fa/interfaces/third-party_client_libraries.md @@ -47,4 +47,5 @@ ما این کتابخانه ها را تست نکردیم. آنها به صورت تصادفی انتخاب شده اند. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party_client_libraries/) diff --git a/docs/fa/interfaces/third-party_gui.md b/docs/fa/interfaces/third-party_gui.md index 8972edd880a..7f537b1c26e 100644 --- a/docs/fa/interfaces/third-party_gui.md +++ b/docs/fa/interfaces/third-party_gui.md @@ -35,4 +35,5 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - مانیتورینگ کافکا و جداول replicate (بزودی); - و بسیاری از ویژگی های دیگر برای شما. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party_gui/) diff --git a/docs/fa/introduction/distinctive_features.md b/docs/fa/introduction/distinctive_features.md index 61b2115a3b5..94d4198e12e 100644 --- a/docs/fa/introduction/distinctive_features.md +++ b/docs/fa/introduction/distinctive_features.md @@ -63,4 +63,5 @@ ClickHouse از روش asynchronous multimaster replication استفاده می برای اطلاعات بیشتر، به بخش [replication داده ها](../operations/table_engines/replication.md#table_engines-replication) مراجعه کنید. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/introduction/distinctive_features/) diff --git a/docs/fa/introduction/features_considered_disadvantages.md b/docs/fa/introduction/features_considered_disadvantages.md index 0c9e1b0cf8a..3a963d05140 100644 --- a/docs/fa/introduction/features_considered_disadvantages.md +++ b/docs/fa/introduction/features_considered_disadvantages.md @@ -7,3 +7,5 @@ 3. Sparse index باعث می شود ClickHouse چندان مناسب اجرای پرسمان های point query برای دریافت یک ردیف از داده ها با استفاده از کلید آنها نباشد. + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/introduction/features_considered_disadvantages/) diff --git a/docs/fa/introduction/performance.md b/docs/fa/introduction/performance.md index 8d738cdbf9f..2fb2a9dc036 100644 --- a/docs/fa/introduction/performance.md +++ b/docs/fa/introduction/performance.md @@ -24,4 +24,5 @@ benchmark های زیادی وجود دارند که این نتایج را تا پیشنهاد می کنیم درج داده ها را به صورت دسته ای و حداقل 100 سطر در هر دسته انجام دهید و یا بیش از یک درخواست insert در ثانیه را نداشته باشید. در هنگام درج داده در جدول MergeTree از یک dump جدا شده با tab، سرعت درج داده از 50 تا 200 مگابایت در ثانیه می باشد. اگر سطر های درج شده حدود 1 کیلوبایت باشند، سرعت حدود 50 هزار تا 200 هزار سطر در ثانیه می باشد. اگر سطر ها کوچک باشند بازدهی بالایی در تعداد سطر در ثانیه خواهیم داشت. در Banner System Data -`>` 500 هزار سطر در ثانیه، در Graphite data -`>` 1 میلیون سطر در ثانیه). برای بهبود کارایی، شما می توانید چندین insert را به صورت موازی اجرا کنید، که در این حالت کارایی سیستم به صورت خطی افزایش می یابد. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/introduction/performance/) diff --git a/docs/fa/introduction/ya_metrika_task.md b/docs/fa/introduction/ya_metrika_task.md index d1f4aa1d1fd..1ea434f248c 100644 --- a/docs/fa/introduction/ya_metrika_task.md +++ b/docs/fa/introduction/ya_metrika_task.md @@ -45,4 +45,5 @@ Yandex.Metrica دارای یک سیستم تخصصی برای aggregate کردن برای حذف محدودیت های OLAPServer و حل مشکلات کار با داده های Non-Aggregate برای تمام گزارش ها، ما مدیریت دیتابیس ClicHouse را توسعه دادیم.. - \ No newline at end of file + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/introduction/ya_metrika_task/) diff --git a/docs/ru/data_types/array.md b/docs/ru/data_types/array.md index 73b86d7c9d1..450c4cf5178 100644 --- a/docs/ru/data_types/array.md +++ b/docs/ru/data_types/array.md @@ -81,3 +81,5 @@ Code: 386. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception 0 rows in set. Elapsed: 0.246 sec. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/array/) diff --git a/docs/ru/data_types/boolean.md b/docs/ru/data_types/boolean.md index 541f8ef0345..b85f1393a80 100644 --- a/docs/ru/data_types/boolean.md +++ b/docs/ru/data_types/boolean.md @@ -1,3 +1,5 @@ # Булевы значения Отдельного типа для булевых значений нет. Для них используется тип UInt8, в котором используются только значения 0 и 1. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/boolean/) diff --git a/docs/ru/data_types/date.md b/docs/ru/data_types/date.md index c458deaf627..887bb19e967 100644 --- a/docs/ru/data_types/date.md +++ b/docs/ru/data_types/date.md @@ -6,3 +6,5 @@ Минимальное значение выводится как 0000-00-00. Дата хранится без учёта часового пояса. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/date/) diff --git a/docs/ru/data_types/datetime.md b/docs/ru/data_types/datetime.md index dfc54e43add..d9f5457e3ac 100644 --- a/docs/ru/data_types/datetime.md +++ b/docs/ru/data_types/datetime.md @@ -14,3 +14,5 @@ Поддерживаются только часовые пояса, для которых для всего диапазона времён, с которым вы будете работать, не существовало моментов времени, в которые время отличалось от UTC на нецелое число часов (без учёта секунд координации). То есть, при работе с датой в виде текста (например, при сохранении текстовых дампов), следует иметь ввиду о проблемах с неоднозначностью во время перевода стрелок назад, и о проблемах с соответствием данных, при смене часового пояса. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/datetime/) diff --git a/docs/ru/data_types/decimal.md b/docs/ru/data_types/decimal.md index 9e554395a0f..cc0a3e4761b 100644 --- a/docs/ru/data_types/decimal.md +++ b/docs/ru/data_types/decimal.md @@ -93,3 +93,5 @@ SELECT toDecimal32(1, 8) < 100 ``` DB::Exception: Can't compare. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/decimal/) diff --git a/docs/ru/data_types/enum.md b/docs/ru/data_types/enum.md index aaae8aad378..62250d8667b 100644 --- a/docs/ru/data_types/enum.md +++ b/docs/ru/data_types/enum.md @@ -110,3 +110,5 @@ INSERT INTO t_enum_null Values('hello'),('world'),(NULL) При ALTER, есть возможность бесплатно изменить тип Enum-а, если меняется только множество значений. При этом, можно добавлять новые значения; можно удалять старые значения (это безопасно только если они ни разу не использовались, так как это не проверяется). В качестве "защиты от дурака", нельзя менять числовые значения у имеющихся строк - в этом случае, кидается исключение. При ALTER, есть возможность поменять Enum8 на Enum16 и обратно - так же, как можно поменять Int8 на Int16. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/enum/) diff --git a/docs/ru/data_types/fixedstring.md b/docs/ru/data_types/fixedstring.md index 75fb9650b02..5c7fa19d506 100644 --- a/docs/ru/data_types/fixedstring.md +++ b/docs/ru/data_types/fixedstring.md @@ -7,3 +7,5 @@ Обратите внимание, как это поведение отличается от поведения MySQL для типа CHAR (строки дополняются пробелами, пробелы перед выводом вырезаются). С типом FixedString(N) умеет работать меньше функций, чем с типом String - то есть, он менее удобен в использовании. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/fixedstring/) diff --git a/docs/ru/data_types/float.md b/docs/ru/data_types/float.md index 228fd93193e..61e17521b4f 100644 --- a/docs/ru/data_types/float.md +++ b/docs/ru/data_types/float.md @@ -66,3 +66,5 @@ SELECT 0 / 0 ``` Смотрите правила сортировки `NaN` в разделе [Секция ORDER BY](../query_language/select.md#query_language-queries-order_by). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/float/) diff --git a/docs/ru/data_types/index.md b/docs/ru/data_types/index.md index e41d457ee4c..a167ec3859f 100644 --- a/docs/ru/data_types/index.md +++ b/docs/ru/data_types/index.md @@ -4,4 +4,5 @@ ClickHouse может сохранять в ячейках таблиц данные различных типов. -Раздел содержит описания поддерживаемых типов данных и специфику их использования и/или реализации, если таковые имеются. \ No newline at end of file +Раздел содержит описания поддерживаемых типов данных и специфику их использования и/или реализации, если таковые имеются. +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/) diff --git a/docs/ru/data_types/int_uint.md b/docs/ru/data_types/int_uint.md index 49b7bbbbcf8..562da33e730 100644 --- a/docs/ru/data_types/int_uint.md +++ b/docs/ru/data_types/int_uint.md @@ -19,3 +19,5 @@ - UInt16 - [ 0 : 65535 ] - UInt32 - [ 0 : 4294967295 ] - UInt64 - [ 0 : 18446744073709551615 ] + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/int_uint/) diff --git a/docs/ru/data_types/nested_data_structures/aggregatefunction.md b/docs/ru/data_types/nested_data_structures/aggregatefunction.md index a15205cf120..51acc27b299 100644 --- a/docs/ru/data_types/nested_data_structures/aggregatefunction.md +++ b/docs/ru/data_types/nested_data_structures/aggregatefunction.md @@ -1,3 +1,5 @@ # AggregateFunction(name, types_of_arguments...) Промежуточное состояние агрегатной функции. Чтобы его получить, используются агрегатные функции с суффиксом -State. Подробнее смотрите в разделе "AggregatingMergeTree". + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/nested_data_structures/aggregatefunction/) diff --git a/docs/ru/data_types/nested_data_structures/index.md b/docs/ru/data_types/nested_data_structures/index.md index b7bc28de3da..3e5ea1bd69e 100644 --- a/docs/ru/data_types/nested_data_structures/index.md +++ b/docs/ru/data_types/nested_data_structures/index.md @@ -1 +1,2 @@ -# Вложенные структуры данных \ No newline at end of file +# Вложенные структуры данных +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/nested_data_structures/) diff --git a/docs/ru/data_types/nested_data_structures/nested.md b/docs/ru/data_types/nested_data_structures/nested.md index 6db4e9e83ab..58c7c48da3e 100644 --- a/docs/ru/data_types/nested_data_structures/nested.md +++ b/docs/ru/data_types/nested_data_structures/nested.md @@ -95,3 +95,5 @@ LIMIT 10 При запросе DESCRIBE, столбцы вложенной структуры данных перечисляются так же по отдельности. Работоспособность запроса ALTER для элементов вложенных структур данных, является сильно ограниченной. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/nested_data_structures/nested/) diff --git a/docs/ru/data_types/nullable.md b/docs/ru/data_types/nullable.md index f098cac2f76..e4b3bb830c7 100644 --- a/docs/ru/data_types/nullable.md +++ b/docs/ru/data_types/nullable.md @@ -61,3 +61,5 @@ FROM t_null 2 rows in set. Elapsed: 0.144 sec. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/nullable/) diff --git a/docs/ru/data_types/special_data_types/expression.md b/docs/ru/data_types/special_data_types/expression.md index 8451a034743..438492c5399 100644 --- a/docs/ru/data_types/special_data_types/expression.md +++ b/docs/ru/data_types/special_data_types/expression.md @@ -1,3 +1,5 @@ # Expression Используется для представления лямбда-выражений в функциях высшего порядка. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/special_data_types/expression/) diff --git a/docs/ru/data_types/special_data_types/index.md b/docs/ru/data_types/special_data_types/index.md index 9adb03853ba..b9eda72c556 100644 --- a/docs/ru/data_types/special_data_types/index.md +++ b/docs/ru/data_types/special_data_types/index.md @@ -1,3 +1,5 @@ # Служебные типы данных Значения служебных типов данных не могут сохраняться в таблицу и выводиться в качестве результата, а возникают как промежуточный результат выполнения запроса. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/special_data_types/) diff --git a/docs/ru/data_types/special_data_types/nothing.md b/docs/ru/data_types/special_data_types/nothing.md index 6b83c354d5e..c452aa2f198 100644 --- a/docs/ru/data_types/special_data_types/nothing.md +++ b/docs/ru/data_types/special_data_types/nothing.md @@ -17,3 +17,5 @@ SELECT toTypeName([]) 1 rows in set. Elapsed: 0.062 sec. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/special_data_types/nothing/) diff --git a/docs/ru/data_types/special_data_types/set.md b/docs/ru/data_types/special_data_types/set.md index 72a9a2647e5..fe31450ab29 100644 --- a/docs/ru/data_types/special_data_types/set.md +++ b/docs/ru/data_types/special_data_types/set.md @@ -1,3 +1,5 @@ # Set Используется для представления правой части выражения IN. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/special_data_types/set/) diff --git a/docs/ru/data_types/string.md b/docs/ru/data_types/string.md index f4a100470c7..18d18eecb0e 100644 --- a/docs/ru/data_types/string.md +++ b/docs/ru/data_types/string.md @@ -11,3 +11,5 @@ Если вам нужно хранить тексты, рекомендуется использовать кодировку UTF-8. По крайней мере, если у вас терминал работает в кодировке UTF-8 (это рекомендуется), вы сможете читать и писать свои значения без каких-либо преобразований. Также, некоторые функции по работе со строками, имеют отдельные варианты, которые работают при допущении, что строка содержит набор байт, представляющий текст в кодировке UTF-8. Например, функция length вычисляет длину строки в байтах, а функция lengthUTF8 - длину строки в кодовых точках Unicode, при допущении, что значение в кодировке UTF-8. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/string/) diff --git a/docs/ru/data_types/tuple.md b/docs/ru/data_types/tuple.md index 66aca46d939..cd954a2e477 100644 --- a/docs/ru/data_types/tuple.md +++ b/docs/ru/data_types/tuple.md @@ -51,3 +51,5 @@ SELECT 1 rows in set. Elapsed: 0.002 sec. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/tuple/) diff --git a/docs/ru/development/style.md b/docs/ru/development/style.md index f5470b48fcd..4bcff77ca3a 100644 --- a/docs/ru/development/style.md +++ b/docs/ru/development/style.md @@ -836,3 +836,5 @@ function( const & RangesInDataParts ranges, size_t limit) ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/development/style/) diff --git a/docs/ru/faq/general.md b/docs/ru/faq/general.md index 15a19bbeb85..8cecad1aaf8 100644 --- a/docs/ru/faq/general.md +++ b/docs/ru/faq/general.md @@ -9,4 +9,5 @@ Распределённая сортировка не является оптимальным способом выполнения операции reduce, если результат выполнения операции и все промежуточные результаты, при их наличии, помещаются в оперативку на одном сервере, как обычно бывает в запросах, выполняющихся в режиме онлайн. В таком случае, оптимальным способом выполнения операции reduce является хэш-таблица. Частым способом оптимизации map-reduce задач является предагрегация (частичный reduce) с использованием хэш-таблицы в оперативной памяти. Эта оптимизация делается пользователем в ручном режиме. Распределённая сортировка является основной причиной тормозов при выполнении несложных map-reduce задач. -Большинство реализаций MapReduce позволяют выполнять произвольный код на кластере. Но для OLAP задач лучше подходит декларативный язык запросов, который позволяет быстро проводить исследования. Для примера, для Hadoop существует Hive и Pig. Также смотрите Cloudera Impala, Shark (устаревший) для Spark, а также Spark SQL, Presto, Apache Drill. Впрочем, производительность при выполнении таких задач является сильно неоптимальной по сравнению со специализированными системами, а сравнительно высокая latency не позволяет использовать эти системы в качестве бэкенда для веб-интерфейса. \ No newline at end of file +Большинство реализаций MapReduce позволяют выполнять произвольный код на кластере. Но для OLAP задач лучше подходит декларативный язык запросов, который позволяет быстро проводить исследования. Для примера, для Hadoop существует Hive и Pig. Также смотрите Cloudera Impala, Shark (устаревший) для Spark, а также Spark SQL, Presto, Apache Drill. Впрочем, производительность при выполнении таких задач является сильно неоптимальной по сравнению со специализированными системами, а сравнительно высокая latency не позволяет использовать эти системы в качестве бэкенда для веб-интерфейса. +[Оригинальная статья](https://clickhouse.yandex/docs/ru/faq/general/) diff --git a/docs/ru/getting_started/example_datasets/amplab_benchmark.md b/docs/ru/getting_started/example_datasets/amplab_benchmark.md index 602a12eaea1..e65d76ee5eb 100644 --- a/docs/ru/getting_started/example_datasets/amplab_benchmark.md +++ b/docs/ru/getting_started/example_datasets/amplab_benchmark.md @@ -119,3 +119,5 @@ GROUP BY sourceIP ORDER BY totalRevenue DESC LIMIT 1 ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/example_datasets/amplab_benchmark/) diff --git a/docs/ru/getting_started/example_datasets/criteo.md b/docs/ru/getting_started/example_datasets/criteo.md index 2d2f44242f8..57074e11fb4 100644 --- a/docs/ru/getting_started/example_datasets/criteo.md +++ b/docs/ru/getting_started/example_datasets/criteo.md @@ -70,3 +70,5 @@ INSERT INTO criteo SELECT date, clicked, int1, int2, int3, int4, int5, int6, int DROP TABLE criteo_log; ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/example_datasets/criteo/) diff --git a/docs/ru/getting_started/example_datasets/nyc_taxi.md b/docs/ru/getting_started/example_datasets/nyc_taxi.md index f66f37de89a..1ce2f12193d 100644 --- a/docs/ru/getting_started/example_datasets/nyc_taxi.md +++ b/docs/ru/getting_started/example_datasets/nyc_taxi.md @@ -366,3 +366,5 @@ Q4: 0.072 sec. | 1 | 0.490 | 1.224 | 2.104 | 3.593 | | 3 | 0.212 | 0.438 | 0.733 | 1.241 | | 140 | 0.028 | 0.043 | 0.051 | 0.072 | + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/example_datasets/nyc_taxi/) diff --git a/docs/ru/getting_started/example_datasets/ontime.md b/docs/ru/getting_started/example_datasets/ontime.md index afd4de06893..77142179ae1 100644 --- a/docs/ru/getting_started/example_datasets/ontime.md +++ b/docs/ru/getting_started/example_datasets/ontime.md @@ -316,3 +316,5 @@ SELECT OriginCityName, count() AS c FROM ontime GROUP BY OriginCityName ORDER BY - - - + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/example_datasets/ontime/) diff --git a/docs/ru/getting_started/example_datasets/star_schema.md b/docs/ru/getting_started/example_datasets/star_schema.md index 279daed3fdd..e89e04e80ed 100644 --- a/docs/ru/getting_started/example_datasets/star_schema.md +++ b/docs/ru/getting_started/example_datasets/star_schema.md @@ -82,3 +82,5 @@ CREATE TABLE partd AS part ENGINE = Distributed(perftest_3shards_1replicas, defa cat customer.tbl | sed 's/$/2000-01-01/' | clickhouse-client --query "INSERT INTO customer FORMAT CSV" cat lineorder.tbl | clickhouse-client --query "INSERT INTO lineorder FORMAT CSV" ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/example_datasets/star_schema/) diff --git a/docs/ru/getting_started/example_datasets/wikistat.md b/docs/ru/getting_started/example_datasets/wikistat.md index 5f07989262e..31455f8c392 100644 --- a/docs/ru/getting_started/example_datasets/wikistat.md +++ b/docs/ru/getting_started/example_datasets/wikistat.md @@ -24,3 +24,5 @@ for i in {2007..2016}; do for j in {01..12}; do echo $i-$j >&2; curl -sSL "http: cat links.txt | while read link; do wget http://dumps.wikimedia.org/other/pagecounts-raw/$(echo $link | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})[0-9]{2}-[0-9]+\.gz/\1/')/$(echo $link | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})[0-9]{2}-[0-9]+\.gz/\1-\2/')/$link; done ls -1 /opt/wikistat/ | grep gz | while read i; do echo $i; gzip -cd /opt/wikistat/$i | ./wikistat-loader --time="$(echo -n $i | sed -r 's/pagecounts-([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2})([0-9]{2})([0-9]{2})\.gz/\1-\2-\3 \4-00-00/')" | clickhouse-client --query="INSERT INTO wikistat FORMAT TabSeparated"; done ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/example_datasets/wikistat/) diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index 18e006f01c3..b53f128ad49 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -136,3 +136,5 @@ SELECT 1 **Поздравляем, система работает!** Для дальнейших экспериментов можно попробовать загрузить из тестовых наборов данных. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/) diff --git a/docs/ru/index.md b/docs/ru/index.md index 54e6b172342..a2f6945bd04 100644 --- a/docs/ru/index.md +++ b/docs/ru/index.md @@ -138,3 +138,5 @@ LIMIT 20 В "обычных" БД этого не делается, так как не имеет смысла при выполнении простых запросов. Хотя есть исключения. Например, в MemSQL кодогенерация используется для уменьшения latency при выполнении SQL запросов. (Для сравнения - в аналитических СУБД, требуется оптимизация throughput, а не latency). Стоит заметить, что для эффективности по CPU требуется, чтобы язык запросов был декларативным (SQL, MDX) или хотя бы векторным (J, K). То есть, чтобы запрос содержал циклы только в неявном виде, открывая возможности для оптимизации. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/) diff --git a/docs/ru/interfaces/cli.md b/docs/ru/interfaces/cli.md index 09f21a64f83..ec7bc7d2c1b 100644 --- a/docs/ru/interfaces/cli.md +++ b/docs/ru/interfaces/cli.md @@ -115,4 +115,5 @@ cat file.csv | clickhouse-client --database=test --query="INSERT INTO test FORMA username password -``` \ No newline at end of file +``` +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/cli/) diff --git a/docs/ru/interfaces/formats.md b/docs/ru/interfaces/formats.md index c87ed059143..801c9516454 100644 --- a/docs/ru/interfaces/formats.md +++ b/docs/ru/interfaces/formats.md @@ -617,3 +617,5 @@ struct Message { Файлы со схемами находятся в файле, который находится в каталоге указанном в параметре [format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) конфигурации сервера. Десериализация эффективна и обычно не повышает нагрузку на систему. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/formats/) diff --git a/docs/ru/interfaces/http_interface.md b/docs/ru/interfaces/http_interface.md index 6aa2d786ae9..6c8c0de1c11 100644 --- a/docs/ru/interfaces/http_interface.md +++ b/docs/ru/interfaces/http_interface.md @@ -219,3 +219,5 @@ curl -sS 'http://localhost:8123/?max_result_bytes=4000000&buffer_size=3000000&wa ``` Буферизация позволяет избежать ситуации когда код ответа и HTTP-заголовки были отправлены клиенту, после чего возникла ошибка выполнения запроса. В такой ситуации сообщение об ошибке записывается в конце тела ответа, и на стороне клиента ошибка может быть обнаружена только на этапе парсинга. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/http_interface/) diff --git a/docs/ru/interfaces/index.md b/docs/ru/interfaces/index.md index 348cf975fce..4560cda1fb7 100644 --- a/docs/ru/interfaces/index.md +++ b/docs/ru/interfaces/index.md @@ -3,3 +3,5 @@ # Интерфейсы Для изучения возможностей системы, загрузки данных в таблицы, ручных запросов, используйте программу clickhouse-client. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/) diff --git a/docs/ru/interfaces/jdbc.md b/docs/ru/interfaces/jdbc.md index 90051ad464f..8c54419d34a 100644 --- a/docs/ru/interfaces/jdbc.md +++ b/docs/ru/interfaces/jdbc.md @@ -2,3 +2,5 @@ - [Официальный драйвер](https://github.com/yandex/clickhouse-jdbc). - Драйвер от сторонней огранизации [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/jdbc/) diff --git a/docs/ru/interfaces/tcp.md b/docs/ru/interfaces/tcp.md index e73a90ddff3..98672b505e4 100644 --- a/docs/ru/interfaces/tcp.md +++ b/docs/ru/interfaces/tcp.md @@ -1,3 +1,5 @@ # Родной интерфейс (TCP) Родной интерфейс используется в клиенте командной строки clickhouse-client, при межсерверном взаимодействии для распределённой обработки запроса, а также в программах на C++. Будет рассмотрен только клиент командной строки. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/tcp/) diff --git a/docs/ru/interfaces/third-party_client_libraries.md b/docs/ru/interfaces/third-party_client_libraries.md index 618e693698d..8d681e38d8b 100644 --- a/docs/ru/interfaces/third-party_client_libraries.md +++ b/docs/ru/interfaces/third-party_client_libraries.md @@ -46,3 +46,5 @@ - [AORM](https://github.com/TanVD/AORM) - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party_client_libraries/) diff --git a/docs/ru/interfaces/third-party_gui.md b/docs/ru/interfaces/third-party_gui.md index bb1d4e5b166..33b3e59ab8d 100644 --- a/docs/ru/interfaces/third-party_gui.md +++ b/docs/ru/interfaces/third-party_gui.md @@ -48,3 +48,5 @@ - Построение запросов с подсветкой синтаксиса; - Просмотр таблиц; - Автодополнение команд. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party_gui/) diff --git a/docs/ru/introduction/distinctive_features.md b/docs/ru/introduction/distinctive_features.md index 7851e580985..db00c6af6c9 100644 --- a/docs/ru/introduction/distinctive_features.md +++ b/docs/ru/introduction/distinctive_features.md @@ -60,3 +60,5 @@ ClickHouse предоставляет различные способы разм Используется асинхронная multimaster репликация. После записи на любую доступную реплику, данные распространяются на все остальные реплики в фоне. Система поддерживает полную идентичность данных на разных репликах. Восстановление после большинства сбоев осуществляется автоматически, а в сложных случаях — полуавтоматически. При необходимости, можно [включить кворумную запись](../operations/settings/settings.md#setting-insert_quorum) данных. Подробнее смотрите раздел [Репликация данных](../operations/table_engines/replication.md#table_engines-replication). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/distinctive_features/) diff --git a/docs/ru/introduction/features_considered_disadvantages.md b/docs/ru/introduction/features_considered_disadvantages.md index b7ac877cc32..9e04f747c10 100644 --- a/docs/ru/introduction/features_considered_disadvantages.md +++ b/docs/ru/introduction/features_considered_disadvantages.md @@ -4,3 +4,5 @@ 2. Возможность изменять или удалять ранее записанные данные с низкими задержками и высокой частотой запросов не предоставляется. Есть массовое удаление данных для очистки более не нужного или соответствия [GDPR](https://gdpr-info.eu). Массовое изменение данных находится в разработке (на момент июля 2018). 3. Разреженный индекс делает ClickHouse плохо пригодным для точечных чтений одиночных строк по своим ключам. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/features_considered_disadvantages/) diff --git a/docs/ru/introduction/performance.md b/docs/ru/introduction/performance.md index 95e1d1cd008..f9ac886971f 100644 --- a/docs/ru/introduction/performance.md +++ b/docs/ru/introduction/performance.md @@ -21,3 +21,5 @@ ## Производительность при вставке данных Данные рекомендуется вставлять пачками не менее 1000 строк или не более одного запроса в секунду. При вставке в таблицу типа MergeTree из tab-separated дампа, скорость вставки будет в районе 50-200 МБ/сек. Если вставляются строчки размером около 1 КБ, то скорость будет в районе 50 000 - 200 000 строчек в секунду. Если строчки маленькие - производительность в строчках в секунду будет выше (на данных БК - `>` 500 000 строк в секунду, на данных Graphite - `>` 1 000 000 строк в секунду). Для увеличения производительности, можно производить несколько запросов INSERT параллельно - при этом производительность растёт линейно. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/performance/) diff --git a/docs/ru/introduction/ya_metrika_task.md b/docs/ru/introduction/ya_metrika_task.md index b4030376ba0..c7e22346ae5 100644 --- a/docs/ru/introduction/ya_metrika_task.md +++ b/docs/ru/introduction/ya_metrika_task.md @@ -45,3 +45,5 @@ ClickHouse имеет более десятка инсталляций в дру OLAPServer хорошо подходил для неагрегированных данных, но содержал много ограничений, не позволяющих использовать его для всех отчётов так, как хочется: отсутствие поддержки типов данных (только числа), невозможность инкрементального обновления данных в реальном времени (только перезаписью данных за сутки). OLAPServer не является СУБД, а является специализированной БД. Чтобы снять ограничения OLAPServer-а и решить задачу работы с неагрегированными данными для всех отчётов, разработана СУБД ClickHouse. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/ya_metrika_task/) diff --git a/docs/ru/operations/access_rights.md b/docs/ru/operations/access_rights.md index 7f09a917c7a..93e496b3dc1 100644 --- a/docs/ru/operations/access_rights.md +++ b/docs/ru/operations/access_rights.md @@ -98,3 +98,5 @@ Пользователь может получить список всех БД и таблиц в них с помощью запросов `SHOW` или системных таблиц, даже если у него нет доступа к отдельным БД. Доступ к БД не связан с настройкой [readonly](settings/query_complexity.md#query_complexity_readonly). Невозможно дать полный доступ к одной БД и `readonly` к другой. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/access_rights/) diff --git a/docs/ru/operations/configuration_files.md b/docs/ru/operations/configuration_files.md index ab4f3d4ebd5..563696a78fe 100644 --- a/docs/ru/operations/configuration_files.md +++ b/docs/ru/operations/configuration_files.md @@ -40,3 +40,5 @@ $ cat /etc/clickhouse-server/users.d/alice.xml Для каждого конфигурационного файла, сервер при запуске генерирует также файлы `file-preprocessed.xml`. Эти файлы содержат все выполненные подстановки и переопределения, и предназначены для информационных целей. Если в конфигурационных файлах были использованы ZooKeeper-подстановки, но при старте сервера ZooKeeper недоступен, то сервер загрузит конфигурацию из preprocessed-файла. Сервер следит за изменениями конфигурационных файлов, а также файлов и ZooKeeper-узлов, которые были использованы при выполнении подстановок и переопределений, и перезагружает настройки пользователей и кластеров на лету. То есть, можно изменять кластера, пользователей и их настройки без перезапуска сервера. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/configuration_files/) diff --git a/docs/ru/operations/index.md b/docs/ru/operations/index.md index 75f20597ec3..f16d6b3f8d7 100644 --- a/docs/ru/operations/index.md +++ b/docs/ru/operations/index.md @@ -1 +1,3 @@ # Эксплуатация + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/) diff --git a/docs/ru/operations/quotas.md b/docs/ru/operations/quotas.md index 1a56ff9fe62..93a795973d9 100644 --- a/docs/ru/operations/quotas.md +++ b/docs/ru/operations/quotas.md @@ -103,3 +103,5 @@ При распределённой обработке запроса, накопленные величины хранятся на сервере-инициаторе запроса. То есть, если пользователь пойдёт на другой сервер - там квота будет действовать "с нуля". При перезапуске сервера, квоты сбрасываются. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/quotas/) diff --git a/docs/ru/operations/server_settings/index.md b/docs/ru/operations/server_settings/index.md index 644b1af79c4..c208f9b418b 100644 --- a/docs/ru/operations/server_settings/index.md +++ b/docs/ru/operations/server_settings/index.md @@ -9,3 +9,5 @@ Прочие настройки описаны в разделе "[Настройки](../settings/index.md#settings)". Перед изучением настроек ознакомьтесь с разделом [Конфигурационные файлы](../configuration_files.md#configuration_files), обратите внимание на использование подстановок (атрибуты `incl` и `optional`). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/server_settings/) diff --git a/docs/ru/operations/server_settings/settings.md b/docs/ru/operations/server_settings/settings.md index 5e71c871615..567551cc394 100644 --- a/docs/ru/operations/server_settings/settings.md +++ b/docs/ru/operations/server_settings/settings.md @@ -719,3 +719,5 @@ ClickHouse использует ZooKeeper для хранения метадан ```xml ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/server_settings/settings/) diff --git a/docs/ru/operations/settings/index.md b/docs/ru/operations/settings/index.md index 3de41c00b3f..1fa2f55bd53 100644 --- a/docs/ru/operations/settings/index.md +++ b/docs/ru/operations/settings/index.md @@ -22,3 +22,5 @@ - При использовании HTTP API передавайте cgi-параметры (`URL?setting_1=value&setting_2=value...`). Настройки, которые можно задать только в конфигурационном файле сервера, в разделе не рассматриваются. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/settings/) diff --git a/docs/ru/operations/settings/query_complexity.md b/docs/ru/operations/settings/query_complexity.md index ccb206a587d..3be6205e5be 100644 --- a/docs/ru/operations/settings/query_complexity.md +++ b/docs/ru/operations/settings/query_complexity.md @@ -196,3 +196,5 @@ ## transfer_overflow_mode Что делать, когда количество данных превысило одно из ограничений: throw или break. По умолчанию: throw. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/settings/query_complexity/) diff --git a/docs/ru/operations/settings/settings.md b/docs/ru/operations/settings/settings.md index 9648620be93..91271b2de5f 100644 --- a/docs/ru/operations/settings/settings.md +++ b/docs/ru/operations/settings/settings.md @@ -413,3 +413,5 @@ ClickHouse применяет настройку в тех случаях, ко - [insert_quorum](#setting-insert_quorum) - [insert_quorum_timeout](#setting-insert_quorum_timeout) + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/settings/settings/) diff --git a/docs/ru/operations/settings/settings_profiles.md b/docs/ru/operations/settings/settings_profiles.md index 8e30d76107e..90b7fd9c6f0 100644 --- a/docs/ru/operations/settings/settings_profiles.md +++ b/docs/ru/operations/settings/settings_profiles.md @@ -62,3 +62,5 @@ SET profile = 'web' В примере задано два профиля: `default` и `web`. Профиль `default` имеет специальное значение - он всегда обязан присутствовать и применяется при запуске сервера. То есть, профиль `default` содержит настройки по умолчанию. Профиль `web` - обычный профиль, который может быть установлен с помощью запроса `SET` или с помощью параметра URL при запросе по HTTP. Профили настроек могут наследоваться от друг-друга - это реализуется указанием настройки `profile` перед остальными настройками, перечисленными в профиле. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/settings/settings_profiles/) diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index ee03d00ac34..8dbc5c78150 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -410,3 +410,5 @@ numChildren: 7 pzxid: 987021252247 path: /clickhouse/tables/01-08/visits/replicas ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/system_tables/) diff --git a/docs/ru/operations/table_engines/aggregatingmergetree.md b/docs/ru/operations/table_engines/aggregatingmergetree.md index cff9116988d..d8ab0d90c2e 100644 --- a/docs/ru/operations/table_engines/aggregatingmergetree.md +++ b/docs/ru/operations/table_engines/aggregatingmergetree.md @@ -85,3 +85,5 @@ ORDER BY StartDate; Вы можете создать такое материализованное представление и навесить на него обычное представление, выполняющее доагрегацию данных. Заметим, что в большинстве случаев, использование `AggregatingMergeTree` является неоправданным, так как можно достаточно эффективно выполнять запросы по неагрегированным данным. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/aggregatingmergetree/) diff --git a/docs/ru/operations/table_engines/buffer.md b/docs/ru/operations/table_engines/buffer.md index 7f947ea91b6..48aca209cdf 100644 --- a/docs/ru/operations/table_engines/buffer.md +++ b/docs/ru/operations/table_engines/buffer.md @@ -57,3 +57,5 @@ CREATE TABLE merge.hits_buffer AS merge.hits ENGINE = Buffer(merge, hits, 16, 10 Таблицы типа Buffer используются в тех случаях, когда от большого количества серверов поступает слишком много INSERT-ов в единицу времени, и нет возможности заранее самостоятельно буферизовать данные перед вставкой, в результате чего, INSERT-ы не успевают выполняться. Заметим, что даже для таблиц типа Buffer не имеет смысла вставлять данные по одной строке, так как таким образом будет достигнута скорость всего лишь в несколько тысяч строк в секунду, тогда как при вставке более крупными блоками, достижимо более миллиона строк в секунду (смотрите раздел "Производительность"). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/buffer/) diff --git a/docs/ru/operations/table_engines/collapsingmergetree.md b/docs/ru/operations/table_engines/collapsingmergetree.md index 83dfaf99d72..70cce9e111b 100644 --- a/docs/ru/operations/table_engines/collapsingmergetree.md +++ b/docs/ru/operations/table_engines/collapsingmergetree.md @@ -35,3 +35,5 @@ CollapsingMergeTree(EventDate, (CounterID, EventDate, intHash32(UniqID), VisitID 1. Написать запрос с GROUP BY и агрегатными функциями, учитывающими знак. Например, чтобы посчитать количество, надо вместо count() написать sum(Sign); чтобы посчитать сумму чего-либо, надо вместо sum(x) написать sum(Sign \* x) и т. п., а также добавить HAVING sum(Sign) `>` 0. Не все величины можно посчитать подобным образом. Например, агрегатные функции min, max не могут быть переписаны. 2. Если необходимо вынимать данные без агрегации (например, проверить наличие строк, самые новые значения которых удовлетворяют некоторым условиям), можно использовать модификатор FINAL для секции FROM. Это вариант существенно менее эффективен. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/collapsingmergetree/) diff --git a/docs/ru/operations/table_engines/custom_partitioning_key.md b/docs/ru/operations/table_engines/custom_partitioning_key.md index dc7abf81811..b87755c0a9e 100644 --- a/docs/ru/operations/table_engines/custom_partitioning_key.md +++ b/docs/ru/operations/table_engines/custom_partitioning_key.md @@ -41,3 +41,5 @@ ALTER TABLE table DROP PARTITION (toMonday(today()), 1) ID партиции - это её строковый идентификатор (по возможности человекочитаемый), используемый для имён кусков на файловой системе и в ZooKeeper. Его можно указывать в запросах ALTER вместо значения ключа партиционирования. Пример: ключ партиционирования `toYYYYMM(EventDate)`, в ALTER можно указывать либо `PARTITION 201710`, либо `PARTITION ID '201710'`. Больше примеров в тестах [`00502_custom_partitioning_local`](https://github.com/yandex/ClickHouse/blob/master/dbms/tests/queries/0_stateless/00502_custom_partitioning_local.sql) и [`00502_custom_partitioning_replicated_zookeeper`](https://github.com/yandex/ClickHouse/blob/master/dbms/tests/queries/0_stateless/00502_custom_partitioning_replicated_zookeeper.sql). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/custom_partitioning_key/) diff --git a/docs/ru/operations/table_engines/dictionary.md b/docs/ru/operations/table_engines/dictionary.md index 90a9f786404..a87eba36f63 100644 --- a/docs/ru/operations/table_engines/dictionary.md +++ b/docs/ru/operations/table_engines/dictionary.md @@ -106,3 +106,5 @@ LIMIT 1 1 rows in set. Elapsed: 0.006 sec. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/dictionary/) diff --git a/docs/ru/operations/table_engines/distributed.md b/docs/ru/operations/table_engines/distributed.md index a797677690e..528fa7954d6 100644 --- a/docs/ru/operations/table_engines/distributed.md +++ b/docs/ru/operations/table_engines/distributed.md @@ -120,3 +120,5 @@ logs - имя кластера в конфигурационном файле с Если после INSERT-а в Distributed таблицу, сервер перестал существовать или был грубо перезапущен (например, в следствие аппаратного сбоя), то записанные данные могут быть потеряны. Если в директории таблицы обнаружен повреждённый кусок данных, то он переносится в поддиректорию broken и больше не используется. При выставлении опции max_parallel_replicas выполнение запроса распараллеливается по всем репликам внутри одного шарда. Подробнее смотрите раздел "Настройки, max_parallel_replicas". + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/distributed/) diff --git a/docs/ru/operations/table_engines/external_data.md b/docs/ru/operations/table_engines/external_data.md index fc61c77677c..430f90a82ae 100644 --- a/docs/ru/operations/table_engines/external_data.md +++ b/docs/ru/operations/table_engines/external_data.md @@ -59,3 +59,5 @@ curl -F 'passwd=@passwd.tsv;' 'http://localhost:8123/?query=SELECT+shell,+count( ``` При распределённой обработке запроса, временные таблицы передаются на все удалённые серверы. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/external_data/) diff --git a/docs/ru/operations/table_engines/file.md b/docs/ru/operations/table_engines/file.md index f6573676822..dd972cffa9f 100644 --- a/docs/ru/operations/table_engines/file.md +++ b/docs/ru/operations/table_engines/file.md @@ -75,3 +75,5 @@ $ echo -e "1,2\n3,4" | clickhouse-local -q "CREATE TABLE table (a Int64, b Int64 - использование операций `ALTER` и `SELECT...SAMPLE`; - индексы; - репликация. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/file/) diff --git a/docs/ru/operations/table_engines/graphitemergetree.md b/docs/ru/operations/table_engines/graphitemergetree.md index 3617fe40829..bcaa82272c2 100644 --- a/docs/ru/operations/table_engines/graphitemergetree.md +++ b/docs/ru/operations/table_engines/graphitemergetree.md @@ -83,3 +83,5 @@ default ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/graphitemergetree/) diff --git a/docs/ru/operations/table_engines/index.md b/docs/ru/operations/table_engines/index.md index 90b14f70094..a5e42c21edb 100644 --- a/docs/ru/operations/table_engines/index.md +++ b/docs/ru/operations/table_engines/index.md @@ -14,3 +14,5 @@ При чтении, движок обязан лишь выдать запрошенные столбцы, но в некоторых случаях движок может частично обрабатывать данные при ответе на запрос. Для большинства серьёзных задач, следует использовать движки семейства `MergeTree`. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/) diff --git a/docs/ru/operations/table_engines/join.md b/docs/ru/operations/table_engines/join.md index 2acabefc491..0fcae4688c9 100644 --- a/docs/ru/operations/table_engines/join.md +++ b/docs/ru/operations/table_engines/join.md @@ -14,3 +14,5 @@ Join(ANY|ALL, LEFT|INNER, k1[, k2, ...]) В таблицу можно вставлять данные INSERT-ом, аналогично движку Set. В случае ANY, данные для дублирующихся ключей будут проигнорированы; в случае ALL - будут учитываться. Из таблицы нельзя, непосредственно, делать SELECT. Единственная возможность чтения - использование в качестве "правой" таблицы для JOIN. Хранение данных на диске аналогично движку Set. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/join/) diff --git a/docs/ru/operations/table_engines/kafka.md b/docs/ru/operations/table_engines/kafka.md index 282140d4350..aded13ae666 100644 --- a/docs/ru/operations/table_engines/kafka.md +++ b/docs/ru/operations/table_engines/kafka.md @@ -136,3 +136,5 @@ Kafka SETTINGS ``` В документе [librdkafka configuration reference](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md) можно увидеть список возможных опций конфигурации. Используйте подчёркивания (`_`) вместо точек в конфигурации ClickHouse, например, `check.crcs=true` будет соответствовать `true`. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/kafka/) diff --git a/docs/ru/operations/table_engines/log.md b/docs/ru/operations/table_engines/log.md index cfb050f1640..58aab57f5f7 100644 --- a/docs/ru/operations/table_engines/log.md +++ b/docs/ru/operations/table_engines/log.md @@ -3,3 +3,5 @@ Отличается от TinyLog тем, что вместе с файлами столбцов лежит небольшой файл "засечек". Засечки пишутся на каждый блок данных и содержат смещение - с какого места нужно читать файл, чтобы пропустить заданное количество строк. Это позволяет читать данные из таблицы в несколько потоков. При конкуррентном доступе к данным, чтения могут выполняться одновременно, а записи блокируют чтения и друг друга. Движок Log не поддерживает индексы. Также, если при записи в таблицу произошёл сбой, то таблица станет битой, и чтения из неё будут возвращать ошибку. Движок Log подходит для временных данных, write-once таблиц, а также для тестовых и демонстрационных целей. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/log/) diff --git a/docs/ru/operations/table_engines/materializedview.md b/docs/ru/operations/table_engines/materializedview.md index 8c44eb40c01..843f0678a9a 100644 --- a/docs/ru/operations/table_engines/materializedview.md +++ b/docs/ru/operations/table_engines/materializedview.md @@ -1,3 +1,5 @@ # MaterializedView Используется для реализации материализованных представлений (подробнее см. запрос [CREATE TABLE](../../query_language/create.md#query_language-queries-create_table)). Для хранения данных, использует другой движок, который был указан при создании представления. При чтении из таблицы, просто использует этот движок. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/materializedview/) diff --git a/docs/ru/operations/table_engines/memory.md b/docs/ru/operations/table_engines/memory.md index 7552a270988..70cf0c8db20 100644 --- a/docs/ru/operations/table_engines/memory.md +++ b/docs/ru/operations/table_engines/memory.md @@ -8,3 +8,5 @@ Обычно, использование этого движка таблиц является неоправданным. Тем не менее, он может использоваться для тестов, а также в задачах, где важно достичь максимальной скорости на не очень большом количестве строк (примерно до 100 000 000). Движок Memory используется системой для временных таблиц - внешних данных запроса (смотрите раздел "Внешние данные для обработки запроса"), для реализации `GLOBAL IN` (смотрите раздел "Операторы IN"). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/memory/) diff --git a/docs/ru/operations/table_engines/merge.md b/docs/ru/operations/table_engines/merge.md index 7aa5ebd3348..3b2174d52fa 100644 --- a/docs/ru/operations/table_engines/merge.md +++ b/docs/ru/operations/table_engines/merge.md @@ -39,3 +39,5 @@ Merge(hits, '^WatchLog') Таблица типа `Merge` содержит виртуальный столбец `_table` типа `String`. (Если в таблице уже есть столбец `_table`, то виртуальный столбец называется `_table1`; если уже есть `_table1`, то `_table2` и т. п.) Он содержит имя таблицы, из которой были прочитаны данные. Если секция `WHERE/PREWHERE` содержит (в качестве одного из элементов конъюнкции или в качестве всего выражения) условия на столбец `_table`, не зависящие от других столбцов таблицы, то эти условия используются как индекс: условия выполняются над множеством имён таблиц, из которых нужно читать данные, и чтение будет производиться только из тех таблиц, для которых условия сработали. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/merge/) diff --git a/docs/ru/operations/table_engines/mergetree.md b/docs/ru/operations/table_engines/mergetree.md index f41e165f7b4..6736740a063 100644 --- a/docs/ru/operations/table_engines/mergetree.md +++ b/docs/ru/operations/table_engines/mergetree.md @@ -185,3 +185,5 @@ SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%' Для конкурентного доступа к таблице используется мультиверсионность. То есть, при одновременном чтении и обновлении таблицы, данные будут читаться из набора кусочков, актуального на момент запроса. Длинных блокировок нет. Вставки никак не мешают чтениям. Чтения из таблицы автоматически распараллеливаются. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/mergetree/) diff --git a/docs/ru/operations/table_engines/mysql.md b/docs/ru/operations/table_engines/mysql.md index e08edc4e180..d4444dfe269 100644 --- a/docs/ru/operations/table_engines/mysql.md +++ b/docs/ru/operations/table_engines/mysql.md @@ -25,3 +25,5 @@ MySQL('host:port', 'database', 'table', 'user', 'password'[, replace_query, 'on_ Остальные условия и ограничение выборки `LIMIT` будут выполнены в ClickHouse только после выполнения запроса к MySQL. Движок `MySQL` не поддерживает тип данных [Nullable](../../data_types/nullable.md#data_type-nullable), поэтому при чтении данных из таблиц MySQL `NULL` преобразуются в значения по умолчанию для заданного типа столбца, обычно это 0 или пустая строка. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/mysql/) diff --git a/docs/ru/operations/table_engines/null.md b/docs/ru/operations/table_engines/null.md index 252517b1acd..a67b9bb16a8 100644 --- a/docs/ru/operations/table_engines/null.md +++ b/docs/ru/operations/table_engines/null.md @@ -3,3 +3,5 @@ При записи в таблицу типа Null, данные игнорируются. При чтении из таблицы типа Null, возвращается пустота. Тем не менее, есть возможность создать материализованное представление над таблицей типа Null. Тогда данные, записываемые в таблицу, будут попадать в представление. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/null/) diff --git a/docs/ru/operations/table_engines/replacingmergetree.md b/docs/ru/operations/table_engines/replacingmergetree.md index 8e09810ca2b..054ff84e769 100644 --- a/docs/ru/operations/table_engines/replacingmergetree.md +++ b/docs/ru/operations/table_engines/replacingmergetree.md @@ -15,3 +15,5 @@ ReplacingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, ver) Таким образом, `ReplacingMergeTree` подходит для фоновой чистки дублирующихся данных в целях экономии места, но не даёт гарантий отсутствия дубликатов. *Движок не используется в Яндекс.Метрике, но нашёл своё применение в других отделах Яндекса.* + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/replacingmergetree/) diff --git a/docs/ru/operations/table_engines/replication.md b/docs/ru/operations/table_engines/replication.md index 1dec0f4f42c..8ee94d4beb3 100644 --- a/docs/ru/operations/table_engines/replication.md +++ b/docs/ru/operations/table_engines/replication.md @@ -180,3 +180,5 @@ sudo -u clickhouse touch /var/lib/clickhouse/flags/force_restore_data ## Восстановление в случае потери или повреждения метаданных на ZooKeeper кластере Если данные в ZooKeeper оказались утеряны или повреждены, то вы можете сохранить данные, переместив их в нереплицируемую таблицу, как описано в пункте выше. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/replication/) diff --git a/docs/ru/operations/table_engines/set.md b/docs/ru/operations/table_engines/set.md index 0697b32b492..b4371e1a9c2 100644 --- a/docs/ru/operations/table_engines/set.md +++ b/docs/ru/operations/table_engines/set.md @@ -8,3 +8,5 @@ Данные постоянно находятся в оперативке. При INSERT-е, в директорию таблицы на диске, также пишутся блоки вставленных данных. При запуске сервера, эти данные считываются в оперативку. То есть, после перезапуска, данные остаются на месте. При грубом перезапуске сервера, блок данных на диске может быть потерян или повреждён. В последнем случае, может потребоваться вручную удалить файл с повреждёнными данными. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/set/) diff --git a/docs/ru/operations/table_engines/summingmergetree.md b/docs/ru/operations/table_engines/summingmergetree.md index 6aa2f116d72..422c5fc57da 100644 --- a/docs/ru/operations/table_engines/summingmergetree.md +++ b/docs/ru/operations/table_engines/summingmergetree.md @@ -44,3 +44,5 @@ SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, (Shows, C Для вложенных структур данных не нужно указывать её столбцы в качестве списка столбцов для суммирования. Этот движок таблиц разработан по просьбе БК, и является мало полезным. Помните, что при хранении лишь предагрегированных данных, вы теряете часть преимуществ системы. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/summingmergetree/) diff --git a/docs/ru/operations/table_engines/tinylog.md b/docs/ru/operations/table_engines/tinylog.md index 813eaa56890..3e09668504e 100644 --- a/docs/ru/operations/table_engines/tinylog.md +++ b/docs/ru/operations/table_engines/tinylog.md @@ -16,3 +16,5 @@ **Индексы не поддерживаются.** В Яндекс.Метрике таблицы типа TinyLog используются для промежуточных данных, обрабатываемых маленькими пачками. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/tinylog/) diff --git a/docs/ru/operations/table_engines/url.md b/docs/ru/operations/table_engines/url.md index b3daae06169..1d28694bdaa 100644 --- a/docs/ru/operations/table_engines/url.md +++ b/docs/ru/operations/table_engines/url.md @@ -72,3 +72,5 @@ SELECT * FROM url_engine_table - индексы; - репликация. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/url/) diff --git a/docs/ru/operations/table_engines/view.md b/docs/ru/operations/table_engines/view.md index 128986eb733..874569e3af4 100644 --- a/docs/ru/operations/table_engines/view.md +++ b/docs/ru/operations/table_engines/view.md @@ -1,3 +1,5 @@ # View Используется для реализации представлений (подробнее см. запрос `CREATE VIEW`). Не хранит данные, а хранит только указанный запрос `SELECT`. При чтении из таблицы, выполняет его (с удалением из запроса всех ненужных столбцов). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/view/) diff --git a/docs/ru/operations/tips.md b/docs/ru/operations/tips.md index 9927d78dcf3..e51480e3a1c 100644 --- a/docs/ru/operations/tips.md +++ b/docs/ru/operations/tips.md @@ -254,3 +254,5 @@ script -Dzookeeper.root.logger=${ZOO_LOG4J_PROP} $ZOOMAIN $ZOOCFG end script ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/tips/) diff --git a/docs/ru/operations/utils/clickhouse-copier.md b/docs/ru/operations/utils/clickhouse-copier.md index 849fa532d41..d114c826dc6 100644 --- a/docs/ru/operations/utils/clickhouse-copier.md +++ b/docs/ru/operations/utils/clickhouse-copier.md @@ -157,3 +157,5 @@ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/path ``` `clickhouse-copier` отслеживает изменения `/task/path/description` и применяет их "на лету". Если вы поменяете, например, значение `max_workers`, то количество процессов, выполняющих задания, также изменится. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/utils/clickhouse-copier/) diff --git a/docs/ru/operations/utils/clickhouse-local.md b/docs/ru/operations/utils/clickhouse-local.md index ddaa64e0a21..4edbb3abb2b 100644 --- a/docs/ru/operations/utils/clickhouse-local.md +++ b/docs/ru/operations/utils/clickhouse-local.md @@ -66,3 +66,5 @@ Read 186 rows, 4.15 KiB in 0.035 sec., 5302 rows/sec., 118.34 KiB/sec. ├──────────┼──────────┤ ... ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/utils/clickhouse-local/) diff --git a/docs/ru/operations/utils/index.md b/docs/ru/operations/utils/index.md index 75bd574a72e..aa07954d8c6 100644 --- a/docs/ru/operations/utils/index.md +++ b/docs/ru/operations/utils/index.md @@ -2,3 +2,5 @@ * [clickhouse-local](clickhouse-local.md#utils-clickhouse-local) - позволяет выполнять SQL-запросы над данными без установки сервера ClickHouse подобно тому, как это делает `awk`. * [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) - копирует (и перешардирует) данные с одного кластера на другой. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/utils/) diff --git a/docs/ru/query_language/agg_functions/combinators.md b/docs/ru/query_language/agg_functions/combinators.md index ba08f46e4ea..0e4c1dd8733 100644 --- a/docs/ru/query_language/agg_functions/combinators.md +++ b/docs/ru/query_language/agg_functions/combinators.md @@ -38,3 +38,5 @@ ## -ForEach Преобразует агрегатную функцию для таблиц в агрегатную функцию для массивов, которая применяет агрегирование для соответствующих элементов массивов и возвращает массив результатов. Например, `sumForEach` для массивов `[1, 2]`, `[3, 4, 5]` и `[6, 7]` даст результат `[10, 13, 5]`, сложив соответственные элементы массивов. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/agg_functions/combinators/) diff --git a/docs/ru/query_language/agg_functions/index.md b/docs/ru/query_language/agg_functions/index.md index 261c3c3700c..e89934fde39 100644 --- a/docs/ru/query_language/agg_functions/index.md +++ b/docs/ru/query_language/agg_functions/index.md @@ -61,3 +61,5 @@ FROM t_null_big ``` `groupArray` не включает `NULL` в результирующий массив. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/agg_functions/) diff --git a/docs/ru/query_language/agg_functions/parametric_functions.md b/docs/ru/query_language/agg_functions/parametric_functions.md index b86b75baf6c..7bfcb58eb1b 100644 --- a/docs/ru/query_language/agg_functions/parametric_functions.md +++ b/docs/ru/query_language/agg_functions/parametric_functions.md @@ -127,3 +127,5 @@ ORDER BY level Задача: показывать в отчёте только поисковые фразы, по которым было хотя бы 5 уникальных посетителей. Решение: пишем в запросе GROUP BY SearchPhrase HAVING uniqUpTo(4)(UserID) >= 5 ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/agg_functions/parametric_functions/) diff --git a/docs/ru/query_language/agg_functions/reference.md b/docs/ru/query_language/agg_functions/reference.md index 1ad00d76778..5fa297e004d 100644 --- a/docs/ru/query_language/agg_functions/reference.md +++ b/docs/ru/query_language/agg_functions/reference.md @@ -377,3 +377,5 @@ FROM ontime ## corr(x, y) Вычисляет коэффициент корреляции Пирсона: `Σ((x - x̅)(y - y̅)) / sqrt(Σ((x - x̅)^2) * Σ((y - y̅)^2))`. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/agg_functions/reference/) diff --git a/docs/ru/query_language/alter.md b/docs/ru/query_language/alter.md index 4a39af65b95..0b01ac86e2a 100644 --- a/docs/ru/query_language/alter.md +++ b/docs/ru/query_language/alter.md @@ -270,3 +270,5 @@ ALTER TABLE [db.]table UPDATE column1 = expr1 [, ...] WHERE filter_expr **parts_to_do** - Количество кусков таблицы, которые ещё предстоит изменить. **is_done** - Завершена ли мутация. Замечание: даже если `parts_to_do = 0`, для реплицированной таблицы возможна ситуация, когда мутация ещё не завершена из-за долго выполняющейся вставки, которая добавляет данные, которые нужно будет мутировать. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/alter/) diff --git a/docs/ru/query_language/create.md b/docs/ru/query_language/create.md index a33692d12b1..12f6f9c4901 100644 --- a/docs/ru/query_language/create.md +++ b/docs/ru/query_language/create.md @@ -153,3 +153,5 @@ SELECT a, b, c FROM (SELECT ...) Отсутствует отдельный запрос для удаления представлений. Чтобы удалить представление, следует использовать `DROP TABLE`. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/create/) diff --git a/docs/ru/query_language/dicts/external_dicts.md b/docs/ru/query_language/dicts/external_dicts.md index 6fdd4d2d266..d1df2c4990c 100644 --- a/docs/ru/query_language/dicts/external_dicts.md +++ b/docs/ru/query_language/dicts/external_dicts.md @@ -48,3 +48,5 @@ ClickHouse: - [Источники внешних словарей](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources) - [Ключ и поля словаря](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) - [Функции для работы с внешними словарями](../functions/ext_dict_functions.md#ext_dict_functions) + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict.md b/docs/ru/query_language/dicts/external_dicts_dict.md index 7ba8588dcc1..0c56593fdd1 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict.md +++ b/docs/ru/query_language/dicts/external_dicts_dict.md @@ -31,3 +31,5 @@ - [layout](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) - Размещение словаря в памяти. - [structure](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) - Структура словаря. Ключ и атрибуты, которые можно получить по ключу. - [lifetime](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) - Периодичность обновления словарей. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict_layout.md b/docs/ru/query_language/dicts/external_dicts_dict_layout.md index d2ee91d5d3d..199b6926f7a 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_layout.md @@ -290,3 +290,5 @@ dictGetString('prefix', 'asn', tuple(IPv6StringToNum('2001:db8::1'))) Никакие другие типы не поддерживаются. Функция возвращает атрибут для префикса, соответствующего данному IP-адресу. Если есть перекрывающиеся префиксы, возвращается наиболее специфический. Данные хранятся в побитовом дереве (`trie`), он должены полностью помещаться в оперативной памяти. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict_layout/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md b/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md index f8898684353..4e78a838165 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md @@ -56,3 +56,5 @@ ClickHouse периодически обновляет словари. Инте ... ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict_lifetime/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict_sources.md b/docs/ru/query_language/dicts/external_dicts_dict_sources.md index 6b2c455b5bc..0128de7b9ef 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_sources.md @@ -421,3 +421,5 @@ MySQL можно подключить на локальном хосте чер - `password` - пароль пользователя MongoDB. - `db` - имя базы данных. - `collection` - имя коллекции. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict_sources/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict_structure.md b/docs/ru/query_language/dicts/external_dicts_dict_structure.md index 15952024c06..e26eb0282bc 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_structure.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_structure.md @@ -116,3 +116,5 @@ ClickHouse поддерживает следующие виды ключей: - `injective` - Признак инъективности отображения `id -> attribute`. Если `true`, то можно оптимизировать `GROUP BY`. По умолчанию, `false`. - `is_object_id` - Признак того, что запрос выполняется к документу MongoDB по `ObjectID`. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict_structure/) diff --git a/docs/ru/query_language/dicts/index.md b/docs/ru/query_language/dicts/index.md index 30d5d705b1e..2ea9f67ce26 100644 --- a/docs/ru/query_language/dicts/index.md +++ b/docs/ru/query_language/dicts/index.md @@ -10,3 +10,5 @@ ClickHouse поддерживает: - [Встроенные словари](internal_dicts.md#internal_dicts) со специфическим [набором функций](../functions/ym_dict_functions.md#ym_dict_functions). - [Подключаемые (внешние) словари](external_dicts.md#dicts-external_dicts) с [набором функций](../functions/ext_dict_functions.md#ext_dict_functions). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/) diff --git a/docs/ru/query_language/dicts/internal_dicts.md b/docs/ru/query_language/dicts/internal_dicts.md index 0a61652dd0d..da4e9846e55 100644 --- a/docs/ru/query_language/dicts/internal_dicts.md +++ b/docs/ru/query_language/dicts/internal_dicts.md @@ -46,3 +46,5 @@ ClickHouse содержит встроенную возможность рабо Рекомендуется периодически обновлять словари с геобазой. При обновлении, генерируйте новые файлы, записывая их в отдельное место, а только когда всё готово - переименовывайте в файлы, которые использует сервер. Также имеются функции для работы с идентификаторами операционных систем и поисковых систем Яндекс.Метрики, пользоваться которыми не нужно. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/internal_dicts/) diff --git a/docs/ru/query_language/functions/arithmetic_functions.md b/docs/ru/query_language/functions/arithmetic_functions.md index 70c6826d8b3..ce20fb5dcdc 100644 --- a/docs/ru/query_language/functions/arithmetic_functions.md +++ b/docs/ru/query_language/functions/arithmetic_functions.md @@ -71,3 +71,5 @@ SELECT toTypeName(0), toTypeName(0 + 0), toTypeName(0 + 0 + 0), toTypeName(0 + 0 ## lcm(a, b) Вычисляет наименьшее общее кратное чисел. При делении на ноль или при делении минимального отрицательного числа на минус единицу, кидается исключение. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/arithmetic_functions/) diff --git a/docs/ru/query_language/functions/array_functions.md b/docs/ru/query_language/functions/array_functions.md index 4fab96f32e7..b61c39258ec 100644 --- a/docs/ru/query_language/functions/array_functions.md +++ b/docs/ru/query_language/functions/array_functions.md @@ -378,3 +378,5 @@ SELECT arraySlice([1, 2, NULL, 4, 5], 2, 3) AS res ## arrayJoin(arr) Особенная функция. Смотрите раздел ["Функция arrayJoin"](array_join.md#functions_arrayjoin). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/array_functions/) diff --git a/docs/ru/query_language/functions/array_join.md b/docs/ru/query_language/functions/array_join.md index 40878eee027..a9de7a36754 100644 --- a/docs/ru/query_language/functions/array_join.md +++ b/docs/ru/query_language/functions/array_join.md @@ -28,3 +28,5 @@ SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src │ 3 │ Hello │ [1,2,3] │ └─────┴───────────┴─────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/array_join/) diff --git a/docs/ru/query_language/functions/bit_functions.md b/docs/ru/query_language/functions/bit_functions.md index b2fc83b6e0f..7ba32ad6ba8 100644 --- a/docs/ru/query_language/functions/bit_functions.md +++ b/docs/ru/query_language/functions/bit_functions.md @@ -15,3 +15,5 @@ ## bitShiftLeft(a, b) ## bitShiftRight(a, b) + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/bit_functions/) diff --git a/docs/ru/query_language/functions/comparison_functions.md b/docs/ru/query_language/functions/comparison_functions.md index 99879e2dc7d..392c6c2573c 100644 --- a/docs/ru/query_language/functions/comparison_functions.md +++ b/docs/ru/query_language/functions/comparison_functions.md @@ -29,3 +29,5 @@ ## lessOrEquals, оператор `<=` ## greaterOrEquals, оператор `>=` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/comparison_functions/) diff --git a/docs/ru/query_language/functions/conditional_functions.md b/docs/ru/query_language/functions/conditional_functions.md index 0393094fb4a..0140a008123 100644 --- a/docs/ru/query_language/functions/conditional_functions.md +++ b/docs/ru/query_language/functions/conditional_functions.md @@ -46,3 +46,5 @@ multiIf(cond_1, then_1, cond_2, then_2...else) │ ᴺᵁᴸᴸ │ └────────────────────────────────────────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/conditional_functions/) diff --git a/docs/ru/query_language/functions/date_time_functions.md b/docs/ru/query_language/functions/date_time_functions.md index 40f12cea07a..107ec2e61d3 100644 --- a/docs/ru/query_language/functions/date_time_functions.md +++ b/docs/ru/query_language/functions/date_time_functions.md @@ -153,3 +153,5 @@ SELECT |%y|год, последние 2 цифры (00-99)|18| |%Y|год, 4 цифры|2018| |%%|символ %|%| + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/date_time_functions/) diff --git a/docs/ru/query_language/functions/encoding_functions.md b/docs/ru/query_language/functions/encoding_functions.md index f0961822ec3..c3825cd22af 100644 --- a/docs/ru/query_language/functions/encoding_functions.md +++ b/docs/ru/query_language/functions/encoding_functions.md @@ -19,3 +19,5 @@ ## bitmaskToArray(num) Принимает целое число. Возвращает массив чисел типа UInt64, содержащий степени двойки, в сумме дающих исходное число; числа в массиве идут по возрастанию. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/encoding_functions/) diff --git a/docs/ru/query_language/functions/ext_dict_functions.md b/docs/ru/query_language/functions/ext_dict_functions.md index 67702c538a4..d80d309a02c 100644 --- a/docs/ru/query_language/functions/ext_dict_functions.md +++ b/docs/ru/query_language/functions/ext_dict_functions.md @@ -38,3 +38,5 @@ ## dictHas `dictHas('dict_name', id)` - проверить наличие ключа в словаре. Возвращает значение типа UInt8, равное 0, если ключа нет и 1, если ключ есть. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/ext_dict_functions/) diff --git a/docs/ru/query_language/functions/functions_for_nulls.md b/docs/ru/query_language/functions/functions_for_nulls.md index 5d5314efb6b..9173b466f5b 100644 --- a/docs/ru/query_language/functions/functions_for_nulls.md +++ b/docs/ru/query_language/functions/functions_for_nulls.md @@ -287,3 +287,5 @@ SELECT toTypeName(toNullable(10)) │ Nullable(UInt8) │ └────────────────────────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/functions_for_nulls/) diff --git a/docs/ru/query_language/functions/geo.md b/docs/ru/query_language/functions/geo.md index 0b0c6fa24c3..5356568e8ea 100644 --- a/docs/ru/query_language/functions/geo.md +++ b/docs/ru/query_language/functions/geo.md @@ -99,3 +99,5 @@ SELECT pointInPolygon((3., 3.), [(6, 0), (8, 4), (5, 8), (0, 2)]) AS res │ 1 │ └─────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/geo/) diff --git a/docs/ru/query_language/functions/hash_functions.md b/docs/ru/query_language/functions/hash_functions.md index 905b14182c4..62699d38d5b 100644 --- a/docs/ru/query_language/functions/hash_functions.md +++ b/docs/ru/query_language/functions/hash_functions.md @@ -55,3 +55,5 @@ SipHash - криптографическая хэш-функция. Работа `URLHash(s)` - вычислить хэш от строки без одного завершающего символа `/`, `?` или `#` на конце, если такой там есть. `URLHash(s, N)` - вычислить хэш от строки до N-го уровня в иерархии URL, без одного завершающего символа `/`, `?` или `#` на конце, если такой там есть. Уровни аналогичные URLHierarchy. Функция специфична для Яндекс.Метрики. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/hash_functions/) diff --git a/docs/ru/query_language/functions/higher_order_functions.md b/docs/ru/query_language/functions/higher_order_functions.md index 2dfe08066bc..d0fb2c7bbe4 100644 --- a/docs/ru/query_language/functions/higher_order_functions.md +++ b/docs/ru/query_language/functions/higher_order_functions.md @@ -103,3 +103,5 @@ SELECT arraySort((x, y) -> y, ['hello', 'world'], [2, 1]); ### arrayReverseSort(\[func,\] arr1, ...) Возвращает отсортированный в нисходящем порядке массив `arr1`. Если задана функция `func`, то порядок сортировки определяется результатом применения функции `func` на элементы массива (массивов). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/higher_order_functions/) diff --git a/docs/ru/query_language/functions/in_functions.md b/docs/ru/query_language/functions/in_functions.md index 71aa8187e4f..606867c85bb 100644 --- a/docs/ru/query_language/functions/in_functions.md +++ b/docs/ru/query_language/functions/in_functions.md @@ -12,3 +12,5 @@ Функция, позволяющая достать столбец из кортежа. N - индекс столбца начиная с 1. N должно быть константой. N должно быть целым строго положительным числом не большим размера кортежа. Выполнение функции ничего не стоит. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/in_functions/) diff --git a/docs/ru/query_language/functions/index.md b/docs/ru/query_language/functions/index.md index 870eccb24ab..c24e020097d 100644 --- a/docs/ru/query_language/functions/index.md +++ b/docs/ru/query_language/functions/index.md @@ -61,3 +61,5 @@ Другой пример - функция `hostName` вернёт имя сервера, на котором она выполняется, и это можно использовать для служебных целей - чтобы в запросе `SELECT` сделать `GROUP BY` по серверам. Если функция в запросе выполняется на сервере-инициаторе запроса, а вам нужно, чтобы она выполнялась на удалённых серверах, вы можете обернуть её в агрегатную функцию any или добавить в ключ в `GROUP BY`. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/) diff --git a/docs/ru/query_language/functions/ip_address_functions.md b/docs/ru/query_language/functions/ip_address_functions.md index 5d1945d5545..fb4d1fee613 100644 --- a/docs/ru/query_language/functions/ip_address_functions.md +++ b/docs/ru/query_language/functions/ip_address_functions.md @@ -107,3 +107,5 @@ LIMIT 10 ## IPv6StringToNum(s) Функция, обратная к IPv6NumToString. Если IPv6 адрес в неправильном формате, то возвращает строку из нулевых байт. HEX может быть в любом регистре. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/ip_address_functions/) diff --git a/docs/ru/query_language/functions/json_functions.md b/docs/ru/query_language/functions/json_functions.md index 302bed008ef..fb0c55eecc5 100644 --- a/docs/ru/query_language/functions/json_functions.md +++ b/docs/ru/query_language/functions/json_functions.md @@ -47,3 +47,5 @@ visitParamExtractString('{"abc":"hello}', 'abc') = '' ``` На данный момент, не поддерживаются записанные в формате `\uXXXX\uYYYY` кодовые точки не из basic multilingual plane (они переводятся не в UTF-8, а в CESU-8). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/json_functions/) diff --git a/docs/ru/query_language/functions/logical_functions.md b/docs/ru/query_language/functions/logical_functions.md index 458356b5cc9..6fa2504f933 100644 --- a/docs/ru/query_language/functions/logical_functions.md +++ b/docs/ru/query_language/functions/logical_functions.md @@ -11,3 +11,5 @@ ## not, оператор NOT ## xor + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/logical_functions/) diff --git a/docs/ru/query_language/functions/math_functions.md b/docs/ru/query_language/functions/math_functions.md index bd75e481960..92feceb3a95 100644 --- a/docs/ru/query_language/functions/math_functions.md +++ b/docs/ru/query_language/functions/math_functions.md @@ -78,3 +78,5 @@ SELECT erf(3 / sqrt(2)) ## pow(x, y) Принимает два числовых аргумента x и y. Возвращает число типа Float64, близкое к x в степени y. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/math_functions/) diff --git a/docs/ru/query_language/functions/other_functions.md b/docs/ru/query_language/functions/other_functions.md index fb41049f23c..df047344379 100644 --- a/docs/ru/query_language/functions/other_functions.md +++ b/docs/ru/query_language/functions/other_functions.md @@ -540,3 +540,5 @@ SELECT replicate(1, ['a', 'b', 'c']) │ [1,1,1] │ └───────────────────────────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/other_functions/) diff --git a/docs/ru/query_language/functions/random_functions.md b/docs/ru/query_language/functions/random_functions.md index 5e74ac10b56..b29f50dfd4e 100644 --- a/docs/ru/query_language/functions/random_functions.md +++ b/docs/ru/query_language/functions/random_functions.md @@ -13,3 +13,5 @@ ## rand64 Возвращает псевдослучайное число типа UInt64, равномерно распределённое среди всех чисел типа UInt64. Используется linear congruential generator. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/random_functions/) diff --git a/docs/ru/query_language/functions/rounding_functions.md b/docs/ru/query_language/functions/rounding_functions.md index 849c35013b9..4765c676d8c 100644 --- a/docs/ru/query_language/functions/rounding_functions.md +++ b/docs/ru/query_language/functions/rounding_functions.md @@ -61,3 +61,5 @@ LIMIT 10 ## roundAge(num) Принимает число. Если число меньше 18 - возвращает 0. Иначе округляет число вниз до чисел из набора: 18, 25, 35, 45, 55. Эта функция специфична для Яндекс.Метрики и предназначена для реализации отчёта по возрасту посетителей. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/rounding_functions/) diff --git a/docs/ru/query_language/functions/splitting_merging_functions.md b/docs/ru/query_language/functions/splitting_merging_functions.md index 1f4d38ac79d..8561048b864 100644 --- a/docs/ru/query_language/functions/splitting_merging_functions.md +++ b/docs/ru/query_language/functions/splitting_merging_functions.md @@ -25,4 +25,5 @@ SELECT alphaTokens('abca1abc') ┌─alphaTokens('abca1abc')─┐ │ ['abca','abc'] │ └─────────────────────────┘ -``` \ No newline at end of file +``` +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/splitting_merging_functions/) diff --git a/docs/ru/query_language/functions/string_functions.md b/docs/ru/query_language/functions/string_functions.md index 43842b59468..a917fb4d91d 100644 --- a/docs/ru/query_language/functions/string_functions.md +++ b/docs/ru/query_language/functions/string_functions.md @@ -58,3 +58,5 @@ ## convertCharset(s, from, to) Возвращает сконвертированную из кодировки from в кодировку to строку s. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_functions/) diff --git a/docs/ru/query_language/functions/string_replace_functions.md b/docs/ru/query_language/functions/string_replace_functions.md index 7669b598b9f..0c4cb9923f2 100644 --- a/docs/ru/query_language/functions/string_replace_functions.md +++ b/docs/ru/query_language/functions/string_replace_functions.md @@ -73,3 +73,5 @@ SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res │ here: Hello, World! │ └─────────────────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_replace_functions/) diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index 125c57a6138..031082c6659 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -44,3 +44,5 @@ ## notLike(haystack, pattern), оператор haystack NOT LIKE pattern То же, что like, но с отрицанием. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_search_functions/) diff --git a/docs/ru/query_language/functions/type_conversion_functions.md b/docs/ru/query_language/functions/type_conversion_functions.md index ea39c4f6160..eb4361520c7 100644 --- a/docs/ru/query_language/functions/type_conversion_functions.md +++ b/docs/ru/query_language/functions/type_conversion_functions.md @@ -135,3 +135,5 @@ SELECT toTypeName(CAST(x, 'Nullable(UInt16)')) FROM t_null │ Nullable(UInt16) │ └─────────────────────────────────────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/type_conversion_functions/) diff --git a/docs/ru/query_language/functions/url_functions.md b/docs/ru/query_language/functions/url_functions.md index f4697b9537f..01abbf579f0 100644 --- a/docs/ru/query_language/functions/url_functions.md +++ b/docs/ru/query_language/functions/url_functions.md @@ -97,3 +97,5 @@ SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS Decod ### cutURLParameter(URL, name) Удаляет параметр URL с именем name, если такой есть. Функция работает при допущении, что имя параметра закодировано в URL в точности таким же образом, что и в переданном аргументе. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/url_functions/) diff --git a/docs/ru/query_language/functions/ym_dict_functions.md b/docs/ru/query_language/functions/ym_dict_functions.md index 1761a21a7dd..a5374eefb82 100644 --- a/docs/ru/query_language/functions/ym_dict_functions.md +++ b/docs/ru/query_language/functions/ym_dict_functions.md @@ -116,3 +116,5 @@ LIMIT 15 Принимает число типа UInt32 - идентификатор региона из геобазы Яндекса. Вторым аргументом может быть передана строка - название языка. Поддерживаются языки ru, en, ua, uk, by, kz, tr. Если второй аргумент отсутствует - используется язык ru. Если язык не поддерживается - кидается исключение. Возвращает строку - название региона на соответствующем языке. Если региона с указанным идентификатором не существует - возвращается пустая строка. `ua` и `uk` обозначают одно и то же - украинский язык. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/ym_dict_functions/) diff --git a/docs/ru/query_language/index.md b/docs/ru/query_language/index.md index 01666d3e0e7..59313b15f8a 100644 --- a/docs/ru/query_language/index.md +++ b/docs/ru/query_language/index.md @@ -5,3 +5,5 @@ * [CREATE](create.md#create-database) * [ALTER](alter.md#query_language_queries_alter) * [Прочие виды запросов](misc.md#miscellaneous-queries) + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/) diff --git a/docs/ru/query_language/insert_into.md b/docs/ru/query_language/insert_into.md index 9d2e6280e3a..3dc489529ef 100644 --- a/docs/ru/query_language/insert_into.md +++ b/docs/ru/query_language/insert_into.md @@ -65,3 +65,5 @@ INSERT INTO [db.]table [(c1, c2, c3)] SELECT ... - Данные поступают в режиме реального времени. - Вы загружаете данные, которые как правило отсортированы по времени. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/insert_into/) diff --git a/docs/ru/query_language/misc.md b/docs/ru/query_language/misc.md index 86080a7360c..8c2470e77f4 100644 --- a/docs/ru/query_language/misc.md +++ b/docs/ru/query_language/misc.md @@ -210,3 +210,5 @@ Readonly-пользователи могут останавливать толь 3. остальные значения описывают причину невозможности остановки запроса. Тестовый вариант запроса (`TEST`) только проверяет права пользователя и выводит список запросов для остановки. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/misc/) diff --git a/docs/ru/query_language/operators.md b/docs/ru/query_language/operators.md index c5f90588faa..75693c3ff2d 100644 --- a/docs/ru/query_language/operators.md +++ b/docs/ru/query_language/operators.md @@ -173,3 +173,5 @@ WHERE isNotNull(y) 1 rows in set. Elapsed: 0.002 sec. ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/operators/) diff --git a/docs/ru/query_language/select.md b/docs/ru/query_language/select.md index 81537d1573b..09a8ad6fe56 100644 --- a/docs/ru/query_language/select.md +++ b/docs/ru/query_language/select.md @@ -999,3 +999,5 @@ SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID GLOBAL - в подзапросах (так как из подзапросов выкидываются столбцы, не нужные для внешнего запроса). В других случаях использование звёздочки является издевательством над системой, так как вместо преимуществ столбцовой СУБД вы получаете недостатки. То есть использовать звёздочку не рекомендуется. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/select/) diff --git a/docs/ru/query_language/syntax.md b/docs/ru/query_language/syntax.md index 95609b37109..ea44d1456ba 100644 --- a/docs/ru/query_language/syntax.md +++ b/docs/ru/query_language/syntax.md @@ -115,3 +115,5 @@ SELECT (1 AS n) + 2, n Выражение представляет собой функцию, идентификатор, литерал, применение оператора, выражение в скобках, подзапрос, звёздочку; и может содержать синоним. Список выражений - одно выражение или несколько выражений через запятую. Функции и операторы, в свою очередь, в качестве аргументов, могут иметь произвольные выражения. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/syntax/) diff --git a/docs/ru/query_language/table_functions/file.md b/docs/ru/query_language/table_functions/file.md index 9e029a6b729..e4c80be7186 100644 --- a/docs/ru/query_language/table_functions/file.md +++ b/docs/ru/query_language/table_functions/file.md @@ -45,3 +45,5 @@ LIMIT 2 │ 3 │ 2 │ 1 │ └─────────┴─────────┴─────────┘ ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/file/) diff --git a/docs/ru/query_language/table_functions/index.md b/docs/ru/query_language/table_functions/index.md index 6649ae3978f..704c9fa7123 100644 --- a/docs/ru/query_language/table_functions/index.md +++ b/docs/ru/query_language/table_functions/index.md @@ -3,3 +3,5 @@ Табличные функции могут указываться в секции FROM вместо имени БД и таблицы. Табличные функции можно использовать только если не выставлена настройка readonly. Табличные функции не имеют отношения к другим функциям. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/) diff --git a/docs/ru/query_language/table_functions/jdbc.md b/docs/ru/query_language/table_functions/jdbc.md index 60bcb27f27b..4fbd12abadd 100644 --- a/docs/ru/query_language/table_functions/jdbc.md +++ b/docs/ru/query_language/table_functions/jdbc.md @@ -21,3 +21,5 @@ SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', ```sql SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table') ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/jdbc/) diff --git a/docs/ru/query_language/table_functions/merge.md b/docs/ru/query_language/table_functions/merge.md index 092c9243fc5..04a3ba98223 100644 --- a/docs/ru/query_language/table_functions/merge.md +++ b/docs/ru/query_language/table_functions/merge.md @@ -3,3 +3,5 @@ `merge(db_name, 'tables_regexp')` - создаёт временную таблицу типа Merge. Подробнее смотрите раздел "Движки таблиц, Merge". Структура таблицы берётся из первой попавшейся таблицы, подходящей под регулярное выражение. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/merge/) diff --git a/docs/ru/query_language/table_functions/numbers.md b/docs/ru/query_language/table_functions/numbers.md index 8ff5ae3ac97..7406773c8c2 100644 --- a/docs/ru/query_language/table_functions/numbers.md +++ b/docs/ru/query_language/table_functions/numbers.md @@ -17,3 +17,5 @@ SELECT * FROM system.numbers LIMIT 10; -- генерация последовательности всех дат от 2010-01-01 до 2010-12-31 select toDate('2010-01-01') + number as d FROM numbers(365); ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/numbers/) diff --git a/docs/ru/query_language/table_functions/remote.md b/docs/ru/query_language/table_functions/remote.md index a2366607fe7..1eb4016759f 100644 --- a/docs/ru/query_language/table_functions/remote.md +++ b/docs/ru/query_language/table_functions/remote.md @@ -72,3 +72,5 @@ example01-{01..02}-{1|2} Если пользователь не задан,то используется `default`. Если пароль не задан, то используется пустой пароль. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/remote/) diff --git a/docs/ru/query_language/table_functions/url.md b/docs/ru/query_language/table_functions/url.md index 7c5068b3caa..461d38135d0 100644 --- a/docs/ru/query_language/table_functions/url.md +++ b/docs/ru/query_language/table_functions/url.md @@ -18,3 +18,5 @@ structure - структура таблицы в форме `'UserID UInt64, Nam -- получение 3-х строк таблицы, состоящей из двух колонк типа String и UInt32 от сервера, отдающего данные в формате CSV SELECT * FROM url('http://127.0.0.1:12345/', CSV, 'column1 String, column2 UInt32') LIMIT 3 ``` + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/table_functions/url/) diff --git a/docs/ru/roadmap.md b/docs/ru/roadmap.md index afd492c4b60..6ebd233a956 100644 --- a/docs/ru/roadmap.md +++ b/docs/ru/roadmap.md @@ -18,3 +18,5 @@ - Перенос зависящих только от одной стороны предикатов сквозь JOIN - Пулы ресурсов для более точного распределения мощностей кластера между его пользователями + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/roadmap/) diff --git a/docs/ru/security_changelog.md b/docs/ru/security_changelog.md index de3e3b2cbd9..7bf286a4e45 100644 --- a/docs/ru/security_changelog.md +++ b/docs/ru/security_changelog.md @@ -18,4 +18,5 @@ Некоррректная конфигурация в deb пакете могла привести к неавторизованному доступу к базе данных. -Обнаружено благодаря: the UK's National Cyber Security Centre (NCSC) \ No newline at end of file +Обнаружено благодаря: the UK's National Cyber Security Centre (NCSC) +[Оригинальная статья](https://clickhouse.yandex/docs/ru/security_changelog/) diff --git a/docs/tools/build.py b/docs/tools/build.py index 41cd9842346..96a2a74ea70 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -13,6 +13,9 @@ import sys import tempfile import time +import markdown.extensions +import markdown.util + from mkdocs import config from mkdocs import exceptions from mkdocs.commands import build as mkdocs_build @@ -36,6 +39,18 @@ def autoremoved_file(path): finally: os.unlink(path) +class ClickHouseMarkdown(markdown.extensions.Extension): + class ClickHousePreprocessor(markdown.util.Processor): + def run(self, lines): + for line in lines: + if '' not in line: + yield line + + def extendMarkdown(self, md): + md.preprocessors.register(self.ClickHousePreprocessor(), 'clickhouse_preprocessor', 31) + +markdown.extensions.ClickHouseMarkdown = ClickHouseMarkdown + def build_for_lang(lang, args): logging.info('Building %s docs' % lang) @@ -88,6 +103,7 @@ def build_for_lang(lang, args): edit_uri='edit/master/docs/%s' % lang, extra_css=['assets/stylesheets/custom.css'], markdown_extensions=[ + 'clickhouse', 'admonition', 'attr_list', 'codehilite', diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py new file mode 100755 index 00000000000..c38d6ddcf16 --- /dev/null +++ b/docs/tools/mdx_clickhouse.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +import markdown.extensions +import markdown.util + + +class ClickHousePreprocessor(markdown.util.Processor): + def run(self, lines): + for line in lines: + if '' not in line: + yield line + +class ClickHouseMarkdown(markdown.extensions.Extension): + + def extendMarkdown(self, md, md_globals): + md.preprocessors['clickhouse'] = ClickHousePreprocessor() + + +def makeExtension(**kwargs): + return ClickHouseMarkdown(**kwargs) diff --git a/docs/zh/faq/general.md b/docs/zh/faq/general.md index a45670232fa..adc0b5791b4 100644 --- a/docs/zh/faq/general.md +++ b/docs/zh/faq/general.md @@ -8,3 +8,5 @@ 大多数MapReduce系统允许您在集群上执行任意代码。但是,声明性查询语言更适合OLAP,以便快速运行实验。例如,Hadoop包含Hive和Pig,Cloudera Impala或Shark(过时)for Spark,以及Spark SQL、Presto和Apache Drill。与专业系统相比,运行此类任务时的性能非常不理想,所以将这些系统用作Web接口的后端服务是不现实的,因为延迟相对较高。 + +[来源文章](https://clickhouse.yandex/docs/zh/faq/general/) diff --git a/docs/zh/index.md b/docs/zh/index.md index 22cc4ab4d93..6c16c93eafb 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -137,3 +137,5 @@ LIMIT 20 这是不应该在一个通用数据库中实现的,因为这在运行简单查询时是没有意义的。但是也有例外,例如,MemSQL使用代码生成来减少处理SQL查询的延迟(只是为了比较,分析型数据库通常需要优化的是吞吐而不是延迟)。 请注意,为了提高CPU效率,查询语言必须是声明型的(SQL或MDX), 或者至少一个向量(J,K)。 查询应该只包含隐式循环,允许进行优化。 + +[来源文章](https://clickhouse.yandex/docs/zh/) diff --git a/docs/zh/interfaces/cli.md b/docs/zh/interfaces/cli.md index 134132bf87a..c9a287a1efd 100644 --- a/docs/zh/interfaces/cli.md +++ b/docs/zh/interfaces/cli.md @@ -111,3 +111,5 @@ cat file.csv | clickhouse-client --database=test --query="INSERT INTO test FORMA ``` + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/cli/) diff --git a/docs/zh/interfaces/formats.md b/docs/zh/interfaces/formats.md index c7945ee7755..8d72eddb973 100644 --- a/docs/zh/interfaces/formats.md +++ b/docs/zh/interfaces/formats.md @@ -621,3 +621,5 @@ test: string with \'quotes\' and \t with some special \n characters 在字符串值中,字符 `<` 和 `&` 被转义为 `<` 和 `&`。 数组输出为 ` Hello World ... `,元组输出为 ` Hello World ... ` 。 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/formats/) diff --git a/docs/zh/interfaces/http_interface.md b/docs/zh/interfaces/http_interface.md index 98c24c81e1c..8b150d059a9 100644 --- a/docs/zh/interfaces/http_interface.md +++ b/docs/zh/interfaces/http_interface.md @@ -213,3 +213,5 @@ curl -sS 'http://localhost:8123/?max_result_bytes=4000000&buffer_size=3000000&wa ``` 查询请求响应状态码和 HTTP 头被发送到客户端后,若发生查询处理出错,使用缓冲区可以避免这种情况的发生。在这种情况下,响应主体的结尾会写入一条错误消息,而在客户端,只能在解析阶段检测到该错误。 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/http_interface/) diff --git a/docs/zh/interfaces/index.md b/docs/zh/interfaces/index.md index f6766dfb2b0..b5603f81e6f 100644 --- a/docs/zh/interfaces/index.md +++ b/docs/zh/interfaces/index.md @@ -5,3 +5,5 @@ 为了探索 ClickHouse 的能力,如导入数据到表中,或做一些手动的查询,可以使用 clickhouse-client 命令行程序来完成 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/) diff --git a/docs/zh/interfaces/jdbc.md b/docs/zh/interfaces/jdbc.md index f4c8139ef63..41bf39ab2f7 100644 --- a/docs/zh/interfaces/jdbc.md +++ b/docs/zh/interfaces/jdbc.md @@ -4,3 +4,5 @@ - 三方提供的 JDBC 驱动 [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC). + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/jdbc/) diff --git a/docs/zh/interfaces/tcp.md b/docs/zh/interfaces/tcp.md index b987a42836c..742e252a25f 100644 --- a/docs/zh/interfaces/tcp.md +++ b/docs/zh/interfaces/tcp.md @@ -2,3 +2,5 @@ TCP 原生接口用于 `clickhouse-client` 命令行,它可以在分布式查询执行中和服务器进行交互,并且可以用在 C++ 程序中。我们讲解只覆盖命令行客户端。 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/tcp/) diff --git a/docs/zh/interfaces/third-party_client_libraries.md b/docs/zh/interfaces/third-party_client_libraries.md index 7e9203beb01..c3cabeaca80 100644 --- a/docs/zh/interfaces/third-party_client_libraries.md +++ b/docs/zh/interfaces/third-party_client_libraries.md @@ -45,3 +45,5 @@ - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party_client_libraries/) diff --git a/docs/zh/interfaces/third-party_gui.md b/docs/zh/interfaces/third-party_gui.md index 942569bf54c..e9f20405234 100644 --- a/docs/zh/interfaces/third-party_gui.md +++ b/docs/zh/interfaces/third-party_gui.md @@ -36,3 +36,5 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 集群管理 - 监控副本情况以及 Kafka 引擎表 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party_gui/) From 89f2886b518bba529e3add5d0c4fea699e855f3f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 12:38:39 +0300 Subject: [PATCH 014/297] Do not make fonts extra light --- .../tools/mkdocs-material-theme/assets/stylesheets/custom.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css index 3af2b99db71..0024345554b 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css @@ -64,11 +64,11 @@ } body { - font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; + font: 400 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; } body.md-lang-zh { - font: 300 14pt/200% 'Yandex Sans Text Web', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font: 400 14pt/200% 'Yandex Sans Text Web', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } a:link, a:visited { From 71e030323e4cebc40b211ea2523ee55dd68febea Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 12:40:37 +0300 Subject: [PATCH 015/297] find . -name '*.md' -type f | xargs -I{} perl -pi -e 's//g' {} --- .../nested_data_structures/nested.md | 4 ++-- .../example_datasets/nyc_taxi.md | 10 +++++----- docs/en/getting_started/index.md | 6 +++--- docs/en/interfaces/formats.md | 8 ++++---- docs/en/operations/system_tables.md | 16 +++++++-------- docs/en/operations/table_engines/buffer.md | 2 +- .../operations/table_engines/distributed.md | 2 +- docs/en/operations/table_engines/file.md | 2 +- .../table_engines/graphitemergetree.md | 2 +- docs/en/operations/table_engines/join.md | 2 +- .../operations/table_engines/replication.md | 2 +- .../table_engines/summingmergetree.md | 2 +- docs/en/operations/table_engines/url.md | 2 +- docs/en/operations/tips.md | 4 ++-- .../agg_functions/parametric_functions.md | 4 ++-- .../query_language/agg_functions/reference.md | 2 +- .../functions/arithmetic_functions.md | 2 +- .../functions/array_functions.md | 8 ++++---- .../en/query_language/functions/array_join.md | 2 +- .../functions/date_time_functions.md | 2 +- docs/en/query_language/functions/geo.md | 4 ++-- .../functions/higher_order_functions.md | 8 ++++---- .../functions/ip_address_functions.md | 8 ++++---- .../functions/json_functions.md | 4 ++-- .../functions/math_functions.md | 2 +- .../functions/other_functions.md | 10 +++++----- .../functions/string_replace_functions.md | 8 ++++---- .../functions/type_conversion_functions.md | 10 +++++----- .../query_language/functions/url_functions.md | 4 ++-- .../functions/ym_dict_functions.md | 6 +++--- docs/en/query_language/select.md | 20 +++++++++---------- .../query_language/table_functions/remote.md | 10 +++++----- docs/fa/data_types/enum.md | 2 +- .../nested_data_structures/nested.md | 4 ++-- .../example_datasets/nyc_taxi.md | 10 +++++----- docs/fa/getting_started/index.md | 6 +++--- docs/fa/interfaces/formats.md | 8 ++++---- .../nested_data_structures/nested.md | 4 ++-- .../example_datasets/nyc_taxi.md | 10 +++++----- docs/ru/getting_started/index.md | 6 +++--- docs/ru/interfaces/formats.md | 8 ++++---- docs/ru/operations/system_tables.md | 16 +++++++-------- docs/ru/operations/table_engines/buffer.md | 2 +- .../operations/table_engines/distributed.md | 2 +- docs/ru/operations/table_engines/file.md | 2 +- .../table_engines/graphitemergetree.md | 2 +- docs/ru/operations/table_engines/join.md | 2 +- .../operations/table_engines/replication.md | 2 +- .../table_engines/summingmergetree.md | 2 +- docs/ru/operations/table_engines/url.md | 2 +- docs/ru/operations/tips.md | 4 ++-- .../agg_functions/parametric_functions.md | 4 ++-- .../query_language/agg_functions/reference.md | 2 +- .../functions/arithmetic_functions.md | 2 +- .../functions/array_functions.md | 8 ++++---- .../ru/query_language/functions/array_join.md | 2 +- .../functions/date_time_functions.md | 2 +- docs/ru/query_language/functions/geo.md | 4 ++-- .../functions/higher_order_functions.md | 8 ++++---- .../functions/ip_address_functions.md | 8 ++++---- .../functions/json_functions.md | 4 ++-- .../functions/math_functions.md | 2 +- .../functions/other_functions.md | 10 +++++----- .../functions/string_replace_functions.md | 8 ++++---- .../functions/type_conversion_functions.md | 10 +++++----- .../query_language/functions/url_functions.md | 4 ++-- .../functions/ym_dict_functions.md | 6 +++--- docs/ru/query_language/select.md | 20 +++++++++---------- .../query_language/table_functions/remote.md | 10 +++++----- docs/zh/interfaces/formats.md | 8 ++++---- 70 files changed, 197 insertions(+), 197 deletions(-) diff --git a/docs/en/data_types/nested_data_structures/nested.md b/docs/en/data_types/nested_data_structures/nested.md index 3083d0f915c..80ce04daf8c 100644 --- a/docs/en/data_types/nested_data_structures/nested.md +++ b/docs/en/data_types/nested_data_structures/nested.md @@ -44,7 +44,7 @@ WHERE CounterID = 101500 AND length(Goals.ID) < 5 LIMIT 10 ``` -```text +``` ┌─Goals.ID───────────────────────┬─Goals.EventTime───────────────────────────────────────────────────────────────────────────┐ │ [1073752,591325,591325] │ ['2014-03-17 16:38:10','2014-03-17 16:38:48','2014-03-17 16:42:27'] │ │ [1073752] │ ['2014-03-17 00:28:25'] │ @@ -73,7 +73,7 @@ WHERE CounterID = 101500 AND length(Goals.ID) < 5 LIMIT 10 ``` -```text +``` ┌─Goal.ID─┬──────Goal.EventTime─┐ │ 1073752 │ 2014-03-17 16:38:10 │ │ 591325 │ 2014-03-17 16:38:48 │ diff --git a/docs/en/getting_started/example_datasets/nyc_taxi.md b/docs/en/getting_started/example_datasets/nyc_taxi.md index 8211944aa38..78cc66a533b 100644 --- a/docs/en/getting_started/example_datasets/nyc_taxi.md +++ b/docs/en/getting_started/example_datasets/nyc_taxi.md @@ -24,7 +24,7 @@ It takes about 20-30 minutes to process each month's worth of data in PostgreSQL You can check the number of downloaded rows as follows: -```text +``` time psql nyc-taxi-data -c "SELECT count(*) FROM trips;" ## Count 1298979494 @@ -173,7 +173,7 @@ dropoff_puma Nullable(String) It is needed for converting fields to more correct data types and, if possible, to eliminate NULLs. -```text +``` time clickhouse-client --query="INSERT INTO trips FORMAT TabSeparated" < trips.tsv real 75m56.214s @@ -191,7 +191,7 @@ To start, we'll create a table on a single server. Later we will make the table Create and populate a summary table: -```text +``` CREATE TABLE trips_mergetree ENGINE = MergeTree(pickup_date, pickup_datetime, 8192) AS SELECT @@ -258,7 +258,7 @@ To load it faster, you can create the table with the `Log` engine instead of `Me The table uses 126 GB of disk space. -```text +``` :) SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mergetree' AND active SELECT formatReadableSize(sum(bytes)) @@ -319,7 +319,7 @@ Creating a table on three servers: On each server: -```text +``` CREATE TABLE default.trips_mergetree_third ( trip_id UInt32, vendor_id Enum8('1' = 1, '2' = 2, 'CMT' = 3, 'VTS' = 4, 'DDS' = 5, 'B02512' = 10, 'B02598' = 11, 'B02617' = 12, 'B02682' = 13, 'B02764' = 14), pickup_date Date, pickup_datetime DateTime, dropoff_date Date, dropoff_datetime DateTime, store_and_fwd_flag UInt8, rate_code_id UInt8, pickup_longitude Float64, pickup_latitude Float64, dropoff_longitude Float64, dropoff_latitude Float64, passenger_count UInt8, trip_distance Float64, fare_amount Float32, extra Float32, mta_tax Float32, tip_amount Float32, tolls_amount Float32, ehail_fee Float32, improvement_surcharge Float32, total_amount Float32, payment_type_ Enum8('UNK' = 0, 'CSH' = 1, 'CRE' = 2, 'NOC' = 3, 'DIS' = 4), trip_type UInt8, pickup FixedString(25), dropoff FixedString(25), cab_type Enum8('yellow' = 1, 'green' = 2, 'uber' = 3), pickup_nyct2010_gid UInt8, pickup_ctlabel Float32, pickup_borocode UInt8, pickup_boroname Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5), pickup_ct2010 FixedString(6), pickup_boroct2010 FixedString(7), pickup_cdeligibil Enum8(' ' = 0, 'E' = 1, 'I' = 2), pickup_ntacode FixedString(4), pickup_ntaname Enum16('' = 0, 'Airport' = 1, 'Allerton-Pelham Gardens' = 2, 'Annadale-Huguenot-Prince\'s Bay-Eltingville' = 3, 'Arden Heights' = 4, 'Astoria' = 5, 'Auburndale' = 6, 'Baisley Park' = 7, 'Bath Beach' = 8, 'Battery Park City-Lower Manhattan' = 9, 'Bay Ridge' = 10, 'Bayside-Bayside Hills' = 11, 'Bedford' = 12, 'Bedford Park-Fordham North' = 13, 'Bellerose' = 14, 'Belmont' = 15, 'Bensonhurst East' = 16, 'Bensonhurst West' = 17, 'Borough Park' = 18, 'Breezy Point-Belle Harbor-Rockaway Park-Broad Channel' = 19, 'Briarwood-Jamaica Hills' = 20, 'Brighton Beach' = 21, 'Bronxdale' = 22, 'Brooklyn Heights-Cobble Hill' = 23, 'Brownsville' = 24, 'Bushwick North' = 25, 'Bushwick South' = 26, 'Cambria Heights' = 27, 'Canarsie' = 28, 'Carroll Gardens-Columbia Street-Red Hook' = 29, 'Central Harlem North-Polo Grounds' = 30, 'Central Harlem South' = 31, 'Charleston-Richmond Valley-Tottenville' = 32, 'Chinatown' = 33, 'Claremont-Bathgate' = 34, 'Clinton' = 35, 'Clinton Hill' = 36, 'Co-op City' = 37, 'College Point' = 38, 'Corona' = 39, 'Crotona Park East' = 40, 'Crown Heights North' = 41, 'Crown Heights South' = 42, 'Cypress Hills-City Line' = 43, 'DUMBO-Vinegar Hill-Downtown Brooklyn-Boerum Hill' = 44, 'Douglas Manor-Douglaston-Little Neck' = 45, 'Dyker Heights' = 46, 'East Concourse-Concourse Village' = 47, 'East Elmhurst' = 48, 'East Flatbush-Farragut' = 49, 'East Flushing' = 50, 'East Harlem North' = 51, 'East Harlem South' = 52, 'East New York' = 53, 'East New York (Pennsylvania Ave)' = 54, 'East Tremont' = 55, 'East Village' = 56, 'East Williamsburg' = 57, 'Eastchester-Edenwald-Baychester' = 58, 'Elmhurst' = 59, 'Elmhurst-Maspeth' = 60, 'Erasmus' = 61, 'Far Rockaway-Bayswater' = 62, 'Flatbush' = 63, 'Flatlands' = 64, 'Flushing' = 65, 'Fordham South' = 66, 'Forest Hills' = 67, 'Fort Greene' = 68, 'Fresh Meadows-Utopia' = 69, 'Ft. Totten-Bay Terrace-Clearview' = 70, 'Georgetown-Marine Park-Bergen Beach-Mill Basin' = 71, 'Glen Oaks-Floral Park-New Hyde Park' = 72, 'Glendale' = 73, 'Gramercy' = 74, 'Grasmere-Arrochar-Ft. Wadsworth' = 75, 'Gravesend' = 76, 'Great Kills' = 77, 'Greenpoint' = 78, 'Grymes Hill-Clifton-Fox Hills' = 79, 'Hamilton Heights' = 80, 'Hammels-Arverne-Edgemere' = 81, 'Highbridge' = 82, 'Hollis' = 83, 'Homecrest' = 84, 'Hudson Yards-Chelsea-Flatiron-Union Square' = 85, 'Hunters Point-Sunnyside-West Maspeth' = 86, 'Hunts Point' = 87, 'Jackson Heights' = 88, 'Jamaica' = 89, 'Jamaica Estates-Holliswood' = 90, 'Kensington-Ocean Parkway' = 91, 'Kew Gardens' = 92, 'Kew Gardens Hills' = 93, 'Kingsbridge Heights' = 94, 'Laurelton' = 95, 'Lenox Hill-Roosevelt Island' = 96, 'Lincoln Square' = 97, 'Lindenwood-Howard Beach' = 98, 'Longwood' = 99, 'Lower East Side' = 100, 'Madison' = 101, 'Manhattanville' = 102, 'Marble Hill-Inwood' = 103, 'Mariner\'s Harbor-Arlington-Port Ivory-Graniteville' = 104, 'Maspeth' = 105, 'Melrose South-Mott Haven North' = 106, 'Middle Village' = 107, 'Midtown-Midtown South' = 108, 'Midwood' = 109, 'Morningside Heights' = 110, 'Morrisania-Melrose' = 111, 'Mott Haven-Port Morris' = 112, 'Mount Hope' = 113, 'Murray Hill' = 114, 'Murray Hill-Kips Bay' = 115, 'New Brighton-Silver Lake' = 116, 'New Dorp-Midland Beach' = 117, 'New Springville-Bloomfield-Travis' = 118, 'North Corona' = 119, 'North Riverdale-Fieldston-Riverdale' = 120, 'North Side-South Side' = 121, 'Norwood' = 122, 'Oakland Gardens' = 123, 'Oakwood-Oakwood Beach' = 124, 'Ocean Hill' = 125, 'Ocean Parkway South' = 126, 'Old Astoria' = 127, 'Old Town-Dongan Hills-South Beach' = 128, 'Ozone Park' = 129, 'Park Slope-Gowanus' = 130, 'Parkchester' = 131, 'Pelham Bay-Country Club-City Island' = 132, 'Pelham Parkway' = 133, 'Pomonok-Flushing Heights-Hillcrest' = 134, 'Port Richmond' = 135, 'Prospect Heights' = 136, 'Prospect Lefferts Gardens-Wingate' = 137, 'Queens Village' = 138, 'Queensboro Hill' = 139, 'Queensbridge-Ravenswood-Long Island City' = 140, 'Rego Park' = 141, 'Richmond Hill' = 142, 'Ridgewood' = 143, 'Rikers Island' = 144, 'Rosedale' = 145, 'Rossville-Woodrow' = 146, 'Rugby-Remsen Village' = 147, 'Schuylerville-Throgs Neck-Edgewater Park' = 148, 'Seagate-Coney Island' = 149, 'Sheepshead Bay-Gerritsen Beach-Manhattan Beach' = 150, 'SoHo-TriBeCa-Civic Center-Little Italy' = 151, 'Soundview-Bruckner' = 152, 'Soundview-Castle Hill-Clason Point-Harding Park' = 153, 'South Jamaica' = 154, 'South Ozone Park' = 155, 'Springfield Gardens North' = 156, 'Springfield Gardens South-Brookville' = 157, 'Spuyten Duyvil-Kingsbridge' = 158, 'St. Albans' = 159, 'Stapleton-Rosebank' = 160, 'Starrett City' = 161, 'Steinway' = 162, 'Stuyvesant Heights' = 163, 'Stuyvesant Town-Cooper Village' = 164, 'Sunset Park East' = 165, 'Sunset Park West' = 166, 'Todt Hill-Emerson Hill-Heartland Village-Lighthouse Hill' = 167, 'Turtle Bay-East Midtown' = 168, 'University Heights-Morris Heights' = 169, 'Upper East Side-Carnegie Hill' = 170, 'Upper West Side' = 171, 'Van Cortlandt Village' = 172, 'Van Nest-Morris Park-Westchester Square' = 173, 'Washington Heights North' = 174, 'Washington Heights South' = 175, 'West Brighton' = 176, 'West Concourse' = 177, 'West Farms-Bronx River' = 178, 'West New Brighton-New Brighton-St. George' = 179, 'West Village' = 180, 'Westchester-Unionport' = 181, 'Westerleigh' = 182, 'Whitestone' = 183, 'Williamsbridge-Olinville' = 184, 'Williamsburg' = 185, 'Windsor Terrace' = 186, 'Woodhaven' = 187, 'Woodlawn-Wakefield' = 188, 'Woodside' = 189, 'Yorkville' = 190, 'park-cemetery-etc-Bronx' = 191, 'park-cemetery-etc-Brooklyn' = 192, 'park-cemetery-etc-Manhattan' = 193, 'park-cemetery-etc-Queens' = 194, 'park-cemetery-etc-Staten Island' = 195), pickup_puma UInt16, dropoff_nyct2010_gid UInt8, dropoff_ctlabel Float32, dropoff_borocode UInt8, dropoff_boroname Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5), dropoff_ct2010 FixedString(6), dropoff_boroct2010 FixedString(7), dropoff_cdeligibil Enum8(' ' = 0, 'E' = 1, 'I' = 2), dropoff_ntacode FixedString(4), dropoff_ntaname Enum16('' = 0, 'Airport' = 1, 'Allerton-Pelham Gardens' = 2, 'Annadale-Huguenot-Prince\'s Bay-Eltingville' = 3, 'Arden Heights' = 4, 'Astoria' = 5, 'Auburndale' = 6, 'Baisley Park' = 7, 'Bath Beach' = 8, 'Battery Park City-Lower Manhattan' = 9, 'Bay Ridge' = 10, 'Bayside-Bayside Hills' = 11, 'Bedford' = 12, 'Bedford Park-Fordham North' = 13, 'Bellerose' = 14, 'Belmont' = 15, 'Bensonhurst East' = 16, 'Bensonhurst West' = 17, 'Borough Park' = 18, 'Breezy Point-Belle Harbor-Rockaway Park-Broad Channel' = 19, 'Briarwood-Jamaica Hills' = 20, 'Brighton Beach' = 21, 'Bronxdale' = 22, 'Brooklyn Heights-Cobble Hill' = 23, 'Brownsville' = 24, 'Bushwick North' = 25, 'Bushwick South' = 26, 'Cambria Heights' = 27, 'Canarsie' = 28, 'Carroll Gardens-Columbia Street-Red Hook' = 29, 'Central Harlem North-Polo Grounds' = 30, 'Central Harlem South' = 31, 'Charleston-Richmond Valley-Tottenville' = 32, 'Chinatown' = 33, 'Claremont-Bathgate' = 34, 'Clinton' = 35, 'Clinton Hill' = 36, 'Co-op City' = 37, 'College Point' = 38, 'Corona' = 39, 'Crotona Park East' = 40, 'Crown Heights North' = 41, 'Crown Heights South' = 42, 'Cypress Hills-City Line' = 43, 'DUMBO-Vinegar Hill-Downtown Brooklyn-Boerum Hill' = 44, 'Douglas Manor-Douglaston-Little Neck' = 45, 'Dyker Heights' = 46, 'East Concourse-Concourse Village' = 47, 'East Elmhurst' = 48, 'East Flatbush-Farragut' = 49, 'East Flushing' = 50, 'East Harlem North' = 51, 'East Harlem South' = 52, 'East New York' = 53, 'East New York (Pennsylvania Ave)' = 54, 'East Tremont' = 55, 'East Village' = 56, 'East Williamsburg' = 57, 'Eastchester-Edenwald-Baychester' = 58, 'Elmhurst' = 59, 'Elmhurst-Maspeth' = 60, 'Erasmus' = 61, 'Far Rockaway-Bayswater' = 62, 'Flatbush' = 63, 'Flatlands' = 64, 'Flushing' = 65, 'Fordham South' = 66, 'Forest Hills' = 67, 'Fort Greene' = 68, 'Fresh Meadows-Utopia' = 69, 'Ft. Totten-Bay Terrace-Clearview' = 70, 'Georgetown-Marine Park-Bergen Beach-Mill Basin' = 71, 'Glen Oaks-Floral Park-New Hyde Park' = 72, 'Glendale' = 73, 'Gramercy' = 74, 'Grasmere-Arrochar-Ft. Wadsworth' = 75, 'Gravesend' = 76, 'Great Kills' = 77, 'Greenpoint' = 78, 'Grymes Hill-Clifton-Fox Hills' = 79, 'Hamilton Heights' = 80, 'Hammels-Arverne-Edgemere' = 81, 'Highbridge' = 82, 'Hollis' = 83, 'Homecrest' = 84, 'Hudson Yards-Chelsea-Flatiron-Union Square' = 85, 'Hunters Point-Sunnyside-West Maspeth' = 86, 'Hunts Point' = 87, 'Jackson Heights' = 88, 'Jamaica' = 89, 'Jamaica Estates-Holliswood' = 90, 'Kensington-Ocean Parkway' = 91, 'Kew Gardens' = 92, 'Kew Gardens Hills' = 93, 'Kingsbridge Heights' = 94, 'Laurelton' = 95, 'Lenox Hill-Roosevelt Island' = 96, 'Lincoln Square' = 97, 'Lindenwood-Howard Beach' = 98, 'Longwood' = 99, 'Lower East Side' = 100, 'Madison' = 101, 'Manhattanville' = 102, 'Marble Hill-Inwood' = 103, 'Mariner\'s Harbor-Arlington-Port Ivory-Graniteville' = 104, 'Maspeth' = 105, 'Melrose South-Mott Haven North' = 106, 'Middle Village' = 107, 'Midtown-Midtown South' = 108, 'Midwood' = 109, 'Morningside Heights' = 110, 'Morrisania-Melrose' = 111, 'Mott Haven-Port Morris' = 112, 'Mount Hope' = 113, 'Murray Hill' = 114, 'Murray Hill-Kips Bay' = 115, 'New Brighton-Silver Lake' = 116, 'New Dorp-Midland Beach' = 117, 'New Springville-Bloomfield-Travis' = 118, 'North Corona' = 119, 'North Riverdale-Fieldston-Riverdale' = 120, 'North Side-South Side' = 121, 'Norwood' = 122, 'Oakland Gardens' = 123, 'Oakwood-Oakwood Beach' = 124, 'Ocean Hill' = 125, 'Ocean Parkway South' = 126, 'Old Astoria' = 127, 'Old Town-Dongan Hills-South Beach' = 128, 'Ozone Park' = 129, 'Park Slope-Gowanus' = 130, 'Parkchester' = 131, 'Pelham Bay-Country Club-City Island' = 132, 'Pelham Parkway' = 133, 'Pomonok-Flushing Heights-Hillcrest' = 134, 'Port Richmond' = 135, 'Prospect Heights' = 136, 'Prospect Lefferts Gardens-Wingate' = 137, 'Queens Village' = 138, 'Queensboro Hill' = 139, 'Queensbridge-Ravenswood-Long Island City' = 140, 'Rego Park' = 141, 'Richmond Hill' = 142, 'Ridgewood' = 143, 'Rikers Island' = 144, 'Rosedale' = 145, 'Rossville-Woodrow' = 146, 'Rugby-Remsen Village' = 147, 'Schuylerville-Throgs Neck-Edgewater Park' = 148, 'Seagate-Coney Island' = 149, 'Sheepshead Bay-Gerritsen Beach-Manhattan Beach' = 150, 'SoHo-TriBeCa-Civic Center-Little Italy' = 151, 'Soundview-Bruckner' = 152, 'Soundview-Castle Hill-Clason Point-Harding Park' = 153, 'South Jamaica' = 154, 'South Ozone Park' = 155, 'Springfield Gardens North' = 156, 'Springfield Gardens South-Brookville' = 157, 'Spuyten Duyvil-Kingsbridge' = 158, 'St. Albans' = 159, 'Stapleton-Rosebank' = 160, 'Starrett City' = 161, 'Steinway' = 162, 'Stuyvesant Heights' = 163, 'Stuyvesant Town-Cooper Village' = 164, 'Sunset Park East' = 165, 'Sunset Park West' = 166, 'Todt Hill-Emerson Hill-Heartland Village-Lighthouse Hill' = 167, 'Turtle Bay-East Midtown' = 168, 'University Heights-Morris Heights' = 169, 'Upper East Side-Carnegie Hill' = 170, 'Upper West Side' = 171, 'Van Cortlandt Village' = 172, 'Van Nest-Morris Park-Westchester Square' = 173, 'Washington Heights North' = 174, 'Washington Heights South' = 175, 'West Brighton' = 176, 'West Concourse' = 177, 'West Farms-Bronx River' = 178, 'West New Brighton-New Brighton-St. George' = 179, 'West Village' = 180, 'Westchester-Unionport' = 181, 'Westerleigh' = 182, 'Whitestone' = 183, 'Williamsbridge-Olinville' = 184, 'Williamsburg' = 185, 'Windsor Terrace' = 186, 'Woodhaven' = 187, 'Woodlawn-Wakefield' = 188, 'Woodside' = 189, 'Yorkville' = 190, 'park-cemetery-etc-Bronx' = 191, 'park-cemetery-etc-Brooklyn' = 192, 'park-cemetery-etc-Manhattan' = 193, 'park-cemetery-etc-Queens' = 194, 'park-cemetery-etc-Staten Island' = 195), dropoff_puma UInt16) ENGINE = MergeTree(pickup_date, pickup_datetime, 8192) ``` diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index d66d7eba3b5..53a8fa495fc 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -24,7 +24,7 @@ For testing and development, the system can be installed on a single server or o In `/etc/apt/sources.list` (or in a separate `/etc/apt/sources.list.d/clickhouse.list` file), add the repository: -```text +``` deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ ``` @@ -51,14 +51,14 @@ To compile, follow the instructions: build.md You can compile packages and install them. You can also use programs without installing packages. -```text +``` Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server ``` For the server, create a catalog with data, such as: -```text +``` /opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/ ``` diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index 1a5d02db975..f087f6f8b6b 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -48,7 +48,7 @@ The `TabSeparated` format supports outputting total values (when using WITH TOTA SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -```text +``` 2014-03-17 1406958 2014-03-18 1383658 2014-03-19 1405797 @@ -80,7 +80,7 @@ As an exception, parsing dates with times is also supported in Unix timestamp fo Strings are output with backslash-escaped special characters. The following escape sequences are used for output: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\'`, `\\`. Parsing also supports the sequences `\a`, `\v`, and `\xHH` (hex escape sequences) and any `\c` sequences, where `c` is any character (these sequences are converted to `c`). Thus, reading data supports formats where a line feed can be written as `\n` or `\`, or as a line feed. For example, the string `Hello world` with a line feed between the words instead of a space can be parsed in any of the following variations: -```text +``` Hello\nworld Hello\ @@ -128,7 +128,7 @@ This format is also available under the name `TSVWithNamesAndTypes`. Similar to TabSeparated, but outputs a value in name=value format. Names are escaped the same way as in TabSeparated format, and the = symbol is also escaped. -```text +``` SearchPhrase= count()=8267016 SearchPhrase=bathroom interior design count()=2166 SearchPhrase=yandex count()=1655 @@ -382,7 +382,7 @@ The Pretty format supports outputting total values (when using WITH TOTALS) and SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` -```text +``` ┌──EventDate─┬───────c─┐ │ 2014-03-17 │ 1406958 │ │ 2014-03-18 │ 1383658 │ diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 77d96990d6d..5a84e50b86b 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -18,7 +18,7 @@ Example: The number of SELECT queries currently running; the amount of memory in Contains information about clusters available in the config file and the servers in them. Columns: -```text +``` cluster String — The cluster name. shard_num UInt32 — The shard number in the cluster, starting from 1. shard_weight UInt32 — The relative weight of the shard when writing data. @@ -34,7 +34,7 @@ user String — The name of the user for connecting to the server. Contains information about the columns in all tables. You can use this table to get information similar to `DESCRIBE TABLE`, but for multiple tables at once. -```text +``` database String — The name of the database the table is in. table String – Table name. name String — Column name. @@ -183,7 +183,7 @@ Formats: This system table is used for implementing the `SHOW PROCESSLIST` query. Columns: -```text +``` user String – Name of the user who made the request. For distributed query processing, this is the user who helped the requestor server send the query to this server, not the user who made the distributed request on the requestor server. address String - The IP address the request was made from. The same for distributed processing. @@ -217,7 +217,7 @@ WHERE table = 'visits' FORMAT Vertical ``` -```text +``` Row 1: ────── database: merge @@ -243,7 +243,7 @@ active_replicas: 2 Columns: -```text +``` database: Database name table: Table name engine: Table engine name @@ -335,7 +335,7 @@ I.e. used for executing the query you are using to read from the system.settings Columns: -```text +``` name String — Setting name. value String — Setting value. changed UInt8 — Whether the setting was explicitly defined in the config or explicitly changed. @@ -349,7 +349,7 @@ FROM system.settings WHERE changed ``` -```text +``` ┌─name───────────────────┬─value───────┬─changed─┐ │ max_threads │ 8 │ 1 │ │ use_uncompressed_cache │ 0 │ 1 │ @@ -400,7 +400,7 @@ WHERE path = '/clickhouse/tables/01-08/visits/replicas' FORMAT Vertical ``` -```text +``` Row 1: ────── name: example01-08-1.yandex.ru diff --git a/docs/en/operations/table_engines/buffer.md b/docs/en/operations/table_engines/buffer.md index 8ce007843a2..461b10f81c3 100644 --- a/docs/en/operations/table_engines/buffer.md +++ b/docs/en/operations/table_engines/buffer.md @@ -2,7 +2,7 @@ Buffers the data to write in RAM, periodically flushing it to another table. During the read operation, data is read from the buffer and the other table simultaneously. -```text +``` Buffer(database, table, num_layers, min_time, max_time, min_rows, max_rows, min_bytes, max_bytes) ``` diff --git a/docs/en/operations/table_engines/distributed.md b/docs/en/operations/table_engines/distributed.md index a33fa6dd942..6bd60c1591d 100644 --- a/docs/en/operations/table_engines/distributed.md +++ b/docs/en/operations/table_engines/distributed.md @@ -7,7 +7,7 @@ Reading is automatically parallelized. During a read, the table indexes on remot The Distributed engine accepts parameters: the cluster name in the server's config file, the name of a remote database, the name of a remote table, and (optionally) a sharding key. Example: -```text +``` Distributed(logs, default, hits[, sharding_key]) ``` diff --git a/docs/en/operations/table_engines/file.md b/docs/en/operations/table_engines/file.md index 9a49583dc0e..4fc5e1fa865 100644 --- a/docs/en/operations/table_engines/file.md +++ b/docs/en/operations/table_engines/file.md @@ -51,7 +51,7 @@ two 2 SELECT * FROM file_engine_table ``` -```text +``` ┌─name─┬─value─┐ │ one │ 1 │ │ two │ 2 │ diff --git a/docs/en/operations/table_engines/graphitemergetree.md b/docs/en/operations/table_engines/graphitemergetree.md index e102a58f200..bc557594d76 100644 --- a/docs/en/operations/table_engines/graphitemergetree.md +++ b/docs/en/operations/table_engines/graphitemergetree.md @@ -27,7 +27,7 @@ The Graphite data table must contain the following fields at minimum: Rollup pattern: -```text +``` pattern regexp function diff --git a/docs/en/operations/table_engines/join.md b/docs/en/operations/table_engines/join.md index 4a33eefe27c..299071312b8 100644 --- a/docs/en/operations/table_engines/join.md +++ b/docs/en/operations/table_engines/join.md @@ -2,7 +2,7 @@ A prepared data structure for JOIN that is always located in RAM. -```text +``` Join(ANY|ALL, LEFT|INNER, k1[, k2, ...]) ``` diff --git a/docs/en/operations/table_engines/replication.md b/docs/en/operations/table_engines/replication.md index 09978a48ab4..9574cbaac82 100644 --- a/docs/en/operations/table_engines/replication.md +++ b/docs/en/operations/table_engines/replication.md @@ -78,7 +78,7 @@ Two parameters are also added in the beginning of the parameters list – the pa Example: -```text +``` ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/hits', '{replica}', EventDate, intHash32(UserID), (CounterID, EventDate, intHash32(UserID), EventTime), 8192) ``` diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index 6ce3d5f09df..7fb73d24ee1 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -32,7 +32,7 @@ Then this nested table is interpreted as a mapping of key `=>` (values...), and Examples: -```text +``` [(1, 100)] + [(2, 150)] -> [(1, 100), (2, 150)] [(1, 100)] + [(1, 150)] -> [(1, 250)] [(1, 100)] + [(1, 150), (2, 150)] -> [(1, 250), (2, 150)] diff --git a/docs/en/operations/table_engines/url.md b/docs/en/operations/table_engines/url.md index 02f45c00377..7beae9a666c 100644 --- a/docs/en/operations/table_engines/url.md +++ b/docs/en/operations/table_engines/url.md @@ -57,7 +57,7 @@ python3 server.py SELECT * FROM url_engine_table ``` -```text +``` ┌─word──┬─value─┐ │ Hello │ 1 │ │ World │ 2 │ diff --git a/docs/en/operations/tips.md b/docs/en/operations/tips.md index cf32216e9d5..a34f79f869f 100644 --- a/docs/en/operations/tips.md +++ b/docs/en/operations/tips.md @@ -178,7 +178,7 @@ dynamicConfigFile=/etc/zookeeper-{{ cluster['name'] }}/conf/zoo.cfg.dynamic Java version: -```text +``` Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) ``` @@ -226,7 +226,7 @@ JAVA_OPTS="-Xms{{ cluster.get('xms','128M') }} \ Salt init: -```text +``` description "zookeeper-{{ cluster['name'] }} centralized coordination service" start on runlevel [2345] diff --git a/docs/en/query_language/agg_functions/parametric_functions.md b/docs/en/query_language/agg_functions/parametric_functions.md index 50918704e48..134b4a4b985 100644 --- a/docs/en/query_language/agg_functions/parametric_functions.md +++ b/docs/en/query_language/agg_functions/parametric_functions.md @@ -23,7 +23,7 @@ Example: `sequenceMatch ('(?1).*(?2)')(EventTime, URL LIKE '%company%', URL LIKE This is a singular example. You could write it using other aggregate functions: -```text +``` minIf(EventTime, URL LIKE '%company%') < maxIf(EventTime, URL LIKE '%cart%'). ``` @@ -151,7 +151,7 @@ It works as fast as possible, except for cases when a large N value is used and Usage example: -```text +``` Problem: Generate a report that shows only keywords that produced at least 5 unique users. Solution: Write in the GROUP BY query SearchPhrase HAVING uniqUpTo(4)(UserID) >= 5 ``` diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md index 125d10f0420..5836d20f6c6 100644 --- a/docs/en/query_language/agg_functions/reference.md +++ b/docs/en/query_language/agg_functions/reference.md @@ -122,7 +122,7 @@ FROM sum_map GROUP BY timeslot ``` -```text +``` ┌────────────timeslot─┬─sumMap(statusMap.status, statusMap.requests)─┐ │ 2000-01-01 00:00:00 │ ([1,2,3,4,5],[10,10,20,10,10]) │ │ 2000-01-01 00:01:00 │ ([4,5,6,7,8],[10,10,20,10,10]) │ diff --git a/docs/en/query_language/functions/arithmetic_functions.md b/docs/en/query_language/functions/arithmetic_functions.md index 6e63d90d2e1..2efdcf3ba6b 100644 --- a/docs/en/query_language/functions/arithmetic_functions.md +++ b/docs/en/query_language/functions/arithmetic_functions.md @@ -8,7 +8,7 @@ Example: SELECT toTypeName(0), toTypeName(0 + 0), toTypeName(0 + 0 + 0), toTypeName(0 + 0 + 0 + 0) ``` -```text +``` ┌─toTypeName(0)─┬─toTypeName(plus(0, 0))─┬─toTypeName(plus(plus(0, 0), 0))─┬─toTypeName(plus(plus(plus(0, 0), 0), 0))─┐ │ UInt8 │ UInt16 │ UInt32 │ UInt64 │ └───────────────┴────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────┘ diff --git a/docs/en/query_language/functions/array_functions.md b/docs/en/query_language/functions/array_functions.md index efef18cb153..d45c1c34d96 100644 --- a/docs/en/query_language/functions/array_functions.md +++ b/docs/en/query_language/functions/array_functions.md @@ -144,7 +144,7 @@ WHERE CounterID = 160656 LIMIT 10 ``` -```text +``` ┌─Reaches─┬──Hits─┐ │ 95606 │ 31406 │ └─────────┴───────┘ @@ -160,7 +160,7 @@ FROM test.hits WHERE (CounterID = 160656) AND notEmpty(GoalsReached) ``` -```text +``` ┌─Reaches─┬──Hits─┐ │ 95606 │ 31406 │ └─────────┴───────┘ @@ -191,7 +191,7 @@ ORDER BY Reaches DESC LIMIT 10 ``` -```text +``` ┌──GoalID─┬─Reaches─┬─Visits─┐ │ 53225 │ 3214 │ 1097 │ │ 2825062 │ 3188 │ 1097 │ @@ -214,7 +214,7 @@ The arrayEnumerateUniq function can take multiple arrays of the same size as arg SELECT arrayEnumerateUniq([1, 1, 1, 2, 2, 2], [1, 1, 2, 1, 1, 2]) AS res ``` -```text +``` ┌─res───────────┐ │ [1,2,1,1,2,1] │ └───────────────┘ diff --git a/docs/en/query_language/functions/array_join.md b/docs/en/query_language/functions/array_join.md index 16cef78a665..1e9361f28cf 100644 --- a/docs/en/query_language/functions/array_join.md +++ b/docs/en/query_language/functions/array_join.md @@ -21,7 +21,7 @@ Example: SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src ``` -```text +``` ┌─dst─┬─\'Hello\'─┬─src─────┐ │ 1 │ Hello │ [1,2,3] │ │ 2 │ Hello │ [1,2,3] │ diff --git a/docs/en/query_language/functions/date_time_functions.md b/docs/en/query_language/functions/date_time_functions.md index 5596151eaac..399afd602e5 100644 --- a/docs/en/query_language/functions/date_time_functions.md +++ b/docs/en/query_language/functions/date_time_functions.md @@ -12,7 +12,7 @@ SELECT toString(time, 'US/Samoa') AS time_samoa ``` -```text +``` ┌────────────────time─┬─date_local─┬─date_yekat─┬─time_samoa──────────┐ │ 2016-06-15 23:00:00 │ 2016-06-15 │ 2016-06-16 │ 2016-06-15 09:00:00 │ └─────────────────────┴────────────┴────────────┴─────────────────────┘ diff --git a/docs/en/query_language/functions/geo.md b/docs/en/query_language/functions/geo.md index f34361b43ca..e66a9030c31 100644 --- a/docs/en/query_language/functions/geo.md +++ b/docs/en/query_language/functions/geo.md @@ -29,7 +29,7 @@ Generates an exception when the input parameter values fall outside of the range SELECT greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673) ``` -```text +``` ┌─greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673)─┐ │ 14132374.194975413 │ └───────────────────────────────────────────────────────────────────┘ @@ -62,7 +62,7 @@ The input parameters must be `2+4⋅n`, where `n` is the number of ellipses. SELECT pointInEllipses(55.755831, 37.617673, 55.755831, 37.617673, 1.0, 2.0) ``` -```text +``` ┌─pointInEllipses(55.755831, 37.617673, 55.755831, 37.617673, 1., 2.)─┐ │ 1 │ └─────────────────────────────────────────────────────────────────────┘ diff --git a/docs/en/query_language/functions/higher_order_functions.md b/docs/en/query_language/functions/higher_order_functions.md index ef26a62bea1..fa135adeb20 100644 --- a/docs/en/query_language/functions/higher_order_functions.md +++ b/docs/en/query_language/functions/higher_order_functions.md @@ -26,7 +26,7 @@ Examples: SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res ``` -```text +``` ┌─res───────────┐ │ ['abc World'] │ └───────────────┘ @@ -41,7 +41,7 @@ SELECT AS res ``` -```text +``` ┌─res─┐ │ [2] │ └─────┘ @@ -81,7 +81,7 @@ Example: SELECT arrayCumSum([1, 1, 1, 1]) AS res ``` -```text +``` ┌─res──────────┐ │ [1, 2, 3, 4] │ └──────────────┘ @@ -99,7 +99,7 @@ Example: SELECT arraySort((x, y) -> y, ['hello', 'world'], [2, 1]); ``` -```text +``` ┌─res────────────────┐ │ ['world', 'hello'] │ └────────────────────┘ diff --git a/docs/en/query_language/functions/ip_address_functions.md b/docs/en/query_language/functions/ip_address_functions.md index f4d559aeb13..31dbb7b4a6c 100644 --- a/docs/en/query_language/functions/ip_address_functions.md +++ b/docs/en/query_language/functions/ip_address_functions.md @@ -24,7 +24,7 @@ ORDER BY c DESC LIMIT 10 ``` -```text +``` ┌─k──────────────┬─────c─┐ │ 83.149.9.xxx │ 26238 │ │ 217.118.81.xxx │ 26074 │ @@ -50,7 +50,7 @@ IPv6-mapped IPv4 addresses are output in the format ::ffff:111.222.33.44. Exampl SELECT IPv6NumToString(toFixedString(unhex('2A0206B8000000000000000000000011'), 16)) AS addr ``` -```text +``` ┌─addr─────────┐ │ 2a02:6b8::11 │ └──────────────┘ @@ -67,7 +67,7 @@ ORDER BY c DESC LIMIT 10 ``` -```text +``` ┌─IPv6NumToString(ClientIP6)──────────────┬─────c─┐ │ 2a02:2168:aaa:bbbb::2 │ 24695 │ │ 2a02:2698:abcd:abcd:abcd:abcd:8888:5555 │ 22408 │ @@ -93,7 +93,7 @@ ORDER BY c DESC LIMIT 10 ``` -```text +``` ┌─IPv6NumToString(ClientIP6)─┬──────c─┐ │ ::ffff:94.26.111.111 │ 747440 │ │ ::ffff:37.143.222.4 │ 529483 │ diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md index ffe4e5d9fc5..f28b329690d 100644 --- a/docs/en/query_language/functions/json_functions.md +++ b/docs/en/query_language/functions/json_functions.md @@ -35,7 +35,7 @@ Returns the value of a field, including separators. Examples: -```text +``` visitParamExtractRaw('{"abc":"\\n\\u0000"}', 'abc') = '"\\n\\u0000"' visitParamExtractRaw('{"abc":{"def":[1,2,3]}}', 'abc') = '{"def":[1,2,3]}' ``` @@ -46,7 +46,7 @@ Parses the string in double quotes. The value is unescaped. If unescaping failed Examples: -```text +``` visitParamExtractString('{"abc":"\\n\\u0000"}', 'abc') = '\n\0' visitParamExtractString('{"abc":"\\u263a"}', 'abc') = '☺' visitParamExtractString('{"abc":"\\u263"}', 'abc') = '' diff --git a/docs/en/query_language/functions/math_functions.md b/docs/en/query_language/functions/math_functions.md index deb96686a27..47ef47e8c00 100644 --- a/docs/en/query_language/functions/math_functions.md +++ b/docs/en/query_language/functions/math_functions.md @@ -52,7 +52,7 @@ Example (three sigma rule): SELECT erf(3 / sqrt(2)) ``` -```text +``` ┌─erf(divide(3, sqrt(2)))─┐ │ 0.9973002039367398 │ └─────────────────────────┘ diff --git a/docs/en/query_language/functions/other_functions.md b/docs/en/query_language/functions/other_functions.md index c58495db616..f20f781b40a 100644 --- a/docs/en/query_language/functions/other_functions.md +++ b/docs/en/query_language/functions/other_functions.md @@ -93,7 +93,7 @@ GROUP BY h ORDER BY h ASC ``` -```text +``` ┌──h─┬──────c─┬─bar────────────────┐ │ 0 │ 292907 │ █████████▋ │ │ 1 │ 180563 │ ██████ │ @@ -163,7 +163,7 @@ GROUP BY title ORDER BY c DESC ``` -```text +``` ┌─title─────┬──────c─┐ │ Yandex │ 498635 │ │ Google │ 229872 │ @@ -192,7 +192,7 @@ ORDER BY count() DESC LIMIT 10 ``` -```text +``` ┌─s──────────────┬───────c─┐ │ │ 2906259 │ │ www.yandex │ 867767 │ @@ -218,7 +218,7 @@ SELECT formatReadableSize(filesize_bytes) AS filesize ``` -```text +``` ┌─filesize_bytes─┬─filesize───┐ │ 1 │ 1.00 B │ │ 1024 │ 1.00 KiB │ @@ -274,7 +274,7 @@ FROM ) ``` -```text +``` ┌─EventID─┬───────────EventTime─┬─delta─┐ │ 1106 │ 2016-11-24 00:00:04 │ 0 │ │ 1107 │ 2016-11-24 00:00:05 │ 1 │ diff --git a/docs/en/query_language/functions/string_replace_functions.md b/docs/en/query_language/functions/string_replace_functions.md index 59e7d6e8e04..c76a6976cda 100644 --- a/docs/en/query_language/functions/string_replace_functions.md +++ b/docs/en/query_language/functions/string_replace_functions.md @@ -28,7 +28,7 @@ LIMIT 7 FORMAT TabSeparated ``` -```text +``` 2014-03-17 03/17/2014 2014-03-18 03/18/2014 2014-03-19 03/19/2014 @@ -44,7 +44,7 @@ Example 2. Copying a string ten times: SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') AS res ``` -```text +``` ┌─res────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World! │ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ @@ -58,7 +58,7 @@ This does the same thing, but replaces all the occurrences. Example: SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res ``` -```text +``` ┌─res────────────────────────┐ │ HHeelllloo,, WWoorrlldd!! │ └────────────────────────────┘ @@ -71,7 +71,7 @@ Example: SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res ``` -```text +``` ┌─res─────────────────┐ │ here: Hello, World! │ └─────────────────────┘ diff --git a/docs/en/query_language/functions/type_conversion_functions.md b/docs/en/query_language/functions/type_conversion_functions.md index 43819dcb489..91fe456e776 100644 --- a/docs/en/query_language/functions/type_conversion_functions.md +++ b/docs/en/query_language/functions/type_conversion_functions.md @@ -24,7 +24,7 @@ When converting dates with times to numbers or vice versa, the date with time co The date and date-with-time formats for the toDate/toDateTime functions are defined as follows: -```text +``` YYYY-MM-DD YYYY-MM-DD hh:mm:ss ``` @@ -43,7 +43,7 @@ SELECT toString(now(), 'Asia/Yekaterinburg') AS now_yekat ``` -```text +``` ┌───────────now_local─┬─now_yekat───────────┐ │ 2016-06-15 00:11:21 │ 2016-06-15 02:11:21 │ └─────────────────────┴─────────────────────┘ @@ -66,7 +66,7 @@ Example: SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut ``` -```text +``` ┌─s─────────────┬─s_cut─┐ │ foo\0\0\0\0\0 │ foo │ └───────────────┴───────┘ @@ -76,7 +76,7 @@ SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut SELECT toFixedString('foo\0bar', 8) AS s, toStringCutToZero(s) AS s_cut ``` -```text +``` ┌─s──────────┬─s_cut─┐ │ foo\0bar\0 │ foo │ └────────────┴───────┘ @@ -111,7 +111,7 @@ SELECT CAST(timestamp, 'FixedString(22)') AS fixed_string ``` -```text +``` ┌─timestamp───────────┬────────────datetime─┬───────date─┬─string──────────────┬─fixed_string──────────────┐ │ 2016-06-15 23:00:00 │ 2016-06-15 23:00:00 │ 2016-06-15 │ 2016-06-15 23:00:00 │ 2016-06-15 23:00:00\0\0\0 │ └─────────────────────┴─────────────────────┴────────────┴─────────────────────┴───────────────────────────┘ diff --git a/docs/en/query_language/functions/url_functions.md b/docs/en/query_language/functions/url_functions.md index afaaf0495f1..9269d4d5b69 100644 --- a/docs/en/query_language/functions/url_functions.md +++ b/docs/en/query_language/functions/url_functions.md @@ -72,7 +72,7 @@ Returns an array containing the URL, truncated at the end by the symbols /,? in The same as above, but without the protocol and host in the result. The / element (root) is not included. Example: the function is used to implement tree reports the URL in Yandex. Metric. -```text +``` URLPathHierarchy('https://example.com/browse/CONV-6788') = [ '/browse/', @@ -89,7 +89,7 @@ Example: SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS DecodedURL; ``` -```text +``` ┌─DecodedURL─────────────────────────────┐ │ http://127.0.0.1:8123/?query=SELECT 1; │ └────────────────────────────────────────┘ diff --git a/docs/en/query_language/functions/ym_dict_functions.md b/docs/en/query_language/functions/ym_dict_functions.md index 385a0ceff32..065ef7403dc 100644 --- a/docs/en/query_language/functions/ym_dict_functions.md +++ b/docs/en/query_language/functions/ym_dict_functions.md @@ -20,7 +20,7 @@ All the dictionaries are re-loaded in runtime (once every certain number of seco All functions for working with regions have an optional argument at the end – the dictionary key. It is referred to as the geobase. Example: -```text +``` regionToCountry(RegionID) – Uses the default dictionary: /opt/geo/regions_hierarchy.txt regionToCountry(RegionID, '') – Uses the default dictionary: /opt/geo/regions_hierarchy.txt regionToCountry(RegionID, 'ua') – Uses the dictionary for the 'ua' key: /opt/geo/regions_hierarchy_ua.txt @@ -40,7 +40,7 @@ FROM system.numbers LIMIT 15 ``` -```text +``` ┌─regionToName(regionToArea(toUInt32(number), \'ua\'))─┐ │ │ │ Moscow and Moscow region │ @@ -70,7 +70,7 @@ FROM system.numbers LIMIT 15 ``` -```text +``` ┌─regionToName(regionToDistrict(toUInt32(number), \'ua\'))─┐ │ │ │ Central federal district │ diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index ae1b4c3f265..00cf96a1a64 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -86,7 +86,7 @@ Allows executing JOIN with an array or nested data structure. The intent is simi `ARRAY JOIN` is essentially `INNER JOIN` with an array. Example: -```text +``` :) CREATE TABLE arrays_test (s String, arr Array(UInt8)) ENGINE = Memory CREATE TABLE arrays_test @@ -139,7 +139,7 @@ ARRAY JOIN arr An alias can be specified for an array in the ARRAY JOIN clause. In this case, an array item can be accessed by this alias, but the array itself by the original name. Example: -```text +``` :) SELECT s, arr, a FROM arrays_test ARRAY JOIN arr AS a SELECT s, arr, a @@ -159,7 +159,7 @@ ARRAY JOIN arr AS a Multiple arrays of the same size can be comma-separated in the ARRAY JOIN clause. In this case, JOIN is performed with them simultaneously (the direct sum, not the direct product). Example: -```text +``` :) SELECT s, arr, a, num, mapped FROM arrays_test ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num, arrayMap(x -> x + 1, arr) AS mapped SELECT s, arr, a, num, mapped @@ -195,7 +195,7 @@ ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num ARRAY JOIN also works with nested data structures. Example: -```text +``` :) CREATE TABLE nested_test (s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory CREATE TABLE nested_test @@ -250,7 +250,7 @@ ARRAY JOIN nest When specifying names of nested data structures in ARRAY JOIN, the meaning is the same as ARRAY JOIN with all the array elements that it consists of. Example: -```text +``` :) SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest.x, nest.y SELECT s, `nest.x`, `nest.y` @@ -270,7 +270,7 @@ ARRAY JOIN `nest.x`, `nest.y` This variation also makes sense: -```text +``` :) SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest.x SELECT s, `nest.x`, `nest.y` @@ -290,7 +290,7 @@ ARRAY JOIN `nest.x` An alias may be used for a nested data structure, in order to select either the JOIN result or the source array. Example: -```text +``` :) SELECT s, n.x, n.y, nest.x, nest.y FROM nested_test ARRAY JOIN nest AS n SELECT s, `n.x`, `n.y`, `nest.x`, `nest.y` @@ -310,7 +310,7 @@ ARRAY JOIN nest AS n Example of using the arrayEnumerate function: -```text +``` :) SELECT s, n.x, n.y, nest.x, nest.y, num FROM nested_test ARRAY JOIN nest AS n, arrayEnumerate(nest.x) AS num SELECT s, `n.x`, `n.y`, `nest.x`, `nest.y`, num @@ -395,7 +395,7 @@ ORDER BY hits DESC LIMIT 10 ``` -```text +``` ┌─CounterID─┬───hits─┬─visits─┐ │ 1143050 │ 523264 │ 13665 │ │ 731962 │ 475698 │ 102716 │ @@ -787,7 +787,7 @@ GROUP BY EventDate ORDER BY EventDate ASC ``` -```text +``` ┌──EventDate─┬────ratio─┐ │ 2014-03-17 │ 1 │ │ 2014-03-18 │ 0.807696 │ diff --git a/docs/en/query_language/table_functions/remote.md b/docs/en/query_language/table_functions/remote.md index a45a1c1bbae..7c1431b6f60 100644 --- a/docs/en/query_language/table_functions/remote.md +++ b/docs/en/query_language/table_functions/remote.md @@ -18,7 +18,7 @@ remote('addresses_expr', db.table[, 'user'[, 'password']]) Examples: -```text +``` example01-01-1 example01-01-1:9000 localhost @@ -31,19 +31,19 @@ Multiple addresses can be comma-separated. In this case, ClickHouse will use dis Example: -```text +``` example01-01-1,example01-02-1 ``` Part of the expression can be specified in curly brackets. The previous example can be written as follows: -```text +``` example01-0{1,2}-1 ``` Curly brackets can contain a range of numbers separated by two dots (non-negative integers). In this case, the range is expanded to a set of values that generate shard addresses. If the first number starts with zero, the values are formed with the same zero alignment. The previous example can be written as follows: -```text +``` example01-{01..02}-1 ``` @@ -53,7 +53,7 @@ Addresses and parts of addresses in curly brackets can be separated by the pipe Example: -```text +``` example01-{01..02}-{1|2} ``` diff --git a/docs/fa/data_types/enum.md b/docs/fa/data_types/enum.md index 60dd120f19e..d84f2a1aa68 100644 --- a/docs/fa/data_types/enum.md +++ b/docs/fa/data_types/enum.md @@ -8,7 +8,7 @@ Enum8 یا Enum16، به شما اجازه ی ذخیره سازی مجموعه -```text +``` Enum8('hello' = 1, 'world' = 2) ``` diff --git a/docs/fa/data_types/nested_data_structures/nested.md b/docs/fa/data_types/nested_data_structures/nested.md index 1a52a90f239..8c26aef62da 100644 --- a/docs/fa/data_types/nested_data_structures/nested.md +++ b/docs/fa/data_types/nested_data_structures/nested.md @@ -52,7 +52,7 @@ WHERE CounterID = 101500 AND length(Goals.ID) < 5 LIMIT 10 ``` -```text +``` ┌─Goals.ID───────────────────────┬─Goals.EventTime───────────────────────────────────────────────────────────────────────────┐ │ [1073752,591325,591325] │ ['2014-03-17 16:38:10','2014-03-17 16:38:48','2014-03-17 16:42:27'] │ │ [1073752] │ ['2014-03-17 00:28:25'] │ @@ -85,7 +85,7 @@ WHERE CounterID = 101500 AND length(Goals.ID) < 5 LIMIT 10 ``` -```text +``` ┌─Goal.ID─┬──────Goal.EventTime─┐ │ 1073752 │ 2014-03-17 16:38:10 │ │ 591325 │ 2014-03-17 16:38:48 │ diff --git a/docs/fa/getting_started/example_datasets/nyc_taxi.md b/docs/fa/getting_started/example_datasets/nyc_taxi.md index cb5db536f32..9ec87bda02f 100644 --- a/docs/fa/getting_started/example_datasets/nyc_taxi.md +++ b/docs/fa/getting_started/example_datasets/nyc_taxi.md @@ -33,7 +33,7 @@ PostgreSQL تقریبا 20 تا 30 دقیقه برای پردازش هر ماه -```text +``` time psql nyc-taxi-data -c "SELECT count(*) FROM trips;" ## count 1298979494 @@ -193,7 +193,7 @@ dropoff_puma Nullable(String) -```text +``` time clickhouse-client --query="INSERT INTO trips FORMAT TabSeparated" < trips.tsv real 75m56.214s @@ -213,7 +213,7 @@ real 75m56.214s -```text +``` CREATE TABLE trips_mergetree ENGINE = MergeTree(pickup_date, pickup_datetime, 8192) AS SELECT @@ -283,7 +283,7 @@ FROM trips -```text +``` :) SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mergetree' AND active SELECT formatReadableSize(sum(bytes)) @@ -354,7 +354,7 @@ Two Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz, 16 physical kernels total, -```text +``` CREATE TABLE default.trips_mergetree_third ( trip_id UInt32, vendor_id Enum8('1' = 1, '2' = 2, 'CMT' = 3, 'VTS' = 4, 'DDS' = 5, 'B02512' = 10, 'B02598' = 11, 'B02617' = 12, 'B02682' = 13, 'B02764' = 14), pickup_date Date, pickup_datetime DateTime, dropoff_date Date, dropoff_datetime DateTime, store_and_fwd_flag UInt8, rate_code_id UInt8, pickup_longitude Float64, pickup_latitude Float64, dropoff_longitude Float64, dropoff_latitude Float64, passenger_count UInt8, trip_distance Float64, fare_amount Float32, extra Float32, mta_tax Float32, tip_amount Float32, tolls_amount Float32, ehail_fee Float32, improvement_surcharge Float32, total_amount Float32, payment_type_ Enum8('UNK' = 0, 'CSH' = 1, 'CRE' = 2, 'NOC' = 3, 'DIS' = 4), trip_type UInt8, pickup FixedString(25), dropoff FixedString(25), cab_type Enum8('yellow' = 1, 'green' = 2, 'uber' = 3), pickup_nyct2010_gid UInt8, pickup_ctlabel Float32, pickup_borocode UInt8, pickup_boroname Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5), pickup_ct2010 FixedString(6), pickup_boroct2010 FixedString(7), pickup_cdeligibil Enum8(' ' = 0, 'E' = 1, 'I' = 2), pickup_ntacode FixedString(4), pickup_ntaname Enum16('' = 0, 'Airport' = 1, 'Allerton-Pelham Gardens' = 2, 'Annadale-Huguenot-Prince\'s Bay-Eltingville' = 3, 'Arden Heights' = 4, 'Astoria' = 5, 'Auburndale' = 6, 'Baisley Park' = 7, 'Bath Beach' = 8, 'Battery Park City-Lower Manhattan' = 9, 'Bay Ridge' = 10, 'Bayside-Bayside Hills' = 11, 'Bedford' = 12, 'Bedford Park-Fordham North' = 13, 'Bellerose' = 14, 'Belmont' = 15, 'Bensonhurst East' = 16, 'Bensonhurst West' = 17, 'Borough Park' = 18, 'Breezy Point-Belle Harbor-Rockaway Park-Broad Channel' = 19, 'Briarwood-Jamaica Hills' = 20, 'Brighton Beach' = 21, 'Bronxdale' = 22, 'Brooklyn Heights-Cobble Hill' = 23, 'Brownsville' = 24, 'Bushwick North' = 25, 'Bushwick South' = 26, 'Cambria Heights' = 27, 'Canarsie' = 28, 'Carroll Gardens-Columbia Street-Red Hook' = 29, 'Central Harlem North-Polo Grounds' = 30, 'Central Harlem South' = 31, 'Charleston-Richmond Valley-Tottenville' = 32, 'Chinatown' = 33, 'Claremont-Bathgate' = 34, 'Clinton' = 35, 'Clinton Hill' = 36, 'Co-op City' = 37, 'College Point' = 38, 'Corona' = 39, 'Crotona Park East' = 40, 'Crown Heights North' = 41, 'Crown Heights South' = 42, 'Cypress Hills-City Line' = 43, 'DUMBO-Vinegar Hill-Downtown Brooklyn-Boerum Hill' = 44, 'Douglas Manor-Douglaston-Little Neck' = 45, 'Dyker Heights' = 46, 'East Concourse-Concourse Village' = 47, 'East Elmhurst' = 48, 'East Flatbush-Farragut' = 49, 'East Flushing' = 50, 'East Harlem North' = 51, 'East Harlem South' = 52, 'East New York' = 53, 'East New York (Pennsylvania Ave)' = 54, 'East Tremont' = 55, 'East Village' = 56, 'East Williamsburg' = 57, 'Eastchester-Edenwald-Baychester' = 58, 'Elmhurst' = 59, 'Elmhurst-Maspeth' = 60, 'Erasmus' = 61, 'Far Rockaway-Bayswater' = 62, 'Flatbush' = 63, 'Flatlands' = 64, 'Flushing' = 65, 'Fordham South' = 66, 'Forest Hills' = 67, 'Fort Greene' = 68, 'Fresh Meadows-Utopia' = 69, 'Ft. Totten-Bay Terrace-Clearview' = 70, 'Georgetown-Marine Park-Bergen Beach-Mill Basin' = 71, 'Glen Oaks-Floral Park-New Hyde Park' = 72, 'Glendale' = 73, 'Gramercy' = 74, 'Grasmere-Arrochar-Ft. Wadsworth' = 75, 'Gravesend' = 76, 'Great Kills' = 77, 'Greenpoint' = 78, 'Grymes Hill-Clifton-Fox Hills' = 79, 'Hamilton Heights' = 80, 'Hammels-Arverne-Edgemere' = 81, 'Highbridge' = 82, 'Hollis' = 83, 'Homecrest' = 84, 'Hudson Yards-Chelsea-Flatiron-Union Square' = 85, 'Hunters Point-Sunnyside-West Maspeth' = 86, 'Hunts Point' = 87, 'Jackson Heights' = 88, 'Jamaica' = 89, 'Jamaica Estates-Holliswood' = 90, 'Kensington-Ocean Parkway' = 91, 'Kew Gardens' = 92, 'Kew Gardens Hills' = 93, 'Kingsbridge Heights' = 94, 'Laurelton' = 95, 'Lenox Hill-Roosevelt Island' = 96, 'Lincoln Square' = 97, 'Lindenwood-Howard Beach' = 98, 'Longwood' = 99, 'Lower East Side' = 100, 'Madison' = 101, 'Manhattanville' = 102, 'Marble Hill-Inwood' = 103, 'Mariner\'s Harbor-Arlington-Port Ivory-Graniteville' = 104, 'Maspeth' = 105, 'Melrose South-Mott Haven North' = 106, 'Middle Village' = 107, 'Midtown-Midtown South' = 108, 'Midwood' = 109, 'Morningside Heights' = 110, 'Morrisania-Melrose' = 111, 'Mott Haven-Port Morris' = 112, 'Mount Hope' = 113, 'Murray Hill' = 114, 'Murray Hill-Kips Bay' = 115, 'New Brighton-Silver Lake' = 116, 'New Dorp-Midland Beach' = 117, 'New Springville-Bloomfield-Travis' = 118, 'North Corona' = 119, 'North Riverdale-Fieldston-Riverdale' = 120, 'North Side-South Side' = 121, 'Norwood' = 122, 'Oakland Gardens' = 123, 'Oakwood-Oakwood Beach' = 124, 'Ocean Hill' = 125, 'Ocean Parkway South' = 126, 'Old Astoria' = 127, 'Old Town-Dongan Hills-South Beach' = 128, 'Ozone Park' = 129, 'Park Slope-Gowanus' = 130, 'Parkchester' = 131, 'Pelham Bay-Country Club-City Island' = 132, 'Pelham Parkway' = 133, 'Pomonok-Flushing Heights-Hillcrest' = 134, 'Port Richmond' = 135, 'Prospect Heights' = 136, 'Prospect Lefferts Gardens-Wingate' = 137, 'Queens Village' = 138, 'Queensboro Hill' = 139, 'Queensbridge-Ravenswood-Long Island City' = 140, 'Rego Park' = 141, 'Richmond Hill' = 142, 'Ridgewood' = 143, 'Rikers Island' = 144, 'Rosedale' = 145, 'Rossville-Woodrow' = 146, 'Rugby-Remsen Village' = 147, 'Schuylerville-Throgs Neck-Edgewater Park' = 148, 'Seagate-Coney Island' = 149, 'Sheepshead Bay-Gerritsen Beach-Manhattan Beach' = 150, 'SoHo-TriBeCa-Civic Center-Little Italy' = 151, 'Soundview-Bruckner' = 152, 'Soundview-Castle Hill-Clason Point-Harding Park' = 153, 'South Jamaica' = 154, 'South Ozone Park' = 155, 'Springfield Gardens North' = 156, 'Springfield Gardens South-Brookville' = 157, 'Spuyten Duyvil-Kingsbridge' = 158, 'St. Albans' = 159, 'Stapleton-Rosebank' = 160, 'Starrett City' = 161, 'Steinway' = 162, 'Stuyvesant Heights' = 163, 'Stuyvesant Town-Cooper Village' = 164, 'Sunset Park East' = 165, 'Sunset Park West' = 166, 'Todt Hill-Emerson Hill-Heartland Village-Lighthouse Hill' = 167, 'Turtle Bay-East Midtown' = 168, 'University Heights-Morris Heights' = 169, 'Upper East Side-Carnegie Hill' = 170, 'Upper West Side' = 171, 'Van Cortlandt Village' = 172, 'Van Nest-Morris Park-Westchester Square' = 173, 'Washington Heights North' = 174, 'Washington Heights South' = 175, 'West Brighton' = 176, 'West Concourse' = 177, 'West Farms-Bronx River' = 178, 'West New Brighton-New Brighton-St. George' = 179, 'West Village' = 180, 'Westchester-Unionport' = 181, 'Westerleigh' = 182, 'Whitestone' = 183, 'Williamsbridge-Olinville' = 184, 'Williamsburg' = 185, 'Windsor Terrace' = 186, 'Woodhaven' = 187, 'Woodlawn-Wakefield' = 188, 'Woodside' = 189, 'Yorkville' = 190, 'park-cemetery-etc-Bronx' = 191, 'park-cemetery-etc-Brooklyn' = 192, 'park-cemetery-etc-Manhattan' = 193, 'park-cemetery-etc-Queens' = 194, 'park-cemetery-etc-Staten Island' = 195), pickup_puma UInt16, dropoff_nyct2010_gid UInt8, dropoff_ctlabel Float32, dropoff_borocode UInt8, dropoff_boroname Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5), dropoff_ct2010 FixedString(6), dropoff_boroct2010 FixedString(7), dropoff_cdeligibil Enum8(' ' = 0, 'E' = 1, 'I' = 2), dropoff_ntacode FixedString(4), dropoff_ntaname Enum16('' = 0, 'Airport' = 1, 'Allerton-Pelham Gardens' = 2, 'Annadale-Huguenot-Prince\'s Bay-Eltingville' = 3, 'Arden Heights' = 4, 'Astoria' = 5, 'Auburndale' = 6, 'Baisley Park' = 7, 'Bath Beach' = 8, 'Battery Park City-Lower Manhattan' = 9, 'Bay Ridge' = 10, 'Bayside-Bayside Hills' = 11, 'Bedford' = 12, 'Bedford Park-Fordham North' = 13, 'Bellerose' = 14, 'Belmont' = 15, 'Bensonhurst East' = 16, 'Bensonhurst West' = 17, 'Borough Park' = 18, 'Breezy Point-Belle Harbor-Rockaway Park-Broad Channel' = 19, 'Briarwood-Jamaica Hills' = 20, 'Brighton Beach' = 21, 'Bronxdale' = 22, 'Brooklyn Heights-Cobble Hill' = 23, 'Brownsville' = 24, 'Bushwick North' = 25, 'Bushwick South' = 26, 'Cambria Heights' = 27, 'Canarsie' = 28, 'Carroll Gardens-Columbia Street-Red Hook' = 29, 'Central Harlem North-Polo Grounds' = 30, 'Central Harlem South' = 31, 'Charleston-Richmond Valley-Tottenville' = 32, 'Chinatown' = 33, 'Claremont-Bathgate' = 34, 'Clinton' = 35, 'Clinton Hill' = 36, 'Co-op City' = 37, 'College Point' = 38, 'Corona' = 39, 'Crotona Park East' = 40, 'Crown Heights North' = 41, 'Crown Heights South' = 42, 'Cypress Hills-City Line' = 43, 'DUMBO-Vinegar Hill-Downtown Brooklyn-Boerum Hill' = 44, 'Douglas Manor-Douglaston-Little Neck' = 45, 'Dyker Heights' = 46, 'East Concourse-Concourse Village' = 47, 'East Elmhurst' = 48, 'East Flatbush-Farragut' = 49, 'East Flushing' = 50, 'East Harlem North' = 51, 'East Harlem South' = 52, 'East New York' = 53, 'East New York (Pennsylvania Ave)' = 54, 'East Tremont' = 55, 'East Village' = 56, 'East Williamsburg' = 57, 'Eastchester-Edenwald-Baychester' = 58, 'Elmhurst' = 59, 'Elmhurst-Maspeth' = 60, 'Erasmus' = 61, 'Far Rockaway-Bayswater' = 62, 'Flatbush' = 63, 'Flatlands' = 64, 'Flushing' = 65, 'Fordham South' = 66, 'Forest Hills' = 67, 'Fort Greene' = 68, 'Fresh Meadows-Utopia' = 69, 'Ft. Totten-Bay Terrace-Clearview' = 70, 'Georgetown-Marine Park-Bergen Beach-Mill Basin' = 71, 'Glen Oaks-Floral Park-New Hyde Park' = 72, 'Glendale' = 73, 'Gramercy' = 74, 'Grasmere-Arrochar-Ft. Wadsworth' = 75, 'Gravesend' = 76, 'Great Kills' = 77, 'Greenpoint' = 78, 'Grymes Hill-Clifton-Fox Hills' = 79, 'Hamilton Heights' = 80, 'Hammels-Arverne-Edgemere' = 81, 'Highbridge' = 82, 'Hollis' = 83, 'Homecrest' = 84, 'Hudson Yards-Chelsea-Flatiron-Union Square' = 85, 'Hunters Point-Sunnyside-West Maspeth' = 86, 'Hunts Point' = 87, 'Jackson Heights' = 88, 'Jamaica' = 89, 'Jamaica Estates-Holliswood' = 90, 'Kensington-Ocean Parkway' = 91, 'Kew Gardens' = 92, 'Kew Gardens Hills' = 93, 'Kingsbridge Heights' = 94, 'Laurelton' = 95, 'Lenox Hill-Roosevelt Island' = 96, 'Lincoln Square' = 97, 'Lindenwood-Howard Beach' = 98, 'Longwood' = 99, 'Lower East Side' = 100, 'Madison' = 101, 'Manhattanville' = 102, 'Marble Hill-Inwood' = 103, 'Mariner\'s Harbor-Arlington-Port Ivory-Graniteville' = 104, 'Maspeth' = 105, 'Melrose South-Mott Haven North' = 106, 'Middle Village' = 107, 'Midtown-Midtown South' = 108, 'Midwood' = 109, 'Morningside Heights' = 110, 'Morrisania-Melrose' = 111, 'Mott Haven-Port Morris' = 112, 'Mount Hope' = 113, 'Murray Hill' = 114, 'Murray Hill-Kips Bay' = 115, 'New Brighton-Silver Lake' = 116, 'New Dorp-Midland Beach' = 117, 'New Springville-Bloomfield-Travis' = 118, 'North Corona' = 119, 'North Riverdale-Fieldston-Riverdale' = 120, 'North Side-South Side' = 121, 'Norwood' = 122, 'Oakland Gardens' = 123, 'Oakwood-Oakwood Beach' = 124, 'Ocean Hill' = 125, 'Ocean Parkway South' = 126, 'Old Astoria' = 127, 'Old Town-Dongan Hills-South Beach' = 128, 'Ozone Park' = 129, 'Park Slope-Gowanus' = 130, 'Parkchester' = 131, 'Pelham Bay-Country Club-City Island' = 132, 'Pelham Parkway' = 133, 'Pomonok-Flushing Heights-Hillcrest' = 134, 'Port Richmond' = 135, 'Prospect Heights' = 136, 'Prospect Lefferts Gardens-Wingate' = 137, 'Queens Village' = 138, 'Queensboro Hill' = 139, 'Queensbridge-Ravenswood-Long Island City' = 140, 'Rego Park' = 141, 'Richmond Hill' = 142, 'Ridgewood' = 143, 'Rikers Island' = 144, 'Rosedale' = 145, 'Rossville-Woodrow' = 146, 'Rugby-Remsen Village' = 147, 'Schuylerville-Throgs Neck-Edgewater Park' = 148, 'Seagate-Coney Island' = 149, 'Sheepshead Bay-Gerritsen Beach-Manhattan Beach' = 150, 'SoHo-TriBeCa-Civic Center-Little Italy' = 151, 'Soundview-Bruckner' = 152, 'Soundview-Castle Hill-Clason Point-Harding Park' = 153, 'South Jamaica' = 154, 'South Ozone Park' = 155, 'Springfield Gardens North' = 156, 'Springfield Gardens South-Brookville' = 157, 'Spuyten Duyvil-Kingsbridge' = 158, 'St. Albans' = 159, 'Stapleton-Rosebank' = 160, 'Starrett City' = 161, 'Steinway' = 162, 'Stuyvesant Heights' = 163, 'Stuyvesant Town-Cooper Village' = 164, 'Sunset Park East' = 165, 'Sunset Park West' = 166, 'Todt Hill-Emerson Hill-Heartland Village-Lighthouse Hill' = 167, 'Turtle Bay-East Midtown' = 168, 'University Heights-Morris Heights' = 169, 'Upper East Side-Carnegie Hill' = 170, 'Upper West Side' = 171, 'Van Cortlandt Village' = 172, 'Van Nest-Morris Park-Westchester Square' = 173, 'Washington Heights North' = 174, 'Washington Heights South' = 175, 'West Brighton' = 176, 'West Concourse' = 177, 'West Farms-Bronx River' = 178, 'West New Brighton-New Brighton-St. George' = 179, 'West Village' = 180, 'Westchester-Unionport' = 181, 'Westerleigh' = 182, 'Whitestone' = 183, 'Williamsbridge-Olinville' = 184, 'Williamsburg' = 185, 'Windsor Terrace' = 186, 'Woodhaven' = 187, 'Woodlawn-Wakefield' = 188, 'Woodside' = 189, 'Yorkville' = 190, 'park-cemetery-etc-Bronx' = 191, 'park-cemetery-etc-Brooklyn' = 192, 'park-cemetery-etc-Manhattan' = 193, 'park-cemetery-etc-Queens' = 194, 'park-cemetery-etc-Staten Island' = 195), dropoff_puma UInt16) ENGINE = MergeTree(pickup_date, pickup_datetime, 8192) ``` diff --git a/docs/fa/getting_started/index.md b/docs/fa/getting_started/index.md index 002473ef1f5..dba3d4d080f 100644 --- a/docs/fa/getting_started/index.md +++ b/docs/fa/getting_started/index.md @@ -26,7 +26,7 @@ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not su -```text +``` deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ ``` @@ -58,7 +58,7 @@ ClickHouse دارای تنظیمات محدودیت دسترسی می باشد. -```text +``` Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server ``` @@ -69,7 +69,7 @@ Server: dbms/programs/clickhouse-server -```text +``` /opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/ ``` diff --git a/docs/fa/interfaces/formats.md b/docs/fa/interfaces/formats.md index c461f062734..15360369f04 100644 --- a/docs/fa/interfaces/formats.md +++ b/docs/fa/interfaces/formats.md @@ -51,7 +51,7 @@ Dates با فرمت YYY-MM-DD نوشته می شوند و به همین حالت -```text +``` Hello\nworld Hello\ @@ -78,7 +78,7 @@ world SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -```text +``` 2014-03-17 1406958 2014-03-18 1383658 2014-03-19 1405797 @@ -123,7 +123,7 @@ SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORD -```text +``` SearchPhrase= count()=8267016 SearchPhrase=bathroom interior design count()=2166 SearchPhrase=yandex count()=1655 @@ -354,7 +354,7 @@ JSON با جاوااسکریپت سازگار است. برای اطمینان ا SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` -```text +``` ┌──EventDate─┬───────c─┐ │ 2014-03-17 │ 1406958 │ │ 2014-03-18 │ 1383658 │ diff --git a/docs/ru/data_types/nested_data_structures/nested.md b/docs/ru/data_types/nested_data_structures/nested.md index 58c7c48da3e..5846543bd6b 100644 --- a/docs/ru/data_types/nested_data_structures/nested.md +++ b/docs/ru/data_types/nested_data_structures/nested.md @@ -44,7 +44,7 @@ WHERE CounterID = 101500 AND length(Goals.ID) < 5 LIMIT 10 ``` -```text +``` ┌─Goals.ID───────────────────────┬─Goals.EventTime───────────────────────────────────────────────────────────────────────────┐ │ [1073752,591325,591325] │ ['2014-03-17 16:38:10','2014-03-17 16:38:48','2014-03-17 16:42:27'] │ │ [1073752] │ ['2014-03-17 00:28:25'] │ @@ -73,7 +73,7 @@ WHERE CounterID = 101500 AND length(Goals.ID) < 5 LIMIT 10 ``` -```text +``` ┌─Goal.ID─┬──────Goal.EventTime─┐ │ 1073752 │ 2014-03-17 16:38:10 │ │ 591325 │ 2014-03-17 16:38:48 │ diff --git a/docs/ru/getting_started/example_datasets/nyc_taxi.md b/docs/ru/getting_started/example_datasets/nyc_taxi.md index 1ce2f12193d..9e556283a3f 100644 --- a/docs/ru/getting_started/example_datasets/nyc_taxi.md +++ b/docs/ru/getting_started/example_datasets/nyc_taxi.md @@ -24,7 +24,7 @@ mv data/yellow_tripdata_2010-03.csv_ data/yellow_tripdata_2010-03.csv Проверить количество загруженных строк можно следующим образом: -```text +``` time psql nyc-taxi-data -c "SELECT count(*) FROM trips;" ## count 1298979494 @@ -173,7 +173,7 @@ dropoff_puma Nullable(String) Она нужна для преобразование полей к более правильным типам данных и, если возможно, чтобы избавиться от NULL'ов. -```text +``` time clickhouse-client --query="INSERT INTO trips FORMAT TabSeparated" < trips.tsv real 75m56.214s @@ -191,7 +191,7 @@ real 75m56.214s Создадим и заполним итоговую таблицу: -```text +``` CREATE TABLE trips_mergetree ENGINE = MergeTree(pickup_date, pickup_datetime, 8192) AS SELECT @@ -258,7 +258,7 @@ FROM trips Таблица заняла 126 Гб дискового пространства. -```text +``` :) SELECT formatReadableSize(sum(bytes)) FROM system.parts WHERE table = 'trips_mergetree' AND active SELECT formatReadableSize(sum(bytes)) @@ -322,7 +322,7 @@ ORDER BY year, count(*) DESC На каждом сервере: -```text +``` CREATE TABLE default.trips_mergetree_third ( trip_id UInt32, vendor_id Enum8('1' = 1, '2' = 2, 'CMT' = 3, 'VTS' = 4, 'DDS' = 5, 'B02512' = 10, 'B02598' = 11, 'B02617' = 12, 'B02682' = 13, 'B02764' = 14), pickup_date Date, pickup_datetime DateTime, dropoff_date Date, dropoff_datetime DateTime, store_and_fwd_flag UInt8, rate_code_id UInt8, pickup_longitude Float64, pickup_latitude Float64, dropoff_longitude Float64, dropoff_latitude Float64, passenger_count UInt8, trip_distance Float64, fare_amount Float32, extra Float32, mta_tax Float32, tip_amount Float32, tolls_amount Float32, ehail_fee Float32, improvement_surcharge Float32, total_amount Float32, payment_type_ Enum8('UNK' = 0, 'CSH' = 1, 'CRE' = 2, 'NOC' = 3, 'DIS' = 4), trip_type UInt8, pickup FixedString(25), dropoff FixedString(25), cab_type Enum8('yellow' = 1, 'green' = 2, 'uber' = 3), pickup_nyct2010_gid UInt8, pickup_ctlabel Float32, pickup_borocode UInt8, pickup_boroname Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5), pickup_ct2010 FixedString(6), pickup_boroct2010 FixedString(7), pickup_cdeligibil Enum8(' ' = 0, 'E' = 1, 'I' = 2), pickup_ntacode FixedString(4), pickup_ntaname Enum16('' = 0, 'Airport' = 1, 'Allerton-Pelham Gardens' = 2, 'Annadale-Huguenot-Prince\'s Bay-Eltingville' = 3, 'Arden Heights' = 4, 'Astoria' = 5, 'Auburndale' = 6, 'Baisley Park' = 7, 'Bath Beach' = 8, 'Battery Park City-Lower Manhattan' = 9, 'Bay Ridge' = 10, 'Bayside-Bayside Hills' = 11, 'Bedford' = 12, 'Bedford Park-Fordham North' = 13, 'Bellerose' = 14, 'Belmont' = 15, 'Bensonhurst East' = 16, 'Bensonhurst West' = 17, 'Borough Park' = 18, 'Breezy Point-Belle Harbor-Rockaway Park-Broad Channel' = 19, 'Briarwood-Jamaica Hills' = 20, 'Brighton Beach' = 21, 'Bronxdale' = 22, 'Brooklyn Heights-Cobble Hill' = 23, 'Brownsville' = 24, 'Bushwick North' = 25, 'Bushwick South' = 26, 'Cambria Heights' = 27, 'Canarsie' = 28, 'Carroll Gardens-Columbia Street-Red Hook' = 29, 'Central Harlem North-Polo Grounds' = 30, 'Central Harlem South' = 31, 'Charleston-Richmond Valley-Tottenville' = 32, 'Chinatown' = 33, 'Claremont-Bathgate' = 34, 'Clinton' = 35, 'Clinton Hill' = 36, 'Co-op City' = 37, 'College Point' = 38, 'Corona' = 39, 'Crotona Park East' = 40, 'Crown Heights North' = 41, 'Crown Heights South' = 42, 'Cypress Hills-City Line' = 43, 'DUMBO-Vinegar Hill-Downtown Brooklyn-Boerum Hill' = 44, 'Douglas Manor-Douglaston-Little Neck' = 45, 'Dyker Heights' = 46, 'East Concourse-Concourse Village' = 47, 'East Elmhurst' = 48, 'East Flatbush-Farragut' = 49, 'East Flushing' = 50, 'East Harlem North' = 51, 'East Harlem South' = 52, 'East New York' = 53, 'East New York (Pennsylvania Ave)' = 54, 'East Tremont' = 55, 'East Village' = 56, 'East Williamsburg' = 57, 'Eastchester-Edenwald-Baychester' = 58, 'Elmhurst' = 59, 'Elmhurst-Maspeth' = 60, 'Erasmus' = 61, 'Far Rockaway-Bayswater' = 62, 'Flatbush' = 63, 'Flatlands' = 64, 'Flushing' = 65, 'Fordham South' = 66, 'Forest Hills' = 67, 'Fort Greene' = 68, 'Fresh Meadows-Utopia' = 69, 'Ft. Totten-Bay Terrace-Clearview' = 70, 'Georgetown-Marine Park-Bergen Beach-Mill Basin' = 71, 'Glen Oaks-Floral Park-New Hyde Park' = 72, 'Glendale' = 73, 'Gramercy' = 74, 'Grasmere-Arrochar-Ft. Wadsworth' = 75, 'Gravesend' = 76, 'Great Kills' = 77, 'Greenpoint' = 78, 'Grymes Hill-Clifton-Fox Hills' = 79, 'Hamilton Heights' = 80, 'Hammels-Arverne-Edgemere' = 81, 'Highbridge' = 82, 'Hollis' = 83, 'Homecrest' = 84, 'Hudson Yards-Chelsea-Flatiron-Union Square' = 85, 'Hunters Point-Sunnyside-West Maspeth' = 86, 'Hunts Point' = 87, 'Jackson Heights' = 88, 'Jamaica' = 89, 'Jamaica Estates-Holliswood' = 90, 'Kensington-Ocean Parkway' = 91, 'Kew Gardens' = 92, 'Kew Gardens Hills' = 93, 'Kingsbridge Heights' = 94, 'Laurelton' = 95, 'Lenox Hill-Roosevelt Island' = 96, 'Lincoln Square' = 97, 'Lindenwood-Howard Beach' = 98, 'Longwood' = 99, 'Lower East Side' = 100, 'Madison' = 101, 'Manhattanville' = 102, 'Marble Hill-Inwood' = 103, 'Mariner\'s Harbor-Arlington-Port Ivory-Graniteville' = 104, 'Maspeth' = 105, 'Melrose South-Mott Haven North' = 106, 'Middle Village' = 107, 'Midtown-Midtown South' = 108, 'Midwood' = 109, 'Morningside Heights' = 110, 'Morrisania-Melrose' = 111, 'Mott Haven-Port Morris' = 112, 'Mount Hope' = 113, 'Murray Hill' = 114, 'Murray Hill-Kips Bay' = 115, 'New Brighton-Silver Lake' = 116, 'New Dorp-Midland Beach' = 117, 'New Springville-Bloomfield-Travis' = 118, 'North Corona' = 119, 'North Riverdale-Fieldston-Riverdale' = 120, 'North Side-South Side' = 121, 'Norwood' = 122, 'Oakland Gardens' = 123, 'Oakwood-Oakwood Beach' = 124, 'Ocean Hill' = 125, 'Ocean Parkway South' = 126, 'Old Astoria' = 127, 'Old Town-Dongan Hills-South Beach' = 128, 'Ozone Park' = 129, 'Park Slope-Gowanus' = 130, 'Parkchester' = 131, 'Pelham Bay-Country Club-City Island' = 132, 'Pelham Parkway' = 133, 'Pomonok-Flushing Heights-Hillcrest' = 134, 'Port Richmond' = 135, 'Prospect Heights' = 136, 'Prospect Lefferts Gardens-Wingate' = 137, 'Queens Village' = 138, 'Queensboro Hill' = 139, 'Queensbridge-Ravenswood-Long Island City' = 140, 'Rego Park' = 141, 'Richmond Hill' = 142, 'Ridgewood' = 143, 'Rikers Island' = 144, 'Rosedale' = 145, 'Rossville-Woodrow' = 146, 'Rugby-Remsen Village' = 147, 'Schuylerville-Throgs Neck-Edgewater Park' = 148, 'Seagate-Coney Island' = 149, 'Sheepshead Bay-Gerritsen Beach-Manhattan Beach' = 150, 'SoHo-TriBeCa-Civic Center-Little Italy' = 151, 'Soundview-Bruckner' = 152, 'Soundview-Castle Hill-Clason Point-Harding Park' = 153, 'South Jamaica' = 154, 'South Ozone Park' = 155, 'Springfield Gardens North' = 156, 'Springfield Gardens South-Brookville' = 157, 'Spuyten Duyvil-Kingsbridge' = 158, 'St. Albans' = 159, 'Stapleton-Rosebank' = 160, 'Starrett City' = 161, 'Steinway' = 162, 'Stuyvesant Heights' = 163, 'Stuyvesant Town-Cooper Village' = 164, 'Sunset Park East' = 165, 'Sunset Park West' = 166, 'Todt Hill-Emerson Hill-Heartland Village-Lighthouse Hill' = 167, 'Turtle Bay-East Midtown' = 168, 'University Heights-Morris Heights' = 169, 'Upper East Side-Carnegie Hill' = 170, 'Upper West Side' = 171, 'Van Cortlandt Village' = 172, 'Van Nest-Morris Park-Westchester Square' = 173, 'Washington Heights North' = 174, 'Washington Heights South' = 175, 'West Brighton' = 176, 'West Concourse' = 177, 'West Farms-Bronx River' = 178, 'West New Brighton-New Brighton-St. George' = 179, 'West Village' = 180, 'Westchester-Unionport' = 181, 'Westerleigh' = 182, 'Whitestone' = 183, 'Williamsbridge-Olinville' = 184, 'Williamsburg' = 185, 'Windsor Terrace' = 186, 'Woodhaven' = 187, 'Woodlawn-Wakefield' = 188, 'Woodside' = 189, 'Yorkville' = 190, 'park-cemetery-etc-Bronx' = 191, 'park-cemetery-etc-Brooklyn' = 192, 'park-cemetery-etc-Manhattan' = 193, 'park-cemetery-etc-Queens' = 194, 'park-cemetery-etc-Staten Island' = 195), pickup_puma UInt16, dropoff_nyct2010_gid UInt8, dropoff_ctlabel Float32, dropoff_borocode UInt8, dropoff_boroname Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5), dropoff_ct2010 FixedString(6), dropoff_boroct2010 FixedString(7), dropoff_cdeligibil Enum8(' ' = 0, 'E' = 1, 'I' = 2), dropoff_ntacode FixedString(4), dropoff_ntaname Enum16('' = 0, 'Airport' = 1, 'Allerton-Pelham Gardens' = 2, 'Annadale-Huguenot-Prince\'s Bay-Eltingville' = 3, 'Arden Heights' = 4, 'Astoria' = 5, 'Auburndale' = 6, 'Baisley Park' = 7, 'Bath Beach' = 8, 'Battery Park City-Lower Manhattan' = 9, 'Bay Ridge' = 10, 'Bayside-Bayside Hills' = 11, 'Bedford' = 12, 'Bedford Park-Fordham North' = 13, 'Bellerose' = 14, 'Belmont' = 15, 'Bensonhurst East' = 16, 'Bensonhurst West' = 17, 'Borough Park' = 18, 'Breezy Point-Belle Harbor-Rockaway Park-Broad Channel' = 19, 'Briarwood-Jamaica Hills' = 20, 'Brighton Beach' = 21, 'Bronxdale' = 22, 'Brooklyn Heights-Cobble Hill' = 23, 'Brownsville' = 24, 'Bushwick North' = 25, 'Bushwick South' = 26, 'Cambria Heights' = 27, 'Canarsie' = 28, 'Carroll Gardens-Columbia Street-Red Hook' = 29, 'Central Harlem North-Polo Grounds' = 30, 'Central Harlem South' = 31, 'Charleston-Richmond Valley-Tottenville' = 32, 'Chinatown' = 33, 'Claremont-Bathgate' = 34, 'Clinton' = 35, 'Clinton Hill' = 36, 'Co-op City' = 37, 'College Point' = 38, 'Corona' = 39, 'Crotona Park East' = 40, 'Crown Heights North' = 41, 'Crown Heights South' = 42, 'Cypress Hills-City Line' = 43, 'DUMBO-Vinegar Hill-Downtown Brooklyn-Boerum Hill' = 44, 'Douglas Manor-Douglaston-Little Neck' = 45, 'Dyker Heights' = 46, 'East Concourse-Concourse Village' = 47, 'East Elmhurst' = 48, 'East Flatbush-Farragut' = 49, 'East Flushing' = 50, 'East Harlem North' = 51, 'East Harlem South' = 52, 'East New York' = 53, 'East New York (Pennsylvania Ave)' = 54, 'East Tremont' = 55, 'East Village' = 56, 'East Williamsburg' = 57, 'Eastchester-Edenwald-Baychester' = 58, 'Elmhurst' = 59, 'Elmhurst-Maspeth' = 60, 'Erasmus' = 61, 'Far Rockaway-Bayswater' = 62, 'Flatbush' = 63, 'Flatlands' = 64, 'Flushing' = 65, 'Fordham South' = 66, 'Forest Hills' = 67, 'Fort Greene' = 68, 'Fresh Meadows-Utopia' = 69, 'Ft. Totten-Bay Terrace-Clearview' = 70, 'Georgetown-Marine Park-Bergen Beach-Mill Basin' = 71, 'Glen Oaks-Floral Park-New Hyde Park' = 72, 'Glendale' = 73, 'Gramercy' = 74, 'Grasmere-Arrochar-Ft. Wadsworth' = 75, 'Gravesend' = 76, 'Great Kills' = 77, 'Greenpoint' = 78, 'Grymes Hill-Clifton-Fox Hills' = 79, 'Hamilton Heights' = 80, 'Hammels-Arverne-Edgemere' = 81, 'Highbridge' = 82, 'Hollis' = 83, 'Homecrest' = 84, 'Hudson Yards-Chelsea-Flatiron-Union Square' = 85, 'Hunters Point-Sunnyside-West Maspeth' = 86, 'Hunts Point' = 87, 'Jackson Heights' = 88, 'Jamaica' = 89, 'Jamaica Estates-Holliswood' = 90, 'Kensington-Ocean Parkway' = 91, 'Kew Gardens' = 92, 'Kew Gardens Hills' = 93, 'Kingsbridge Heights' = 94, 'Laurelton' = 95, 'Lenox Hill-Roosevelt Island' = 96, 'Lincoln Square' = 97, 'Lindenwood-Howard Beach' = 98, 'Longwood' = 99, 'Lower East Side' = 100, 'Madison' = 101, 'Manhattanville' = 102, 'Marble Hill-Inwood' = 103, 'Mariner\'s Harbor-Arlington-Port Ivory-Graniteville' = 104, 'Maspeth' = 105, 'Melrose South-Mott Haven North' = 106, 'Middle Village' = 107, 'Midtown-Midtown South' = 108, 'Midwood' = 109, 'Morningside Heights' = 110, 'Morrisania-Melrose' = 111, 'Mott Haven-Port Morris' = 112, 'Mount Hope' = 113, 'Murray Hill' = 114, 'Murray Hill-Kips Bay' = 115, 'New Brighton-Silver Lake' = 116, 'New Dorp-Midland Beach' = 117, 'New Springville-Bloomfield-Travis' = 118, 'North Corona' = 119, 'North Riverdale-Fieldston-Riverdale' = 120, 'North Side-South Side' = 121, 'Norwood' = 122, 'Oakland Gardens' = 123, 'Oakwood-Oakwood Beach' = 124, 'Ocean Hill' = 125, 'Ocean Parkway South' = 126, 'Old Astoria' = 127, 'Old Town-Dongan Hills-South Beach' = 128, 'Ozone Park' = 129, 'Park Slope-Gowanus' = 130, 'Parkchester' = 131, 'Pelham Bay-Country Club-City Island' = 132, 'Pelham Parkway' = 133, 'Pomonok-Flushing Heights-Hillcrest' = 134, 'Port Richmond' = 135, 'Prospect Heights' = 136, 'Prospect Lefferts Gardens-Wingate' = 137, 'Queens Village' = 138, 'Queensboro Hill' = 139, 'Queensbridge-Ravenswood-Long Island City' = 140, 'Rego Park' = 141, 'Richmond Hill' = 142, 'Ridgewood' = 143, 'Rikers Island' = 144, 'Rosedale' = 145, 'Rossville-Woodrow' = 146, 'Rugby-Remsen Village' = 147, 'Schuylerville-Throgs Neck-Edgewater Park' = 148, 'Seagate-Coney Island' = 149, 'Sheepshead Bay-Gerritsen Beach-Manhattan Beach' = 150, 'SoHo-TriBeCa-Civic Center-Little Italy' = 151, 'Soundview-Bruckner' = 152, 'Soundview-Castle Hill-Clason Point-Harding Park' = 153, 'South Jamaica' = 154, 'South Ozone Park' = 155, 'Springfield Gardens North' = 156, 'Springfield Gardens South-Brookville' = 157, 'Spuyten Duyvil-Kingsbridge' = 158, 'St. Albans' = 159, 'Stapleton-Rosebank' = 160, 'Starrett City' = 161, 'Steinway' = 162, 'Stuyvesant Heights' = 163, 'Stuyvesant Town-Cooper Village' = 164, 'Sunset Park East' = 165, 'Sunset Park West' = 166, 'Todt Hill-Emerson Hill-Heartland Village-Lighthouse Hill' = 167, 'Turtle Bay-East Midtown' = 168, 'University Heights-Morris Heights' = 169, 'Upper East Side-Carnegie Hill' = 170, 'Upper West Side' = 171, 'Van Cortlandt Village' = 172, 'Van Nest-Morris Park-Westchester Square' = 173, 'Washington Heights North' = 174, 'Washington Heights South' = 175, 'West Brighton' = 176, 'West Concourse' = 177, 'West Farms-Bronx River' = 178, 'West New Brighton-New Brighton-St. George' = 179, 'West Village' = 180, 'Westchester-Unionport' = 181, 'Westerleigh' = 182, 'Whitestone' = 183, 'Williamsbridge-Olinville' = 184, 'Williamsburg' = 185, 'Windsor Terrace' = 186, 'Woodhaven' = 187, 'Woodlawn-Wakefield' = 188, 'Woodside' = 189, 'Yorkville' = 190, 'park-cemetery-etc-Bronx' = 191, 'park-cemetery-etc-Brooklyn' = 192, 'park-cemetery-etc-Manhattan' = 193, 'park-cemetery-etc-Queens' = 194, 'park-cemetery-etc-Staten Island' = 195), dropoff_puma UInt16) ENGINE = MergeTree(pickup_date, pickup_datetime, 8192) ``` diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index b53f128ad49..037dfb7379b 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -24,7 +24,7 @@ ClickHouse также работает на FreeBSD и Mac OS X; может бы Пропишите в `/etc/apt/sources.list` (или в отдельный файл `/etc/apt/sources.list.d/clickhouse.list`) репозитории: -```text +``` deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ ``` @@ -51,14 +51,14 @@ ClickHouse содержит настройки ограничения досту Вы можете собрать пакеты и установить их. Также вы можете использовать программы без установки пакетов. -```text +``` Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server ``` Для сервера создаёте директории с данными, например: -```text +``` /opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/ ``` diff --git a/docs/ru/interfaces/formats.md b/docs/ru/interfaces/formats.md index 801c9516454..06f0caa30e1 100644 --- a/docs/ru/interfaces/formats.md +++ b/docs/ru/interfaces/formats.md @@ -48,7 +48,7 @@ ClickHouse может принимать (`INSERT`) и отдавать (`SELECT SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -```text +``` 2014-03-17 1406958 2014-03-18 1383658 2014-03-19 1405797 @@ -80,7 +80,7 @@ SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORD Строки выводятся с экранированием спец-символов с помощью обратного слеша. При выводе, используются следующие escape-последовательности: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\'`, `\\`. При парсинге, также поддерживаются последовательности `\a`, `\v`, а также `\xHH` (hex escape-последовательности) и любые последовательности вида `\c`, где `c` - любой символ - такие последовательности преобразуется в `c`. Таким образом, при чтении поддерживаются форматы, где перевод строки может быть записан как `\n` и как `\` и перевод строки. Например, строка `Hello world`, где между словами вместо пробела стоит перевод строки, может быть считана в любом из следующих вариантов: -```text +``` Hello\nworld Hello\ @@ -128,7 +128,7 @@ world Похож на TabSeparated, но выводит значения в формате name=value. Имена экранируются так же, как строки в формате TabSeparated и, дополнительно, экранируется также символ =. -```text +``` SearchPhrase= count()=8267016 SearchPhrase=интерьер ванной комнаты count()=2166 SearchPhrase=яндекс count()=1655 @@ -380,7 +380,7 @@ SELECT * FROM t_null SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` -```text +``` ┌──EventDate─┬───────c─┐ │ 2014-03-17 │ 1406958 │ │ 2014-03-18 │ 1383658 │ diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index 8dbc5c78150..5b93396a86d 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -19,7 +19,7 @@ Содержит информацию о доступных в конфигурационном файле кластерах и серверах, которые в них входят. Столбцы: -```text +``` cluster String - имя кластера shard_num UInt32 - номер шарда в кластере, начиная с 1 shard_weight UInt32 - относительный вес шарда при записи данных @@ -34,7 +34,7 @@ user String - имя пользователя, которого испо Содержит информацию о столбцах всех таблиц. С помощью этой таблицы можно получить информацию аналогично запросу `DESCRIBE TABLE`, но для многих таблиц сразу. -```text +``` database String - имя базы данных, в которой находится таблица table String - имя таблицы name String - имя столбца @@ -159,7 +159,7 @@ default_expression String - выражение для значения по ум Эта системная таблица используется для реализации запроса `SHOW PROCESSLIST`. Столбцы: -```text +``` user String - имя пользователя, который задал запрос. При распределённой обработке запроса, относится к пользователю, с помощью которого сервер-инициатор запроса отправил запрос на данный сервер, а не к имени пользователя, который задал распределённый запрос на сервер-инициатор запроса. address String - IP-адрес, с которого задан запрос. При распределённой обработке запроса, аналогично. @@ -192,7 +192,7 @@ WHERE table = 'visits' FORMAT Vertical ``` -```text +``` Row 1: ────── database: merge @@ -218,7 +218,7 @@ active_replicas: 2 Столбцы: -```text +``` database: имя БД table: имя таблицы engine: имя движка таблицы @@ -309,7 +309,7 @@ WHERE Столбцы: -```text +``` name String - имя настройки value String - значение настройки changed UInt8 - была ли настройка явно задана в конфиге или изменена явным образом @@ -323,7 +323,7 @@ FROM system.settings WHERE changed ``` -```text +``` ┌─name───────────────────┬─value───────┬─changed─┐ │ max_threads │ 8 │ 1 │ │ use_uncompressed_cache │ 0 │ 1 │ @@ -375,7 +375,7 @@ WHERE path = '/clickhouse/tables/01-08/visits/replicas' FORMAT Vertical ``` -```text +``` Row 1: ────── name: example01-08-1.yandex.ru diff --git a/docs/ru/operations/table_engines/buffer.md b/docs/ru/operations/table_engines/buffer.md index 48aca209cdf..655c54c28ea 100644 --- a/docs/ru/operations/table_engines/buffer.md +++ b/docs/ru/operations/table_engines/buffer.md @@ -2,7 +2,7 @@ Буферизует записываемые данные в оперативке, периодически сбрасывая их в другую таблицу. При чтении, производится чтение данных одновременно из буфера и из другой таблицы. -```text +``` Buffer(database, table, num_layers, min_time, max_time, min_rows, max_rows, min_bytes, max_bytes) ``` diff --git a/docs/ru/operations/table_engines/distributed.md b/docs/ru/operations/table_engines/distributed.md index 528fa7954d6..a483e6de8b5 100644 --- a/docs/ru/operations/table_engines/distributed.md +++ b/docs/ru/operations/table_engines/distributed.md @@ -7,7 +7,7 @@ Движок Distributed принимает параметры: имя кластера в конфигурационном файле сервера, имя удалённой базы данных, имя удалённой таблицы, а также (не обязательно) ключ шардирования. Пример: -```text +``` Distributed(logs, default, hits[, sharding_key]) ``` diff --git a/docs/ru/operations/table_engines/file.md b/docs/ru/operations/table_engines/file.md index dd972cffa9f..4e333bee369 100644 --- a/docs/ru/operations/table_engines/file.md +++ b/docs/ru/operations/table_engines/file.md @@ -51,7 +51,7 @@ two 2 SELECT * FROM file_engine_table ``` -```text +``` ┌─name─┬─value─┐ │ one │ 1 │ │ two │ 2 │ diff --git a/docs/ru/operations/table_engines/graphitemergetree.md b/docs/ru/operations/table_engines/graphitemergetree.md index bcaa82272c2..fa789857751 100644 --- a/docs/ru/operations/table_engines/graphitemergetree.md +++ b/docs/ru/operations/table_engines/graphitemergetree.md @@ -27,7 +27,7 @@ Graphite хранит в ClickHouse полные данные, а получат Шаблон правил rollup: -```text +``` pattern regexp function diff --git a/docs/ru/operations/table_engines/join.md b/docs/ru/operations/table_engines/join.md index 0fcae4688c9..d9ce49665e9 100644 --- a/docs/ru/operations/table_engines/join.md +++ b/docs/ru/operations/table_engines/join.md @@ -2,7 +2,7 @@ Представляет собой подготовленную структуру данных для JOIN-а, постоянно находящуюся в оперативке. -```text +``` Join(ANY|ALL, LEFT|INNER, k1[, k2, ...]) ``` diff --git a/docs/ru/operations/table_engines/replication.md b/docs/ru/operations/table_engines/replication.md index 8ee94d4beb3..ec40645a8f6 100644 --- a/docs/ru/operations/table_engines/replication.md +++ b/docs/ru/operations/table_engines/replication.md @@ -78,7 +78,7 @@ Пример: -```text +``` ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/hits', '{replica}', EventDate, intHash32(UserID), (CounterID, EventDate, intHash32(UserID), EventTime), 8192) ``` diff --git a/docs/ru/operations/table_engines/summingmergetree.md b/docs/ru/operations/table_engines/summingmergetree.md index 422c5fc57da..5041ddc8abb 100644 --- a/docs/ru/operations/table_engines/summingmergetree.md +++ b/docs/ru/operations/table_engines/summingmergetree.md @@ -32,7 +32,7 @@ SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, (Shows, C Примеры: -```text +``` [(1, 100)] + [(2, 150)] -> [(1, 100), (2, 150)] [(1, 100)] + [(1, 150)] -> [(1, 250)] [(1, 100)] + [(1, 150), (2, 150)] -> [(1, 250), (2, 150)] diff --git a/docs/ru/operations/table_engines/url.md b/docs/ru/operations/table_engines/url.md index 1d28694bdaa..a10d51cab98 100644 --- a/docs/ru/operations/table_engines/url.md +++ b/docs/ru/operations/table_engines/url.md @@ -57,7 +57,7 @@ python3 server.py SELECT * FROM url_engine_table ``` -```text +``` ┌─word──┬─value─┐ │ Hello │ 1 │ │ World │ 2 │ diff --git a/docs/ru/operations/tips.md b/docs/ru/operations/tips.md index e51480e3a1c..af5ab00c31a 100644 --- a/docs/ru/operations/tips.md +++ b/docs/ru/operations/tips.md @@ -178,7 +178,7 @@ dynamicConfigFile=/etc/zookeeper-{{ cluster['name'] }}/conf/zoo.cfg.dynamic Версия Java: -```text +``` Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) ``` @@ -226,7 +226,7 @@ JAVA_OPTS="-Xms{{ cluster.get('xms','128M') }} \ Salt init: -```text +``` description "zookeeper-{{ cluster['name'] }} centralized coordination service" start on runlevel [2345] diff --git a/docs/ru/query_language/agg_functions/parametric_functions.md b/docs/ru/query_language/agg_functions/parametric_functions.md index 7bfcb58eb1b..7f7432fb671 100644 --- a/docs/ru/query_language/agg_functions/parametric_functions.md +++ b/docs/ru/query_language/agg_functions/parametric_functions.md @@ -23,7 +23,7 @@ Это вырожденный пример. Его можно записать с помощью других агрегатных функций: -```text +``` minIf(EventTime, URL LIKE '%company%') < maxIf(EventTime, URL LIKE '%cart%'). ``` @@ -123,7 +123,7 @@ ORDER BY level Пример применения: -```text +``` Задача: показывать в отчёте только поисковые фразы, по которым было хотя бы 5 уникальных посетителей. Решение: пишем в запросе GROUP BY SearchPhrase HAVING uniqUpTo(4)(UserID) >= 5 ``` diff --git a/docs/ru/query_language/agg_functions/reference.md b/docs/ru/query_language/agg_functions/reference.md index 5fa297e004d..8fccf9c0a64 100644 --- a/docs/ru/query_language/agg_functions/reference.md +++ b/docs/ru/query_language/agg_functions/reference.md @@ -130,7 +130,7 @@ FROM sum_map GROUP BY timeslot ``` -```text +``` ┌────────────timeslot─┬─sumMap(statusMap.status, statusMap.requests)─┐ │ 2000-01-01 00:00:00 │ ([1,2,3,4,5],[10,10,20,10,10]) │ │ 2000-01-01 00:01:00 │ ([4,5,6,7,8],[10,10,20,10,10]) │ diff --git a/docs/ru/query_language/functions/arithmetic_functions.md b/docs/ru/query_language/functions/arithmetic_functions.md index ce20fb5dcdc..162a3b75c9f 100644 --- a/docs/ru/query_language/functions/arithmetic_functions.md +++ b/docs/ru/query_language/functions/arithmetic_functions.md @@ -8,7 +8,7 @@ SELECT toTypeName(0), toTypeName(0 + 0), toTypeName(0 + 0 + 0), toTypeName(0 + 0 + 0 + 0) ``` -```text +``` ┌─toTypeName(0)─┬─toTypeName(plus(0, 0))─┬─toTypeName(plus(plus(0, 0), 0))─┬─toTypeName(plus(plus(plus(0, 0), 0), 0))─┐ │ UInt8 │ UInt16 │ UInt32 │ UInt64 │ └───────────────┴────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────┘ diff --git a/docs/ru/query_language/functions/array_functions.md b/docs/ru/query_language/functions/array_functions.md index b61c39258ec..9d1ae64da26 100644 --- a/docs/ru/query_language/functions/array_functions.md +++ b/docs/ru/query_language/functions/array_functions.md @@ -135,7 +135,7 @@ WHERE CounterID = 160656 LIMIT 10 ``` -```text +``` ┌─Reaches─┬──Hits─┐ │ 95606 │ 31406 │ └─────────┴───────┘ @@ -151,7 +151,7 @@ FROM test.hits WHERE (CounterID = 160656) AND notEmpty(GoalsReached) ``` -```text +``` ┌─Reaches─┬──Hits─┐ │ 95606 │ 31406 │ └─────────┴───────┘ @@ -181,7 +181,7 @@ ORDER BY Reaches DESC LIMIT 10 ``` -```text +``` ┌──GoalID─┬─Reaches─┬─Visits─┐ │ 53225 │ 3214 │ 1097 │ │ 2825062 │ 3188 │ 1097 │ @@ -204,7 +204,7 @@ LIMIT 10 SELECT arrayEnumerateUniq([1, 1, 1, 2, 2, 2], [1, 1, 2, 1, 1, 2]) AS res ``` -```text +``` ┌─res───────────┐ │ [1,2,1,1,2,1] │ └───────────────┘ diff --git a/docs/ru/query_language/functions/array_join.md b/docs/ru/query_language/functions/array_join.md index a9de7a36754..b954b69ad4a 100644 --- a/docs/ru/query_language/functions/array_join.md +++ b/docs/ru/query_language/functions/array_join.md @@ -21,7 +21,7 @@ SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src ``` -```text +``` ┌─dst─┬─\'Hello\'─┬─src─────┐ │ 1 │ Hello │ [1,2,3] │ │ 2 │ Hello │ [1,2,3] │ diff --git a/docs/ru/query_language/functions/date_time_functions.md b/docs/ru/query_language/functions/date_time_functions.md index 107ec2e61d3..419d26e51da 100644 --- a/docs/ru/query_language/functions/date_time_functions.md +++ b/docs/ru/query_language/functions/date_time_functions.md @@ -12,7 +12,7 @@ SELECT toString(time, 'US/Samoa') AS time_samoa ``` -```text +``` ┌────────────────time─┬─date_local─┬─date_yekat─┬─time_samoa──────────┐ │ 2016-06-15 23:00:00 │ 2016-06-15 │ 2016-06-16 │ 2016-06-15 09:00:00 │ └─────────────────────┴────────────┴────────────┴─────────────────────┘ diff --git a/docs/ru/query_language/functions/geo.md b/docs/ru/query_language/functions/geo.md index 5356568e8ea..2c10c372290 100644 --- a/docs/ru/query_language/functions/geo.md +++ b/docs/ru/query_language/functions/geo.md @@ -29,7 +29,7 @@ greatCircleDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg) SELECT greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673) ``` -```text +``` ┌─greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673)─┐ │ 14132374.194975413 │ └───────────────────────────────────────────────────────────────────┘ @@ -63,7 +63,7 @@ pointInEllipses(x, y, x₀, y₀, a₀, b₀,...,xₙ, yₙ, aₙ, bₙ) SELECT pointInEllipses(55.755831, 37.617673, 55.755831, 37.617673, 1.0, 2.0) ``` -```text +``` ┌─pointInEllipses(55.755831, 37.617673, 55.755831, 37.617673, 1., 2.)─┐ │ 1 │ └─────────────────────────────────────────────────────────────────────┘ diff --git a/docs/ru/query_language/functions/higher_order_functions.md b/docs/ru/query_language/functions/higher_order_functions.md index d0fb2c7bbe4..99d98549127 100644 --- a/docs/ru/query_language/functions/higher_order_functions.md +++ b/docs/ru/query_language/functions/higher_order_functions.md @@ -26,7 +26,7 @@ SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res ``` -```text +``` ┌─res───────────┐ │ ['abc World'] │ └───────────────┘ @@ -41,7 +41,7 @@ SELECT AS res ``` -```text +``` ┌─res─┐ │ [2] │ └─────┘ @@ -75,7 +75,7 @@ SELECT SELECT arrayCumSum([1, 1, 1, 1]) AS res ``` -```text +``` ┌─res──────────┐ │ [1, 2, 3, 4] │ └──────────────┘ @@ -94,7 +94,7 @@ SELECT arrayCumSum([1, 1, 1, 1]) AS res SELECT arraySort((x, y) -> y, ['hello', 'world'], [2, 1]); ``` -```text +``` ┌─res────────────────┐ │ ['world', 'hello'] │ └────────────────────┘ diff --git a/docs/ru/query_language/functions/ip_address_functions.md b/docs/ru/query_language/functions/ip_address_functions.md index fb4d1fee613..fa6035968ae 100644 --- a/docs/ru/query_language/functions/ip_address_functions.md +++ b/docs/ru/query_language/functions/ip_address_functions.md @@ -21,7 +21,7 @@ ORDER BY c DESC LIMIT 10 ``` -```text +``` ┌─k──────────────┬─────c─┐ │ 83.149.9.xxx │ 26238 │ │ 217.118.81.xxx │ 26074 │ @@ -46,7 +46,7 @@ IPv6-mapped IPv4 адреса выводится в формате ::ffff:111.22 SELECT IPv6NumToString(toFixedString(unhex('2A0206B8000000000000000000000011'), 16)) AS addr ``` -```text +``` ┌─addr─────────┐ │ 2a02:6b8::11 │ └──────────────┘ @@ -63,7 +63,7 @@ ORDER BY c DESC LIMIT 10 ``` -```text +``` ┌─IPv6NumToString(ClientIP6)──────────────┬─────c─┐ │ 2a02:2168:aaa:bbbb::2 │ 24695 │ │ 2a02:2698:abcd:abcd:abcd:abcd:8888:5555 │ 22408 │ @@ -89,7 +89,7 @@ ORDER BY c DESC LIMIT 10 ``` -```text +``` ┌─IPv6NumToString(ClientIP6)─┬──────c─┐ │ ::ffff:94.26.111.111 │ 747440 │ │ ::ffff:37.143.222.4 │ 529483 │ diff --git a/docs/ru/query_language/functions/json_functions.md b/docs/ru/query_language/functions/json_functions.md index fb0c55eecc5..6958f33e2ba 100644 --- a/docs/ru/query_language/functions/json_functions.md +++ b/docs/ru/query_language/functions/json_functions.md @@ -29,7 +29,7 @@ Примеры: -```text +``` visitParamExtractRaw('{"abc":"\\n\\u0000"}', 'abc') = '"\\n\\u0000"' visitParamExtractRaw('{"abc":{"def":[1,2,3]}}', 'abc') = '{"def":[1,2,3]}' ``` @@ -39,7 +39,7 @@ visitParamExtractRaw('{"abc":{"def":[1,2,3]}}', 'abc') = '{"def":[1,2,3]}' Примеры: -```text +``` visitParamExtractString('{"abc":"\\n\\u0000"}', 'abc') = '\n\0' visitParamExtractString('{"abc":"\\u263a"}', 'abc') = '☺' visitParamExtractString('{"abc":"\\u263"}', 'abc') = '' diff --git a/docs/ru/query_language/functions/math_functions.md b/docs/ru/query_language/functions/math_functions.md index 92feceb3a95..40d9185fe0d 100644 --- a/docs/ru/query_language/functions/math_functions.md +++ b/docs/ru/query_language/functions/math_functions.md @@ -43,7 +43,7 @@ SELECT erf(3 / sqrt(2)) ``` -```text +``` ┌─erf(divide(3, sqrt(2)))─┐ │ 0.9973002039367398 │ └─────────────────────────┘ diff --git a/docs/ru/query_language/functions/other_functions.md b/docs/ru/query_language/functions/other_functions.md index df047344379..c744dc7631d 100644 --- a/docs/ru/query_language/functions/other_functions.md +++ b/docs/ru/query_language/functions/other_functions.md @@ -82,7 +82,7 @@ GROUP BY h ORDER BY h ASC ``` -```text +``` ┌──h─┬──────c─┬─bar────────────────┐ │ 0 │ 292907 │ █████████▋ │ │ 1 │ 180563 │ ██████ │ @@ -151,7 +151,7 @@ GROUP BY title ORDER BY c DESC ``` -```text +``` ┌─title─────┬──────c─┐ │ Yandex │ 498635 │ │ Google │ 229872 │ @@ -180,7 +180,7 @@ ORDER BY count() DESC LIMIT 10 ``` -```text +``` ┌─s──────────────┬───────c─┐ │ │ 2906259 │ │ www.yandex │ 867767 │ @@ -205,7 +205,7 @@ SELECT formatReadableSize(filesize_bytes) AS filesize ``` -```text +``` ┌─filesize_bytes─┬─filesize───┐ │ 1 │ 1.00 B │ │ 1024 │ 1.00 KiB │ @@ -255,7 +255,7 @@ FROM ) ``` -```text +``` ┌─EventID─┬───────────EventTime─┬─delta─┐ │ 1106 │ 2016-11-24 00:00:04 │ 0 │ │ 1107 │ 2016-11-24 00:00:05 │ 1 │ diff --git a/docs/ru/query_language/functions/string_replace_functions.md b/docs/ru/query_language/functions/string_replace_functions.md index 0c4cb9923f2..0f6ba002e93 100644 --- a/docs/ru/query_language/functions/string_replace_functions.md +++ b/docs/ru/query_language/functions/string_replace_functions.md @@ -26,7 +26,7 @@ LIMIT 7 FORMAT TabSeparated ``` -```text +``` 2014-03-17 03/17/2014 2014-03-18 03/18/2014 2014-03-19 03/19/2014 @@ -42,7 +42,7 @@ FORMAT TabSeparated SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') AS res ``` -```text +``` ┌─res────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World! │ └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ @@ -55,7 +55,7 @@ SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res ``` -```text +``` ┌─res────────────────────────┐ │ HHeelllloo,, WWoorrlldd!! │ └────────────────────────────┘ @@ -68,7 +68,7 @@ SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res ``` -```text +``` ┌─res─────────────────┐ │ here: Hello, World! │ └─────────────────────┘ diff --git a/docs/ru/query_language/functions/type_conversion_functions.md b/docs/ru/query_language/functions/type_conversion_functions.md index eb4361520c7..f580c81414b 100644 --- a/docs/ru/query_language/functions/type_conversion_functions.md +++ b/docs/ru/query_language/functions/type_conversion_functions.md @@ -27,7 +27,7 @@ Форматы даты и даты-с-временем для функций toDate/toDateTime определены следующим образом: -```text +``` YYYY-MM-DD YYYY-MM-DD hh:mm:ss ``` @@ -46,7 +46,7 @@ SELECT toString(now(), 'Asia/Yekaterinburg') AS now_yekat ``` -```text +``` ┌───────────now_local─┬─now_yekat───────────┐ │ 2016-06-15 00:11:21 │ 2016-06-15 02:11:21 │ └─────────────────────┴─────────────────────┘ @@ -67,7 +67,7 @@ SELECT SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut ``` -```text +``` ┌─s─────────────┬─s_cut─┐ │ foo\0\0\0\0\0 │ foo │ └───────────────┴───────┘ @@ -77,7 +77,7 @@ SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut SELECT toFixedString('foo\0bar', 8) AS s, toStringCutToZero(s) AS s_cut ``` -```text +``` ┌─s──────────┬─s_cut─┐ │ foo\0bar\0 │ foo │ └────────────┴───────┘ @@ -110,7 +110,7 @@ SELECT CAST(timestamp, 'FixedString(22)') AS fixed_string ``` -```text +``` ┌─timestamp───────────┬────────────datetime─┬───────date─┬─string──────────────┬─fixed_string──────────────┐ │ 2016-06-15 23:00:00 │ 2016-06-15 23:00:00 │ 2016-06-15 │ 2016-06-15 23:00:00 │ 2016-06-15 23:00:00\0\0\0 │ └─────────────────────┴─────────────────────┴────────────┴─────────────────────┴───────────────────────────┘ diff --git a/docs/ru/query_language/functions/url_functions.md b/docs/ru/query_language/functions/url_functions.md index 01abbf579f0..c66781c5821 100644 --- a/docs/ru/query_language/functions/url_functions.md +++ b/docs/ru/query_language/functions/url_functions.md @@ -57,7 +57,7 @@ То же самое, но без протокола и хоста в результате. Элемент / (корень) не включается. Пример: Функция используется для реализации древовидных отчётов по URL в Яндекс.Метрике. -```text +``` URLPathHierarchy('https://example.com/browse/CONV-6788') = [ '/browse/', @@ -73,7 +73,7 @@ URLPathHierarchy('https://example.com/browse/CONV-6788') = SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS DecodedURL; ``` -```text +``` ┌─DecodedURL─────────────────────────────┐ │ http://127.0.0.1:8123/?query=SELECT 1; │ └────────────────────────────────────────┘ diff --git a/docs/ru/query_language/functions/ym_dict_functions.md b/docs/ru/query_language/functions/ym_dict_functions.md index a5374eefb82..eeea7faa9d0 100644 --- a/docs/ru/query_language/functions/ym_dict_functions.md +++ b/docs/ru/query_language/functions/ym_dict_functions.md @@ -23,7 +23,7 @@ ClickHouse поддерживает работу одновременно с н Во все функции по работе с регионами, в конце добавлен один необязательный аргумент - ключ словаря. Далее он обозначен как geobase. Пример: -```text +``` regionToCountry(RegionID) - использует словарь по умолчанию: /opt/geo/regions_hierarchy.txt; regionToCountry(RegionID, '') - использует словарь по умолчанию: /opt/geo/regions_hierarchy.txt; regionToCountry(RegionID, 'ua') - использует словарь для ключа ua: /opt/geo/regions_hierarchy_ua.txt; @@ -41,7 +41,7 @@ FROM system.numbers LIMIT 15 ``` -```text +``` ┌─regionToName(regionToArea(toUInt32(number), \'ua\'))─┐ │ │ │ Москва и Московская область │ @@ -70,7 +70,7 @@ FROM system.numbers LIMIT 15 ``` -```text +``` ┌─regionToName(regionToDistrict(toUInt32(number), \'ua\'))─┐ │ │ │ Центральный федеральный округ │ diff --git a/docs/ru/query_language/select.md b/docs/ru/query_language/select.md index 09a8ad6fe56..6d5a6db7d02 100644 --- a/docs/ru/query_language/select.md +++ b/docs/ru/query_language/select.md @@ -90,7 +90,7 @@ ORDER BY PageViews DESC LIMIT 1000 `ARRAY JOIN` - это, по сути, `INNER JOIN` с массивом. Пример: -```text +``` :) CREATE TABLE arrays_test (s String, arr Array(UInt8)) ENGINE = Memory CREATE TABLE arrays_test @@ -143,7 +143,7 @@ ARRAY JOIN arr Для массива в секции ARRAY JOIN может быть указан алиас. В этом случае, элемент массива будет доступен под этим алиасом, а сам массив - под исходным именем. Пример: -```text +``` :) SELECT s, arr, a FROM arrays_test ARRAY JOIN arr AS a SELECT s, arr, a @@ -163,7 +163,7 @@ ARRAY JOIN arr AS a В секции ARRAY JOIN может быть указано несколько массивов одинаковых размеров через запятую. В этом случае, JOIN делается с ними одновременно (прямая сумма, а не прямое произведение). Пример: -```text +``` :) SELECT s, arr, a, num, mapped FROM arrays_test ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num, arrayMap(x -> x + 1, arr) AS mapped SELECT s, arr, a, num, mapped @@ -199,7 +199,7 @@ ARRAY JOIN arr AS a, arrayEnumerate(arr) AS num ARRAY JOIN также работает с вложенными структурами данных. Пример: -```text +``` :) CREATE TABLE nested_test (s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory CREATE TABLE nested_test @@ -254,7 +254,7 @@ ARRAY JOIN nest При указании имени вложенной структуры данных в ARRAY JOIN, смысл такой же, как ARRAY JOIN со всеми элементами-массивами, из которых она состоит. Пример: -```text +``` :) SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest.x, nest.y SELECT s, `nest.x`, `nest.y` @@ -274,7 +274,7 @@ ARRAY JOIN `nest.x`, `nest.y` Такой вариант тоже имеет смысл: -```text +``` :) SELECT s, nest.x, nest.y FROM nested_test ARRAY JOIN nest.x SELECT s, `nest.x`, `nest.y` @@ -294,7 +294,7 @@ ARRAY JOIN `nest.x` Алиас для вложенной структуры данных можно использовать, чтобы выбрать как результат JOIN-а, так и исходный массив. Пример: -```text +``` :) SELECT s, n.x, n.y, nest.x, nest.y FROM nested_test ARRAY JOIN nest AS n SELECT s, `n.x`, `n.y`, `nest.x`, `nest.y` @@ -314,7 +314,7 @@ ARRAY JOIN nest AS n Пример использования функции arrayEnumerate: -```text +``` :) SELECT s, n.x, n.y, nest.x, nest.y, num FROM nested_test ARRAY JOIN nest AS n, arrayEnumerate(nest.x) AS num SELECT s, `n.x`, `n.y`, `nest.x`, `nest.y`, num @@ -404,7 +404,7 @@ ORDER BY hits DESC LIMIT 10 ``` -```text +``` ┌─CounterID─┬───hits─┬─visits─┐ │ 1143050 │ 523264 │ 13665 │ │ 731962 │ 475698 │ 102716 │ @@ -821,7 +821,7 @@ GROUP BY EventDate ORDER BY EventDate ASC ``` -```text +``` ┌──EventDate─┬────ratio─┐ │ 2014-03-17 │ 1 │ │ 2014-03-18 │ 0.807696 │ diff --git a/docs/ru/query_language/table_functions/remote.md b/docs/ru/query_language/table_functions/remote.md index 1eb4016759f..17faaea6bb5 100644 --- a/docs/ru/query_language/table_functions/remote.md +++ b/docs/ru/query_language/table_functions/remote.md @@ -18,7 +18,7 @@ remote('addresses_expr', db.table[, 'user'[, 'password']]) Примеры: -```text +``` example01-01-1 example01-01-1:9000 localhost @@ -31,19 +31,19 @@ localhost Пример: -```text +``` example01-01-1,example01-02-1 ``` Часть выражения может быть указана в фигурных скобках. Предыдущий пример может быть записан следующим образом: -```text +``` example01-0{1,2}-1 ``` В фигурных скобках может быть указан диапазон (неотрицательных целых) чисел через две точки. В этом случае, диапазон раскрывается в множество значений, генерирующих адреса шардов. Если запись первого числа начинается с нуля, то значения формируются с таким же выравниванием нулями. Предыдущий пример может быть записан следующим образом: -```text +``` example01-{01..02}-1 ``` @@ -53,7 +53,7 @@ example01-{01..02}-1 Пример: -```text +``` example01-{01..02}-{1|2} ``` diff --git a/docs/zh/interfaces/formats.md b/docs/zh/interfaces/formats.md index 8d72eddb973..2a25df1c405 100644 --- a/docs/zh/interfaces/formats.md +++ b/docs/zh/interfaces/formats.md @@ -283,7 +283,7 @@ Pretty格式支持输出总值(当使用 WITH TOTALS 时)和极值(当 `ex SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` -```text +``` ┌──EventDate─┬───────c─┐ │ 2014-03-17 │ 1406958 │ │ 2014-03-18 │ 1383658 │ @@ -375,7 +375,7 @@ TabSeparated 格式支持输出数据总值(当使用 WITH TOTALS) 以及极 SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -```text +``` 2014-03-17 1406958 2014-03-18 1383658 2014-03-19 1405797 @@ -407,7 +407,7 @@ SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORD 字符串以反斜线转义的特殊字符输出。 以下转义序列用于输出:`\b`,`\f`,`\r`,`\n`,`\t`,`\0`,`\'`,`\\`。 解析还支持`\a`,`\v`和`\xHH`(十六进制转义字符)和任何`\c`字符,其中`c`是任何字符(这些序列被转换为`c`)。 因此,读取数据支持可以将换行符写为`\n`或`\`的格式,或者换行。例如,字符串 `Hello world` 在单词之间换行而不是空格可以解析为以下任何形式: -```text +``` Hello\nworld Hello\ @@ -455,7 +455,7 @@ world 与 `TabSeparated` 格式类似,但它输出的是 `name=value` 的格式。名称会和 `TabSeparated` 格式一样被转义,`=` 字符也会被转义。 -```text +``` SearchPhrase= count()=8267016 SearchPhrase=bathroom interior design count()=2166 SearchPhrase=yandex count()=1655 From 10da7f20f0255bccd943d9cfe56611184cd0bab3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 12:41:29 +0300 Subject: [PATCH 016/297] find . -name '*.md' -type f | xargs -I{} perl -pi -e 's/ sql/g' {} --- docs/en/data_types/float.md | 6 +-- .../nested_data_structures/nested.md | 6 +-- .../example_datasets/amplab_benchmark.md | 4 +- .../example_datasets/criteo.md | 6 +-- .../example_datasets/nyc_taxi.md | 16 +++---- .../example_datasets/ontime.md | 32 +++++++------- .../example_datasets/star_schema.md | 2 +- .../example_datasets/wikistat.md | 2 +- docs/en/interfaces/formats.md | 14 +++---- .../operations/settings/settings_profiles.md | 2 +- docs/en/operations/system_tables.md | 8 ++-- .../table_engines/aggregatingmergetree.md | 10 ++--- docs/en/operations/table_engines/buffer.md | 2 +- .../table_engines/collapsingmergetree.md | 2 +- .../table_engines/custom_partitioning_key.md | 4 +- .../en/operations/table_engines/dictionary.md | 6 +-- docs/en/operations/table_engines/file.md | 4 +- docs/en/operations/table_engines/kafka.md | 4 +- docs/en/operations/table_engines/mergetree.md | 4 +- .../table_engines/replacingmergetree.md | 2 +- .../table_engines/summingmergetree.md | 4 +- docs/en/operations/table_engines/url.md | 4 +- .../query_language/agg_functions/reference.md | 6 +-- docs/en/query_language/alter.md | 24 +++++------ docs/en/query_language/create.md | 18 ++++---- .../functions/arithmetic_functions.md | 2 +- .../functions/array_functions.md | 20 ++++----- .../en/query_language/functions/array_join.md | 2 +- .../functions/date_time_functions.md | 2 +- docs/en/query_language/functions/geo.md | 6 +-- .../functions/higher_order_functions.md | 8 ++-- .../functions/ip_address_functions.md | 8 ++-- .../functions/math_functions.md | 2 +- .../functions/other_functions.md | 10 ++--- .../functions/rounding_functions.md | 2 +- .../functions/string_replace_functions.md | 8 ++-- .../functions/type_conversion_functions.md | 8 ++-- .../query_language/functions/url_functions.md | 2 +- .../functions/ym_dict_functions.md | 4 +- docs/en/query_language/insert_into.md | 10 ++--- docs/en/query_language/misc.md | 32 +++++++------- docs/en/query_language/operators.md | 2 +- docs/en/query_language/select.md | 42 +++++++++---------- docs/en/query_language/syntax.md | 4 +- .../en/query_language/table_functions/file.md | 2 +- .../en/query_language/table_functions/jdbc.md | 6 +-- .../query_language/table_functions/numbers.md | 4 +- .../query_language/table_functions/remote.md | 2 +- docs/en/query_language/table_functions/url.md | 2 +- docs/fa/data_types/float.md | 6 +-- .../nested_data_structures/nested.md | 6 +-- .../example_datasets/amplab_benchmark.md | 4 +- .../example_datasets/criteo.md | 6 +-- .../example_datasets/nyc_taxi.md | 16 +++---- .../example_datasets/ontime.md | 32 +++++++------- .../example_datasets/star_schema.md | 2 +- .../example_datasets/wikistat.md | 2 +- docs/fa/interfaces/formats.md | 8 ++-- docs/ru/data_types/float.md | 6 +-- .../nested_data_structures/nested.md | 6 +-- .../example_datasets/amplab_benchmark.md | 4 +- .../example_datasets/criteo.md | 6 +-- .../example_datasets/nyc_taxi.md | 16 +++---- .../example_datasets/ontime.md | 32 +++++++------- .../example_datasets/star_schema.md | 2 +- .../example_datasets/wikistat.md | 2 +- docs/ru/interfaces/formats.md | 14 +++---- .../operations/settings/settings_profiles.md | 2 +- docs/ru/operations/system_tables.md | 8 ++-- .../table_engines/aggregatingmergetree.md | 10 ++--- docs/ru/operations/table_engines/buffer.md | 2 +- .../table_engines/collapsingmergetree.md | 2 +- .../table_engines/custom_partitioning_key.md | 4 +- .../ru/operations/table_engines/dictionary.md | 6 +-- docs/ru/operations/table_engines/file.md | 4 +- docs/ru/operations/table_engines/kafka.md | 4 +- docs/ru/operations/table_engines/mergetree.md | 4 +- .../table_engines/replacingmergetree.md | 2 +- .../table_engines/summingmergetree.md | 4 +- docs/ru/operations/table_engines/url.md | 4 +- .../query_language/agg_functions/reference.md | 6 +-- docs/ru/query_language/alter.md | 24 +++++------ docs/ru/query_language/create.md | 18 ++++---- .../functions/arithmetic_functions.md | 2 +- .../functions/array_functions.md | 20 ++++----- .../ru/query_language/functions/array_join.md | 2 +- .../functions/date_time_functions.md | 2 +- docs/ru/query_language/functions/geo.md | 6 +-- .../functions/higher_order_functions.md | 8 ++-- .../functions/ip_address_functions.md | 8 ++-- .../functions/math_functions.md | 2 +- .../functions/other_functions.md | 10 ++--- .../functions/rounding_functions.md | 2 +- .../functions/string_replace_functions.md | 8 ++-- .../functions/type_conversion_functions.md | 8 ++-- .../query_language/functions/url_functions.md | 2 +- .../functions/ym_dict_functions.md | 4 +- docs/ru/query_language/insert_into.md | 10 ++--- docs/ru/query_language/misc.md | 32 +++++++------- docs/ru/query_language/operators.md | 2 +- docs/ru/query_language/select.md | 42 +++++++++---------- docs/ru/query_language/syntax.md | 4 +- .../ru/query_language/table_functions/file.md | 2 +- .../ru/query_language/table_functions/jdbc.md | 6 +-- .../query_language/table_functions/numbers.md | 4 +- .../query_language/table_functions/remote.md | 2 +- docs/ru/query_language/table_functions/url.md | 2 +- docs/zh/interfaces/formats.md | 14 +++---- 108 files changed, 430 insertions(+), 430 deletions(-) diff --git a/docs/en/data_types/float.md b/docs/en/data_types/float.md index 1c95cc48c2e..c106640e85a 100644 --- a/docs/en/data_types/float.md +++ b/docs/en/data_types/float.md @@ -13,7 +13,7 @@ We recommend that you store data in integer form whenever possible. For example, - Computations with floating-point numbers might produce a rounding error. -```sql +``` sql SELECT 1 - 0.9 ``` @@ -33,7 +33,7 @@ In contrast to standard SQL, ClickHouse supports the following categories of flo - `Inf` – Infinity. -```sql +``` sql SELECT 0.5 / 0 ``` @@ -45,7 +45,7 @@ SELECT 0.5 / 0 - `-Inf` – Negative infinity. -```sql +``` sql SELECT -0.5 / 0 ``` diff --git a/docs/en/data_types/nested_data_structures/nested.md b/docs/en/data_types/nested_data_structures/nested.md index 80ce04daf8c..1d90048d626 100644 --- a/docs/en/data_types/nested_data_structures/nested.md +++ b/docs/en/data_types/nested_data_structures/nested.md @@ -4,7 +4,7 @@ A nested data structure is like a nested table. The parameters of a nested data Example: -```sql +``` sql CREATE TABLE test.visits ( CounterID UInt32, @@ -35,7 +35,7 @@ In most cases, when working with a nested data structure, its individual columns Example: -```sql +``` sql SELECT Goals.ID, Goals.EventTime @@ -63,7 +63,7 @@ It is easiest to think of a nested data structure as a set of multiple column ar The only place where a SELECT query can specify the name of an entire nested data structure instead of individual columns is the ARRAY JOIN clause. For more information, see "ARRAY JOIN clause". Example: -```sql +``` sql SELECT Goal.ID, Goal.EventTime diff --git a/docs/en/getting_started/example_datasets/amplab_benchmark.md b/docs/en/getting_started/example_datasets/amplab_benchmark.md index ef067ee4dd9..e5d9812a9c3 100644 --- a/docs/en/getting_started/example_datasets/amplab_benchmark.md +++ b/docs/en/getting_started/example_datasets/amplab_benchmark.md @@ -21,7 +21,7 @@ cd .. Run the following ClickHouse queries: -```sql +``` sql CREATE TABLE rankings_tiny ( pageURL String, @@ -96,7 +96,7 @@ for i in 5nodes/uservisits/*.deflate; do echo $i; zlib-flate -uncompress < $i | Queries for obtaining data samples: -```sql +``` sql SELECT pageURL, pageRank FROM rankings_1node WHERE pageRank > 1000 SELECT substring(sourceIP, 1, 8), sum(adRevenue) FROM uservisits_1node GROUP BY substring(sourceIP, 1, 8) diff --git a/docs/en/getting_started/example_datasets/criteo.md b/docs/en/getting_started/example_datasets/criteo.md index 9dd4a545056..268e8346d6c 100644 --- a/docs/en/getting_started/example_datasets/criteo.md +++ b/docs/en/getting_started/example_datasets/criteo.md @@ -4,7 +4,7 @@ Download the data from = 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC; ``` Q2. The number of flights delayed by more than 10 minutes, grouped by the day of the week, for 2000-2008 -```sql +``` sql SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC ``` Q3. The number of delays by airport for 2000-2008 -```sql +``` sql SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10 ``` Q4. The number of delays by carrier for 2007 -```sql +``` sql SELECT Carrier, count(*) FROM ontime WHERE DepDelay>10 AND Year = 2007 GROUP BY Carrier ORDER BY count(*) DESC ``` Q5. The percentage of delays by carrier for 2007 -```sql +``` sql SELECT Carrier, c, c2, c*1000/c2 as c3 FROM ( @@ -198,13 +198,13 @@ ORDER BY c3 DESC; Better version of the same query: -```sql +``` sql SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year = 2007 GROUP BY Carrier ORDER BY Carrier ``` Q6. The previous request for a broader range of years, 2000-2008 -```sql +``` sql SELECT Carrier, c, c2, c*1000/c2 as c3 FROM ( @@ -230,13 +230,13 @@ ORDER BY c3 DESC; Better version of the same query: -```sql +``` sql SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier ``` Q7. Percentage of flights delayed for more than 10 minutes, by year -```sql +``` sql SELECT Year, c1/c2 FROM ( @@ -260,25 +260,25 @@ ORDER BY Year Better version of the same query: -```sql +``` sql SELECT Year, avg(DepDelay > 10) FROM ontime GROUP BY Year ORDER BY Year ``` Q8. The most popular destinations by the number of directly connected cities for various year ranges -```sql +``` sql SELECT DestCityName, uniqExact(OriginCityName) AS u FROM ontime WHERE Year >= 2000 and Year <= 2010 GROUP BY DestCityName ORDER BY u DESC LIMIT 10; ``` Q9. -```sql +``` sql select Year, count(*) as c1 from ontime group by Year; ``` Q10. -```sql +``` sql select min(Year), max(Year), Carrier, count(*) as cnt, sum(ArrDelayMinutes>30) as flights_delayed, @@ -296,7 +296,7 @@ LIMIT 1000; Bonus: -```sql +``` sql SELECT avg(cnt) FROM (SELECT Year,Month,count(*) AS cnt FROM ontime WHERE DepDel15=1 GROUP BY Year,Month) select avg(c1) from (select Year,Month,count(*) as c1 from ontime group by Year,Month) diff --git a/docs/en/getting_started/example_datasets/star_schema.md b/docs/en/getting_started/example_datasets/star_schema.md index 235c361d167..5606cf71dd1 100644 --- a/docs/en/getting_started/example_datasets/star_schema.md +++ b/docs/en/getting_started/example_datasets/star_schema.md @@ -21,7 +21,7 @@ Generating data: Creating tables in ClickHouse: -```sql +``` sql CREATE TABLE lineorder ( LO_ORDERKEY UInt32, LO_LINENUMBER UInt8, diff --git a/docs/en/getting_started/example_datasets/wikistat.md b/docs/en/getting_started/example_datasets/wikistat.md index 250ecfccac9..f81d0525367 100644 --- a/docs/en/getting_started/example_datasets/wikistat.md +++ b/docs/en/getting_started/example_datasets/wikistat.md @@ -4,7 +4,7 @@ See: Creating a table: -```sql +``` sql CREATE TABLE wikistat ( date Date, diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index f087f6f8b6b..d26b8f54ab9 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -44,7 +44,7 @@ The `TabSeparated` format is convenient for processing data using custom program The `TabSeparated` format supports outputting total values (when using WITH TOTALS) and extreme values (when 'extremes' is set to 1). In these cases, the total values and extremes are output after the main data. The main result, total values, and extremes are separated from each other by an empty line. Example: -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` @@ -143,7 +143,7 @@ SearchPhrase=baku count()=1000 [NULL](../query_language/syntax.md#null-literal) is formatted as `\N`. -```sql +``` sql SELECT * FROM t_null FORMAT TSKV ``` @@ -186,7 +186,7 @@ Also prints the header row, similar to `TabSeparatedWithNames`. Outputs data in JSON format. Besides data tables, it also outputs column names and types, along with some additional information: the total number of output rows, and the number of rows that could have been output if there weren't a LIMIT. Example: -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase WITH TOTALS ORDER BY c DESC LIMIT 5 FORMAT JSON ``` @@ -363,7 +363,7 @@ Each result block is output as a separate table. This is necessary so that block [NULL](../query_language/syntax.md#null-literal) is output as `ᴺᵁᴸᴸ`. -```sql +``` sql SELECT * FROM t_null ``` @@ -378,7 +378,7 @@ This format is only appropriate for outputting a query result, but not for parsi The Pretty format supports outputting total values (when using WITH TOTALS) and extremes (when 'extremes' is set to 1). In these cases, total values and extreme values are output after the main data, in separate tables. Example (shown for the PrettyCompact format): -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` @@ -477,7 +477,7 @@ Prints each value on a separate line with the column name specified. This format Example: -```sql +``` sql SELECT * FROM t_null FORMAT Vertical ``` @@ -604,7 +604,7 @@ Cap'n Proto is a binary message format similar to Protocol Buffers and Thrift, b Cap'n Proto messages are strictly typed and not self-describing, meaning they need an external schema description. The schema is applied on the fly and cached for each query. -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' ``` diff --git a/docs/en/operations/settings/settings_profiles.md b/docs/en/operations/settings/settings_profiles.md index 31b8016ccf4..338800fbee2 100644 --- a/docs/en/operations/settings/settings_profiles.md +++ b/docs/en/operations/settings/settings_profiles.md @@ -9,7 +9,7 @@ Example: Install the `web` profile. -```sql +``` sql SET profile = 'web' ``` diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 5a84e50b86b..a67fec3f9c5 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -210,7 +210,7 @@ This table can be used for monitoring. The table contains a row for every Replic Example: -```sql +``` sql SELECT * FROM system.replicas WHERE table = 'visits' @@ -296,7 +296,7 @@ If you don't request the last 4 columns (log_max_index, log_pointer, total_repli For example, you can check that everything is working correctly like this: -```sql +``` sql SELECT database, table, @@ -343,7 +343,7 @@ changed UInt8 — Whether the setting was explicitly defined in the config or ex Example: -```sql +``` sql SELECT * FROM system.settings WHERE changed @@ -393,7 +393,7 @@ Columns: Example: -```sql +``` sql SELECT * FROM system.zookeeper WHERE path = '/clickhouse/tables/01-08/visits/replicas' diff --git a/docs/en/operations/table_engines/aggregatingmergetree.md b/docs/en/operations/table_engines/aggregatingmergetree.md index 2f3b0fb9638..44bc03a8bd5 100644 --- a/docs/en/operations/table_engines/aggregatingmergetree.md +++ b/docs/en/operations/table_engines/aggregatingmergetree.md @@ -8,7 +8,7 @@ There is an `AggregateFunction` data type. It is a parametric data type. As para Examples: -```sql +``` sql CREATE TABLE t ( column1 AggregateFunction(uniq, UInt64), @@ -33,7 +33,7 @@ Example: `uniqMerge(UserIDState)`, where `UserIDState` has the `AggregateFunctio In other words, an aggregate function with the 'Merge' suffix takes a set of states, combines them, and returns the result. As an example, these two queries return the same result: -```sql +``` sql SELECT uniq(UserID) FROM table SELECT uniqMerge(state) FROM (SELECT uniqState(UserID) AS state FROM table GROUP BY RegionID) @@ -51,7 +51,7 @@ Example: Create an `AggregatingMergeTree` materialized view that watches the `test.visits` table: -```sql +``` sql CREATE MATERIALIZED VIEW test.basic ENGINE = AggregatingMergeTree(StartDate, (CounterID, StartDate), 8192) AS SELECT @@ -65,13 +65,13 @@ GROUP BY CounterID, StartDate; Insert data in the `test.visits` table. Data will also be inserted in the view, where it will be aggregated: -```sql +``` sql INSERT INTO test.visits ... ``` Perform `SELECT` from the view using `GROUP BY` in order to complete data aggregation: -```sql +``` sql SELECT StartDate, sumMerge(Visits) AS Visits, diff --git a/docs/en/operations/table_engines/buffer.md b/docs/en/operations/table_engines/buffer.md index 461b10f81c3..24a990bb260 100644 --- a/docs/en/operations/table_engines/buffer.md +++ b/docs/en/operations/table_engines/buffer.md @@ -16,7 +16,7 @@ The conditions for flushing the data are calculated separately for each of the ' Example: -```sql +``` sql CREATE TABLE merge.hits_buffer AS merge.hits ENGINE = Buffer(merge, hits, 16, 10, 100, 10000, 1000000, 10000000, 100000000) ``` diff --git a/docs/en/operations/table_engines/collapsingmergetree.md b/docs/en/operations/table_engines/collapsingmergetree.md index c2a67cd9212..193984c92a5 100644 --- a/docs/en/operations/table_engines/collapsingmergetree.md +++ b/docs/en/operations/table_engines/collapsingmergetree.md @@ -14,7 +14,7 @@ This is the main concept that allows Yandex.Metrica to work in real time. CollapsingMergeTree accepts an additional parameter - the name of an Int8-type column that contains the row's "sign". Example: -```sql +``` sql CollapsingMergeTree(EventDate, (CounterID, EventDate, intHash32(UniqID), VisitID), 8192, Sign) ``` diff --git a/docs/en/operations/table_engines/custom_partitioning_key.md b/docs/en/operations/table_engines/custom_partitioning_key.md index ef4ca2a2ee1..55940db8ca9 100644 --- a/docs/en/operations/table_engines/custom_partitioning_key.md +++ b/docs/en/operations/table_engines/custom_partitioning_key.md @@ -12,7 +12,7 @@ ENGINE [=] Name(...) [PARTITION BY expr] [ORDER BY expr] [SAMPLE BY expr] [SETTI For MergeTree tables, the partition expression is specified after `PARTITION BY`, the primary key after `ORDER BY`, the sampling key after `SAMPLE BY`, and `SETTINGS` can specify `index_granularity` (optional; the default value is 8192), as well as other settings from [MergeTreeSettings.h](https://github.com/yandex/ClickHouse/blob/master/dbms/src/Storages/MergeTree/MergeTreeSettings.h). The other engine parameters are specified in parentheses after the engine name, as previously. Example: -```sql +``` sql ENGINE = ReplicatedCollapsingMergeTree('/clickhouse/tables/name', 'replica1', Sign) PARTITION BY (toMonday(StartDate), EventType) ORDER BY (CounterID, StartDate, intHash32(UserID)) @@ -27,7 +27,7 @@ After this table is created, merge will only work for data parts that have the s To specify a partition in ALTER PARTITION commands, specify the value of the partition expression (or a tuple). Constants and constant expressions are supported. Example: -```sql +``` sql ALTER TABLE table DROP PARTITION (toMonday(today()), 1) ``` diff --git a/docs/en/operations/table_engines/dictionary.md b/docs/en/operations/table_engines/dictionary.md index e1f16670b04..eed7f7afaf4 100644 --- a/docs/en/operations/table_engines/dictionary.md +++ b/docs/en/operations/table_engines/dictionary.md @@ -39,7 +39,7 @@ As an example, consider a dictionary of `products` with the following configurat Query the dictionary data: -```sql +``` sql select name, type, key, attribute.names, attribute.types, bytes_allocated, element_count,source from system.dictionaries where name = 'products'; SELECT @@ -73,7 +73,7 @@ CREATE TABLE %table_name% (%fields%) engine = Dictionary(%dictionary_name%)` Usage example: -```sql +``` sql create table products (product_id UInt64, title String) Engine = Dictionary(products); CREATE TABLE products @@ -92,7 +92,7 @@ Ok. Take a look at what's in the table. -```sql +``` sql select * from products limit 1; SELECT * diff --git a/docs/en/operations/table_engines/file.md b/docs/en/operations/table_engines/file.md index 4fc5e1fa865..ed49a693630 100644 --- a/docs/en/operations/table_engines/file.md +++ b/docs/en/operations/table_engines/file.md @@ -31,7 +31,7 @@ You may manually create this subfolder and file in server filesystem and then [A **1.** Set up the `file_engine_table` table: -```sql +``` sql CREATE TABLE file_engine_table (name String, value UInt32) ENGINE=File(TabSeparated) ``` @@ -47,7 +47,7 @@ two 2 **3.** Query the data: -```sql +``` sql SELECT * FROM file_engine_table ``` diff --git a/docs/en/operations/table_engines/kafka.md b/docs/en/operations/table_engines/kafka.md index aa8626f6389..3ee70146409 100644 --- a/docs/en/operations/table_engines/kafka.md +++ b/docs/en/operations/table_engines/kafka.md @@ -44,7 +44,7 @@ Optional parameters: Examples: -```sql +``` sql CREATE TABLE queue ( timestamp UInt64, level String, @@ -86,7 +86,7 @@ When the `MATERIALIZED VIEW` joins the engine, it starts collecting data in the Example: -```sql +``` sql CREATE TABLE queue ( timestamp UInt64, level String, diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index 297779de03a..35cb660f56d 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -156,7 +156,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa In this case, in queries: -```sql +``` sql SELECT count() FROM table WHERE EventDate = toDate(now()) AND CounterID = 34 SELECT count() FROM table WHERE EventDate = toDate(now()) AND (CounterID = 34 OR CounterID = 42) SELECT count() FROM table WHERE ((EventDate >= toDate('2014-01-01') AND EventDate <= toDate('2014-01-31')) OR EventDate = toDate('2014-05-01')) AND CounterID IN (101500, 731962, 160656) AND (CounterID = 101500 OR EventDate != toDate('2014-05-01')) @@ -168,7 +168,7 @@ The queries above show that the index is used even for complex expressions. Read In the example below, the index can't be used. -```sql +``` sql SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%' ``` diff --git a/docs/en/operations/table_engines/replacingmergetree.md b/docs/en/operations/table_engines/replacingmergetree.md index b2b7890670c..482f49982d0 100644 --- a/docs/en/operations/table_engines/replacingmergetree.md +++ b/docs/en/operations/table_engines/replacingmergetree.md @@ -6,7 +6,7 @@ The last optional parameter for the table engine is the version column. When mer The version column must have a type from the `UInt` family, `Date`, or `DateTime`. -```sql +``` sql ReplacingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, ver) ``` diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index 7fb73d24ee1..82df821804a 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -4,13 +4,13 @@ This engine differs from `MergeTree` in that it totals data while merging. -```sql +``` sql SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192) ``` The columns to total are implicit. When merging, all rows with the same primary key value (in the example, OrderId, EventDate, BannerID, ...) have their values totaled in numeric columns that are not part of the primary key. -```sql +``` sql SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, (Shows, Clicks, Cost, ...)) ``` diff --git a/docs/en/operations/table_engines/url.md b/docs/en/operations/table_engines/url.md index 7beae9a666c..54d742e409a 100644 --- a/docs/en/operations/table_engines/url.md +++ b/docs/en/operations/table_engines/url.md @@ -23,7 +23,7 @@ respectively. For processing `POST` requests, the remote server must support **1.** Create a `url_engine_table` table on the server : -```sql +``` sql CREATE TABLE url_engine_table (word String, value UInt64) ENGINE=URL('http://127.0.0.1:12345/', CSV) ``` @@ -53,7 +53,7 @@ python3 server.py **3.** Request data: -```sql +``` sql SELECT * FROM url_engine_table ``` diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md index 5836d20f6c6..fd0bb213933 100644 --- a/docs/en/query_language/agg_functions/reference.md +++ b/docs/en/query_language/agg_functions/reference.md @@ -35,7 +35,7 @@ anyHeavy(column) Take the [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) data set and select any frequently occurring value in the `AirlineID` column. -```sql +``` sql SELECT anyHeavy(AirlineID) AS res FROM ontime ``` @@ -101,7 +101,7 @@ Returns a tuple of two arrays: keys in sorted order, and values ​​summed for Example: -```sql +``` sql CREATE TABLE sum_map( date Date, timeslot DateTime, @@ -325,7 +325,7 @@ We recommend using the `N < 10 ` value; performance is reduced with large `N` va Take the [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) data set and select the three most frequently occurring values in the `AirlineID` column. -```sql +``` sql SELECT topK(3)(AirlineID) AS res FROM ontime ``` diff --git a/docs/en/query_language/alter.md b/docs/en/query_language/alter.md index a5428944329..cdc43271197 100644 --- a/docs/en/query_language/alter.md +++ b/docs/en/query_language/alter.md @@ -8,7 +8,7 @@ The `ALTER` query is only supported for `*MergeTree` tables, as well as `Merge`a Changing the table structure. -```sql +``` sql ALTER TABLE [db].name [ON CLUSTER cluster] ADD|DROP|MODIFY COLUMN ... ``` @@ -17,7 +17,7 @@ Each action is an operation on a column. The following actions are supported: -```sql +``` sql ADD COLUMN name [type] [default_expr] [AFTER name_after] ``` @@ -27,14 +27,14 @@ Adding a column just changes the table structure, without performing any actions This approach allows us to complete the ALTER query instantly, without increasing the volume of old data. -```sql +``` sql DROP COLUMN name ``` Deletes the column with the name 'name'. Deletes data from the file system. Since this deletes entire files, the query is completed almost instantly. -```sql +``` sql MODIFY COLUMN name [type] [default_expr] ``` @@ -86,7 +86,7 @@ A "part" in the table is part of the data from a single partition, sorted by the You can use the `system.parts` table to view the set of table parts and partitions: -```sql +``` sql SELECT * FROM system.parts WHERE active ``` @@ -123,7 +123,7 @@ For replicated tables, the set of parts can't be changed in any case. The `detached` directory contains parts that are not used by the server - detached from the table using the `ALTER ... DETACH` query. Parts that are damaged are also moved to this directory, instead of deleting them. You can add, delete, or modify the data in the 'detached' directory at any time – the server won't know about this until you make the `ALTER TABLE ... ATTACH` query. -```sql +``` sql ALTER TABLE [db.]table DETACH PARTITION 'name' ``` @@ -134,13 +134,13 @@ After the query is executed, you can do whatever you want with the data in the ' The query is replicated – data will be moved to the 'detached' directory and forgotten on all replicas. The query can only be sent to a leader replica. To find out if a replica is a leader, perform SELECT to the 'system.replicas' system table. Alternatively, it is easier to make a query on all replicas, and all except one will throw an exception. -```sql +``` sql ALTER TABLE [db.]table DROP PARTITION 'name' ``` The same as the `DETACH` operation. Deletes data from the table. Data parts will be tagged as inactive and will be completely deleted in approximately 10 minutes. The query is replicated – data will be deleted on all replicas. -```sql +``` sql ALTER TABLE [db.]table ATTACH PARTITION|PART 'name' ``` @@ -152,7 +152,7 @@ The query is replicated. Each replica checks whether there is data in the 'detac So you can put data in the 'detached' directory on one replica, and use the ALTER ... ATTACH query to add it to the table on all replicas. -```sql +``` sql ALTER TABLE [db.]table FREEZE PARTITION 'name' ``` @@ -196,7 +196,7 @@ For protection from device failures, you must use replication. For more informat Backups protect against human error (accidentally deleting data, deleting the wrong data or in the wrong cluster, or corrupting data). For high-volume databases, it can be difficult to copy backups to remote servers. In such cases, to protect from human error, you can keep a backup on the same server (it will reside in `/var/lib/clickhouse/shadow/`). -```sql +``` sql ALTER TABLE [db.]table FETCH PARTITION 'name' FROM 'path-in-zookeeper' ``` @@ -232,13 +232,13 @@ Existing tables are ready for mutations as-is (no conversion necessary), but aft Currently available commands: -```sql +``` sql ALTER TABLE [db.]table DELETE WHERE filter_expr ``` The `filter_expr` must be of type UInt8. The query deletes rows in the table for which this expression takes a non-zero value. -```sql +``` sql ALTER TABLE [db.]table UPDATE column1 = expr1 [, ...] WHERE filter_expr ``` diff --git a/docs/en/query_language/create.md b/docs/en/query_language/create.md index 6daed08ca11..4956955b30b 100644 --- a/docs/en/query_language/create.md +++ b/docs/en/query_language/create.md @@ -2,7 +2,7 @@ Creating db_name databases -```sql +``` sql CREATE DATABASE [IF NOT EXISTS] db_name ``` @@ -15,7 +15,7 @@ If `IF NOT EXISTS` is included, the query won't return an error if the database The `CREATE TABLE` query can have several forms. -```sql +``` sql CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ( name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1], @@ -30,13 +30,13 @@ The structure of the table is a list of column descriptions. If indexes are supp A column description is `name type` in the simplest case. Example: `RegionID UInt32`. Expressions can also be defined for default values (see below). -```sql +``` sql CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name AS [db2.]name2 [ENGINE = engine] ``` Creates a table with the same structure as another table. You can specify a different engine for the table. If the engine is not specified, the same engine will be used as for the `db2.name2` table. -```sql +``` sql CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name ENGINE = engine AS SELECT ... ``` @@ -97,7 +97,7 @@ Distributed DDL queries (ON CLUSTER clause) The `CREATE`, `DROP`, `ALTER`, and `RENAME` queries support distributed execution on a cluster. For example, the following query creates the `all_hits` `Distributed` table on each host in `cluster`: -```sql +``` sql CREATE TABLE IF NOT EXISTS all_hits ON CLUSTER cluster (p Date, i Int32) ENGINE = Distributed(cluster, default, hits) ``` @@ -107,7 +107,7 @@ The local version of the query will eventually be implemented on each host in th ## CREATE VIEW -```sql +``` sql CREATE [MATERIALIZED] VIEW [IF NOT EXISTS] [db.]name [TO[db.]name] [ENGINE = engine] [POPULATE] AS SELECT ... ``` @@ -121,19 +121,19 @@ Normal views don't store any data, but just perform a read from another table. I As an example, assume you've created a view: -```sql +``` sql CREATE VIEW view AS SELECT ... ``` and written a query: -```sql +``` sql SELECT a, b, c FROM view ``` This query is fully equivalent to using the subquery: -```sql +``` sql SELECT a, b, c FROM (SELECT ...) ``` diff --git a/docs/en/query_language/functions/arithmetic_functions.md b/docs/en/query_language/functions/arithmetic_functions.md index 2efdcf3ba6b..7420fbe532f 100644 --- a/docs/en/query_language/functions/arithmetic_functions.md +++ b/docs/en/query_language/functions/arithmetic_functions.md @@ -4,7 +4,7 @@ For all arithmetic functions, the result type is calculated as the smallest numb Example: -```sql +``` sql SELECT toTypeName(0), toTypeName(0 + 0), toTypeName(0 + 0 + 0), toTypeName(0 + 0 + 0 + 0) ``` diff --git a/docs/en/query_language/functions/array_functions.md b/docs/en/query_language/functions/array_functions.md index d45c1c34d96..afb4f5f1e6e 100644 --- a/docs/en/query_language/functions/array_functions.md +++ b/docs/en/query_language/functions/array_functions.md @@ -59,7 +59,7 @@ arrayConcat(arrays) **Example** -```sql +``` sql SELECT arrayConcat([1, 2], [3, 4], [5, 6]) AS res ``` @@ -132,7 +132,7 @@ Returns the array \[1, 2, 3, ..., length (arr) \] This function is normally used with ARRAY JOIN. It allows counting something just once for each array after applying ARRAY JOIN. Example: -```sql +``` sql SELECT count() AS Reaches, countIf(num = 1) AS Hits @@ -152,7 +152,7 @@ LIMIT 10 In this example, Reaches is the number of conversions (the strings received after applying ARRAY JOIN), and Hits is the number of pageviews (strings before ARRAY JOIN). In this particular case, you can get the same result in an easier way: -```sql +``` sql SELECT sum(length(GoalsReached)) AS Reaches, count() AS Hits @@ -176,7 +176,7 @@ For example: arrayEnumerateUniq(\[10, 20, 10, 30\]) = \[1, 1, 2, 1\]. This function is useful when using ARRAY JOIN and aggregation of array elements. Example: -```sql +``` sql SELECT Goals.ID AS GoalID, sum(Sign) AS Reaches, @@ -210,7 +210,7 @@ In this example, each goal ID has a calculation of the number of conversions (ea The arrayEnumerateUniq function can take multiple arrays of the same size as arguments. In this case, uniqueness is considered for tuples of elements in the same positions in all the arrays. -```sql +``` sql SELECT arrayEnumerateUniq([1, 1, 1, 2, 2, 2], [1, 1, 2, 1, 1, 2]) AS res ``` @@ -236,7 +236,7 @@ arrayPopBack(array) **Example** -```sql +``` sql SELECT arrayPopBack([1, 2, 3]) AS res ``` @@ -260,7 +260,7 @@ arrayPopFront(array) **Example** -```sql +``` sql SELECT arrayPopFront([1, 2, 3]) AS res ``` @@ -285,7 +285,7 @@ arrayPushBack(array, single_value) **Example** -```sql +``` sql SELECT arrayPushBack(['a'], 'b') AS res ``` @@ -310,7 +310,7 @@ arrayPushFront(array, single_value) **Example** -```sql +``` sql SELECT arrayPushBack(['b'], 'a') AS res ``` @@ -374,7 +374,7 @@ arraySlice(array, offset[, length]) **Example** -```sql +``` sql SELECT arraySlice([1, 2, NULL, 4, 5], 2, 3) AS res ``` diff --git a/docs/en/query_language/functions/array_join.md b/docs/en/query_language/functions/array_join.md index 1e9361f28cf..01b1d383e3f 100644 --- a/docs/en/query_language/functions/array_join.md +++ b/docs/en/query_language/functions/array_join.md @@ -17,7 +17,7 @@ Note the ARRAY JOIN syntax in the SELECT query, which provides broader possibili Example: -```sql +``` sql SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src ``` diff --git a/docs/en/query_language/functions/date_time_functions.md b/docs/en/query_language/functions/date_time_functions.md index 399afd602e5..82821474431 100644 --- a/docs/en/query_language/functions/date_time_functions.md +++ b/docs/en/query_language/functions/date_time_functions.md @@ -4,7 +4,7 @@ Support for time zones All functions for working with the date and time that have a logical use for the time zone can accept a second optional time zone argument. Example: Asia/Yekaterinburg. In this case, they use the specified time zone instead of the local (default) one. -```sql +``` sql SELECT toDateTime('2016-06-15 23:00:00') AS time, toDate(time) AS date_local, diff --git a/docs/en/query_language/functions/geo.md b/docs/en/query_language/functions/geo.md index e66a9030c31..05725b95aed 100644 --- a/docs/en/query_language/functions/geo.md +++ b/docs/en/query_language/functions/geo.md @@ -25,7 +25,7 @@ Generates an exception when the input parameter values fall outside of the range **Example** -```sql +``` sql SELECT greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673) ``` @@ -58,7 +58,7 @@ The input parameters must be `2+4⋅n`, where `n` is the number of ellipses. **Example** -```sql +``` sql SELECT pointInEllipses(55.755831, 37.617673, 55.755831, 37.617673, 1.0, 2.0) ``` @@ -89,7 +89,7 @@ If the point is on the polygon boundary, the function may return either 0 or 1. **Example** -```sql +``` sql SELECT pointInPolygon((3., 3.), [(6, 0), (8, 4), (5, 8), (0, 2)]) AS res ``` diff --git a/docs/en/query_language/functions/higher_order_functions.md b/docs/en/query_language/functions/higher_order_functions.md index fa135adeb20..b00896cb4ab 100644 --- a/docs/en/query_language/functions/higher_order_functions.md +++ b/docs/en/query_language/functions/higher_order_functions.md @@ -22,7 +22,7 @@ Returns an array containing only the elements in 'arr1' for which 'func' returns Examples: -```sql +``` sql SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res ``` @@ -32,7 +32,7 @@ SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res └───────────────┘ ``` -```sql +``` sql SELECT arrayFilter( (i, x) -> x LIKE '%World%', @@ -77,7 +77,7 @@ Returns an array of partial sums of elements in the source array (a running sum) Example: -```sql +``` sql SELECT arrayCumSum([1, 1, 1, 1]) AS res ``` @@ -95,7 +95,7 @@ The [Schwartzian transform](https://en.wikipedia.org/wiki/Schwartzian_transform) Example: -```sql +``` sql SELECT arraySort((x, y) -> y, ['hello', 'world'], [2, 1]); ``` diff --git a/docs/en/query_language/functions/ip_address_functions.md b/docs/en/query_language/functions/ip_address_functions.md index 31dbb7b4a6c..27e1290c63c 100644 --- a/docs/en/query_language/functions/ip_address_functions.md +++ b/docs/en/query_language/functions/ip_address_functions.md @@ -14,7 +14,7 @@ Similar to IPv4NumToString, but using xxx instead of the last octet. Example: -```sql +``` sql SELECT IPv4NumToStringClassC(ClientIP) AS k, count() AS c @@ -46,7 +46,7 @@ Since using 'xxx' is highly unusual, this may be changed in the future. We recom Accepts a FixedString(16) value containing the IPv6 address in binary format. Returns a string containing this address in text format. IPv6-mapped IPv4 addresses are output in the format ::ffff:111.222.33.44. Examples: -```sql +``` sql SELECT IPv6NumToString(toFixedString(unhex('2A0206B8000000000000000000000011'), 16)) AS addr ``` @@ -56,7 +56,7 @@ SELECT IPv6NumToString(toFixedString(unhex('2A0206B8000000000000000000000011'), └──────────────┘ ``` -```sql +``` sql SELECT IPv6NumToString(ClientIP6 AS k), count() AS c @@ -82,7 +82,7 @@ LIMIT 10 └─────────────────────────────────────────┴───────┘ ``` -```sql +``` sql SELECT IPv6NumToString(ClientIP6 AS k), count() AS c diff --git a/docs/en/query_language/functions/math_functions.md b/docs/en/query_language/functions/math_functions.md index 47ef47e8c00..af4c9a30129 100644 --- a/docs/en/query_language/functions/math_functions.md +++ b/docs/en/query_language/functions/math_functions.md @@ -48,7 +48,7 @@ If 'x' is non-negative, then erf(x / σ√2) is the probability that a random Example (three sigma rule): -```sql +``` sql SELECT erf(3 / sqrt(2)) ``` diff --git a/docs/en/query_language/functions/other_functions.md b/docs/en/query_language/functions/other_functions.md index f20f781b40a..a8090fc30d4 100644 --- a/docs/en/query_language/functions/other_functions.md +++ b/docs/en/query_language/functions/other_functions.md @@ -83,7 +83,7 @@ The band is drawn with accuracy to one eighth of a symbol. Example: -```sql +``` sql SELECT toHour(EventTime) AS h, count() AS c, @@ -153,7 +153,7 @@ If the 'x' value is equal to one of the elements in the 'array_from' array, it r Example: -```sql +``` sql SELECT transform(SearchEngineID, [2, 3], ['Yandex', 'Google'], 'Other') AS title, count() AS c @@ -182,7 +182,7 @@ Types: Example: -```sql +``` sql SELECT transform(domain(Referer), ['yandex.ru', 'google.ru', 'vk.com'], ['www.yandex', 'example.com']) AS s, count() AS c @@ -212,7 +212,7 @@ Accepts the size (number of bytes). Returns a rounded size with a suffix (KiB, M Example: -```sql +``` sql SELECT arrayJoin([1, 1024, 1024*1024, 192851925]) AS filesize_bytes, formatReadableSize(filesize_bytes) AS filesize @@ -257,7 +257,7 @@ If you make a subquery with ORDER BY and call the function from outside the subq Example: -```sql +``` sql SELECT EventID, EventTime, diff --git a/docs/en/query_language/functions/rounding_functions.md b/docs/en/query_language/functions/rounding_functions.md index 75a94415197..17407aee852 100644 --- a/docs/en/query_language/functions/rounding_functions.md +++ b/docs/en/query_language/functions/rounding_functions.md @@ -31,7 +31,7 @@ The rounded number of the same type as the input number `x` **Example:** -```sql +``` sql SELECT number / 2 AS x, round(x) diff --git a/docs/en/query_language/functions/string_replace_functions.md b/docs/en/query_language/functions/string_replace_functions.md index c76a6976cda..400e4a7eff6 100644 --- a/docs/en/query_language/functions/string_replace_functions.md +++ b/docs/en/query_language/functions/string_replace_functions.md @@ -19,7 +19,7 @@ Also keep in mind that a string literal requires an extra escape. Example 1. Converting the date to American format: -```sql +``` sql SELECT DISTINCT EventDate, replaceRegexpOne(toString(EventDate), '(\\d{4})-(\\d{2})-(\\d{2})', '\\2/\\3/\\1') AS res @@ -40,7 +40,7 @@ FORMAT TabSeparated Example 2. Copying a string ten times: -```sql +``` sql SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') AS res ``` @@ -54,7 +54,7 @@ SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') This does the same thing, but replaces all the occurrences. Example: -```sql +``` sql SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res ``` @@ -67,7 +67,7 @@ SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res As an exception, if a regular expression worked on an empty substring, the replacement is not made more than once. Example: -```sql +``` sql SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res ``` diff --git a/docs/en/query_language/functions/type_conversion_functions.md b/docs/en/query_language/functions/type_conversion_functions.md index 91fe456e776..c4b4099d7e6 100644 --- a/docs/en/query_language/functions/type_conversion_functions.md +++ b/docs/en/query_language/functions/type_conversion_functions.md @@ -37,7 +37,7 @@ Conversion between numeric types uses the same rules as assignments between diff Additionally, the toString function of the DateTime argument can take a second String argument containing the name of the time zone. Example: `Asia/Yekaterinburg` In this case, the time is formatted according to the specified time zone. -```sql +``` sql SELECT now() AS now_local, toString(now(), 'Asia/Yekaterinburg') AS now_yekat @@ -62,7 +62,7 @@ Accepts a String or FixedString argument. Returns the String with the content tr Example: -```sql +``` sql SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut ``` @@ -72,7 +72,7 @@ SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut └───────────────┴───────┘ ``` -```sql +``` sql SELECT toFixedString('foo\0bar', 8) AS s, toStringCutToZero(s) AS s_cut ``` @@ -102,7 +102,7 @@ Converts 'x' to the 't' data type. The syntax CAST(x AS t) is also supported. Example: -```sql +``` sql SELECT '2016-06-15 23:00:00' AS timestamp, CAST(timestamp AS DateTime) AS datetime, diff --git a/docs/en/query_language/functions/url_functions.md b/docs/en/query_language/functions/url_functions.md index 9269d4d5b69..efe48970338 100644 --- a/docs/en/query_language/functions/url_functions.md +++ b/docs/en/query_language/functions/url_functions.md @@ -85,7 +85,7 @@ URLPathHierarchy('https://example.com/browse/CONV-6788') = Returns the decoded URL. Example: -```sql +``` sql SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS DecodedURL; ``` diff --git a/docs/en/query_language/functions/ym_dict_functions.md b/docs/en/query_language/functions/ym_dict_functions.md index 065ef7403dc..8039c77edea 100644 --- a/docs/en/query_language/functions/ym_dict_functions.md +++ b/docs/en/query_language/functions/ym_dict_functions.md @@ -34,7 +34,7 @@ Accepts a UInt32 number – the region ID from the Yandex geobase. If this regio Converts a region to an area (type 5 in the geobase). In every other way, this function is the same as 'regionToCity'. -```sql +``` sql SELECT DISTINCT regionToName(regionToArea(toUInt32(number), 'ua')) FROM system.numbers LIMIT 15 @@ -64,7 +64,7 @@ LIMIT 15 Converts a region to a federal district (type 4 in the geobase). In every other way, this function is the same as 'regionToCity'. -```sql +``` sql SELECT DISTINCT regionToName(regionToDistrict(toUInt32(number), 'ua')) FROM system.numbers LIMIT 15 diff --git a/docs/en/query_language/insert_into.md b/docs/en/query_language/insert_into.md index 5019af5fff4..d34e306777b 100644 --- a/docs/en/query_language/insert_into.md +++ b/docs/en/query_language/insert_into.md @@ -6,7 +6,7 @@ Adding data. Basic query format: -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] VALUES (v11, v12, v13), (v21, v22, v23), ... ``` @@ -19,13 +19,13 @@ If [strict_insert_defaults=1](../operations/settings/settings.md#settings-strict Data can be passed to the INSERT in any [format](../interfaces/formats.md#formats) supported by ClickHouse. The format must be specified explicitly in the query: -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] FORMAT format_name data_set ``` For example, the following query format is identical to the basic version of INSERT ... VALUES: -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] FORMAT Values (v11, v12, v13), (v21, v22, v23), ... ``` @@ -33,7 +33,7 @@ ClickHouse removes all spaces and one line feed (if there is one) before the dat Example: -```sql +``` sql INSERT INTO t FORMAT TabSeparated 11 Hello, world! 22 Qwerty @@ -43,7 +43,7 @@ You can insert data separately from the query by using the command-line client o ### Inserting The Results of `SELECT` -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] SELECT ... ``` diff --git a/docs/en/query_language/misc.md b/docs/en/query_language/misc.md index 7c580248496..e81deca4b49 100644 --- a/docs/en/query_language/misc.md +++ b/docs/en/query_language/misc.md @@ -10,7 +10,7 @@ After executing an ATTACH query, the server will know about the existence of the If the table was previously detached (``DETACH``), meaning that its structure is known, you can use shorthand without defining the structure. -```sql +``` sql ATTACH TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ``` @@ -20,14 +20,14 @@ This query is used when starting the server. The server stores table metadata as This query has two types: `DROP DATABASE` and `DROP TABLE`. -```sql +``` sql DROP DATABASE [IF EXISTS] db [ON CLUSTER cluster] ``` Deletes all tables inside the 'db' database, then deletes the 'db' database itself. If `IF EXISTS` is specified, it doesn't return an error if the database doesn't exist. -```sql +``` sql DROP [TEMPORARY] TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ``` @@ -38,7 +38,7 @@ If `IF EXISTS` is specified, it doesn't return an error if the table doesn't exi Deletes information about the 'name' table from the server. The server stops knowing about the table's existence. -```sql +``` sql DETACH TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ``` @@ -51,7 +51,7 @@ There is no `DETACH DATABASE` query. Renames one or more tables. -```sql +``` sql RENAME TABLE [db11.]name11 TO [db12.]name12, [db21.]name21 TO [db22.]name22, ... [ON CLUSTER cluster] ``` @@ -59,7 +59,7 @@ All tables are renamed under global locking. Renaming tables is a light operatio ## SHOW DATABASES -```sql +``` sql SHOW DATABASES [INTO OUTFILE filename] [FORMAT format] ``` @@ -70,7 +70,7 @@ See also the section "Formats". ## SHOW TABLES -```sql +``` sql SHOW [TEMPORARY] TABLES [FROM db] [LIKE 'pattern'] [INTO OUTFILE filename] [FORMAT format] ``` @@ -85,7 +85,7 @@ See also the section "LIKE operator". ## SHOW PROCESSLIST -```sql +``` sql SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format] ``` @@ -117,7 +117,7 @@ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'" ## SHOW CREATE TABLE -```sql +``` sql SHOW CREATE [TEMPORARY] TABLE [db.]table [INTO OUTFILE filename] [FORMAT format] ``` @@ -125,7 +125,7 @@ Returns a single `String`-type 'statement' column, which contains a single value ## DESCRIBE TABLE -```sql +``` sql DESC|DESCRIBE TABLE [db.]table [INTO OUTFILE filename] [FORMAT format] ``` @@ -135,7 +135,7 @@ Nested data structures are output in "expanded" format. Each column is shown sep ## EXISTS -```sql +``` sql EXISTS [TEMPORARY] TABLE [db.]name [INTO OUTFILE filename] [FORMAT format] ``` @@ -143,7 +143,7 @@ Returns a single `UInt8`-type column, which contains the single value `0` if the ## USE -```sql +``` sql USE db ``` @@ -153,7 +153,7 @@ This query can't be made when using the HTTP protocol, since there is no concept ## SET -```sql +``` sql SET param = value ``` @@ -166,7 +166,7 @@ To make settings that persist after a server restart, you can only use the serve ## OPTIMIZE -```sql +``` sql OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition] [FINAL] ``` @@ -180,7 +180,7 @@ If you specify `FINAL`, optimization will be performed even when all the data is ## KILL QUERY -```sql +``` sql KILL QUERY [ON CLUSTER cluster] WHERE [SYNC|ASYNC|TEST] @@ -192,7 +192,7 @@ The queries to terminate are selected from the system.processes table using the Examples: -```sql +``` sql -- Forcibly terminates all queries with the specified query_id: KILL QUERY WHERE query_id='2-857d-4a57-9ee0-327da5d60a90' diff --git a/docs/en/query_language/operators.md b/docs/en/query_language/operators.md index 08aee7296b1..613dc50a58b 100644 --- a/docs/en/query_language/operators.md +++ b/docs/en/query_language/operators.md @@ -87,7 +87,7 @@ The conditional operator calculates the values of b and c, then checks whether c ## Conditional Expression -```sql +``` sql CASE [x] WHEN a THEN b [WHEN ... THEN ...] diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index 00cf96a1a64..53164e67d80 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -2,7 +2,7 @@ `SELECT` performs data retrieval. -```sql +``` sql SELECT [DISTINCT] expr_list [FROM [db.]table | (subquery) | table_function] [FINAL] [SAMPLE sample_coeff] @@ -55,7 +55,7 @@ In the second case, the query will be executed on a sample of no more than 'n' r Example: -```sql +``` sql SELECT Title, count() * 10 AS PageViews @@ -336,7 +336,7 @@ The corresponding conversion can be performed before the WHERE/PREWHERE clause ( The normal JOIN, which is not related to ARRAY JOIN described above. -```sql +``` sql [GLOBAL] ANY|ALL INNER|LEFT [OUTER] JOIN (subquery)|table USING columns_list ``` @@ -371,7 +371,7 @@ When running a JOIN, there is no optimization of the order of execution in relat Example: -```sql +``` sql SELECT CounterID, hits, @@ -469,7 +469,7 @@ If a query contains only table columns inside aggregate functions, the GROUP BY Example: -```sql +``` sql SELECT count(), median(FetchTiming > 60 ? 60 : FetchTiming), @@ -483,7 +483,7 @@ As opposed to MySQL (and conforming to standard SQL), you can't get some value o Example: -```sql +``` sql SELECT domainWithoutWWW(URL) AS domain, count(), @@ -579,7 +579,7 @@ LIMIT N BY COLUMNS selects the top N rows for each group of COLUMNS. LIMIT N BY Example: -```sql +``` sql SELECT domainWithoutWWW(URL) AS domain, domainWithoutWWW(REFERRER_URL) AS referrer, @@ -698,7 +698,7 @@ If there isn't an ORDER BY clause that explicitly sorts results, the result may You can use UNION ALL to combine any number of queries. Example: -```sql +``` sql SELECT CounterID, 1 AS table, toInt64(count()) AS c FROM test.hits GROUP BY CounterID @@ -746,7 +746,7 @@ The left side of the operator is either a single column or a tuple. Examples: -```sql +``` sql SELECT UserID IN (123, 456) FROM ... SELECT (CounterID, UserID) IN ((34, 123), (101500, 456)) FROM ... ``` @@ -764,7 +764,7 @@ If the right side of the operator is a table name that has the Set engine (a pre The subquery may specify more than one column for filtering tuples. Example: -```sql +``` sql SELECT (CounterID, UserID) IN (SELECT CounterID, UserID FROM ...) FROM ... ``` @@ -773,7 +773,7 @@ The columns to the left and right of the IN operator should have the same type. The IN operator and subquery may occur in any part of the query, including in aggregate functions and lambda functions. Example: -```sql +``` sql SELECT EventDate, avg(UserID IN @@ -858,13 +858,13 @@ For a query to the **distributed_table**, the query will be sent to all the remo For example, the query -```sql +``` sql SELECT uniq(UserID) FROM distributed_table ``` will be sent to all remote servers as -```sql +``` sql SELECT uniq(UserID) FROM local_table ``` @@ -872,7 +872,7 @@ and run on each of them in parallel, until it reaches the stage where intermedia Now let's examine a query with IN: -```sql +``` sql SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM local_table WHERE CounterID = 34) ``` @@ -880,7 +880,7 @@ SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID I This query will be sent to all remote servers as -```sql +``` sql SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM local_table WHERE CounterID = 34) ``` @@ -890,19 +890,19 @@ This will work correctly and optimally if you are prepared for this case and hav To correct how the query works when data is spread randomly across the cluster servers, you could specify **distributed_table** inside a subquery. The query would look like this: -```sql +``` sql SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM distributed_table WHERE CounterID = 34) ``` This query will be sent to all remote servers as -```sql +``` sql SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM distributed_table WHERE CounterID = 34) ``` The subquery will begin running on each remote server. Since the subquery uses a distributed table, the subquery that is on each remote server will be resent to every remote server as -```sql +``` sql SELECT UserID FROM local_table WHERE CounterID = 34 ``` @@ -910,19 +910,19 @@ For example, if you have a cluster of 100 servers, executing the entire query wi In such cases, you should always use GLOBAL IN instead of IN. Let's look at how it works for the query -```sql +``` sql SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID GLOBAL IN (SELECT UserID FROM distributed_table WHERE CounterID = 34) ``` The requestor server will run the subquery -```sql +``` sql SELECT UserID FROM distributed_table WHERE CounterID = 34 ``` and the result will be put in a temporary table in RAM. Then the request will be sent to each remote server as -```sql +``` sql SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID GLOBAL IN _data1 ``` diff --git a/docs/en/query_language/syntax.md b/docs/en/query_language/syntax.md index d40dd58442d..548a4771a40 100644 --- a/docs/en/query_language/syntax.md +++ b/docs/en/query_language/syntax.md @@ -4,7 +4,7 @@ There are two types of parsers in the system: the full SQL parser (a recursive d In all cases except the INSERT query, only the full SQL parser is used. The INSERT query uses both parsers: -```sql +``` sql INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def') ``` @@ -103,7 +103,7 @@ Data types and table engines in the `CREATE` query are written the same way as i In the SELECT query, expressions can specify synonyms using the AS keyword. Any expression is placed to the left of AS. The identifier name for the synonym is placed to the right of AS. As opposed to standard SQL, synonyms are not only declared on the top level of expressions: -```sql +``` sql SELECT (1 AS n) + 2, n ``` diff --git a/docs/en/query_language/table_functions/file.md b/docs/en/query_language/table_functions/file.md index 85aef565546..8d1c336b049 100644 --- a/docs/en/query_language/table_functions/file.md +++ b/docs/en/query_language/table_functions/file.md @@ -12,7 +12,7 @@ structure - table structure in 'UserID UInt64, URL String' format. Determines c **Example** -```sql +``` sql -- getting the first 10 lines of a table that contains 3 columns of UInt32 type from a CSV file SELECT * FROM file('test.csv', 'CSV', 'column1 UInt32, column2 UInt32, column3 UInt32') LIMIT 10 ``` diff --git a/docs/en/query_language/table_functions/jdbc.md b/docs/en/query_language/table_functions/jdbc.md index 1ea6e1e3cd7..240e12551d8 100644 --- a/docs/en/query_language/table_functions/jdbc.md +++ b/docs/en/query_language/table_functions/jdbc.md @@ -10,15 +10,15 @@ It supports Nullable types (based on DDL of remote table that is queried). **Examples** -```sql +``` sql SELECT * FROM jdbc('jdbc:mysql://localhost:3306/?user=root&password=root', 'schema', 'table') ``` -```sql +``` sql SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', 'table') ``` -```sql +``` sql SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table') ``` diff --git a/docs/en/query_language/table_functions/numbers.md b/docs/en/query_language/table_functions/numbers.md index f3f64cf6399..e8b025d922e 100644 --- a/docs/en/query_language/table_functions/numbers.md +++ b/docs/en/query_language/table_functions/numbers.md @@ -7,7 +7,7 @@ Similar to the `system.numbers` table, it can be used for testing and generating The following queries are equivalent: -```sql +``` sql SELECT * FROM numbers(10); SELECT * FROM numbers(0, 10); SELECT * FROM system.numbers LIMIT 10; @@ -15,7 +15,7 @@ SELECT * FROM system.numbers LIMIT 10; Examples: -```sql +``` sql -- Generate a sequence of dates from 2010-01-01 to 2010-12-31 select toDate('2010-01-01') + number as d FROM numbers(365); ``` diff --git a/docs/en/query_language/table_functions/remote.md b/docs/en/query_language/table_functions/remote.md index 7c1431b6f60..834dbf30be7 100644 --- a/docs/en/query_language/table_functions/remote.md +++ b/docs/en/query_language/table_functions/remote.md @@ -6,7 +6,7 @@ Allows you to access remote servers without creating a `Distributed` table. Signatures: -```sql +``` sql remote('addresses_expr', db, table[, 'user'[, 'password']]) remote('addresses_expr', db.table[, 'user'[, 'password']]) ``` diff --git a/docs/en/query_language/table_functions/url.md b/docs/en/query_language/table_functions/url.md index 8f6b9619140..4e012cff01f 100644 --- a/docs/en/query_language/table_functions/url.md +++ b/docs/en/query_language/table_functions/url.md @@ -13,7 +13,7 @@ structure - table structure in `'UserID UInt64, Name String'` format. Determines **Example** -```sql +``` sql -- getting the first 3 lines of a table that contains columns of String and UInt32 type from HTTP-server which answers in CSV format. SELECT * FROM url('http://127.0.0.1:12345/', CSV, 'column1 String, column2 UInt32') LIMIT 3 ``` diff --git a/docs/fa/data_types/float.md b/docs/fa/data_types/float.md index a61210e39fb..77a17d6eca7 100644 --- a/docs/fa/data_types/float.md +++ b/docs/fa/data_types/float.md @@ -17,7 +17,7 @@ Type های float در ClickHouse مشابه C می باشد: -```sql +``` sql SELECT 1 - 0.9 ``` ``` @@ -40,7 +40,7 @@ SELECT 1 - 0.9 -```sql +``` sql SELECT 0.5 / 0 ``` @@ -56,7 +56,7 @@ SELECT 0.5 / 0 -```sql +``` sql SELECT -0.5 / 0 ``` diff --git a/docs/fa/data_types/nested_data_structures/nested.md b/docs/fa/data_types/nested_data_structures/nested.md index 8c26aef62da..1f3b675eef1 100644 --- a/docs/fa/data_types/nested_data_structures/nested.md +++ b/docs/fa/data_types/nested_data_structures/nested.md @@ -8,7 +8,7 @@ -```sql +``` sql CREATE TABLE test.visits ( CounterID UInt32, @@ -43,7 +43,7 @@ CREATE TABLE test.visits -```sql +``` sql SELECT Goals.ID, Goals.EventTime @@ -75,7 +75,7 @@ LIMIT 10 -```sql +``` sql SELECT Goal.ID, Goal.EventTime diff --git a/docs/fa/getting_started/example_datasets/amplab_benchmark.md b/docs/fa/getting_started/example_datasets/amplab_benchmark.md index 04c22d39967..6ed6f97a344 100644 --- a/docs/fa/getting_started/example_datasets/amplab_benchmark.md +++ b/docs/fa/getting_started/example_datasets/amplab_benchmark.md @@ -29,7 +29,7 @@ cd .. -```sql +``` sql CREATE TABLE rankings_tiny ( pageURL String, @@ -112,7 +112,7 @@ query های گرفتن data sample -```sql +``` sql SELECT pageURL, pageRank FROM rankings_1node WHERE pageRank > 1000 SELECT substring(sourceIP, 1, 8), sum(adRevenue) FROM uservisits_1node GROUP BY substring(sourceIP, 1, 8) diff --git a/docs/fa/getting_started/example_datasets/criteo.md b/docs/fa/getting_started/example_datasets/criteo.md index 9e8cb4196d4..47013f7aaab 100644 --- a/docs/fa/getting_started/example_datasets/criteo.md +++ b/docs/fa/getting_started/example_datasets/criteo.md @@ -8,7 +8,7 @@ -```sql +``` sql CREATE TABLE criteo_log (date Date, clicked UInt8, int1 Int32, int2 Int32, int3 Int32, int4 Int32, int5 Int32, int6 Int32, int7 Int32, int8 Int32, int9 Int32, int10 Int32, int11 Int32, int12 Int32, int13 Int32, cat1 String, cat2 String, cat3 String, cat4 String, cat5 String, cat6 String, cat7 String, cat8 String, cat9 String, cat10 String, cat11 String, cat12 String, cat13 String, cat14 String, cat15 String, cat16 String, cat17 String, cat18 String, cat19 String, cat20 String, cat21 String, cat22 String, cat23 String, cat24 String, cat25 String, cat26 String) ENGINE = Log ``` @@ -28,7 +28,7 @@ for i in {00..23}; do echo $i; zcat datasets/criteo/day_${i#0}.gz | sed -r 's/^/ -```sql +``` sql CREATE TABLE criteo ( date Date, @@ -81,7 +81,7 @@ CREATE TABLE criteo -```sql +``` sql INSERT INTO criteo SELECT date, clicked, int1, int2, int3, int4, int5, int6, int7, int8, int9, int10, int11, int12, int13, reinterpretAsUInt32(unhex(cat1)) AS icat1, reinterpretAsUInt32(unhex(cat2)) AS icat2, reinterpretAsUInt32(unhex(cat3)) AS icat3, reinterpretAsUInt32(unhex(cat4)) AS icat4, reinterpretAsUInt32(unhex(cat5)) AS icat5, reinterpretAsUInt32(unhex(cat6)) AS icat6, reinterpretAsUInt32(unhex(cat7)) AS icat7, reinterpretAsUInt32(unhex(cat8)) AS icat8, reinterpretAsUInt32(unhex(cat9)) AS icat9, reinterpretAsUInt32(unhex(cat10)) AS icat10, reinterpretAsUInt32(unhex(cat11)) AS icat11, reinterpretAsUInt32(unhex(cat12)) AS icat12, reinterpretAsUInt32(unhex(cat13)) AS icat13, reinterpretAsUInt32(unhex(cat14)) AS icat14, reinterpretAsUInt32(unhex(cat15)) AS icat15, reinterpretAsUInt32(unhex(cat16)) AS icat16, reinterpretAsUInt32(unhex(cat17)) AS icat17, reinterpretAsUInt32(unhex(cat18)) AS icat18, reinterpretAsUInt32(unhex(cat19)) AS icat19, reinterpretAsUInt32(unhex(cat20)) AS icat20, reinterpretAsUInt32(unhex(cat21)) AS icat21, reinterpretAsUInt32(unhex(cat22)) AS icat22, reinterpretAsUInt32(unhex(cat23)) AS icat23, reinterpretAsUInt32(unhex(cat24)) AS icat24, reinterpretAsUInt32(unhex(cat25)) AS icat25, reinterpretAsUInt32(unhex(cat26)) AS icat26 FROM criteo_log; DROP TABLE criteo_log; diff --git a/docs/fa/getting_started/example_datasets/nyc_taxi.md b/docs/fa/getting_started/example_datasets/nyc_taxi.md index 9ec87bda02f..892b706e616 100644 --- a/docs/fa/getting_started/example_datasets/nyc_taxi.md +++ b/docs/fa/getting_started/example_datasets/nyc_taxi.md @@ -52,7 +52,7 @@ Export گیری داده ها از PostgreSQL: -```sql +``` sql COPY ( SELECT trips.id, @@ -130,7 +130,7 @@ snapshot از داده ها با سرعت 50 مگابایت در ثانیه ان -```sql +``` sql CREATE TABLE trips ( trip_id UInt32, @@ -305,7 +305,7 @@ WHERE (table = 'trips_mergetree') AND active Q1: -```sql +``` sql SELECT cab_type, count(*) FROM trips_mergetree GROUP BY cab_type ``` @@ -313,7 +313,7 @@ SELECT cab_type, count(*) FROM trips_mergetree GROUP BY cab_type Q2: -```sql +``` sql SELECT passenger_count, avg(total_amount) FROM trips_mergetree GROUP BY passenger_count ``` @@ -321,7 +321,7 @@ SELECT passenger_count, avg(total_amount) FROM trips_mergetree GROUP BY passenge Q3: -```sql +``` sql SELECT passenger_count, toYear(pickup_date) AS year, count(*) FROM trips_mergetree GROUP BY passenger_count, year ``` @@ -329,7 +329,7 @@ SELECT passenger_count, toYear(pickup_date) AS year, count(*) FROM trips_mergetr Q4: -```sql +``` sql SELECT passenger_count, toYear(pickup_date) AS year, round(trip_distance) AS distance, count(*) FROM trips_mergetree GROUP BY passenger_count, year, distance @@ -364,7 +364,7 @@ CREATE TABLE default.trips_mergetree_third ( trip_id UInt32, vendor_id Enum8('1 -```sql +``` sql CREATE TABLE trips_mergetree_x3 AS trips_mergetree_third ENGINE = Distributed(perftest, default, trips_mergetree_third, rand()) ``` @@ -374,7 +374,7 @@ query زیر دادها را توزیع مجدد می کند: -```sql +``` sql INSERT INTO trips_mergetree_x3 SELECT * FROM trips_mergetree ``` diff --git a/docs/fa/getting_started/example_datasets/ontime.md b/docs/fa/getting_started/example_datasets/ontime.md index 4acc22d6063..443e37ed9fe 100644 --- a/docs/fa/getting_started/example_datasets/ontime.md +++ b/docs/fa/getting_started/example_datasets/ontime.md @@ -26,7 +26,7 @@ done -```sql +``` sql CREATE TABLE `ontime` ( `Year` UInt16, `Quarter` UInt8, @@ -157,7 +157,7 @@ Q0. -```sql +``` sql select avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month); ``` @@ -167,7 +167,7 @@ Q1. تعداد پروازهای به تفکیک روز از تاریخ 2000 تا -```sql +``` sql SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC; ``` @@ -177,7 +177,7 @@ Q2. تعداد پروازهای بیش از 10 دقیقه تاخیر خورده -```sql +``` sql SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC ``` @@ -187,7 +187,7 @@ Q3. تعداد تاخیرها براساس airport از سال 2000 تا 2008 -```sql +``` sql SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10 ``` @@ -197,7 +197,7 @@ Q4. تعداد تاخیرها براساس carrier در سال 78 -```sql +``` sql SELECT Carrier, count(*) FROM ontime WHERE DepDelay>10 AND Year = 2007 GROUP BY Carrier ORDER BY count(*) DESC ``` @@ -207,7 +207,7 @@ Q5. درصد تاخیر ها براساس carrier در سال 2007 -```sql +``` sql SELECT Carrier, c, c2, c*1000/c2 as c3 FROM ( @@ -237,7 +237,7 @@ ORDER BY c3 DESC; -```sql +``` sql SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year = 2007 GROUP BY Carrier ORDER BY Carrier ``` @@ -247,7 +247,7 @@ Q6. مانند query قبلی اما برای طیف وسیعی از سال ها -```sql +``` sql SELECT Carrier, c, c2, c*1000/c2 as c3 FROM ( @@ -277,7 +277,7 @@ ORDER BY c3 DESC; -```sql +``` sql SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier ``` @@ -287,7 +287,7 @@ Q7. درصد تاخیر بیش از 10 دقیقه پروازها به تفکیک -```sql +``` sql SELECT Year, c1/c2 FROM ( @@ -315,7 +315,7 @@ ORDER BY Year -```sql +``` sql SELECT Year, avg(DepDelay > 10) FROM ontime GROUP BY Year ORDER BY Year ``` @@ -325,7 +325,7 @@ Q8. مقصدهای پرطرفدار براساس تعداد اتصال های م -```sql +``` sql SELECT DestCityName, uniqExact(OriginCityName) AS u FROM ontime WHERE Year >= 2000 and Year <= 2010 GROUP BY DestCityName ORDER BY u DESC LIMIT 10; ``` @@ -335,7 +335,7 @@ Q9. -```sql +``` sql select Year, count(*) as c1 from ontime group by Year; ``` @@ -345,7 +345,7 @@ Q10. -```sql +``` sql select min(Year), max(Year), Carrier, count(*) as cnt, sum(ArrDelayMinutes>30) as flights_delayed, @@ -367,7 +367,7 @@ query های بیشتر: -```sql +``` sql SELECT avg(cnt) FROM (SELECT Year,Month,count(*) AS cnt FROM ontime WHERE DepDel15=1 GROUP BY Year,Month) select avg(c1) from (select Year,Month,count(*) as c1 from ontime group by Year,Month) diff --git a/docs/fa/getting_started/example_datasets/star_schema.md b/docs/fa/getting_started/example_datasets/star_schema.md index bc61cc9137c..90bf5246e5c 100644 --- a/docs/fa/getting_started/example_datasets/star_schema.md +++ b/docs/fa/getting_started/example_datasets/star_schema.md @@ -33,7 +33,7 @@ make -```sql +``` sql CREATE TABLE lineorder ( LO_ORDERKEY UInt32, LO_LINENUMBER UInt8, diff --git a/docs/fa/getting_started/example_datasets/wikistat.md b/docs/fa/getting_started/example_datasets/wikistat.md index 3cc9a28d586..c49fd4ae271 100644 --- a/docs/fa/getting_started/example_datasets/wikistat.md +++ b/docs/fa/getting_started/example_datasets/wikistat.md @@ -8,7 +8,7 @@ -```sql +``` sql CREATE TABLE wikistat ( date Date, diff --git a/docs/fa/interfaces/formats.md b/docs/fa/interfaces/formats.md index 15360369f04..197946df71d 100644 --- a/docs/fa/interfaces/formats.md +++ b/docs/fa/interfaces/formats.md @@ -74,7 +74,7 @@ world -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` @@ -176,7 +176,7 @@ clickhouse-client --format_csv_delimiter="|" --query="INSERT INTO test.csv FORMA -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase WITH TOTALS ORDER BY c DESC LIMIT 5 FORMAT JSON ``` @@ -350,7 +350,7 @@ JSON با جاوااسکریپت سازگار است. برای اطمینان ا -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` @@ -558,7 +558,7 @@ Cap'n Proto یک فرمت پیام باینری شبیه به Protocol Buffer و -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' ``` diff --git a/docs/ru/data_types/float.md b/docs/ru/data_types/float.md index 61e17521b4f..8f50419cf92 100644 --- a/docs/ru/data_types/float.md +++ b/docs/ru/data_types/float.md @@ -13,7 +13,7 @@ - При вычислениях с числами с плавающей запятой возможна ошибка округления. -```sql +``` sql SELECT 1 - 0.9 ``` ``` @@ -32,7 +32,7 @@ SELECT 1 - 0.9 - `Inf` - бесконечность. -```sql +``` sql SELECT 0.5 / 0 ``` @@ -44,7 +44,7 @@ SELECT 0.5 / 0 - `-Inf` - отрицательная бесконечность; -```sql +``` sql SELECT -0.5 / 0 ``` diff --git a/docs/ru/data_types/nested_data_structures/nested.md b/docs/ru/data_types/nested_data_structures/nested.md index 5846543bd6b..06a62801e6e 100644 --- a/docs/ru/data_types/nested_data_structures/nested.md +++ b/docs/ru/data_types/nested_data_structures/nested.md @@ -4,7 +4,7 @@ Пример: -```sql +``` sql CREATE TABLE test.visits ( CounterID UInt32, @@ -35,7 +35,7 @@ CREATE TABLE test.visits Пример: -```sql +``` sql SELECT Goals.ID, Goals.EventTime @@ -63,7 +63,7 @@ LIMIT 10 Единственное место, где в запросе SELECT можно указать имя целой вложенной структуры данных, а не отдельных столбцов - секция ARRAY JOIN. Подробнее см. раздел "Секция ARRAY JOIN". Пример: -```sql +``` sql SELECT Goal.ID, Goal.EventTime diff --git a/docs/ru/getting_started/example_datasets/amplab_benchmark.md b/docs/ru/getting_started/example_datasets/amplab_benchmark.md index e65d76ee5eb..87b8de2be43 100644 --- a/docs/ru/getting_started/example_datasets/amplab_benchmark.md +++ b/docs/ru/getting_started/example_datasets/amplab_benchmark.md @@ -22,7 +22,7 @@ cd .. Выполните следующие запросы к ClickHouse: -```sql +``` sql CREATE TABLE rankings_tiny ( pageURL String, @@ -97,7 +97,7 @@ for i in 5nodes/uservisits/*.deflate; do echo $i; zlib-flate -uncompress < $i | Запросы для получения выборок данных: -```sql +``` sql SELECT pageURL, pageRank FROM rankings_1node WHERE pageRank > 1000 SELECT substring(sourceIP, 1, 8), sum(adRevenue) FROM uservisits_1node GROUP BY substring(sourceIP, 1, 8) diff --git a/docs/ru/getting_started/example_datasets/criteo.md b/docs/ru/getting_started/example_datasets/criteo.md index 57074e11fb4..32fc8e234dc 100644 --- a/docs/ru/getting_started/example_datasets/criteo.md +++ b/docs/ru/getting_started/example_datasets/criteo.md @@ -4,7 +4,7 @@ Создайте таблицу для импорта лога: -```sql +``` sql CREATE TABLE criteo_log (date Date, clicked UInt8, int1 Int32, int2 Int32, int3 Int32, int4 Int32, int5 Int32, int6 Int32, int7 Int32, int8 Int32, int9 Int32, int10 Int32, int11 Int32, int12 Int32, int13 Int32, cat1 String, cat2 String, cat3 String, cat4 String, cat5 String, cat6 String, cat7 String, cat8 String, cat9 String, cat10 String, cat11 String, cat12 String, cat13 String, cat14 String, cat15 String, cat16 String, cat17 String, cat18 String, cat19 String, cat20 String, cat21 String, cat22 String, cat23 String, cat24 String, cat25 String, cat26 String) ENGINE = Log ``` @@ -16,7 +16,7 @@ for i in {00..23}; do echo $i; zcat datasets/criteo/day_${i#0}.gz | sed -r 's/^/ Создайте таблицу для сконвертированных данных: -```sql +``` sql CREATE TABLE criteo ( date Date, @@ -65,7 +65,7 @@ CREATE TABLE criteo Преобразуем данные из сырого лога и положим во вторую таблицу: -```sql +``` sql INSERT INTO criteo SELECT date, clicked, int1, int2, int3, int4, int5, int6, int7, int8, int9, int10, int11, int12, int13, reinterpretAsUInt32(unhex(cat1)) AS icat1, reinterpretAsUInt32(unhex(cat2)) AS icat2, reinterpretAsUInt32(unhex(cat3)) AS icat3, reinterpretAsUInt32(unhex(cat4)) AS icat4, reinterpretAsUInt32(unhex(cat5)) AS icat5, reinterpretAsUInt32(unhex(cat6)) AS icat6, reinterpretAsUInt32(unhex(cat7)) AS icat7, reinterpretAsUInt32(unhex(cat8)) AS icat8, reinterpretAsUInt32(unhex(cat9)) AS icat9, reinterpretAsUInt32(unhex(cat10)) AS icat10, reinterpretAsUInt32(unhex(cat11)) AS icat11, reinterpretAsUInt32(unhex(cat12)) AS icat12, reinterpretAsUInt32(unhex(cat13)) AS icat13, reinterpretAsUInt32(unhex(cat14)) AS icat14, reinterpretAsUInt32(unhex(cat15)) AS icat15, reinterpretAsUInt32(unhex(cat16)) AS icat16, reinterpretAsUInt32(unhex(cat17)) AS icat17, reinterpretAsUInt32(unhex(cat18)) AS icat18, reinterpretAsUInt32(unhex(cat19)) AS icat19, reinterpretAsUInt32(unhex(cat20)) AS icat20, reinterpretAsUInt32(unhex(cat21)) AS icat21, reinterpretAsUInt32(unhex(cat22)) AS icat22, reinterpretAsUInt32(unhex(cat23)) AS icat23, reinterpretAsUInt32(unhex(cat24)) AS icat24, reinterpretAsUInt32(unhex(cat25)) AS icat25, reinterpretAsUInt32(unhex(cat26)) AS icat26 FROM criteo_log; DROP TABLE criteo_log; diff --git a/docs/ru/getting_started/example_datasets/nyc_taxi.md b/docs/ru/getting_started/example_datasets/nyc_taxi.md index 9e556283a3f..d0402b9e2f4 100644 --- a/docs/ru/getting_started/example_datasets/nyc_taxi.md +++ b/docs/ru/getting_started/example_datasets/nyc_taxi.md @@ -39,7 +39,7 @@ real 7m9.164s Экспорт данных из PostgreSQL: -```sql +``` sql COPY ( SELECT trips.id, @@ -114,7 +114,7 @@ COPY Создание временной таблицы в ClickHouse: -```sql +``` sql CREATE TABLE trips ( trip_id UInt32, @@ -276,7 +276,7 @@ WHERE (table = 'trips_mergetree') AND active Q1: -```sql +``` sql SELECT cab_type, count(*) FROM trips_mergetree GROUP BY cab_type ``` @@ -284,7 +284,7 @@ SELECT cab_type, count(*) FROM trips_mergetree GROUP BY cab_type Q2: -```sql +``` sql SELECT passenger_count, avg(total_amount) FROM trips_mergetree GROUP BY passenger_count ``` @@ -292,7 +292,7 @@ SELECT passenger_count, avg(total_amount) FROM trips_mergetree GROUP BY passenge Q3: -```sql +``` sql SELECT passenger_count, toYear(pickup_date) AS year, count(*) FROM trips_mergetree GROUP BY passenger_count, year ``` @@ -300,7 +300,7 @@ SELECT passenger_count, toYear(pickup_date) AS year, count(*) FROM trips_mergetr Q4: -```sql +``` sql SELECT passenger_count, toYear(pickup_date) AS year, round(trip_distance) AS distance, count(*) FROM trips_mergetree GROUP BY passenger_count, year, distance @@ -328,13 +328,13 @@ CREATE TABLE default.trips_mergetree_third ( trip_id UInt32, vendor_id Enum8('1 На исходном сервере: -```sql +``` sql CREATE TABLE trips_mergetree_x3 AS trips_mergetree_third ENGINE = Distributed(perftest, default, trips_mergetree_third, rand()) ``` Следующим запрос перераспределит данные: -```sql +``` sql INSERT INTO trips_mergetree_x3 SELECT * FROM trips_mergetree ``` diff --git a/docs/ru/getting_started/example_datasets/ontime.md b/docs/ru/getting_started/example_datasets/ontime.md index 77142179ae1..fa832c99847 100644 --- a/docs/ru/getting_started/example_datasets/ontime.md +++ b/docs/ru/getting_started/example_datasets/ontime.md @@ -18,7 +18,7 @@ done Создание таблицы: -```sql +``` sql CREATE TABLE `ontime` ( `Year` UInt16, `Quarter` UInt8, @@ -142,37 +142,37 @@ for i in *.zip; do echo $i; unzip -cq $i '*.csv' | sed 's/\.00//g' | clickhouse- Q0. -```sql +``` sql select avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month); ``` Q1. Количество полетов в день с 2000 по 2008 года -```sql +``` sql SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC; ``` Q2. Количество полетов, задержанных более чем на 10 минут, с группировкой по дням неделе, за 2000-2008 года -```sql +``` sql SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC ``` Q3. Количество задержек по аэропортам за 2000-2008 -```sql +``` sql SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10 ``` Q4. Количество задержек по перевозчикам за 2007 год -```sql +``` sql SELECT Carrier, count(*) FROM ontime WHERE DepDelay>10 AND Year = 2007 GROUP BY Carrier ORDER BY count(*) DESC ``` Q5. Процент задержек по перевозчикам за 2007 год -```sql +``` sql SELECT Carrier, c, c2, c*1000/c2 as c3 FROM ( @@ -198,13 +198,13 @@ ORDER BY c3 DESC; Более оптимальная версия того же запроса: -```sql +``` sql SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year = 2007 GROUP BY Carrier ORDER BY Carrier ``` Q6. Предыдущий запрос за более широкий диапазон лет, 2000-2008 -```sql +``` sql SELECT Carrier, c, c2, c*1000/c2 as c3 FROM ( @@ -230,13 +230,13 @@ ORDER BY c3 DESC; Более оптимальная версия того же запроса: -```sql +``` sql SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier ``` Q7. Процент полетов, задержанных на более 10 минут, в разбивке по годам -```sql +``` sql SELECT Year, c1/c2 FROM ( @@ -260,25 +260,25 @@ ORDER BY Year Более оптимальная версия того же запроса: -```sql +``` sql SELECT Year, avg(DepDelay > 10) FROM ontime GROUP BY Year ORDER BY Year ``` Q8. Самые популярные направления по количеству напрямую соединенных городов для различных диапазонов лет -```sql +``` sql SELECT DestCityName, uniqExact(OriginCityName) AS u FROM ontime WHERE Year >= 2000 and Year <= 2010 GROUP BY DestCityName ORDER BY u DESC LIMIT 10; ``` Q9. -```sql +``` sql select Year, count(*) as c1 from ontime group by Year; ``` Q10. -```sql +``` sql select min(Year), max(Year), Carrier, count(*) as cnt, sum(ArrDelayMinutes>30) as flights_delayed, @@ -296,7 +296,7 @@ LIMIT 1000; Бонус: -```sql +``` sql SELECT avg(cnt) FROM (SELECT Year,Month,count(*) AS cnt FROM ontime WHERE DepDel15=1 GROUP BY Year,Month) select avg(c1) from (select Year,Month,count(*) as c1 from ontime group by Year,Month) diff --git a/docs/ru/getting_started/example_datasets/star_schema.md b/docs/ru/getting_started/example_datasets/star_schema.md index e89e04e80ed..ddff4c59294 100644 --- a/docs/ru/getting_started/example_datasets/star_schema.md +++ b/docs/ru/getting_started/example_datasets/star_schema.md @@ -21,7 +21,7 @@ make Создание таблиц в ClickHouse: -```sql +``` sql CREATE TABLE lineorder ( LO_ORDERKEY UInt32, LO_LINENUMBER UInt8, diff --git a/docs/ru/getting_started/example_datasets/wikistat.md b/docs/ru/getting_started/example_datasets/wikistat.md index 31455f8c392..ed8037ffc8e 100644 --- a/docs/ru/getting_started/example_datasets/wikistat.md +++ b/docs/ru/getting_started/example_datasets/wikistat.md @@ -4,7 +4,7 @@ Создание таблицы: -```sql +``` sql CREATE TABLE wikistat ( date Date, diff --git a/docs/ru/interfaces/formats.md b/docs/ru/interfaces/formats.md index 06f0caa30e1..8d31b6707d7 100644 --- a/docs/ru/interfaces/formats.md +++ b/docs/ru/interfaces/formats.md @@ -44,7 +44,7 @@ ClickHouse может принимать (`INSERT`) и отдавать (`SELECT Формат `TabSeparated` поддерживает вывод тотальных значений (при использовании WITH TOTALS) и экстремальных значений (при настройке extremes выставленной в 1). В этих случаях, после основных данных выводятся тотальные значения, и экстремальные значения. Основной результат, тотальные значения и экстремальные значения, отделяются друг от друга пустой строкой. Пример: -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` @@ -143,7 +143,7 @@ SearchPhrase=баку count()=1000 [NULL](../query_language/syntax.md#null-literal) форматируется в виде `\N`. -```sql +``` sql SELECT * FROM t_null FORMAT TSKV ``` ``` @@ -185,7 +185,7 @@ clickhouse-client --format_csv_delimiter="|" --query="INSERT INTO test.csv FORMA Выводит данные в формате JSON. Кроме таблицы с данными, также выводятся имена и типы столбцов, и некоторая дополнительная информация - общее количество выведенных строк, а также количество строк, которое могло бы быть выведено, если бы не было LIMIT-а. Пример: -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase WITH TOTALS ORDER BY c DESC LIMIT 5 FORMAT JSON ``` @@ -362,7 +362,7 @@ ClickHouse поддерживает [NULL](../query_language/syntax.md#null-lite [NULL](../query_language/syntax.md#null-literal) выводится как `ᴺᵁᴸᴸ`. -```sql +``` sql SELECT * FROM t_null ``` ``` @@ -376,7 +376,7 @@ SELECT * FROM t_null Формат Pretty поддерживает вывод тотальных значений (при использовании WITH TOTALS) и экстремальных значений (при настройке extremes выставленной в 1). В этих случаях, после основных данных выводятся тотальные значения, и экстремальные значения, в отдельных табличках. Пример (показан для формата PrettyCompact): -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` @@ -475,7 +475,7 @@ Array представлены как длина в формате varint (unsig Пример: -```sql +``` sql SELECT * FROM t_null FORMAT Vertical ``` ``` @@ -599,7 +599,7 @@ Cap'n Proto - формат бинарных сообщений, похож на Сообщения Cap'n Proto строго типизированы и не самоописывающиеся, т.е. нуждаются во внешнем описании схемы. Схема применяется "на лету" и кешируется для каждого запроса. -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' ``` diff --git a/docs/ru/operations/settings/settings_profiles.md b/docs/ru/operations/settings/settings_profiles.md index 90b7fd9c6f0..600b7c11730 100644 --- a/docs/ru/operations/settings/settings_profiles.md +++ b/docs/ru/operations/settings/settings_profiles.md @@ -9,7 +9,7 @@ Установить профиль `web`. -```sql +``` sql SET profile = 'web' ``` diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index 5b93396a86d..d92274b3b27 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -185,7 +185,7 @@ query_id String - идентификатор запроса, если Пример: -```sql +``` sql SELECT * FROM system.replicas WHERE table = 'visits' @@ -271,7 +271,7 @@ active_replicas: число реплик этой таблицы, имеющ Например, так можно проверить, что всё хорошо: -```sql +``` sql SELECT database, table, @@ -317,7 +317,7 @@ changed UInt8 - была ли настройка явно задана в кон Пример: -```sql +``` sql SELECT * FROM system.settings WHERE changed @@ -368,7 +368,7 @@ WHERE changed Пример: -```sql +``` sql SELECT * FROM system.zookeeper WHERE path = '/clickhouse/tables/01-08/visits/replicas' diff --git a/docs/ru/operations/table_engines/aggregatingmergetree.md b/docs/ru/operations/table_engines/aggregatingmergetree.md index d8ab0d90c2e..1cc880e1662 100644 --- a/docs/ru/operations/table_engines/aggregatingmergetree.md +++ b/docs/ru/operations/table_engines/aggregatingmergetree.md @@ -8,7 +8,7 @@ Примеры: -```sql +``` sql CREATE TABLE t ( column1 AggregateFunction(uniq, UInt64), @@ -34,7 +34,7 @@ CREATE TABLE t То есть, агрегатная функция с суффиксом Merge берёт множество состояний, объединяет их, и возвращает готовый результат. Для примера, эти два запроса возвращают один и тот же результат: -```sql +``` sql SELECT uniq(UserID) FROM table SELECT uniqMerge(state) FROM (SELECT uniqState(UserID) AS state FROM table GROUP BY RegionID) @@ -52,7 +52,7 @@ SELECT uniqMerge(state) FROM (SELECT uniqState(UserID) AS state FROM table GROUP Создаём материализованное представление типа `AggregatingMergeTree`, следящее за таблицей `test.visits`: -```sql +``` sql CREATE MATERIALIZED VIEW test.basic ENGINE = AggregatingMergeTree(StartDate, (CounterID, StartDate), 8192) AS SELECT @@ -66,13 +66,13 @@ GROUP BY CounterID, StartDate; Вставляем данные в таблицу `test.visits`. Данные будут также вставлены в представление, где они будут агрегированы: -```sql +``` sql INSERT INTO test.visits ... ``` Делаем `SELECT` из представления, используя `GROUP BY`, чтобы доагрегировать данные: -```sql +``` sql SELECT StartDate, sumMerge(Visits) AS Visits, diff --git a/docs/ru/operations/table_engines/buffer.md b/docs/ru/operations/table_engines/buffer.md index 655c54c28ea..24e456da486 100644 --- a/docs/ru/operations/table_engines/buffer.md +++ b/docs/ru/operations/table_engines/buffer.md @@ -22,7 +22,7 @@ min_bytes, max_bytes - условие на количество байт в бу Пример: -```sql +``` sql CREATE TABLE merge.hits_buffer AS merge.hits ENGINE = Buffer(merge, hits, 16, 10, 100, 10000, 1000000, 10000000, 100000000) ``` diff --git a/docs/ru/operations/table_engines/collapsingmergetree.md b/docs/ru/operations/table_engines/collapsingmergetree.md index 70cce9e111b..d283a8dbe04 100644 --- a/docs/ru/operations/table_engines/collapsingmergetree.md +++ b/docs/ru/operations/table_engines/collapsingmergetree.md @@ -14,7 +14,7 @@ CollapsingMergeTree принимает дополнительный параметр - имя столбца типа Int8, содержащего "знак" строки. Пример: -```sql +``` sql CollapsingMergeTree(EventDate, (CounterID, EventDate, intHash32(UniqID), VisitID), 8192, Sign) ``` diff --git a/docs/ru/operations/table_engines/custom_partitioning_key.md b/docs/ru/operations/table_engines/custom_partitioning_key.md index b87755c0a9e..8d228f5c498 100644 --- a/docs/ru/operations/table_engines/custom_partitioning_key.md +++ b/docs/ru/operations/table_engines/custom_partitioning_key.md @@ -11,7 +11,7 @@ ENGINE [=] Name(...) [PARTITION BY expr] [ORDER BY expr] [SAMPLE BY expr] [SETTI ``` Для MergeTree таблиц выражение партиционирования указывается после `PARTITION BY`, первичный ключ после `ORDER BY`, ключ сэмплирования после `SAMPLE BY`, а в `SETTINGS` можно указать `index_granularity` (не обязательно, значение по умолчанию 8192), а также другие настройки из [MergeTreeSettings.h](https://github.com/yandex/ClickHouse/blob/master/dbms/src/Storages/MergeTree/MergeTreeSettings.h). Остальные параметры движка по-прежнему указываются в скобках после его названия. Пример: -```sql +``` sql ENGINE = ReplicatedCollapsingMergeTree('/clickhouse/tables/name', 'replica1', Sign) PARTITION BY (toMonday(StartDate), EventType) ORDER BY (CounterID, StartDate, intHash32(UserID)) @@ -25,7 +25,7 @@ ENGINE = ReplicatedCollapsingMergeTree('/clickhouse/tables/name', 'replica1', Si После создания такой таблицы слияние кусков будет работать только для кусков с одинаковым значением выражения партиционирования. Замечание: это означает, что нежелательно делать слишком гранулированное партиционирование (более порядка тысячи партиций), иначе производительность SELECT будет неудовлетворительной. Чтобы указать партицию в командах ALTER PARTITION, нужно указать значение выражения партиционирования (или кортежа). Поддерживаются константы и константные выражения. Пример: -```sql +``` sql ALTER TABLE table DROP PARTITION (toMonday(today()), 1) ``` удалит партицию за текущую неделю с типом события 1. То же самое для запроса OPTIMIZE. Чтобы указать единственную партицию непартиционированной таблицы, укажите `PARTITION tuple()`. diff --git a/docs/ru/operations/table_engines/dictionary.md b/docs/ru/operations/table_engines/dictionary.md index a87eba36f63..bc5e8e409ea 100644 --- a/docs/ru/operations/table_engines/dictionary.md +++ b/docs/ru/operations/table_engines/dictionary.md @@ -39,7 +39,7 @@ Запрос данных словаря: -```sql +``` sql select name, type, key, attribute.names, attribute.types, bytes_allocated, element_count,source from system.dictionaries where name = 'products'; SELECT @@ -73,7 +73,7 @@ CREATE TABLE %table_name% (%fields%) engine = Dictionary(%dictionary_name%)` Пример использования: -```sql +``` sql create table products (product_id UInt64, title String) Engine = Dictionary(products); CREATE TABLE products @@ -91,7 +91,7 @@ Ok. Проверим что у нас в таблице? -```sql +``` sql select * from products limit 1; SELECT * diff --git a/docs/ru/operations/table_engines/file.md b/docs/ru/operations/table_engines/file.md index 4e333bee369..2cf9f3ff788 100644 --- a/docs/ru/operations/table_engines/file.md +++ b/docs/ru/operations/table_engines/file.md @@ -31,7 +31,7 @@ File(Format) **1.** Создадим на сервере таблицу `file_engine_table`: -```sql +``` sql CREATE TABLE file_engine_table (name String, value UInt32) ENGINE=File(TabSeparated) ``` @@ -47,7 +47,7 @@ two 2 **3.** Запросим данные: -```sql +``` sql SELECT * FROM file_engine_table ``` diff --git a/docs/ru/operations/table_engines/kafka.md b/docs/ru/operations/table_engines/kafka.md index aded13ae666..8dc7b55e373 100644 --- a/docs/ru/operations/table_engines/kafka.md +++ b/docs/ru/operations/table_engines/kafka.md @@ -43,7 +43,7 @@ Kafka SETTINGS Примеры: -```sql +``` sql CREATE TABLE queue ( timestamp UInt64, level String, @@ -85,7 +85,7 @@ Kafka SETTINGS Пример: -```sql +``` sql CREATE TABLE queue ( timestamp UInt64, level String, diff --git a/docs/ru/operations/table_engines/mergetree.md b/docs/ru/operations/table_engines/mergetree.md index 6736740a063..a0a528561df 100644 --- a/docs/ru/operations/table_engines/mergetree.md +++ b/docs/ru/operations/table_engines/mergetree.md @@ -159,7 +159,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa В этом случае в запросах: -```sql +``` sql SELECT count() FROM table WHERE EventDate = toDate(now()) AND CounterID = 34 SELECT count() FROM table WHERE EventDate = toDate(now()) AND (CounterID = 34 OR CounterID = 42) SELECT count() FROM table WHERE ((EventDate >= toDate('2014-01-01') AND EventDate <= toDate('2014-01-31')) OR EventDate = toDate('2014-05-01')) AND CounterID IN (101500, 731962, 160656) AND (CounterID = 101500 OR EventDate != toDate('2014-05-01')) @@ -171,7 +171,7 @@ ClickHouse будет использовать индекс по первичн В примере ниже индекс не может использоваться. -```sql +``` sql SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%' ``` diff --git a/docs/ru/operations/table_engines/replacingmergetree.md b/docs/ru/operations/table_engines/replacingmergetree.md index 054ff84e769..3c5658baea4 100644 --- a/docs/ru/operations/table_engines/replacingmergetree.md +++ b/docs/ru/operations/table_engines/replacingmergetree.md @@ -6,7 +6,7 @@ Столбец с версией должен иметь тип из семейства `UInt`, или `Date`, или `DateTime`. -```sql +``` sql ReplacingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, ver) ``` diff --git a/docs/ru/operations/table_engines/summingmergetree.md b/docs/ru/operations/table_engines/summingmergetree.md index 5041ddc8abb..6b9d1497337 100644 --- a/docs/ru/operations/table_engines/summingmergetree.md +++ b/docs/ru/operations/table_engines/summingmergetree.md @@ -4,13 +4,13 @@ Отличается от `MergeTree` тем, что суммирует данные при слиянии. -```sql +``` sql SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192) ``` Столбцы для суммирования заданы неявно. При слиянии, для всех строчек с одинаковым значением первичного ключа (в примере - OrderID, EventDate, BannerID, ...), производится суммирование значений в числовых столбцах, не входящих в первичный ключ. -```sql +``` sql SummingMergeTree(EventDate, (OrderID, EventDate, BannerID, ...), 8192, (Shows, Clicks, Cost, ...)) ``` diff --git a/docs/ru/operations/table_engines/url.md b/docs/ru/operations/table_engines/url.md index a10d51cab98..a4a0d511e8a 100644 --- a/docs/ru/operations/table_engines/url.md +++ b/docs/ru/operations/table_engines/url.md @@ -23,7 +23,7 @@ **1.** Создадим на сервере таблицу `url_engine_table`: -```sql +``` sql CREATE TABLE url_engine_table (word String, value UInt64) ENGINE=URL('http://127.0.0.1:12345/', CSV) ``` @@ -53,7 +53,7 @@ python3 server.py **3.** Запросим данные: -```sql +``` sql SELECT * FROM url_engine_table ``` diff --git a/docs/ru/query_language/agg_functions/reference.md b/docs/ru/query_language/agg_functions/reference.md index 8fccf9c0a64..1c700851ef0 100644 --- a/docs/ru/query_language/agg_functions/reference.md +++ b/docs/ru/query_language/agg_functions/reference.md @@ -37,7 +37,7 @@ anyHeavy(column) Возьмем набор данных [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) и выберем произвольное часто встречающееся значение в столбце `AirlineID`. -```sql +``` sql SELECT anyHeavy(AirlineID) AS res FROM ontime ``` @@ -109,7 +109,7 @@ SELECT argMin(user, salary) FROM salary Пример: -```sql +``` sql CREATE TABLE sum_map( date Date, timeslot DateTime, @@ -352,7 +352,7 @@ topK(N)(column) Возьмем набор данных [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) и выберем 3 наиболее часто встречающихся значения в столбце `AirlineID`. -```sql +``` sql SELECT topK(3)(AirlineID) AS res FROM ontime ``` diff --git a/docs/ru/query_language/alter.md b/docs/ru/query_language/alter.md index 0b01ac86e2a..268e7baa962 100644 --- a/docs/ru/query_language/alter.md +++ b/docs/ru/query_language/alter.md @@ -7,7 +7,7 @@ Изменение структуры таблицы. -```sql +``` sql ALTER TABLE [db].name [ON CLUSTER cluster] ADD|DROP|MODIFY COLUMN ... ``` @@ -16,7 +16,7 @@ ALTER TABLE [db].name [ON CLUSTER cluster] ADD|DROP|MODIFY COLUMN ... Существуют следующие действия: -```sql +``` sql ADD COLUMN name [type] [default_expr] [AFTER name_after] ``` @@ -26,14 +26,14 @@ ADD COLUMN name [type] [default_expr] [AFTER name_after] Такая схема позволяет добиться мгновенной работы запроса ALTER и отсутствия необходимости увеличивать объём старых данных. -```sql +``` sql DROP COLUMN name ``` Удаляет столбец с именем name. Удаляет данные из файловой системы. Так как это представляет собой удаление целых файлов, запрос выполняется почти мгновенно. -```sql +``` sql MODIFY COLUMN name [type] [default_expr] ``` @@ -84,7 +84,7 @@ MODIFY COLUMN name [type] [default_expr] Чтобы посмотреть набор кусков и партиций таблицы, можно воспользоваться системной таблицей `system.parts`: -```sql +``` sql SELECT * FROM system.parts WHERE active ``` @@ -122,7 +122,7 @@ drwxrwxrwx 2 clickhouse clickhouse 4096 May 5 02:55 detached Директория `detached` содержит куски, не используемые сервером - отцепленные от таблицы с помощью запроса `ALTER ... DETACH`. Также в эту директорию переносятся куски, признанные повреждёнными, вместо их удаления. Вы можете в любое время добавлять, удалять, модифицировать данные в директории detached - сервер не будет об этом знать, пока вы не сделаете запрос `ALTER TABLE ... ATTACH`. -```sql +``` sql ALTER TABLE [db.]table DETACH PARTITION 'name' ``` @@ -133,13 +133,13 @@ ALTER TABLE [db.]table DETACH PARTITION 'name' Запрос реплицируется - данные будут перенесены в директорию detached и забыты на всех репликах. Запрос может быть отправлен только на реплику-лидер. Вы можете узнать, является ли реплика лидером, сделав SELECT в системную таблицу system.replicas. Или, проще, вы можете выполнить запрос на всех репликах, и на всех кроме одной, он кинет исключение. -```sql +``` sql ALTER TABLE [db.]table DROP PARTITION 'name' ``` Аналогично операции `DETACH`. Удалить данные из таблицы. Куски с данными будут помечены как неактивные и будут полностью удалены примерно через 10 минут. Запрос реплицируется - данные будут удалены на всех репликах. -```sql +``` sql ALTER TABLE [db.]table ATTACH PARTITION|PART 'name' ``` @@ -151,7 +151,7 @@ ALTER TABLE [db.]table ATTACH PARTITION|PART 'name' То есть, вы можете разместить данные в директории detached на одной реплике и, с помощью запроса ALTER ... ATTACH добавить их в таблицу на всех репликах. -```sql +``` sql ALTER TABLE [db.]table FREEZE PARTITION 'name' ``` @@ -195,7 +195,7 @@ ALTER TABLE [db.]table FREEZE PARTITION 'name' Бэкапы защищают от человеческих ошибок (случайно удалили данные, удалили не те данные или не на том кластере, испортили данные). Для баз данных большого объёма, бывает затруднительно копировать бэкапы на удалённые серверы. В этих случаях, для защиты от человеческой ошибки, можно держать бэкап на том же сервере (он будет лежать в `/var/lib/clickhouse/shadow/`). -```sql +``` sql ALTER TABLE [db.]table FETCH PARTITION 'name' FROM 'path-in-zookeeper' ``` @@ -231,13 +231,13 @@ ALTER TABLE [db.]table FETCH PARTITION 'name' FROM 'path-in-zookeeper' На данный момент доступны команды: -```sql +``` sql ALTER TABLE [db.]table DELETE WHERE filter_expr ``` Выражение `filter_expr` должно иметь тип UInt8. Запрос удаляет строки таблицы, для которых это выражение принимает ненулевое значение. -```sql +``` sql ALTER TABLE [db.]table UPDATE column1 = expr1 [, ...] WHERE filter_expr ``` diff --git a/docs/ru/query_language/create.md b/docs/ru/query_language/create.md index 12f6f9c4901..83a137c7bd7 100644 --- a/docs/ru/query_language/create.md +++ b/docs/ru/query_language/create.md @@ -1,7 +1,7 @@ ## CREATE DATABASE Создание базы данных db_name -```sql +``` sql CREATE DATABASE [IF NOT EXISTS] db_name ``` @@ -14,7 +14,7 @@ CREATE DATABASE [IF NOT EXISTS] db_name ## CREATE TABLE Запрос `CREATE TABLE` может иметь несколько форм. -```sql +``` sql CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ( name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1], @@ -29,13 +29,13 @@ CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] Описание столбца, это `name type`, в простейшем случае. Пример: `RegionID UInt32`. Также могут быть указаны выражения для значений по умолчанию - смотрите ниже. -```sql +``` sql CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name AS [db2.]name2 [ENGINE = engine] ``` Создаёт таблицу с такой же структурой, как другая таблица. Можно указать другой движок для таблицы. Если движок не указан, то будет выбран такой же движок, как у таблицы `db2.name2`. -```sql +``` sql CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name ENGINE = engine AS SELECT ... ``` @@ -97,7 +97,7 @@ CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name ENGINE = engine AS SELECT ... Запросы `CREATE`, `DROP`, `ALTER`, `RENAME` поддерживают возможность распределенного выполнения на кластере. Например, следующий запрос создает `Distributed`-таблицу `all_hits` на каждом хосте кластера `cluster`: -```sql +``` sql CREATE TABLE IF NOT EXISTS all_hits ON CLUSTER cluster (p Date, i Int32) ENGINE = Distributed(cluster, default, hits) ``` @@ -107,7 +107,7 @@ CREATE TABLE IF NOT EXISTS all_hits ON CLUSTER cluster (p Date, i Int32) ENGINE ## CREATE VIEW -```sql +``` sql CREATE [MATERIALIZED] VIEW [IF NOT EXISTS] [db.]name [TO[db.]name] [ENGINE = engine] [POPULATE] AS SELECT ... ``` @@ -121,19 +121,19 @@ CREATE [MATERIALIZED] VIEW [IF NOT EXISTS] [db.]name [TO[db.]name] [ENGINE = eng Для примера, пусть вы создали представление: -```sql +``` sql CREATE VIEW view AS SELECT ... ``` и написали запрос: -```sql +``` sql SELECT a, b, c FROM view ``` Этот запрос полностью эквивалентен использованию подзапроса: -```sql +``` sql SELECT a, b, c FROM (SELECT ...) ``` diff --git a/docs/ru/query_language/functions/arithmetic_functions.md b/docs/ru/query_language/functions/arithmetic_functions.md index 162a3b75c9f..8707e0dda08 100644 --- a/docs/ru/query_language/functions/arithmetic_functions.md +++ b/docs/ru/query_language/functions/arithmetic_functions.md @@ -4,7 +4,7 @@ Пример: -```sql +``` sql SELECT toTypeName(0), toTypeName(0 + 0), toTypeName(0 + 0 + 0), toTypeName(0 + 0 + 0 + 0) ``` diff --git a/docs/ru/query_language/functions/array_functions.md b/docs/ru/query_language/functions/array_functions.md index 9d1ae64da26..53bf3b94af6 100644 --- a/docs/ru/query_language/functions/array_functions.md +++ b/docs/ru/query_language/functions/array_functions.md @@ -53,7 +53,7 @@ arrayConcat(arrays) **Пример** -```sql +``` sql SELECT arrayConcat([1, 2], [3, 4], [5, 6]) AS res ``` ``` @@ -123,7 +123,7 @@ SELECT countEqual([1, 2, NULL, NULL], NULL) Эта функция обычно используется совместно с ARRAY JOIN. Она позволяет, после применения ARRAY JOIN, посчитать что-либо только один раз для каждого массива. Пример: -```sql +``` sql SELECT count() AS Reaches, countIf(num = 1) AS Hits @@ -143,7 +143,7 @@ LIMIT 10 В этом примере, Reaches - число достижений целей (строк, получившихся после применения ARRAY JOIN), а Hits - число хитов (строк, которые были до ARRAY JOIN). В данном случае, тот же результат можно получить проще: -```sql +``` sql SELECT sum(length(GoalsReached)) AS Reaches, count() AS Hits @@ -166,7 +166,7 @@ WHERE (CounterID = 160656) AND notEmpty(GoalsReached) Эта функция полезна при использовании ARRAY JOIN и агрегации по элементам массива. Пример: -```sql +``` sql SELECT Goals.ID AS GoalID, sum(Sign) AS Reaches, @@ -200,7 +200,7 @@ LIMIT 10 Функция arrayEnumerateUniq может принимать несколько аргументов - массивов одинаковых размеров. В этом случае, уникальность считается для кортежей элементов на одинаковых позициях всех массивов. -```sql +``` sql SELECT arrayEnumerateUniq([1, 1, 1, 2, 2, 2], [1, 1, 2, 1, 1, 2]) AS res ``` @@ -226,7 +226,7 @@ arrayPopBack(array) **Пример** -```sql +``` sql SELECT arrayPopBack([1, 2, 3]) AS res ``` ``` @@ -249,7 +249,7 @@ arrayPopFront(array) **Пример** -```sql +``` sql SELECT arrayPopFront([1, 2, 3]) AS res ``` ``` @@ -273,7 +273,7 @@ arrayPushBack(array, single_value) **Пример** -```sql +``` sql SELECT arrayPushBack(['a'], 'b') AS res ``` ``` @@ -297,7 +297,7 @@ arrayPushFront(array, single_value) **Пример** -```sql +``` sql SELECT arrayPushBack(['b'], 'a') AS res ``` ``` @@ -359,7 +359,7 @@ arraySlice(array, offset[, length]) **Пример** -```sql +``` sql SELECT arraySlice([1, 2, NULL, 4, 5], 2, 3) AS res ``` ``` diff --git a/docs/ru/query_language/functions/array_join.md b/docs/ru/query_language/functions/array_join.md index b954b69ad4a..57bdbe94c75 100644 --- a/docs/ru/query_language/functions/array_join.md +++ b/docs/ru/query_language/functions/array_join.md @@ -17,7 +17,7 @@ Пример: -```sql +``` sql SELECT arrayJoin([1, 2, 3] AS src) AS dst, 'Hello', src ``` diff --git a/docs/ru/query_language/functions/date_time_functions.md b/docs/ru/query_language/functions/date_time_functions.md index 419d26e51da..c0a654a0507 100644 --- a/docs/ru/query_language/functions/date_time_functions.md +++ b/docs/ru/query_language/functions/date_time_functions.md @@ -4,7 +4,7 @@ Все функции по работе с датой и временем, для которых это имеет смысл, могут принимать второй, необязательный аргумент - имя часового пояса. Пример: Asia/Yekaterinburg. В этом случае, они используют не локальный часовой пояс (по умолчанию), а указанный. -```sql +``` sql SELECT toDateTime('2016-06-15 23:00:00') AS time, toDate(time) AS date_local, diff --git a/docs/ru/query_language/functions/geo.md b/docs/ru/query_language/functions/geo.md index 2c10c372290..f1b460a4c41 100644 --- a/docs/ru/query_language/functions/geo.md +++ b/docs/ru/query_language/functions/geo.md @@ -25,7 +25,7 @@ greatCircleDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg) **Пример** -```sql +``` sql SELECT greatCircleDistance(55.755831, 37.617673, -55.755831, -37.617673) ``` @@ -59,7 +59,7 @@ pointInEllipses(x, y, x₀, y₀, a₀, b₀,...,xₙ, yₙ, aₙ, bₙ) **Пример** -```sql +``` sql SELECT pointInEllipses(55.755831, 37.617673, 55.755831, 37.617673, 1.0, 2.0) ``` @@ -91,7 +91,7 @@ pointInPolygon((x, y), [(a, b), (c, d) ...], ...) **Пример** -```sql +``` sql SELECT pointInPolygon((3., 3.), [(6, 0), (8, 4), (5, 8), (0, 2)]) AS res ``` ``` diff --git a/docs/ru/query_language/functions/higher_order_functions.md b/docs/ru/query_language/functions/higher_order_functions.md index 99d98549127..e9cb1d0de17 100644 --- a/docs/ru/query_language/functions/higher_order_functions.md +++ b/docs/ru/query_language/functions/higher_order_functions.md @@ -22,7 +22,7 @@ Примеры: -```sql +``` sql SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res ``` @@ -32,7 +32,7 @@ SELECT arrayFilter(x -> x LIKE '%World%', ['Hello', 'abc World']) AS res └───────────────┘ ``` -```sql +``` sql SELECT arrayFilter( (i, x) -> x LIKE '%World%', @@ -71,7 +71,7 @@ SELECT Пример: -```sql +``` sql SELECT arrayCumSum([1, 1, 1, 1]) AS res ``` @@ -90,7 +90,7 @@ SELECT arrayCumSum([1, 1, 1, 1]) AS res Пример: -```sql +``` sql SELECT arraySort((x, y) -> y, ['hello', 'world'], [2, 1]); ``` diff --git a/docs/ru/query_language/functions/ip_address_functions.md b/docs/ru/query_language/functions/ip_address_functions.md index fa6035968ae..a0fe39a77b0 100644 --- a/docs/ru/query_language/functions/ip_address_functions.md +++ b/docs/ru/query_language/functions/ip_address_functions.md @@ -11,7 +11,7 @@ Пример: -```sql +``` sql SELECT IPv4NumToStringClassC(ClientIP) AS k, count() AS c @@ -42,7 +42,7 @@ LIMIT 10 Принимает значение типа FixedString(16), содержащее IPv6-адрес в бинарном виде. Возвращает строку, содержащую этот адрес в текстовом виде. IPv6-mapped IPv4 адреса выводится в формате ::ffff:111.222.33.44. Примеры: -```sql +``` sql SELECT IPv6NumToString(toFixedString(unhex('2A0206B8000000000000000000000011'), 16)) AS addr ``` @@ -52,7 +52,7 @@ SELECT IPv6NumToString(toFixedString(unhex('2A0206B8000000000000000000000011'), └──────────────┘ ``` -```sql +``` sql SELECT IPv6NumToString(ClientIP6 AS k), count() AS c @@ -78,7 +78,7 @@ LIMIT 10 └─────────────────────────────────────────┴───────┘ ``` -```sql +``` sql SELECT IPv6NumToString(ClientIP6 AS k), count() AS c diff --git a/docs/ru/query_language/functions/math_functions.md b/docs/ru/query_language/functions/math_functions.md index 40d9185fe0d..0470a469780 100644 --- a/docs/ru/query_language/functions/math_functions.md +++ b/docs/ru/query_language/functions/math_functions.md @@ -39,7 +39,7 @@ Пример (правило трёх сигм): -```sql +``` sql SELECT erf(3 / sqrt(2)) ``` diff --git a/docs/ru/query_language/functions/other_functions.md b/docs/ru/query_language/functions/other_functions.md index c744dc7631d..d7c70d61d52 100644 --- a/docs/ru/query_language/functions/other_functions.md +++ b/docs/ru/query_language/functions/other_functions.md @@ -72,7 +72,7 @@ SELECT visibleWidth(NULL) Пример: -```sql +``` sql SELECT toHour(EventTime) AS h, count() AS c, @@ -141,7 +141,7 @@ ORDER BY h ASC Пример: -```sql +``` sql SELECT transform(SearchEngineID, [2, 3], ['Yandex', 'Google'], 'Other') AS title, count() AS c @@ -170,7 +170,7 @@ ORDER BY c DESC Пример: -```sql +``` sql SELECT transform(domain(Referer), ['yandex.ru', 'google.ru', 'vk.com'], ['www.yandex', 'example.com']) AS s, count() AS c @@ -199,7 +199,7 @@ LIMIT 10 Пример: -```sql +``` sql SELECT arrayJoin([1, 1024, 1024*1024, 192851925]) AS filesize_bytes, formatReadableSize(filesize_bytes) AS filesize @@ -238,7 +238,7 @@ SELECT Пример: -```sql +``` sql SELECT EventID, EventTime, diff --git a/docs/ru/query_language/functions/rounding_functions.md b/docs/ru/query_language/functions/rounding_functions.md index 4765c676d8c..269beccffa1 100644 --- a/docs/ru/query_language/functions/rounding_functions.md +++ b/docs/ru/query_language/functions/rounding_functions.md @@ -31,7 +31,7 @@ N может быть отрицательным. **Пример** -```sql +``` sql SELECT number / 2 AS x, round(x) diff --git a/docs/ru/query_language/functions/string_replace_functions.md b/docs/ru/query_language/functions/string_replace_functions.md index 0f6ba002e93..498b321fb1b 100644 --- a/docs/ru/query_language/functions/string_replace_functions.md +++ b/docs/ru/query_language/functions/string_replace_functions.md @@ -17,7 +17,7 @@ Пример 1. Переведём дату в американский формат: -```sql +``` sql SELECT DISTINCT EventDate, replaceRegexpOne(toString(EventDate), '(\\d{4})-(\\d{2})-(\\d{2})', '\\2/\\3/\\1') AS res @@ -38,7 +38,7 @@ FORMAT TabSeparated Пример 2. Размножить строку десять раз: -```sql +``` sql SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') AS res ``` @@ -51,7 +51,7 @@ SELECT replaceRegexpOne('Hello, World!', '.*', '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0') ## replaceRegexpAll(haystack, pattern, replacement) То же самое, но делается замена всех вхождений. Пример: -```sql +``` sql SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res ``` @@ -64,7 +64,7 @@ SELECT replaceRegexpAll('Hello, World!', '.', '\\0\\0') AS res В качестве исключения, если регулярное выражение сработало на пустой подстроке, то замена делается не более одного раза. Пример: -```sql +``` sql SELECT replaceRegexpAll('Hello, World!', '^', 'here: ') AS res ``` diff --git a/docs/ru/query_language/functions/type_conversion_functions.md b/docs/ru/query_language/functions/type_conversion_functions.md index f580c81414b..6b512574f6e 100644 --- a/docs/ru/query_language/functions/type_conversion_functions.md +++ b/docs/ru/query_language/functions/type_conversion_functions.md @@ -40,7 +40,7 @@ YYYY-MM-DD hh:mm:ss Дополнительно, функция toString от аргумента типа DateTime может принимать второй аргумент String - имя тайм-зоны. Пример: `Asia/Yekaterinburg` В этом случае, форматирование времени производится согласно указанной тайм-зоне. -```sql +``` sql SELECT now() AS now_local, toString(now(), 'Asia/Yekaterinburg') AS now_yekat @@ -63,7 +63,7 @@ SELECT Пример: -```sql +``` sql SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut ``` @@ -73,7 +73,7 @@ SELECT toFixedString('foo', 8) AS s, toStringCutToZero(s) AS s_cut └───────────────┴───────┘ ``` -```sql +``` sql SELECT toFixedString('foo\0bar', 8) AS s, toStringCutToZero(s) AS s_cut ``` @@ -101,7 +101,7 @@ SELECT toFixedString('foo\0bar', 8) AS s, toStringCutToZero(s) AS s_cut Пример: -```sql +``` sql SELECT '2016-06-15 23:00:00' AS timestamp, CAST(timestamp AS DateTime) AS datetime, diff --git a/docs/ru/query_language/functions/url_functions.md b/docs/ru/query_language/functions/url_functions.md index c66781c5821..4b4fdc9adda 100644 --- a/docs/ru/query_language/functions/url_functions.md +++ b/docs/ru/query_language/functions/url_functions.md @@ -69,7 +69,7 @@ URLPathHierarchy('https://example.com/browse/CONV-6788') = Возвращает декодированный URL. Пример: -```sql +``` sql SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS DecodedURL; ``` diff --git a/docs/ru/query_language/functions/ym_dict_functions.md b/docs/ru/query_language/functions/ym_dict_functions.md index eeea7faa9d0..7d37e1b0c87 100644 --- a/docs/ru/query_language/functions/ym_dict_functions.md +++ b/docs/ru/query_language/functions/ym_dict_functions.md @@ -35,7 +35,7 @@ regionToCountry(RegionID, 'ua') - использует словарь для к ### regionToArea(id\[, geobase\]) Переводит регион в область (тип в геобазе - 5). В остальном, аналогично функции regionToCity. -```sql +``` sql SELECT DISTINCT regionToName(regionToArea(toUInt32(number), 'ua')) FROM system.numbers LIMIT 15 @@ -64,7 +64,7 @@ LIMIT 15 ### regionToDistrict(id\[, geobase\]) Переводит регион в федеральный округ (тип в геобазе - 4). В остальном, аналогично функции regionToCity. -```sql +``` sql SELECT DISTINCT regionToName(regionToDistrict(toUInt32(number), 'ua')) FROM system.numbers LIMIT 15 diff --git a/docs/ru/query_language/insert_into.md b/docs/ru/query_language/insert_into.md index 3dc489529ef..70e4d5529f2 100644 --- a/docs/ru/query_language/insert_into.md +++ b/docs/ru/query_language/insert_into.md @@ -6,7 +6,7 @@ Базовый формат запроса: -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] VALUES (v11, v12, v13), (v21, v22, v23), ... ``` @@ -19,13 +19,13 @@ INSERT INTO [db.]table [(c1, c2, c3)] VALUES (v11, v12, v13), (v21, v22, v23), . В INSERT можно передавать данные любого [формата](../interfaces/formats.md#formats), который поддерживает ClickHouse. Для этого формат необходимо указать в запросе в явном виде: -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] FORMAT format_name data_set ``` Например, следующий формат запроса идентичен базовому варианту INSERT ... VALUES: -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] FORMAT Values (v11, v12, v13), (v21, v22, v23), ... ``` @@ -33,7 +33,7 @@ ClickHouse отсекает все пробелы и один перенос с Пример: -```sql +``` sql INSERT INTO t FORMAT TabSeparated 11 Hello, world! 22 Qwerty @@ -43,7 +43,7 @@ INSERT INTO t FORMAT TabSeparated ### Вставка результатов `SELECT` -```sql +``` sql INSERT INTO [db.]table [(c1, c2, c3)] SELECT ... ``` diff --git a/docs/ru/query_language/misc.md b/docs/ru/query_language/misc.md index 8c2470e77f4..5bfddb64b43 100644 --- a/docs/ru/query_language/misc.md +++ b/docs/ru/query_language/misc.md @@ -12,7 +12,7 @@ Если таблица перед этим была отсоединена (`DETACH`), т.е. её структура известна, то можно использовать сокращенную форму записи без определения структуры. -```sql +``` sql ATTACH TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ``` @@ -21,14 +21,14 @@ ATTACH TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ## DROP Запрос имеет два вида: `DROP DATABASE` и `DROP TABLE`. -```sql +``` sql DROP DATABASE [IF EXISTS] db [ON CLUSTER cluster] ``` Удаляет все таблицы внутри базы данных db, а затем саму базу данных db. Если указано `IF EXISTS` - не выдавать ошибку, если база данных не существует. -```sql +``` sql DROP [TEMPORARY] TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ``` @@ -38,7 +38,7 @@ DROP [TEMPORARY] TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ## DETACH Удаляет из сервера информацию о таблице name. Сервер перестаёт знать о существовании таблицы. -```sql +``` sql DETACH TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ``` @@ -50,7 +50,7 @@ DETACH TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ## RENAME Переименовывает одну или несколько таблиц. -```sql +``` sql RENAME TABLE [db11.]name11 TO [db12.]name12, [db21.]name21 TO [db22.]name22, ... [ON CLUSTER cluster] ``` @@ -58,7 +58,7 @@ RENAME TABLE [db11.]name11 TO [db12.]name12, [db21.]name21 TO [db22.]name22, ... ## SHOW DATABASES -```sql +``` sql SHOW DATABASES [INTO OUTFILE filename] [FORMAT format] ``` @@ -69,7 +69,7 @@ SHOW DATABASES [INTO OUTFILE filename] [FORMAT format] ## SHOW TABLES -```sql +``` sql SHOW [TEMPORARY] TABLES [FROM db] [LIKE 'pattern'] [INTO OUTFILE filename] [FORMAT format] ``` @@ -84,7 +84,7 @@ SHOW [TEMPORARY] TABLES [FROM db] [LIKE 'pattern'] [INTO OUTFILE filename] [FORM ## SHOW PROCESSLIST -```sql +``` sql SHOW PROCESSLIST [INTO OUTFILE filename] [FORMAT format] ``` @@ -116,7 +116,7 @@ watch -n1 "clickhouse-client --query='SHOW PROCESSLIST'" ## SHOW CREATE TABLE -```sql +``` sql SHOW CREATE [TEMPORARY] TABLE [db.]table [INTO OUTFILE filename] [FORMAT format] ``` @@ -124,7 +124,7 @@ SHOW CREATE [TEMPORARY] TABLE [db.]table [INTO OUTFILE filename] [FORMAT format] ## DESCRIBE TABLE -```sql +``` sql DESC|DESCRIBE TABLE [db.]table [INTO OUTFILE filename] [FORMAT format] ``` @@ -134,7 +134,7 @@ DESC|DESCRIBE TABLE [db.]table [INTO OUTFILE filename] [FORMAT format] ## EXISTS -```sql +``` sql EXISTS [TEMPORARY] TABLE [db.]name [INTO OUTFILE filename] [FORMAT format] ``` @@ -142,7 +142,7 @@ EXISTS [TEMPORARY] TABLE [db.]name [INTO OUTFILE filename] [FORMAT format] ## USE -```sql +``` sql USE db ``` @@ -152,7 +152,7 @@ USE db ## SET -```sql +``` sql SET param = value ``` @@ -165,7 +165,7 @@ SET param = value ## OPTIMIZE -```sql +``` sql OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition] [FINAL] ``` @@ -179,7 +179,7 @@ OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition] [FINAL] ## KILL QUERY -```sql +``` sql KILL QUERY [ON CLUSTER cluster] WHERE [SYNC|ASYNC|TEST] @@ -190,7 +190,7 @@ KILL QUERY [ON CLUSTER cluster] Запросы для принудительной остановки выбираются из таблицы system.processes с помощью условия, указанного в секции `WHERE` запроса `KILL`. Примеры: -```sql +``` sql -- Принудительно останавливает все запросы с указанным query_id: KILL QUERY WHERE query_id='2-857d-4a57-9ee0-327da5d60a90' diff --git a/docs/ru/query_language/operators.md b/docs/ru/query_language/operators.md index 75693c3ff2d..3814e1699d4 100644 --- a/docs/ru/query_language/operators.md +++ b/docs/ru/query_language/operators.md @@ -87,7 +87,7 @@ ## Условное выражение -```sql +``` sql CASE [x] WHEN a THEN b [WHEN ... THEN ...] diff --git a/docs/ru/query_language/select.md b/docs/ru/query_language/select.md index 6d5a6db7d02..4bf5e1020fb 100644 --- a/docs/ru/query_language/select.md +++ b/docs/ru/query_language/select.md @@ -2,7 +2,7 @@ `SELECT` осуществляет выборку данных. -```sql +``` sql SELECT [DISTINCT] expr_list [FROM [db.]table | (subquery) | table_function] [FINAL] [SAMPLE sample_coeff] @@ -59,7 +59,7 @@ SELECT [DISTINCT] expr_list Пример: -```sql +``` sql SELECT Title, count() * 10 AS PageViews @@ -343,7 +343,7 @@ ARRAY JOIN nest AS n, arrayEnumerate(`nest.x`) AS num Обычный JOIN, не имеет отношения к ARRAY JOIN, который описан выше. -```sql +``` sql [GLOBAL] ANY|ALL INNER|LEFT [OUTER] JOIN (subquery)|table USING columns_list ``` @@ -380,7 +380,7 @@ JOIN-ы бывают нескольких видов: Пример: -```sql +``` sql SELECT CounterID, hits, @@ -500,7 +500,7 @@ WHERE isNull(y) Пример: -```sql +``` sql SELECT count(), median(FetchTiming > 60 ? 60 : FetchTiming), @@ -514,7 +514,7 @@ FROM hits Пример: -```sql +``` sql SELECT domainWithoutWWW(URL) AS domain, count(), @@ -610,7 +610,7 @@ GROUP BY вычисляет для каждого встретившегося Пример: -```sql +``` sql SELECT domainWithoutWWW(URL) AS domain, domainWithoutWWW(REFERRER_URL) AS referrer, @@ -731,7 +731,7 @@ n и m должны быть неотрицательными целыми чи Произвольное количество запросов может быть объединено с помощью `UNION ALL`. Пример: -```sql +``` sql SELECT CounterID, 1 AS table, toInt64(count()) AS c FROM test.hits GROUP BY CounterID @@ -779,7 +779,7 @@ SELECT CounterID, 2 AS table, sum(Sign) AS c Примеры: -```sql +``` sql SELECT UserID IN (123, 456) FROM ... SELECT (CounterID, UserID) IN ((34, 123), (101500, 456)) FROM ... ``` @@ -798,7 +798,7 @@ SELECT (CounterID, UserID) IN ((34, 123), (101500, 456)) FROM ... В подзапросе может быть указано более одного столбца для фильтрации кортежей. Пример: -```sql +``` sql SELECT (CounterID, UserID) IN (SELECT CounterID, UserID FROM ...) FROM ... ``` @@ -807,7 +807,7 @@ SELECT (CounterID, UserID) IN (SELECT CounterID, UserID FROM ...) FROM ... Оператор IN и подзапрос могут встречаться в любой части запроса, в том числе в агрегатных и лямбда функциях. Пример: -```sql +``` sql SELECT EventDate, avg(UserID IN @@ -893,13 +893,13 @@ FROM t_null Например, запрос -```sql +``` sql SELECT uniq(UserID) FROM distributed_table ``` будет отправлен на все удалённые серверы в виде -```sql +``` sql SELECT uniq(UserID) FROM local_table ``` @@ -907,7 +907,7 @@ SELECT uniq(UserID) FROM local_table Теперь рассмотрим запрос с IN-ом: -```sql +``` sql SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM local_table WHERE CounterID = 34) ``` @@ -915,7 +915,7 @@ SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID I Этот запрос будет отправлен на все удалённые серверы в виде -```sql +``` sql SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM local_table WHERE CounterID = 34) ``` @@ -925,19 +925,19 @@ SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID IN (SEL Чтобы исправить работу запроса, когда данные размазаны по серверам кластера произвольным образом, можно было бы указать **distributed_table** внутри подзапроса. Запрос будет выглядеть так: -```sql +``` sql SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM distributed_table WHERE CounterID = 34) ``` Этот запрос будет отправлен на все удалённые серверы в виде -```sql +``` sql SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID IN (SELECT UserID FROM distributed_table WHERE CounterID = 34) ``` На каждом удалённом сервере начнёт выполняться подзапрос. Так как в подзапросе используется распределённая таблица, то подзапрос будет, на каждом удалённом сервере, снова отправлен на каждый удалённый сервер, в виде -```sql +``` sql SELECT UserID FROM local_table WHERE CounterID = 34 ``` @@ -945,19 +945,19 @@ SELECT UserID FROM local_table WHERE CounterID = 34 В таких случаях всегда следует использовать GLOBAL IN вместо IN. Рассмотрим его работу для запроса -```sql +``` sql SELECT uniq(UserID) FROM distributed_table WHERE CounterID = 101500 AND UserID GLOBAL IN (SELECT UserID FROM distributed_table WHERE CounterID = 34) ``` На сервере-инициаторе запроса будет выполнен подзапрос -```sql +``` sql SELECT UserID FROM distributed_table WHERE CounterID = 34 ``` , и результат будет сложен во временную таблицу в оперативке. Затем запрос будет отправлен на каждый удалённый сервер в виде -```sql +``` sql SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID GLOBAL IN _data1 ``` diff --git a/docs/ru/query_language/syntax.md b/docs/ru/query_language/syntax.md index ea44d1456ba..a09074a5681 100644 --- a/docs/ru/query_language/syntax.md +++ b/docs/ru/query_language/syntax.md @@ -4,7 +4,7 @@ Во всех случаях кроме запроса INSERT, используется только полноценный парсер SQL. В запросе INSERT используется оба парсера: -```sql +``` sql INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def') ``` @@ -100,7 +100,7 @@ INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def') В запросе SELECT, в выражениях могут быть указаны синонимы с помощью ключевого слова AS. Слева от AS стоит любое выражение. Справа от AS стоит идентификатор - имя для синонима. В отличие от стандартного SQL, синонимы могут объявляться не только на верхнем уровне выражений: -```sql +``` sql SELECT (1 AS n) + 2, n ``` diff --git a/docs/ru/query_language/table_functions/file.md b/docs/ru/query_language/table_functions/file.md index e4c80be7186..f0fe3d4687b 100644 --- a/docs/ru/query_language/table_functions/file.md +++ b/docs/ru/query_language/table_functions/file.md @@ -34,7 +34,7 @@ $ cat /var/lib/clickhouse/user_files/test.csv Таблица из `test.csv` и выборка первых двух строк из неё: -```sql +``` sql SELECT * FROM file('test.csv', 'CSV', 'column1 UInt32, column2 UInt32, column3 UInt32') LIMIT 2 diff --git a/docs/ru/query_language/table_functions/jdbc.md b/docs/ru/query_language/table_functions/jdbc.md index 4fbd12abadd..77b1da780ab 100644 --- a/docs/ru/query_language/table_functions/jdbc.md +++ b/docs/ru/query_language/table_functions/jdbc.md @@ -10,15 +10,15 @@ **Пример** -```sql +``` sql SELECT * FROM jdbc('jdbc:mysql://localhost:3306/?user=root&password=root', 'schema', 'table') ``` -```sql +``` sql SELECT * FROM jdbc('mysql://localhost:3306/?user=root&password=root', 'schema', 'table') ``` -```sql +``` sql SELECT * FROM jdbc('datasource://mysql-local', 'schema', 'table') ``` diff --git a/docs/ru/query_language/table_functions/numbers.md b/docs/ru/query_language/table_functions/numbers.md index 7406773c8c2..a5e4ba58ed9 100644 --- a/docs/ru/query_language/table_functions/numbers.md +++ b/docs/ru/query_language/table_functions/numbers.md @@ -7,13 +7,13 @@ Следующие запросы эквивалентны: -```sql +``` sql SELECT * FROM numbers(10); SELECT * FROM numbers(0,10); SELECT * FROM system.numbers LIMIT 10; ``` Примеры: -```sql +``` sql -- генерация последовательности всех дат от 2010-01-01 до 2010-12-31 select toDate('2010-01-01') + number as d FROM numbers(365); ``` diff --git a/docs/ru/query_language/table_functions/remote.md b/docs/ru/query_language/table_functions/remote.md index 17faaea6bb5..acd623a583e 100644 --- a/docs/ru/query_language/table_functions/remote.md +++ b/docs/ru/query_language/table_functions/remote.md @@ -6,7 +6,7 @@ Сигнатуры: -```sql +``` sql remote('addresses_expr', db, table[, 'user'[, 'password']]) remote('addresses_expr', db.table[, 'user'[, 'password']]) ``` diff --git a/docs/ru/query_language/table_functions/url.md b/docs/ru/query_language/table_functions/url.md index 461d38135d0..fccaf1fe11e 100644 --- a/docs/ru/query_language/table_functions/url.md +++ b/docs/ru/query_language/table_functions/url.md @@ -14,7 +14,7 @@ structure - структура таблицы в форме `'UserID UInt64, Nam **Пример** -```sql +``` sql -- получение 3-х строк таблицы, состоящей из двух колонк типа String и UInt32 от сервера, отдающего данные в формате CSV SELECT * FROM url('http://127.0.0.1:12345/', CSV, 'column1 String, column2 UInt32') LIMIT 3 ``` diff --git a/docs/zh/interfaces/formats.md b/docs/zh/interfaces/formats.md index 2a25df1c405..369905ae93d 100644 --- a/docs/zh/interfaces/formats.md +++ b/docs/zh/interfaces/formats.md @@ -40,7 +40,7 @@ Cap'n Proto 是一种二进制消息格式,类似 Protocol Buffers 和 Thrifti Cap'n Proto 消息格式是严格类型的,而不是自我描述,这意味着它们不需要外部的描述。这种格式可以实时地应用,并针对每个查询进行缓存。 -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' ``` @@ -87,7 +87,7 @@ CSV 格式是和 TabSeparated 一样的方式输出总数和极值。 以 JSON 格式输出数据。除了数据表之外,它还输出列名称和类型以及一些附加信息:输出行的总数以及在没有 LIMIT 时可以输出的行数。 例: -```sql +``` sql SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase WITH TOTALS ORDER BY c DESC LIMIT 5 FORMAT JSON ``` @@ -264,7 +264,7 @@ ClickHouse 支持 [NULL](../query_language/syntax.md#null-literal), 在 JSON 格 [NULL](../query_language/syntax.md#null-literal) 输出为 `ᴺᵁᴸᴸ`。 -```sql +``` sql SELECT * FROM t_null ``` @@ -279,7 +279,7 @@ SELECT * FROM t_null Pretty格式支持输出总值(当使用 WITH TOTALS 时)和极值(当 `extremes` 设置为1时)。 在这些情况下,总数值和极值在主数据之后以单独的表格形式输出。 示例(以 PrettyCompact 格式显示): -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT PrettyCompact ``` @@ -371,7 +371,7 @@ TabSeparated 格式非常方便用于自定义程序或脚本处理数据。HTTP TabSeparated 格式支持输出数据总值(当使用 WITH TOTALS) 以及极值(当 'extremes' 设置是1)。这种情况下,总值和极值输出在主数据的后面。主要的数据,总值,极值会以一个空行隔开,例如: -```sql +``` sql SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` @@ -470,7 +470,7 @@ SearchPhrase=baku count()=1000 [NULL](../query_language/syntax.md#null-literal) 输出为 `\N`。 -```sql +``` sql SELECT * FROM t_null FORMAT TSKV ``` @@ -502,7 +502,7 @@ x=1 y=\N 示例: -```sql +``` sql SELECT * FROM t_null FORMAT Vertical ``` From 848ca3bf9526febace6d598fda48fb402813861b Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 13:01:15 +0300 Subject: [PATCH 017/297] Remove outdated stuff from roadmap.md --- docs/en/roadmap.md | 10 +--------- docs/ru/roadmap.md | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/docs/en/roadmap.md b/docs/en/roadmap.md index 056ce76192d..490e570b659 100644 --- a/docs/en/roadmap.md +++ b/docs/en/roadmap.md @@ -1,22 +1,14 @@ # Roadmap -## Q3 2018 - -- `ALTER UPDATE` for batch changing the data with approach similar to `ALTER DELETE` -- Protobuf and Parquet input and output formats -- Improved compatibility with Tableau and other BI tools - ## Q4 2018 - JOIN syntax compatible with SQL standard: - Mutliple `JOIN`s in single `SELECT` - - Connecting tables with `ON` - - Support table reference instead of subquery - JOIN execution improvements: - Distributed join not limited by memory - - Predicate pushdown through join +- Protobuf and Parquet input and output formats - Resource pools for more precise distribution of cluster capacity between users [Original article](https://clickhouse.yandex/docs/en/roadmap/) diff --git a/docs/ru/roadmap.md b/docs/ru/roadmap.md index 6ebd233a956..5418cf8a8b1 100644 --- a/docs/ru/roadmap.md +++ b/docs/ru/roadmap.md @@ -1,22 +1,14 @@ # Roadmap -## Q3 2018 - -- `ALTER UPDATE` для массового изменения данных с использованием подхода, аналогичного `ALTER DELETE` -- Добавление Protobuf и Parquet к ассортименту поддерживаемых форматов ввода-вывода -- Улучшением совместимости с Tableau и другими инструментами бизнес-аналитики - ## Q4 2018 - Соответствующий SQL стандарту синтаксис JOIN: - Несколько `JOIN`ов в одном `SELECT` - - Указание связи между таблицами через `ON` - - Возможность сослаться на имя таблицы вместо обязательного использования подзапроса - Улучшения в исполнении JOIN: - Распределённый JOIN, не ограниченный оперативной памятью - - Перенос зависящих только от одной стороны предикатов сквозь JOIN +- Добавление Protobuf и Parquet к ассортименту поддерживаемых форматов ввода-вывода - Пулы ресурсов для более точного распределения мощностей кластера между его пользователями [Оригинальная статья](https://clickhouse.yandex/docs/ru/roadmap/) From 747ef2ad0848787e1e610daa9045e67ebe278b34 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 13:02:31 +0300 Subject: [PATCH 018/297] Not so light font on front page too --- website/index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.css b/website/index.css index fb626a2d802..8a51c5de0ed 100644 --- a/website/index.css +++ b/website/index.css @@ -65,7 +65,7 @@ body { background: #fff; - font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; + font: 400 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; margin: 0; padding: 0; } From e936c97c5390592403c1e96d92b7c4c1e70acdf3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 13:07:32 +0300 Subject: [PATCH 019/297] Refactor Chinese formats.md to match recent changes in other languages --- docs/zh/interfaces/formats.md | 278 +++++++++++++++++----------------- 1 file changed, 139 insertions(+), 139 deletions(-) diff --git a/docs/zh/interfaces/formats.md b/docs/zh/interfaces/formats.md index 369905ae93d..ec905713b1c 100644 --- a/docs/zh/interfaces/formats.md +++ b/docs/zh/interfaces/formats.md @@ -32,31 +32,130 @@ ClickHouse 可以接受多种数据格式,可以在 (`INSERT`) 以及 (`SELECT | [XML](#xml) | ✗ | ✔ | | [CapnProto](#capnproto) | ✔ | ✔ | - + -## CapnProto +## TabSeparated -Cap'n Proto 是一种二进制消息格式,类似 Protocol Buffers 和 Thriftis,但与 JSON 或 MessagePack 格式不一样。 +在 TabSeparated 格式中,数据按行写入。每行包含由制表符分隔的值。除了行中的最后一个值(后面紧跟换行符)之外,每个值都跟随一个制表符。 在任何地方都可以使用严格的 Unix 命令行。最后一行还必须在最后包含换行符。值以文本格式编写,不包含引号,并且要转义特殊字符。 -Cap'n Proto 消息格式是严格类型的,而不是自我描述,这意味着它们不需要外部的描述。这种格式可以实时地应用,并针对每个查询进行缓存。 +这种格式也可以用 `TSV` 来表示。 + +TabSeparated 格式非常方便用于自定义程序或脚本处理数据。HTTP 客户端接口默认会用这种格式,命令行客户端批量模式下也会用这种格式。这种格式允许在不同数据库之间传输数据。例如,从 MYSQL 中导出数据然后导入到 ClickHouse 中,反之亦然。 + +TabSeparated 格式支持输出数据总值(当使用 WITH TOTALS) 以及极值(当 'extremes' 设置是1)。这种情况下,总值和极值输出在主数据的后面。主要的数据,总值,极值会以一个空行隔开,例如: ``` sql -SELECT SearchPhrase, count() AS c FROM test.hits - GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` ``` -其中 `schema.capnp` 描述如下: - ``` -struct Message { - SearchPhrase @0 :Text; - c @1 :Uint64; -} +2014-03-17 1406958 +2014-03-18 1383658 +2014-03-19 1405797 +2014-03-20 1353623 +2014-03-21 1245779 +2014-03-22 1031592 +2014-03-23 1046491 + +0000-00-00 8873898 + +2014-03-17 1031592 +2014-03-23 1406958 ``` -格式文件存储的目录可以在服务配置中的[ format_schema_path ](../operations/server_settings/settings.md#server_settings-format_schema_path) 指定。 +### 数据解析方式 -Cap'n Proto 反序列化是很高效的,通常不会增加系统的负载。 +整数以十进制形式写入。数字在开头可以包含额外的 `+` 字符(解析时忽略,格式化时不记录)。非负数不能包含负号。 读取时,允许将空字符串解析为零,或者(对于带符号的类型)将仅包含负号的字符串解析为零。 不符合相应数据类型的数字可能会被解析为不同的数字,而不会显示错误消息。 + +浮点数以十进制形式写入。点号用作小数点分隔符。支持指数等符号,如'inf','+ inf','-inf'和'nan'。 浮点数的输入可以以小数点开始或结束。 +格式化的时候,浮点数的精确度可能会丢失。 +解析的时候,没有严格需要去读取与机器可以表示的最接近的数值。 + +日期会以 YYYY-MM-DD 格式写入和解析,但会以任何字符作为分隔符。 +带时间的日期会以 YYYY-MM-DD hh:mm:ss 格式写入和解析,但会以任何字符作为分隔符。 +这一切都发生在客户端或服务器启动时的系统时区(取决于哪一种格式的数据)。对于具有时间的日期,夏时制时间未指定。 因此,如果转储在夏令时中有时间,则转储不会明确地匹配数据,解析将选择两者之一。 +在读取操作期间,不正确的日期和具有时间的日期可以使用自然溢出或空日期和时间进行分析,而不会出现错误消息。 + +有个例外情况,Unix 时间戳格式(10个十进制数字)也支持使用时间解析日期。结果不是时区相关的。格式 YYYY-MM-DD hh:mm:ss和 NNNNNNNNNN 会自动区分。 + +字符串以反斜线转义的特殊字符输出。 以下转义序列用于输出:`\b`,`\f`,`\r`,`\n`,`\t`,`\0`,`\'`,`\\`。 解析还支持`\a`,`\v`和`\xHH`(十六进制转义字符)和任何`\c`字符,其中`c`是任何字符(这些序列被转换为`c`)。 因此,读取数据支持可以将换行符写为`\n`或`\`的格式,或者换行。例如,字符串 `Hello world` 在单词之间换行而不是空格可以解析为以下任何形式: + +``` +Hello\nworld + +Hello\ +world +``` + +第二种形式是支持的,因为 MySQL 读取 tab-separated 格式数据集的时候也会使用它。 + +在 TabSeparated 格式中传递数据时需要转义的最小字符集为:Tab,换行符(LF)和反斜杠。 + +只有一小组符号会被转义。你可以轻易地找到一个字符串值,但这不会正常在你的终端显示。 + +数组写在方括号内的逗号分隔值列表中。 通常情况下,数组中的数字项目会被拼凑,但日期,带时间的日期以及字符串将使用与上面相同的转义规则用单引号引起来。 + +[NULL](../query_language/syntax.md#null-literal) 将输出为 `\N`。 + + + +## TabSeparatedRaw + +与 `TabSeparated` 格式不一样的是,行数据是不会被转义的。 +该格式仅适用于输出查询结果,但不适用于解析输入(将数据插入到表中)。 + +这种格式也可以使用名称 `TSVRaw` 来表示。 + + +## TabSeparatedWithNames + +与 `TabSeparated` 格式不一样的是,第一行会显示列的名称。 +在解析过程中,第一行完全被忽略。您不能使用列名来确定其位置或检查其正确性。 +(未来可能会加入解析头行的功能) + +这种格式也可以使用名称 ` TSVWithNames` 来表示。 + + +## TabSeparatedWithNamesAndTypes + +与 `TabSeparated` 格式不一样的是,第一行会显示列的名称,第二行会显示列的类型。 +在解析过程中,第一行和第二行完全被忽略。 + +这种格式也可以使用名称 ` TSVWithNamesAndTypes` 来表示。 + + +## TSKV + +与 `TabSeparated` 格式类似,但它输出的是 `name=value` 的格式。名称会和 `TabSeparated` 格式一样被转义,`=` 字符也会被转义。 + +``` +SearchPhrase= count()=8267016 +SearchPhrase=bathroom interior design count()=2166 +SearchPhrase=yandex count()=1655 +SearchPhrase=2014 spring fashion count()=1549 +SearchPhrase=freeform photos count()=1480 +SearchPhrase=angelina jolie count()=1245 +SearchPhrase=omsk count()=1112 +SearchPhrase=photos of dog breeds count()=1091 +SearchPhrase=curtain designs count()=1064 +SearchPhrase=baku count()=1000 +``` + +[NULL](../query_language/syntax.md#null-literal) 输出为 `\N`。 + +``` sql +SELECT * FROM t_null FORMAT TSKV +``` + +``` +x=1 y=\N +``` + +当有大量的小列时,这种格式是低效的,通常没有理由使用它。它被用于 Yandex 公司的一些部门。 + +数据的输出和解析都支持这种格式。对于解析,任何顺序都支持不同列的值。可以省略某些值,用 `-` 表示, 它们被视为等于它们的默认值。在这种情况下,零和空行被用作默认值。作为默认值,不支持表中指定的复杂值。 + +对于不带等号或值,可以用附加字段 `tskv` 来表示,这种在解析上是被允许的。这样的话该字段被忽略。 ## CSV @@ -359,131 +458,6 @@ FixedString 被简单地表示为一个字节序列。 对于 [NULL](../query_language/syntax.md#null-literal) 的支持, 一个为 1 或 0 的字节会加在每个 [Nullable](../data_types/nullable.md#data_type-nullable) 值前面。如果为 1, 那么该值就是 `NULL`。 如果为 0,则不为 `NULL`。 - - -## TabSeparated - -在 TabSeparated 格式中,数据按行写入。每行包含由制表符分隔的值。除了行中的最后一个值(后面紧跟换行符)之外,每个值都跟随一个制表符。 在任何地方都可以使用严格的 Unix 命令行。最后一行还必须在最后包含换行符。值以文本格式编写,不包含引号,并且要转义特殊字符。 - -这种格式也可以用 `TSV` 来表示。 - -TabSeparated 格式非常方便用于自定义程序或脚本处理数据。HTTP 客户端接口默认会用这种格式,命令行客户端批量模式下也会用这种格式。这种格式允许在不同数据库之间传输数据。例如,从 MYSQL 中导出数据然后导入到 ClickHouse 中,反之亦然。 - -TabSeparated 格式支持输出数据总值(当使用 WITH TOTALS) 以及极值(当 'extremes' 设置是1)。这种情况下,总值和极值输出在主数据的后面。主要的数据,总值,极值会以一个空行隔开,例如: - -``` sql -SELECT EventDate, count() AS c FROM test.hits GROUP BY EventDate WITH TOTALS ORDER BY EventDate FORMAT TabSeparated`` -``` - -``` -2014-03-17 1406958 -2014-03-18 1383658 -2014-03-19 1405797 -2014-03-20 1353623 -2014-03-21 1245779 -2014-03-22 1031592 -2014-03-23 1046491 - -0000-00-00 8873898 - -2014-03-17 1031592 -2014-03-23 1406958 -``` - -## 数据解析方式 - -整数以十进制形式写入。数字在开头可以包含额外的 `+` 字符(解析时忽略,格式化时不记录)。非负数不能包含负号。 读取时,允许将空字符串解析为零,或者(对于带符号的类型)将仅包含负号的字符串解析为零。 不符合相应数据类型的数字可能会被解析为不同的数字,而不会显示错误消息。 - -浮点数以十进制形式写入。点号用作小数点分隔符。支持指数等符号,如'inf','+ inf','-inf'和'nan'。 浮点数的输入可以以小数点开始或结束。 -格式化的时候,浮点数的精确度可能会丢失。 -解析的时候,没有严格需要去读取与机器可以表示的最接近的数值。 - -日期会以 YYYY-MM-DD 格式写入和解析,但会以任何字符作为分隔符。 -带时间的日期会以 YYYY-MM-DD hh:mm:ss 格式写入和解析,但会以任何字符作为分隔符。 -这一切都发生在客户端或服务器启动时的系统时区(取决于哪一种格式的数据)。对于具有时间的日期,夏时制时间未指定。 因此,如果转储在夏令时中有时间,则转储不会明确地匹配数据,解析将选择两者之一。 -在读取操作期间,不正确的日期和具有时间的日期可以使用自然溢出或空日期和时间进行分析,而不会出现错误消息。 - -有个例外情况,Unix 时间戳格式(10个十进制数字)也支持使用时间解析日期。结果不是时区相关的。格式 YYYY-MM-DD hh:mm:ss和 NNNNNNNNNN 会自动区分。 - -字符串以反斜线转义的特殊字符输出。 以下转义序列用于输出:`\b`,`\f`,`\r`,`\n`,`\t`,`\0`,`\'`,`\\`。 解析还支持`\a`,`\v`和`\xHH`(十六进制转义字符)和任何`\c`字符,其中`c`是任何字符(这些序列被转换为`c`)。 因此,读取数据支持可以将换行符写为`\n`或`\`的格式,或者换行。例如,字符串 `Hello world` 在单词之间换行而不是空格可以解析为以下任何形式: - -``` -Hello\nworld - -Hello\ -world -``` - -第二种形式是支持的,因为 MySQL 读取 tab-separated 格式数据集的时候也会使用它。 - -在 TabSeparated 格式中传递数据时需要转义的最小字符集为:Tab,换行符(LF)和反斜杠。 - -只有一小组符号会被转义。你可以轻易地找到一个字符串值,但这不会正常在你的终端显示。 - -数组写在方括号内的逗号分隔值列表中。 通常情况下,数组中的数字项目会被拼凑,但日期,带时间的日期以及字符串将使用与上面相同的转义规则用单引号引起来。 - -[NULL](../query_language/syntax.md#null-literal) 将输出为 `\N`。 - - - -## TabSeparatedRaw - -与 `TabSeparated` 格式不一样的是,行数据是不会被转义的。 -该格式仅适用于输出查询结果,但不适用于解析输入(将数据插入到表中)。 - -这种格式也可以使用名称 `TSVRaw` 来表示。 - - -## TabSeparatedWithNames - -与 `TabSeparated` 格式不一样的是,第一行会显示列的名称。 -在解析过程中,第一行完全被忽略。您不能使用列名来确定其位置或检查其正确性。 -(未来可能会加入解析头行的功能) - -这种格式也可以使用名称 ` TSVWithNames` 来表示。 - - -## TabSeparatedWithNamesAndTypes - -与 `TabSeparated` 格式不一样的是,第一行会显示列的名称,第二行会显示列的类型。 -在解析过程中,第一行和第二行完全被忽略。 - -这种格式也可以使用名称 ` TSVWithNamesAndTypes` 来表示。 - - -## TSKV - -与 `TabSeparated` 格式类似,但它输出的是 `name=value` 的格式。名称会和 `TabSeparated` 格式一样被转义,`=` 字符也会被转义。 - -``` -SearchPhrase= count()=8267016 -SearchPhrase=bathroom interior design count()=2166 -SearchPhrase=yandex count()=1655 -SearchPhrase=2014 spring fashion count()=1549 -SearchPhrase=freeform photos count()=1480 -SearchPhrase=angelina jolie count()=1245 -SearchPhrase=omsk count()=1112 -SearchPhrase=photos of dog breeds count()=1091 -SearchPhrase=curtain designs count()=1064 -SearchPhrase=baku count()=1000 -``` - -[NULL](../query_language/syntax.md#null-literal) 输出为 `\N`。 - -``` sql -SELECT * FROM t_null FORMAT TSKV -``` - -``` -x=1 y=\N -``` - -当有大量的小列时,这种格式是低效的,通常没有理由使用它。它被用于 Yandex 公司的一些部门。 - -数据的输出和解析都支持这种格式。对于解析,任何顺序都支持不同列的值。可以省略某些值,用 `-` 表示, 它们被视为等于它们的默认值。在这种情况下,零和空行被用作默认值。作为默认值,不支持表中指定的复杂值。 - -对于不带等号或值,可以用附加字段 `tskv` 来表示,这种在解析上是被允许的。这样的话该字段被忽略。 - ## Values 在括号中打印每一行。行由逗号分隔。最后一行之后没有逗号。括号内的值也用逗号分隔。数字以十进制格式输出,不含引号。 数组以方括号输出。带有时间的字符串,日期和时间用引号包围输出。转义字符的解析规则与 [TabSeparated](#tabseparated) 格式类似。 在格式化过程中,不插入额外的空格,但在解析过程中,空格是被允许并跳过的(除了数组值之外的空格,这是不允许的)。[NULL](../query_language/syntax.md#null-literal) 为 `NULL`。 @@ -622,4 +596,30 @@ test: string with \'quotes\' and \t with some special \n characters 数组输出为 ` Hello World ... `,元组输出为 ` Hello World ... ` 。 + + +## CapnProto + +Cap'n Proto 是一种二进制消息格式,类似 Protocol Buffers 和 Thriftis,但与 JSON 或 MessagePack 格式不一样。 + +Cap'n Proto 消息格式是严格类型的,而不是自我描述,这意味着它们不需要外部的描述。这种格式可以实时地应用,并针对每个查询进行缓存。 + +``` sql +SELECT SearchPhrase, count() AS c FROM test.hits + GROUP BY SearchPhrase FORMAT CapnProto SETTINGS schema = 'schema:Message' +``` + +其中 `schema.capnp` 描述如下: + +``` +struct Message { + SearchPhrase @0 :Text; + c @1 :Uint64; +} +``` + +格式文件存储的目录可以在服务配置中的[ format_schema_path ](../operations/server_settings/settings.md#server_settings-format_schema_path) 指定。 + +Cap'n Proto 反序列化是很高效的,通常不会增加系统的负载。 + [来源文章](https://clickhouse.yandex/docs/zh/interfaces/formats/) From f4c55f3afe76d9e609107af06c98be7fcce44f6a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 14:08:34 +0300 Subject: [PATCH 020/297] Update some links on front page --- website/index.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/website/index.html b/website/index.html index 53c63e828fe..137f4df0cc1 100644 --- a/website/index.html +++ b/website/index.html @@ -199,6 +199,8 @@ rel="external nofollow" target="_blank">ClickHouse vs Amazon RedShift Benchmark by Altinity
  • Geospatial processing with Clickhouse by Carto
  • +
  • ClickHouse and Vertica comparison by zhtsh (machine translation from Chinese)
  • ClickHouse and InfiniDB comparison by RamboLau (machine translation from Chinese)
  • @@ -306,9 +308,12 @@

    Success Stories

    Or email ClickHouse team at Yandex directly: From be65b4247c60db888a23e61fa89b22424e2f95b7 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 15:18:37 +0300 Subject: [PATCH 023/297] More front page links tuning --- website/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/index.html b/website/index.html index c6c33a76bfe..64675f0eb2c 100644 --- a/website/index.html +++ b/website/index.html @@ -313,13 +313,15 @@ rel="external nofollow" target="_blank">HTTP Analytics and DNS Analytics at CloudFlare

  • ClickHouse for Experimentation at Spotify
  • + rel="external nofollow" target="_blank">ClickHouse for Experimentation at Spotify
  • Migrating to Yandex ClickHouse by LifeStreet (machine translation from Russian)
  • How to start ClickHouse up and win the jackpot by SMI2 (machine translation from Russian)
  • First place at Analysys OLAP algorithm contest (machine translation from Chinese)
  • +
  • Speeding up Report API at Geniee (machine translation from Japanese)
  • LHCb experiment by CERN
  • From 769813f3420c65f190b2365e9304c4a10e0fc197 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 19:34:46 +0300 Subject: [PATCH 024/297] Add Amsterdam meetup link --- website/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/index.html b/website/index.html index 64675f0eb2c..566092278f1 100644 --- a/website/index.html +++ b/website/index.html @@ -92,7 +92,8 @@
    - Upcoming meetup in Beijing on October 28 + Upcoming meetups in Beijing on October 28 + and Amsterdam on November 15
    From cfd2a77ed4e60002d9b3c3bdc7334b3951974e19 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 16 Oct 2018 19:39:18 +0300 Subject: [PATCH 025/297] Smaller font to avoid second line --- website/index.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.css b/website/index.css index 8a51c5de0ed..56d1cc212ce 100644 --- a/website/index.css +++ b/website/index.css @@ -215,7 +215,7 @@ a:hover, a:active { #announcement { margin: 0 0 60px 0; padding: 20px 0; - font: 400 140%/133% 'Yandex Sans Display Web',Arial,sans-serif; + font: 400 125%/133% 'Yandex Sans Display Web',Arial,sans-serif; } .announcement-link { color: #000!important; From d1dee8cf1ab0de7a2523a7ff242f8ebddb3f49ab Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 17 Oct 2018 11:35:20 +0300 Subject: [PATCH 026/297] Add Amsterdam link to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dec43532bc1..c9ec3de44eb 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,4 @@ ClickHouse is an open-source column-oriented database management system that all ## Upcoming Meetups * [Beijing on October 28](http://www.clickhouse.com.cn/topic/5ba0e3f99d28dfde2ddc62a1) +* [Amsterdam on November 15](https://events.yandex.com/events/meetings/15-10-2018/) From 05731ff3ddeb0e47f889344822cb9085ed82cf7b Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 17 Oct 2018 12:17:23 +0300 Subject: [PATCH 027/297] Proper docs nav translation --- .../partials/language/en.html | 4 ++++ .../partials/language/fa.html | 4 ++++ .../partials/language/ru.html | 4 ++++ .../partials/language/zh.html | 4 ++++ .../mkdocs-material-theme/partials/nav.html | 24 ++++--------------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/partials/language/en.html b/docs/tools/mkdocs-material-theme/partials/language/en.html index 2068c97dace..e84e566446a 100644 --- a/docs/tools/mkdocs-material-theme/partials/language/en.html +++ b/docs/tools/mkdocs-material-theme/partials/language/en.html @@ -7,6 +7,10 @@ "footer.next": "Next", "meta.comments": "Comments", "meta.source": "Source", + "nav.multi_page": "Multi page version", + "nav.pdf": "PDF version", + "nav.single_page": "Single page version", + "nav.source": "ClickHouse source code", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", diff --git a/docs/tools/mkdocs-material-theme/partials/language/fa.html b/docs/tools/mkdocs-material-theme/partials/language/fa.html index 54a7d2860d3..71f50043932 100644 --- a/docs/tools/mkdocs-material-theme/partials/language/fa.html +++ b/docs/tools/mkdocs-material-theme/partials/language/fa.html @@ -8,6 +8,10 @@ "footer.next": "بعدی", "meta.comments": "نظرات", "meta.source": "منبع", + "nav.multi_page": "نسخه چند صفحه ای", + "nav.pdf": "نسخه PDF", + "nav.single_page": "نسخه تک صفحه", + "nav.source": "کد منبع کلیک", "search.language": "", "search.pipeline.stopwords": false, "search.pipeline.trimmer": false, diff --git a/docs/tools/mkdocs-material-theme/partials/language/ru.html b/docs/tools/mkdocs-material-theme/partials/language/ru.html index d762438bb60..b8baaea5eff 100644 --- a/docs/tools/mkdocs-material-theme/partials/language/ru.html +++ b/docs/tools/mkdocs-material-theme/partials/language/ru.html @@ -7,6 +7,10 @@ "footer.next": "Вперед", "meta.comments": "Комментарии", "meta.source": "Исходный код", + "nav.multi_page": "Многостраничная версия", + "nav.pdf": "PDF версия", + "nav.single_page": "Одностраничная версия", + "nav.source": "Исходный код ClickHouse", "search.placeholder": "Поиск", "search.result.placeholder": "Начните печатать для поиска", "search.result.none": "Совпадений не найдено", diff --git a/docs/tools/mkdocs-material-theme/partials/language/zh.html b/docs/tools/mkdocs-material-theme/partials/language/zh.html index 84c77d43c8e..89c94ee2a98 100644 --- a/docs/tools/mkdocs-material-theme/partials/language/zh.html +++ b/docs/tools/mkdocs-material-theme/partials/language/zh.html @@ -7,6 +7,10 @@ "footer.next": "前进", "meta.comments": "评论", "meta.source": "来源", + "nav.multi_page": "多页版本", + "nav.pdf": "PDF版本", + "nav.single_page": "单页版本", + "nav.source": "ClickHouse源代码", "search.placeholder": "搜索", "search.result.placeholder": "键入以开始搜索", "search.result.none": "没有找到符合条件的结果", diff --git a/docs/tools/mkdocs-material-theme/partials/nav.html b/docs/tools/mkdocs-material-theme/partials/nav.html index 14f5d507eea..cf58c0c4130 100644 --- a/docs/tools/mkdocs-material-theme/partials/nav.html +++ b/docs/tools/mkdocs-material-theme/partials/nav.html @@ -15,35 +15,19 @@
    • - {% if config.theme.language == 'ru' %} {% if config.extra.single_page %} - Многостраничная версия + {{ lang.t("nav.multi_page") }} {% else %} - Одностраничная версия + {{ lang.t("nav.single_page") }} {% endif %} - {% else %} - {% if config.extra.single_page %} - Multi page version - {% else %} - Single page version - {% endif %} - {% endif %}
    • - {% if config.theme.language == 'ru' %} - PDF версия - {% else %} - PDF version - {% endif %} + {{ lang.t("nav.pdf") }}
    • {% if config.repo_url %}
    • - {% if config.theme.language == 'ru' %} - Исходники ClickHouse - {% else %} - ClickHouse sources - {% endif %} + {{ lang.t("nav.source") }}
    • {% endif %} From 4fb814eb69272110998b9ccf9cc0c59ab7646d61 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 17 Oct 2018 12:18:56 +0300 Subject: [PATCH 028/297] Back to 300 font-weight except Chinese --- docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css | 2 +- website/index.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css index 0024345554b..8569b1d033d 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css @@ -64,7 +64,7 @@ } body { - font: 400 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; + font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; } body.md-lang-zh { diff --git a/website/index.css b/website/index.css index 56d1cc212ce..c5061595a9c 100644 --- a/website/index.css +++ b/website/index.css @@ -65,7 +65,7 @@ body { background: #fff; - font: 400 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; + font: 300 14pt/200% 'Yandex Sans Text Web', Arial, sans-serif; margin: 0; padding: 0; } From d030958a2a2818f8dabe67d473fb3d044cd1192a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 17 Oct 2018 15:48:18 +0300 Subject: [PATCH 029/297] fix docs build --- docs/zh/data_types/float.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/data_types/float.md b/docs/zh/data_types/float.md index 67a237ba5a5..6fb6b9eec40 100644 --- a/docs/zh/data_types/float.md +++ b/docs/zh/data_types/float.md @@ -67,6 +67,6 @@ └──────────────┘ ``` -可以在[ORDER BY 子句](../query_language/queries.md#query_language-queries-order_by) 查看更多关于 ` NaN` 排序的规则。 +可以在[ORDER BY 子句](../query_language/select.md#query_language-queries-order_by) 查看更多关于 ` NaN` 排序的规则。 [来源文章](https://clickhouse.yandex/docs/en/data_types/float/) From 6e1c547cf5b38655c7749e372aa8c700f9eb629e Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 17 Oct 2018 15:48:30 +0300 Subject: [PATCH 030/297] Update Amsterdam link --- README.md | 2 +- website/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c9ec3de44eb..e5ca7ce2ec5 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ ClickHouse is an open-source column-oriented database management system that all ## Upcoming Meetups * [Beijing on October 28](http://www.clickhouse.com.cn/topic/5ba0e3f99d28dfde2ddc62a1) -* [Amsterdam on November 15](https://events.yandex.com/events/meetings/15-10-2018/) +* [Amsterdam on November 15](https://events.yandex.com/events/meetings/15-11-2018/) diff --git a/website/index.html b/website/index.html index 566092278f1..3b6ca4f318a 100644 --- a/website/index.html +++ b/website/index.html @@ -93,7 +93,7 @@
      From 7a90b5f543bec49f16fba2e1609df3debbbbf3f3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 19 Oct 2018 11:15:43 +0300 Subject: [PATCH 031/297] remove symlinks --- docs/zh/query_language/create.md | 1 - docs/zh/query_language/insert_into.md | 1 - 2 files changed, 2 deletions(-) delete mode 120000 docs/zh/query_language/create.md delete mode 120000 docs/zh/query_language/insert_into.md diff --git a/docs/zh/query_language/create.md b/docs/zh/query_language/create.md deleted file mode 120000 index a13304d176e..00000000000 --- a/docs/zh/query_language/create.md +++ /dev/null @@ -1 +0,0 @@ -../../en/query_language/create.md \ No newline at end of file diff --git a/docs/zh/query_language/insert_into.md b/docs/zh/query_language/insert_into.md deleted file mode 120000 index 29b47662b0d..00000000000 --- a/docs/zh/query_language/insert_into.md +++ /dev/null @@ -1 +0,0 @@ -../../en/query_language/insert_into.md \ No newline at end of file From b1a20decd30f46cf9af01a44d434b822111deb82 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 19 Oct 2018 11:28:57 +0300 Subject: [PATCH 032/297] more zh punctuation --- docs/zh/query_language/create.md | 155 ++++++++++++++++++++++++++ docs/zh/query_language/insert_into.md | 68 +++++++++++ 2 files changed, 223 insertions(+) create mode 100644 docs/zh/query_language/create.md create mode 100644 docs/zh/query_language/insert_into.md diff --git a/docs/zh/query_language/create.md b/docs/zh/query_language/create.md new file mode 100644 index 00000000000..1134372a0fd --- /dev/null +++ b/docs/zh/query_language/create.md @@ -0,0 +1,155 @@ +## 创建数据库 + +创建 `db_name` 数据库。 + +```sql +CREATE DATABASE [IF NOT EXISTS] db_name +``` + +一个数据库是表的一个目录。 如果包含`IF NOT EXISTS`, 如果数据库已经存在,则查询不返回错误。 + + + +## 创建表 + +`CREATE TABLE` 语句有几种形式. + +```sql +CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] +( + name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1], + name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2], + ... +) ENGINE = engine +``` + +如果`db`没有设置, 在数据库`db`中或者当前数据库中, 创建一个表名为`name`的表, 在括号和`engine` 引擎中指定结构。 表的结构是一个列描述的列表。 如果引擎支持索引, 则他们将是表引擎的参数。 + +表结构是一个列描述的列表。 如果引擎支持索引, 他们以表引擎的参数表示。 + +在最简单的情况, 一个列描述是'命名类型'。 例如: RegionID UInt32。 对于默认值, 表达式也能够被定义。 + +```sql +CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name AS [db2.]name2 [ENGINE = engine] +``` + +创建一个表, 其结构与另一个表相同。 你能够为此表指定一个不同的引擎。 如果引擎没有被指定, 相同的引擎将被用于`db2。name2`表上。 + +```sql +CREATE [TEMPORARY] TABLE [IF NOT EXISTS] [db.]name ENGINE = engine AS SELECT ... +``` + +创建一个表,其结构类似于 SELECT 查询后的结果, 带有`engine` 引擎, 从 SELECT查询数据填充它。 + +在所有情况下,如果`IF NOT EXISTS`被指定, 如果表已经存在, 查询并不返回一个错误。 在这种情况下, 查询并不做任何事情。 + +### 默认值 + +列描述能够为默认值指定一个表达式, 其中一个方法是:DEFAULT expr, MATERIALIZED expr, ALIAS expr。 +例如: URLDomain String DEFAULT domain(URL)。 + +如果默认值的一个表达式没有定义, 如果字段是数字类型, 默认值是将设置为0, 如果是字符类型, 则设置为空字符串, 日期类型则设置为 0000-00-00 或者 0000-00-00 00:00:00(时间戳)。 NULLs 则不支持。 + +如果默认表达式被定义, 字段类型是可选的。 如果没有明确的定义类型, 则将使用默认表达式。 例如: EventDate DEFAULT toDate(EventTime) – `Date` 类型将用于 `EventDate` 字段。 + +如果数据类型和默认表达式被明确定义, 此表达式将使用函数被转换为特定的类型。 例如: Hits UInt32 DEFAULT 0 与 Hits UInt32 DEFAULT toUInt32(0)是等价的。 + +默认表达是可能被定义为一个任意的表达式,如表的常量和字段。 当创建和更改表结构时, 它将检查表达式是否包含循环。 对于 INSERT操作来说, 它将检查表达式是否可解析 – 所有的字段通过传参后进行计算。 + +`DEFAULT expr` + +正常的默认值。 如果 INSERT 查询并没有指定对应的字段, 它将通过计算对应的表达式来填充。 + +`物化表达式` + +物化表达式。 此类型字段并没有指定插入操作, 因为它经常执行计算任务。 对一个插入操作, 无字段列表, 那么这些字段将不考虑。 另外, 当在一个SELECT查询语句中使用星号时, 此字段并不被替换。 这将保证INSERT INTO SELECT * FROM 的不可变性。 + +`别名表达式` + +别名。 此字段不存储在表中。 +此列的值不插入到表中, 当在一个SELECT查询语句中使用星号时,此字段并不被替换。 +它能够用在 SELECTs中,如果别名在查询解析时被扩展。 + +当使用更新查询添加一个新的字段, 这些列的旧值不被写入。 相反, 新字段没有值,当读取旧值时, 表达式将被计算。 然而,如果运行表达式需要不同的字段, 这些字段将被读取 , 但是仅读取相关的数据块。 + +如果你添加一个新的字段到表中, 然后改变它的默认表达式, 对于使用的旧值将更改(对于此数据, 值不保存在磁盘上)。 当运行背景线程时, 缺少合并数据块的字段数据写入到合并数据块中。 + +在嵌套数据结构中设置默认值是不允许的。 + + +### 临时表 + +在任何情况下, 如果临时表被指定, 一个临时表将被创建。 临时表有如下的特性: + +- 当会话结束后, 临时表将删除,或者连接丢失。 +- 一个临时表使用内存表引擎创建。 其他的表引擎不支持临时表。 +- 数据库不能为一个临时表指定。 它将创建在数据库之外。 +- 如果一个临时表与另外的表有相同的名称 ,一个查询指定了表名并没有指定数据库, 将使用临时表。 +- 对于分布式查询处理, 查询中的临时表将被传递给远程服务器。 + +在大多数情况下, 临时表并不能手工创建, 但当查询外部数据或使用分布式全局(GLOBAL)IN时,可以创建临时表。 + +分布式 DDL 查询 (ON CLUSTER clause) +---------------------------------------------- + +`CREATE`, `DROP`, `ALTER`, 和 `RENAME` 查询支持在集群上分布式执行。 例如, 如下的查询在集群中的每个机器节点上创建了 all_hits Distributed 表: + +```sql +CREATE TABLE IF NOT EXISTS all_hits ON CLUSTER cluster (p Date, i Int32) ENGINE = Distributed(cluster, default, hits) +``` + +为了正确执行这些语句,每个节点必须有相同的集群设置(为了简化同步配置,可以使用 zookeeper 来替换)。 这些节点也可以连接到ZooKeeper 服务器。 +查询语句会在每个节点上执行, 而`ALTER`查询目前暂不支持在同步表(replicated table)上执行。 + + + +## CREATE VIEW + +```sql +CREATE [MATERIALIZED] VIEW [IF NOT EXISTS] [db.]name [TO[db.]name] [ENGINE = engine] [POPULATE] AS SELECT ... +``` + +创建一个视图。 有两种类型的视图: 正常视图和物化(MATERIALIZED)视图。 + +当创建一个物化视图时, 你必须指定表引擎 – 此表引擎用于存储数据 + +一个物化视图工作流程如下所示: 当插入数据到SELECT 查询指定的表中时, 插入数据部分通过SELECT查询部分来转换, 结果插入到视图中。 + +正常视图不保存任何数据, 但是可以从任意表中读取数据。 换句话说,正常视图可以看作是查询结果的一个结果缓存。 当从一个视图中读取数据时, 此查询可以看做是 FROM语句的子查询。 + +例如, 假设你已经创建了一个视图: + +```sql +CREATE VIEW view AS SELECT ... +``` + +写了一个查询语句: + +```sql +SELECT a, b, c FROM view +``` +此查询完全等价于子查询: + +```sql +SELECT a, b, c FROM (SELECT ...) +``` + +物化视图保存由SELECT语句查询转换的数据。 + +当创建一个物化视图时,你必须指定一个引擎 – 存储数据的目标引擎。 + +一个物化视图使用流程如下: 当插入数据到 SELECT 指定的表时, 插入数据部分通过SELECT 来转换, 同时结果被插入到视图中。 + + +如果你指定了 POPULATE, 当创建时, 现有的表数据被插入到了视图中, 类似于 `CREATE TABLE ... AS SELECT ...` . 否则, 在创建视图之后,查询仅包含表中插入的数据. 我们不建议使用 POPULATE, 在视图创建过程中,插入到表中的数据不插入到其中. + +一个`SELECT`查询可以包含 `DISTINCT`, `GROUP BY`, `ORDER BY`, `LIMIT`。。。 对应的转换在每个数据块上独立执行。 例如, 如果 GROUP BY 被设置, 数据将在插入过程中进行聚合, 但仅是在一个插入数据包中。数据不再进一步聚合。 当使用一个引擎时, 如SummingMergeTree,它将独立执行数据聚合。 + +视图看起来和正常表相同。 例如, 你可以使用 SHOW TABLES来列出视图表的相关信息。 + +物化视图的`ALTER`查询执行还没有完全开发出来, 因此使用上可能不方便。 如果物化视图使用 `TO [db。]name`, 你能够 `DETACH` 视图, 在目标表运行 `ALTER`, 然后 `ATTACH` 之前的 `DETACH`视图。 + +视图看起来和正常表相同。 例如, 你可以使用 `SHOW TABLES` 来列出视图表的相关信息。 + +因此并没有一个单独的SQL语句来删除视图。 为了删除一个视图, 可以使用 `DROP TABLE`。 + diff --git a/docs/zh/query_language/insert_into.md b/docs/zh/query_language/insert_into.md new file mode 100644 index 00000000000..7bea8a0b361 --- /dev/null +++ b/docs/zh/query_language/insert_into.md @@ -0,0 +1,68 @@ + + +## INSERT + +正在添加数据。 + +基本查询格式: + +```sql +INSERT INTO [db.]table [(c1, c2, c3)] VALUES (v11, v12, v13), (v21, v22, v23), ... +``` + +此查询能够指定字段的列表来插入 `[(c1, c2, c3)]`。 在这种情况下, 剩下的字段用如下来填充: + +- 从表定义中指定的 `DEFAULT` 表达式中计算出值。 +- 空字符串, 如果 `DEFAULT` 表达式没有定义。 + +如果 [strict_insert_defaults=1](../operations/settings/settings.md#settings-strict_insert_defaults), 没有 `DEFAULT` 定义的字段必须在查询中列出. + +在任何ClickHouse所支持的格式上 [format](../interfaces/formats.md#formats) 数据被传入到 INSERT中. 此格式必须被显式地指定在查询中: + +```sql +INSERT INTO [db.]table [(c1, c2, c3)] FORMAT format_name data_set +``` + +例如, 如下的查询格式与基本的 `INSERT ... VALUES` 版本相同: + +```sql +INSERT INTO [db.]table [(c1, c2, c3)] FORMAT Values (v11, v12, v13), (v21, v22, v23), ... +``` + +ClickHouse 在数据之前, 删除所有空格和换行(如果有)。 当形成一个查询时, 我们推荐在查询操作符之后将数据放入新行(如果数据以空格开始, 这是重要的)。 + +示例: + +```sql +INSERT INTO t FORMAT TabSeparated +11 Hello, world! +22 Qwerty +``` + +你能够单独从查询中插入数据,通过命令行或 HTTP 接口. 进一步信息, 参见 "[Interfaces](../interfaces/index.md#interfaces)". + +### Inserting The Results of `SELECT` + +```sql +INSERT INTO [db.]table [(c1, c2, c3)] SELECT ... +``` + +在 SELECT语句中, 根据字段的位置来映射。 然而, 在SELECT表达式中的名称和表名可能不同。 如果必要, 可以进行类型转换。 + +除了值以外没有其他数据类型允许设置值到表达式中, 例如 `now()`, `1 + 2`, 等。 值格式允许使用有限制的表达式, 但是它并不推荐, 因为在这种情况下, 执行了低效的代码。 + +不支持修改数据分区的查询如下: `UPDATE`, `DELETE`, `REPLACE`, `MERGE`, `UPSERT`, `INSERT UPDATE`。 +然而, 你能够使用 `ALTER TABLE ... DROP PARTITION`来删除旧数据。 + +### Performance Considerations + +`INSERT` 通过主键来排序数据, 并通过月份来拆分数据到每个分区中。 如果插入的数据有混合的月份, 会显著降低`INSERT` 插入的性能。 应该避免此类操作: + +- 大批量地添加数据, 如每次 100,000 行。 +- 在上传数据之前, 通过月份分组数据。 + +下面操作性能不会下降: + +- 数据实时插入。 +- 上传的数据通过时间来排序。 + From 1a4745ca9a7d5ff5566795b0512a12920033abc4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 19 Oct 2018 11:30:03 +0300 Subject: [PATCH 033/297] apply lost comment by @zhang2014 --- docs/zh/query_language/create.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/query_language/create.md b/docs/zh/query_language/create.md index 1134372a0fd..d554dfeeb5b 100644 --- a/docs/zh/query_language/create.md +++ b/docs/zh/query_language/create.md @@ -6,7 +6,7 @@ CREATE DATABASE [IF NOT EXISTS] db_name ``` -一个数据库是表的一个目录。 如果包含`IF NOT EXISTS`, 如果数据库已经存在,则查询不返回错误。 +数据库是一个包含多个表的目录,如果在CREATE DATABASE语句中包含`IF NOT EXISTS`,则在数据库已经存在的情况下查询也不会返回错误。 From 258d989c02d8ec750f5d4ade923d7726658f3a54 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 19 Oct 2018 11:33:47 +0300 Subject: [PATCH 034/297] Apply comments by @zhang2014 from #3417 --- docs/zh/data_types/array.md | 6 +++--- docs/zh/data_types/datetime.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/zh/data_types/array.md b/docs/zh/data_types/array.md index 0dc89baf3c7..00e07d38be0 100644 --- a/docs/zh/data_types/array.md +++ b/docs/zh/data_types/array.md @@ -4,11 +4,11 @@ 由 `T` 类型元素组成的数组。 -`T` 可以是任意类型,包含数组类型。不推荐使用多维数组,ClickHouse 对多维数组的支持有限。例如,不能存储在 `MergeTree` 表中存储多维数组。 +`T` 可以是任意类型,包含数组类型。 但不推荐使用多维数组,ClickHouse 对多维数组的支持有限。例如,不能存储在 `MergeTree` 表中存储多维数组。 ## 创建数组 -您可以使用一个函数创建数组: +您可以使用array函数来创建数组: ``` array(T) @@ -50,7 +50,7 @@ SELECT ## 使用数据类型 -当动态创建数组时,ClickHouse 自动将参数类型定义为可以存储所有列出的参数的最窄的数据类型。如果存在任何 [NULL](../query_language/syntax.md#null-literal) 或者 [Nullable](nullable.md#data_type-nullable) 类型参数,那么数组元素的类型是 [Nullable](nullable.md#data_type-nullable)。 +ClickHouse会自动检测数组元素,并根据元素计算出存储这些元素最小的数据类型。如果在元素中存在[NULL](../query_language/syntax.md#null-literal)或存在[Nullable](nullable.md#data_type-nullable)类型元素,那么数组的元素类型将会变成[Nullable](nullable.md#data_type-nullable)。 如果 ClickHouse 无法确定数据类型,它将产生异常。当尝试同时创建一个包含字符串和数字的数组时会发生这种情况 (`SELECT array(1, 'a')`)。 diff --git a/docs/zh/data_types/datetime.md b/docs/zh/data_types/datetime.md index 4a5a8095f0a..6988d7da283 100644 --- a/docs/zh/data_types/datetime.md +++ b/docs/zh/data_types/datetime.md @@ -2,7 +2,7 @@ # DateTime -时间戳类型。用四个字节存储 Unix 时间戳(无符号的)。允许存储与日期类型相同的范围内的值。最小值为 0000-00-00 00:00:00。时间戳类型值精确到秒(没有闰秒)。 +时间戳类型。用四个字节(无符号的)存储 Unix 时间戳)。允许存储与日期类型相同的范围内的值。最小值为 0000-00-00 00:00:00。时间戳类型值精确到秒(没有闰秒)。 ## 时区 From d1f025d8ed60911f8a2dca71f10e7db94a3a3eeb Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 1 Nov 2018 16:30:46 +0300 Subject: [PATCH 035/297] Remove Beijing link --- website/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/index.html b/website/index.html index 3b6ca4f318a..fffeed2e211 100644 --- a/website/index.html +++ b/website/index.html @@ -92,8 +92,7 @@
      - Upcoming meetups in Beijing on October 28 - and Amsterdam on November 15 + Upcoming meetup in Amsterdam on November 15
      From 4466d0382ac0180db772748f8a251528f0fbf751 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 1 Nov 2018 16:41:44 +0300 Subject: [PATCH 036/297] rm incorrect symlink --- docs/zh/operations/table_engines/index.md | 13 ------------- 1 file changed, 13 deletions(-) delete mode 120000 docs/zh/operations/table_engines/index.md diff --git a/docs/zh/operations/table_engines/index.md b/docs/zh/operations/table_engines/index.md deleted file mode 120000 index b1d1c5db49d..00000000000 --- a/docs/zh/operations/table_engines/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# 表引擎 -表引擎(即表的类型)决定了: - -* 数据的存储方式和位置,写到哪里以及从哪里读取数据。 -* 支持哪些查询以及如何支持。 -* 并发数据访问。 -* 索引的使用(如果存在)。 -* 是否可以执行多线程请求。 -* 数据复制参数。 - -在读取时,引擎只需要输出所请求的列,但在某些情况下,引擎可以在响应请求时部分处理数据。 - -对于大多数正式的任务,应该使用MergeTree族中的引擎。 From 8907a1fb57b0cbd24b66d354d41773441c3620b9 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 1 Nov 2018 16:43:44 +0300 Subject: [PATCH 037/297] restore content of docs/zh/operations/table_engines/index.md --- docs/zh/operations/table_engines/index.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/zh/operations/table_engines/index.md diff --git a/docs/zh/operations/table_engines/index.md b/docs/zh/operations/table_engines/index.md new file mode 100644 index 00000000000..000a1f6cadd --- /dev/null +++ b/docs/zh/operations/table_engines/index.md @@ -0,0 +1,14 @@ +# 表引擎 + +表引擎(即表的类型)决定了: + +* 数据的存储方式和位置,写到哪里以及从哪里读取数据 +* 支持哪些查询以及如何支持。 +* 并发数据访问。 +* 索引的使用(如果存在)。 +* 是否可以执行多线程请求。 +* 数据复制参数。 + +在读取时,引擎只需要输出所请求的列,但在某些情况下,引擎可以在响应请求时部分处理数据。 + +对于大多数正式的任务,应该使用MergeTree族中的引擎。 From efd9f1ee10f12bc5d2f770f3f6322e08b0e5fd33 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 1 Nov 2018 20:17:28 +0300 Subject: [PATCH 038/297] CLICKHOUSE-3751: stem terms while searching docs --- .../mkdocs-material-theme/assets/javascripts/application.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/tools/mkdocs-material-theme/assets/javascripts/application.js b/docs/tools/mkdocs-material-theme/assets/javascripts/application.js index 0d4c888548b..3ab61ed15c5 100644 --- a/docs/tools/mkdocs-material-theme/assets/javascripts/application.js +++ b/docs/tools/mkdocs-material-theme/assets/javascripts/application.js @@ -4887,6 +4887,12 @@ var Result = function () { /* Append trailing wildcard to all terms for prefix querying */ .query(function (query) { _this.value_.toLowerCase().split(" ").filter(Boolean).forEach(function (term) { + for (var lang in _this.lang_) { + lang = _this.lang_[lang]; + if (typeof(_exposeLoaderLunrLunr2.default[lang]) !== 'undefined' && typeof(_exposeLoaderLunrLunr2.default[lang].stemmer) !== 'undefined') { + term = _exposeLoaderLunrLunr2.default[lang].stemmer(new _exposeLoaderLunrLunr2.default.Token(term)).toString(); + } + } query.term(term, { wildcard: _exposeLoaderLunrLunr2.default.Query.wildcard.TRAILING }); }); }) From 59bd6c1d4aca818aa5b11bb730a429c12e0183ac Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 2 Nov 2018 06:40:55 +0300 Subject: [PATCH 039/297] CLICKHOUSE-3751: use English stemmer in non-English docs too --- .../mkdocs-material-theme/assets/javascripts/application.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tools/mkdocs-material-theme/assets/javascripts/application.js b/docs/tools/mkdocs-material-theme/assets/javascripts/application.js index 3ab61ed15c5..ab6ed32146d 100644 --- a/docs/tools/mkdocs-material-theme/assets/javascripts/application.js +++ b/docs/tools/mkdocs-material-theme/assets/javascripts/application.js @@ -4887,6 +4887,7 @@ var Result = function () { /* Append trailing wildcard to all terms for prefix querying */ .query(function (query) { _this.value_.toLowerCase().split(" ").filter(Boolean).forEach(function (term) { + term = _exposeLoaderLunrLunr2.default.stemmer(new _exposeLoaderLunrLunr2.default.Token(term)).toString(); for (var lang in _this.lang_) { lang = _this.lang_[lang]; if (typeof(_exposeLoaderLunrLunr2.default[lang]) !== 'undefined' && typeof(_exposeLoaderLunrLunr2.default[lang].stemmer) !== 'undefined') { From 16855ef7d88bd4542b393468db10b4fb15cd9a60 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 13 Nov 2018 11:40:07 +0300 Subject: [PATCH 040/297] CLICKHOUSE-4135 fix --- .../mkdocs-material-theme/assets/javascripts/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/mkdocs-material-theme/assets/javascripts/application.js b/docs/tools/mkdocs-material-theme/assets/javascripts/application.js index ab6ed32146d..12b85194724 100644 --- a/docs/tools/mkdocs-material-theme/assets/javascripts/application.js +++ b/docs/tools/mkdocs-material-theme/assets/javascripts/application.js @@ -4894,7 +4894,7 @@ var Result = function () { term = _exposeLoaderLunrLunr2.default[lang].stemmer(new _exposeLoaderLunrLunr2.default.Token(term)).toString(); } } - query.term(term, { wildcard: _exposeLoaderLunrLunr2.default.Query.wildcard.TRAILING }); + query.term(term, { wildcard: _exposeLoaderLunrLunr2.default.Query.wildcard.TRAILING | _exposeLoaderLunrLunr2.default.Query.wildcard.LEADING }); }); }) From 7f936c07ab58a817bb15ee1de329e2cf130ea82a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 20 Nov 2018 17:27:17 +0300 Subject: [PATCH 041/297] Remove past meetup link --- website/index.html | 5 ----- 1 file changed, 5 deletions(-) diff --git a/website/index.html b/website/index.html index fffeed2e211..e011ad6006e 100644 --- a/website/index.html +++ b/website/index.html @@ -90,11 +90,6 @@
    -
    -
    - Upcoming meetup in Amsterdam on November 15 -
    -

    ClickHouse. Just makes you think faster.

    From 8242d3685393f58bb4f23f124c7eca5d7b7a63ad Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 22 Nov 2018 16:59:14 +0300 Subject: [PATCH 042/297] Add blog link to top nav --- website/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/website/index.html b/website/index.html index e011ad6006e..b6cac775912 100644 --- a/website/index.html +++ b/website/index.html @@ -31,6 +31,7 @@ Quick Start Performance Documentation + Blog Contacts
    From f23e2ae2cb262b4dd249370bda264fb3e29df032 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 23 Nov 2018 16:10:34 +0300 Subject: [PATCH 043/297] Add ContentSquare article link --- website/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/index.html b/website/index.html index b6cac775912..d70c1be8089 100644 --- a/website/index.html +++ b/website/index.html @@ -312,6 +312,8 @@ rel="external nofollow" target="_blank">ClickHouse for Experimentation at Spotify
  • Migrating to Yandex ClickHouse by LifeStreet (machine translation from Russian)
  • +
  • ClickHouse at ContentSquare (machine translation from French)
  • How to start ClickHouse up and win the jackpot by SMI2 (machine translation from Russian)
  • Date: Fri, 23 Nov 2018 19:11:02 +0300 Subject: [PATCH 044/297] Add form link to front page + refactor some texts --- website/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/website/index.html b/website/index.html index d70c1be8089..69de8f0804f 100644 --- a/website/index.html +++ b/website/index.html @@ -436,13 +436,12 @@ clickhouse-client
  • Follow official Twitter account.
  • +

    Or email Yandex ClickHouse team directly at + turn on JavaScript to see email address. + You can also fill this form to meet us in person. -

    Or email ClickHouse team at Yandex directly: - turn on JavaScript to see email address, - for example if you are interested in commercial support.

    - -

    Friendly reminder: check out the documentation in English or Russian first — maybe your question is already covered. +

    Friendly reminder: check out the documentation in English, Russian, Chinese or Farsi first — maybe your question is already covered.

    Like ClickHouse?

    @@ -450,6 +449,9 @@ clickhouse-client Twitter and LinkedIn!

    +

    Also hosting ClickHouse Meetups is very appreciated, fill this form + if you are interested and we will get in touch. + Short reports about previous meetups are published in official ClickHouse blog.

    From 7f00870b5d511912aa3032fb7568625079d68b4c Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 23 Nov 2018 19:16:21 +0300 Subject: [PATCH 045/297] couple markup fixes --- website/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/index.html b/website/index.html index 69de8f0804f..3b440ffe59d 100644 --- a/website/index.html +++ b/website/index.html @@ -436,12 +436,12 @@ clickhouse-client

  • Follow official Twitter account.
  • -

    Or email Yandex ClickHouse team directly at - turn on JavaScript to see email address. +

  • Or email Yandex ClickHouse team directly at + turn on JavaScript to see email address.
    You can also fill this form to meet us in person.
  • -

    Friendly reminder: check out the documentation in English, Russian, Chinese or Farsi first — maybe your question is already covered. +

    Friendly reminder: check out the documentation in English, Russian, Chinese or Farsi first — maybe your question is already covered.

    Like ClickHouse?

    From 4be902097992c57902689c327d3c1ba0b15ef6aa Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 23 Nov 2018 19:29:57 +0300 Subject: [PATCH 046/297] minor --- website/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/index.html b/website/index.html index 3b440ffe59d..048b46f60e4 100644 --- a/website/index.html +++ b/website/index.html @@ -437,7 +437,7 @@ clickhouse-client href="https://twitter.com/ClickHouseDB" rel="external nofollow" target="_blank">Twitter account.
  • Or email Yandex ClickHouse team directly at - turn on JavaScript to see email address.
    + turn on JavaScript to see email address. You can also fill this form to meet us in person.
  • @@ -450,7 +450,7 @@ clickhouse-client LinkedIn!

    Also hosting ClickHouse Meetups is very appreciated, fill this form - if you are interested and we will get in touch. + if you are interested and we'll get in touch. Short reports about previous meetups are published in official ClickHouse blog.

    Date: Mon, 26 Nov 2018 16:20:36 +0300 Subject: [PATCH 047/297] Introduce basic ODBC driver page in docs --- docs/en/interfaces/jdbc.md | 2 +- docs/en/interfaces/odbc.md | 6 ++++++ docs/fa/interfaces/jdbc.md | 2 -- docs/fa/interfaces/odbc.md | 7 +++++++ docs/ru/interfaces/odbc.md | 5 +++++ docs/toc_en.yml | 3 ++- docs/toc_fa.yml | 3 ++- docs/toc_ru.yml | 5 +++-- docs/toc_zh.yml | 7 ++++--- docs/zh/interfaces/odbc.md | 5 +++++ 10 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 docs/en/interfaces/odbc.md create mode 100644 docs/fa/interfaces/odbc.md create mode 100644 docs/ru/interfaces/odbc.md create mode 100644 docs/zh/interfaces/odbc.md diff --git a/docs/en/interfaces/jdbc.md b/docs/en/interfaces/jdbc.md index 8454881dfb7..de735abfdfd 100644 --- a/docs/en/interfaces/jdbc.md +++ b/docs/en/interfaces/jdbc.md @@ -1,7 +1,7 @@ # JDBC Driver - [Official driver](https://github.com/yandex/clickhouse-jdbc). -- Third-party driver from [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC). +- Third-party driver [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC). [Original article](https://clickhouse.yandex/docs/en/interfaces/jdbc/) diff --git a/docs/en/interfaces/odbc.md b/docs/en/interfaces/odbc.md new file mode 100644 index 00000000000..845c4e21fb3 --- /dev/null +++ b/docs/en/interfaces/odbc.md @@ -0,0 +1,6 @@ +# ODBC Driver + +- [Official driver](https://github.com/yandex/clickhouse-odbc). + + +[Original article](https://clickhouse.yandex/docs/en/interfaces/odbc/) diff --git a/docs/fa/interfaces/jdbc.md b/docs/fa/interfaces/jdbc.md index e72b5504c06..5cb82ff4274 100644 --- a/docs/fa/interfaces/jdbc.md +++ b/docs/fa/interfaces/jdbc.md @@ -5,10 +5,8 @@ درایور رسمی JDBC برای ClickHouse وجود دارد. برای اطلاعات بیشتر [اینجا](https://github.com/yandex/clickhouse-jdbc) را ببینید. -JDBC drivers implemented by other organizations: درایور JDBC توسط سازمان های دیگر اجرا می شوند. - - [ClickHouse-Native-JDBC](https://github.com/housepower/ClickHouse-Native-JDBC) diff --git a/docs/fa/interfaces/odbc.md b/docs/fa/interfaces/odbc.md new file mode 100644 index 00000000000..692fc92651d --- /dev/null +++ b/docs/fa/interfaces/odbc.md @@ -0,0 +1,7 @@ +

    +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/odbc/) diff --git a/docs/ru/interfaces/odbc.md b/docs/ru/interfaces/odbc.md new file mode 100644 index 00000000000..9feb43f13ea --- /dev/null +++ b/docs/ru/interfaces/odbc.md @@ -0,0 +1,5 @@ +# ODBC-драйвер + +- [Официальный драйвер](https://github.com/yandex/clickhouse-jdbc). + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/odbc/) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index ec4ae4e8619..6b6eb0dc8e2 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -20,9 +20,10 @@ nav: - 'Interfaces': - 'Introduction': 'interfaces/index.md' - 'Command-line client': 'interfaces/cli.md' + - 'Native interface (TCP)': 'interfaces/tcp.md' - 'HTTP interface': 'interfaces/http_interface.md' - 'JDBC driver': 'interfaces/jdbc.md' - - 'Native interface (TCP)': 'interfaces/tcp.md' + - 'ODBC driver': 'interfaces/odbc.md' - 'Libraries from third-party developers': 'interfaces/third-party_client_libraries.md' - 'Visual interfaces from third-party developers': 'interfaces/third-party_gui.md' - 'Input and output formats': 'interfaces/formats.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index bf10398ce85..2cf402e4611 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -20,9 +20,10 @@ nav: - 'Interfaces': - 'Interface ها': 'interfaces/index.md' - ' کلاینت Command-line': 'interfaces/cli.md' + - 'Native interface (TCP)': 'interfaces/tcp.md' - 'HTTP interface': 'interfaces/http_interface.md' - ' درایور JDBC': 'interfaces/jdbc.md' - - 'Native interface (TCP)': 'interfaces/tcp.md' + - ' درایور ODBC': 'interfaces/odbc.md' - ' کتابخانه های توسعه دهندگان third-party': 'interfaces/third-party_client_libraries.md' - 'interface های visual توسعه دهندگان third-party': 'interfaces/third-party_gui.md' - ' فرمت های Input و Output': 'interfaces/formats.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 00003aa9359..7bd3af5dfc9 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -20,12 +20,13 @@ nav: - 'Интерфейсы': - 'Введение': 'interfaces/index.md' - 'Клиент командной строки': 'interfaces/cli.md' + - 'Нативный интерфейс (TCP)': 'interfaces/tcp.md' - 'HTTP-интерфейс': 'interfaces/http_interface.md' + - 'Форматы входных и выходных данных': 'interfaces/formats.md' - 'JDBC-драйвер': 'interfaces/jdbc.md' - - 'Родной интерфейс (TCP)': 'interfaces/tcp.md' + - 'ODBC-драйвер': 'interfaces/odbc.md' - 'Библиотеки от сторонних разработчиков': 'interfaces/third-party_client_libraries.md' - 'Визуальные интерфейсы от сторонних разработчиков': 'interfaces/third-party_gui.md' - - 'Форматы входных и выходных данных': 'interfaces/formats.md' - 'Типы данных': - 'Введение': 'data_types/index.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 3b5a3d2756e..a7662e412aa 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -20,12 +20,13 @@ nav: - '客户端': - '介绍': 'interfaces/index.md' - '命令行客户端接口': 'interfaces/cli.md' - - 'HTTP 客户端接口': 'interfaces/http_interface.md' - - 'JDBC 驱动': 'interfaces/jdbc.md' - '原生客户端接口 (TCP)': 'interfaces/tcp.md' + - 'HTTP 客户端接口': 'interfaces/http_interface.md' + - '输入输出格式': 'interfaces/formats.md' + - 'JDBC 驱动': 'interfaces/jdbc.md' + - 'ODBC 驱动': 'interfaces/odbc.md' - '第三方开发的库': 'interfaces/third-party_client_libraries.md' - '第三方开发的可视化界面': 'interfaces/third-party_gui.md' - - '输入输出格式': 'interfaces/formats.md' - '数据类型': - '介绍': 'data_types/index.md' diff --git a/docs/zh/interfaces/odbc.md b/docs/zh/interfaces/odbc.md new file mode 100644 index 00000000000..120201bcc7c --- /dev/null +++ b/docs/zh/interfaces/odbc.md @@ -0,0 +1,5 @@ +# ODBC 驱动 + +- ClickHouse官方有 JDBC 的驱动。 见[这里](https://github.com/yandex/clickhouse-jdbc)。 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/odbc/) From 7a35f2087a68f3356fbdaf8e10ee91f0e9517224 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 26 Nov 2018 16:36:31 +0300 Subject: [PATCH 048/297] More verbose 3rd party libs disclaimer --- docs/en/interfaces/third-party_client_libraries.md | 3 ++- docs/fa/interfaces/third-party_client_libraries.md | 3 ++- docs/ru/interfaces/third-party_client_libraries.md | 3 ++- docs/zh/interfaces/third-party_client_libraries.md | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/en/interfaces/third-party_client_libraries.md b/docs/en/interfaces/third-party_client_libraries.md index 3ae40e829dc..2be4cf37b38 100644 --- a/docs/en/interfaces/third-party_client_libraries.md +++ b/docs/en/interfaces/third-party_client_libraries.md @@ -1,6 +1,7 @@ # Libraries from Third-party Developers -We have not tested the libraries listed below. +!!! warning "Disclaimer" + Yandex does **not** maintain the libraries listed below and haven't done any extensive testing to ensure their quality. - Python - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) diff --git a/docs/fa/interfaces/third-party_client_libraries.md b/docs/fa/interfaces/third-party_client_libraries.md index 3f6536ccf22..8ec03924a3a 100644 --- a/docs/fa/interfaces/third-party_client_libraries.md +++ b/docs/fa/interfaces/third-party_client_libraries.md @@ -2,7 +2,8 @@ # کتابخانه های توسعه دهندگان third-party -کتابخانه هایی برای کار با ClickHouse وجود دارد: +!!! warning "سلب مسئولیت" + Yandex نه حفظ کتابخانه ها در زیر ذکر شده و نشده انجام هر آزمایش های گسترده ای برای اطمینان از کیفیت آنها. - Python - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) diff --git a/docs/ru/interfaces/third-party_client_libraries.md b/docs/ru/interfaces/third-party_client_libraries.md index 6cebd98271d..c270ebcea64 100644 --- a/docs/ru/interfaces/third-party_client_libraries.md +++ b/docs/ru/interfaces/third-party_client_libraries.md @@ -1,6 +1,7 @@ # Библиотеки от сторонних разработчиков -Мы не тестировали перечисленные ниже библиотеки. +!!! warning "Disclaimer" + Яндекс не поддерживает перечисленные ниже библиотеки и не проводит тщательного тестирования для проверки их качества. - Python: - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) diff --git a/docs/zh/interfaces/third-party_client_libraries.md b/docs/zh/interfaces/third-party_client_libraries.md index c3cabeaca80..eb8d4b56562 100644 --- a/docs/zh/interfaces/third-party_client_libraries.md +++ b/docs/zh/interfaces/third-party_client_libraries.md @@ -1,6 +1,7 @@ # 第三方开发的库 -以下都是适用于 ClickHouse 的第三方库: +!!! warning "放弃" + Yandex不维护下面列出的库,也没有进行任何广泛的测试以确保其质量。 - Python - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) From 8232e4d579ff89e6b0afa4078829550e48dc30e0 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 26 Nov 2018 16:51:16 +0300 Subject: [PATCH 049/297] Put third-party stuff into a separate folder --- .../client_libraries.md} | 0 docs/en/interfaces/{third-party_gui.md => third-party/gui.md} | 0 .../client_libraries.md} | 0 docs/fa/interfaces/{third-party_gui.md => third-party/gui.md} | 0 docs/redirects.txt | 2 ++ .../client_libraries.md} | 0 docs/ru/interfaces/{third-party_gui.md => third-party/gui.md} | 0 docs/toc_en.yml | 4 ++-- docs/toc_fa.yml | 4 ++-- docs/toc_ru.yml | 4 ++-- docs/toc_zh.yml | 4 ++-- .../client_libraries.md} | 0 docs/zh/interfaces/{third-party_gui.md => third-party/gui.md} | 0 13 files changed, 10 insertions(+), 8 deletions(-) rename docs/en/interfaces/{third-party_client_libraries.md => third-party/client_libraries.md} (100%) rename docs/en/interfaces/{third-party_gui.md => third-party/gui.md} (100%) rename docs/fa/interfaces/{third-party_client_libraries.md => third-party/client_libraries.md} (100%) rename docs/fa/interfaces/{third-party_gui.md => third-party/gui.md} (100%) rename docs/ru/interfaces/{third-party_client_libraries.md => third-party/client_libraries.md} (100%) rename docs/ru/interfaces/{third-party_gui.md => third-party/gui.md} (100%) rename docs/zh/interfaces/{third-party_client_libraries.md => third-party/client_libraries.md} (100%) rename docs/zh/interfaces/{third-party_gui.md => third-party/gui.md} (100%) diff --git a/docs/en/interfaces/third-party_client_libraries.md b/docs/en/interfaces/third-party/client_libraries.md similarity index 100% rename from docs/en/interfaces/third-party_client_libraries.md rename to docs/en/interfaces/third-party/client_libraries.md diff --git a/docs/en/interfaces/third-party_gui.md b/docs/en/interfaces/third-party/gui.md similarity index 100% rename from docs/en/interfaces/third-party_gui.md rename to docs/en/interfaces/third-party/gui.md diff --git a/docs/fa/interfaces/third-party_client_libraries.md b/docs/fa/interfaces/third-party/client_libraries.md similarity index 100% rename from docs/fa/interfaces/third-party_client_libraries.md rename to docs/fa/interfaces/third-party/client_libraries.md diff --git a/docs/fa/interfaces/third-party_gui.md b/docs/fa/interfaces/third-party/gui.md similarity index 100% rename from docs/fa/interfaces/third-party_gui.md rename to docs/fa/interfaces/third-party/gui.md diff --git a/docs/redirects.txt b/docs/redirects.txt index f9473c69d94..d21acde9eea 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -116,3 +116,5 @@ table_functions/numbers.md query_language/table_functions/numbers.md table_functions/remote.md query_language/table_functions/remote.md query_language/queries.md query_language.md introduction/possible_silly_questions.md faq/general.md +interfaces/third-party_client_libraries.md interfaces/third-party/client_libraries.md +interfaces/third-party_gui.md interfaces/third-party/gui.md diff --git a/docs/ru/interfaces/third-party_client_libraries.md b/docs/ru/interfaces/third-party/client_libraries.md similarity index 100% rename from docs/ru/interfaces/third-party_client_libraries.md rename to docs/ru/interfaces/third-party/client_libraries.md diff --git a/docs/ru/interfaces/third-party_gui.md b/docs/ru/interfaces/third-party/gui.md similarity index 100% rename from docs/ru/interfaces/third-party_gui.md rename to docs/ru/interfaces/third-party/gui.md diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 6b6eb0dc8e2..1f9964cf6f2 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -24,8 +24,8 @@ nav: - 'HTTP interface': 'interfaces/http_interface.md' - 'JDBC driver': 'interfaces/jdbc.md' - 'ODBC driver': 'interfaces/odbc.md' - - 'Libraries from third-party developers': 'interfaces/third-party_client_libraries.md' - - 'Visual interfaces from third-party developers': 'interfaces/third-party_gui.md' + - 'Libraries from third-party developers': 'interfaces/third-party/client_libraries.md' + - 'Visual interfaces from third-party developers': 'interfaces/third-party/gui.md' - 'Input and output formats': 'interfaces/formats.md' - 'Data types': diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 2cf402e4611..3e0ca16fdf6 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -24,8 +24,8 @@ nav: - 'HTTP interface': 'interfaces/http_interface.md' - ' درایور JDBC': 'interfaces/jdbc.md' - ' درایور ODBC': 'interfaces/odbc.md' - - ' کتابخانه های توسعه دهندگان third-party': 'interfaces/third-party_client_libraries.md' - - 'interface های visual توسعه دهندگان third-party': 'interfaces/third-party_gui.md' + - ' کتابخانه های توسعه دهندگان third-party': 'interfaces/third-party/client_libraries.md' + - 'interface های visual توسعه دهندگان third-party': 'interfaces/third-party/gui.md' - ' فرمت های Input و Output': 'interfaces/formats.md' - 'Data types': diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 7bd3af5dfc9..603e7b518a4 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -25,8 +25,8 @@ nav: - 'Форматы входных и выходных данных': 'interfaces/formats.md' - 'JDBC-драйвер': 'interfaces/jdbc.md' - 'ODBC-драйвер': 'interfaces/odbc.md' - - 'Библиотеки от сторонних разработчиков': 'interfaces/third-party_client_libraries.md' - - 'Визуальные интерфейсы от сторонних разработчиков': 'interfaces/third-party_gui.md' + - 'Библиотеки от сторонних разработчиков': 'interfaces/third-party/client_libraries.md' + - 'Визуальные интерфейсы от сторонних разработчиков': 'interfaces/third-party/gui.md' - 'Типы данных': - 'Введение': 'data_types/index.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index a7662e412aa..0e97a69227e 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -25,8 +25,8 @@ nav: - '输入输出格式': 'interfaces/formats.md' - 'JDBC 驱动': 'interfaces/jdbc.md' - 'ODBC 驱动': 'interfaces/odbc.md' - - '第三方开发的库': 'interfaces/third-party_client_libraries.md' - - '第三方开发的可视化界面': 'interfaces/third-party_gui.md' + - '第三方开发的库': 'interfaces/third-party/client_libraries.md' + - '第三方开发的可视化界面': 'interfaces/third-party/gui.md' - '数据类型': - '介绍': 'data_types/index.md' diff --git a/docs/zh/interfaces/third-party_client_libraries.md b/docs/zh/interfaces/third-party/client_libraries.md similarity index 100% rename from docs/zh/interfaces/third-party_client_libraries.md rename to docs/zh/interfaces/third-party/client_libraries.md diff --git a/docs/zh/interfaces/third-party_gui.md b/docs/zh/interfaces/third-party/gui.md similarity index 100% rename from docs/zh/interfaces/third-party_gui.md rename to docs/zh/interfaces/third-party/gui.md From 3dac8703b5f41894db4e6a2959f271f537a66594 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 26 Nov 2018 16:57:16 +0300 Subject: [PATCH 050/297] Separate third-party stuff in ToC too --- docs/toc_en.yml | 7 ++++--- docs/toc_fa.yml | 7 ++++--- docs/toc_ru.yml | 5 +++-- docs/toc_zh.yml | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 1f9964cf6f2..95520d4b0a7 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -22,11 +22,12 @@ nav: - 'Command-line client': 'interfaces/cli.md' - 'Native interface (TCP)': 'interfaces/tcp.md' - 'HTTP interface': 'interfaces/http_interface.md' + - 'Input and output formats': 'interfaces/formats.md' - 'JDBC driver': 'interfaces/jdbc.md' - 'ODBC driver': 'interfaces/odbc.md' - - 'Libraries from third-party developers': 'interfaces/third-party/client_libraries.md' - - 'Visual interfaces from third-party developers': 'interfaces/third-party/gui.md' - - 'Input and output formats': 'interfaces/formats.md' + - 'Third-party': + - 'Client libraries': 'interfaces/third-party/client_libraries.md' + - 'Visual Interfaces': 'interfaces/third-party/gui.md' - 'Data types': - 'Introduction': 'data_types/index.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 3e0ca16fdf6..349cdaafc7c 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -22,11 +22,12 @@ nav: - ' کلاینت Command-line': 'interfaces/cli.md' - 'Native interface (TCP)': 'interfaces/tcp.md' - 'HTTP interface': 'interfaces/http_interface.md' + - ' فرمت های Input و Output': 'interfaces/formats.md' - ' درایور JDBC': 'interfaces/jdbc.md' - ' درایور ODBC': 'interfaces/odbc.md' - - ' کتابخانه های توسعه دهندگان third-party': 'interfaces/third-party/client_libraries.md' - - 'interface های visual توسعه دهندگان third-party': 'interfaces/third-party/gui.md' - - ' فرمت های Input و Output': 'interfaces/formats.md' + - 'Third-party': + - 'کتابخانه های مشتری': 'interfaces/third-party/client_libraries.md' + - 'رابط های بصری': 'interfaces/third-party/gui.md' - 'Data types': - 'Introduction': 'data_types/index.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 603e7b518a4..40e0da9a2d5 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -25,8 +25,9 @@ nav: - 'Форматы входных и выходных данных': 'interfaces/formats.md' - 'JDBC-драйвер': 'interfaces/jdbc.md' - 'ODBC-драйвер': 'interfaces/odbc.md' - - 'Библиотеки от сторонних разработчиков': 'interfaces/third-party/client_libraries.md' - - 'Визуальные интерфейсы от сторонних разработчиков': 'interfaces/third-party/gui.md' + - 'От сторонних разработчиков': + - 'Клиентские библиотеки': 'interfaces/third-party/client_libraries.md' + - 'Визуальные интерфейсы': 'interfaces/third-party/gui.md' - 'Типы данных': - 'Введение': 'data_types/index.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 0e97a69227e..206486aef46 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -25,8 +25,9 @@ nav: - '输入输出格式': 'interfaces/formats.md' - 'JDBC 驱动': 'interfaces/jdbc.md' - 'ODBC 驱动': 'interfaces/odbc.md' - - '第三方开发的库': 'interfaces/third-party/client_libraries.md' - - '第三方开发的可视化界面': 'interfaces/third-party/gui.md' + - '第三方': + - '客户端库': 'interfaces/third-party/client_libraries.md' + - '可视界面': 'interfaces/third-party/gui.md' - '数据类型': - '介绍': 'data_types/index.md' From 87b22ecd908e3554f3f574e8a513c60b32781378 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 26 Nov 2018 17:14:46 +0300 Subject: [PATCH 051/297] Update links --- docs/en/interfaces/third-party/client_libraries.md | 2 +- docs/fa/interfaces/third-party/client_libraries.md | 2 +- docs/ru/interfaces/third-party/client_libraries.md | 2 +- docs/zh/interfaces/third-party/client_libraries.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/interfaces/third-party/client_libraries.md b/docs/en/interfaces/third-party/client_libraries.md index 2be4cf37b38..eb24f114b27 100644 --- a/docs/en/interfaces/third-party/client_libraries.md +++ b/docs/en/interfaces/third-party/client_libraries.md @@ -50,4 +50,4 @@ - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) -[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party_client_libraries/) +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/client_libraries/) diff --git a/docs/fa/interfaces/third-party/client_libraries.md b/docs/fa/interfaces/third-party/client_libraries.md index 8ec03924a3a..c557bcc7d92 100644 --- a/docs/fa/interfaces/third-party/client_libraries.md +++ b/docs/fa/interfaces/third-party/client_libraries.md @@ -49,4 +49,4 @@ ما این کتابخانه ها را تست نکردیم. آنها به صورت تصادفی انتخاب شده اند. -[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party_client_libraries/) +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party/client_libraries/) diff --git a/docs/ru/interfaces/third-party/client_libraries.md b/docs/ru/interfaces/third-party/client_libraries.md index c270ebcea64..469cea5b61b 100644 --- a/docs/ru/interfaces/third-party/client_libraries.md +++ b/docs/ru/interfaces/third-party/client_libraries.md @@ -49,4 +49,4 @@ - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) -[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party_client_libraries/) +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party/client_libraries/) diff --git a/docs/zh/interfaces/third-party/client_libraries.md b/docs/zh/interfaces/third-party/client_libraries.md index eb8d4b56562..776746a94dc 100644 --- a/docs/zh/interfaces/third-party/client_libraries.md +++ b/docs/zh/interfaces/third-party/client_libraries.md @@ -47,4 +47,4 @@ - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) -[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party_client_libraries/) +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party/client_libraries/) From 4cbfa2e1294f856d210efafaf1772e9955b7e1d2 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 26 Nov 2018 17:43:33 +0300 Subject: [PATCH 052/297] Move stuff that is not really (only) a client library into a separate page --- .../third-party/client_libraries.md | 15 +++++------- .../en/interfaces/third-party/integrations.md | 22 +++++++++++++++++ .../third-party/client_libraries.md | 15 ++++++------ .../fa/interfaces/third-party/integrations.md | 24 +++++++++++++++++++ .../third-party/client_libraries.md | 15 +++++------- .../ru/interfaces/third-party/integrations.md | 21 ++++++++++++++++ docs/toc_en.yml | 1 + docs/toc_fa.yml | 1 + docs/toc_ru.yml | 1 + docs/toc_zh.yml | 1 + .../third-party/client_libraries.md | 11 ++++----- .../zh/interfaces/third-party/integrations.md | 22 +++++++++++++++++ 12 files changed, 118 insertions(+), 31 deletions(-) create mode 100644 docs/en/interfaces/third-party/integrations.md create mode 100644 docs/fa/interfaces/third-party/integrations.md create mode 100644 docs/ru/interfaces/third-party/integrations.md create mode 100644 docs/zh/interfaces/third-party/integrations.md diff --git a/docs/en/interfaces/third-party/client_libraries.md b/docs/en/interfaces/third-party/client_libraries.md index eb24f114b27..5878d6e0200 100644 --- a/docs/en/interfaces/third-party/client_libraries.md +++ b/docs/en/interfaces/third-party/client_libraries.md @@ -1,11 +1,10 @@ -# Libraries from Third-party Developers +# Client Libraries from Third-party Developers !!! warning "Disclaimer" Yandex does **not** maintain the libraries listed below and haven't done any extensive testing to ensure their quality. - Python - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) - [clickhouse-driver](https://github.com/mymarilyn/clickhouse-driver) - [clickhouse-client](https://github.com/yurial/clickhouse-client) - [aiochclient](https://github.com/maximdanilchenko/aiochclient) @@ -31,21 +30,19 @@ - R - [clickhouse-r](https://github.com/hannesmuehleisen/clickhouse-r) - [RClickhouse](https://github.com/IMSMWU/RClickhouse) +- Java + - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) - Scala - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) -- .NET +- Kotlin + - [AORM](https://github.com/TanVD/AORM) +- C# - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) - - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) - C++ - [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp/) - Elixir - [clickhousex](https://github.com/appodeal/clickhousex/) - - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) -- Java - - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) -- Kotlin - - [AORM](https://github.com/TanVD/AORM) - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md new file mode 100644 index 00000000000..2dcb4b4eb8c --- /dev/null +++ b/docs/en/interfaces/third-party/integrations.md @@ -0,0 +1,22 @@ +# Integration Libraries from Third-party Developers + +!!! warning "Disclaimer" + Yandex does **not** maintain the libraries listed below and haven't done any extensive testing to ensure their quality. + +- Python + - [SQLAlchemy](https://www.sqlalchemy.org) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Scala + - [Akka](https://akka.io) + - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) +- C# + - [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) + - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) + - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) + - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) +- Elixir + - [Ecto](https://github.com/elixir-ecto/ecto) + - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) + + +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/integrations/) \ No newline at end of file diff --git a/docs/fa/interfaces/third-party/client_libraries.md b/docs/fa/interfaces/third-party/client_libraries.md index c557bcc7d92..48034195fab 100644 --- a/docs/fa/interfaces/third-party/client_libraries.md +++ b/docs/fa/interfaces/third-party/client_libraries.md @@ -1,13 +1,12 @@
    -# کتابخانه های توسعه دهندگان third-party +# کتابخانه های مشتری شخص ثالث !!! warning "سلب مسئولیت" Yandex نه حفظ کتابخانه ها در زیر ذکر شده و نشده انجام هر آزمایش های گسترده ای برای اطمینان از کیفیت آنها. - Python - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) - [clickhouse-driver](https://github.com/mymarilyn/clickhouse-driver) - [clickhouse-client](https://github.com/yurial/clickhouse-client) - PHP @@ -32,17 +31,19 @@ - R - [clickhouse-r](https://github.com/hannesmuehleisen/clickhouse-r) - [RClickhouse](https://github.com/IMSMWU/RClickhouse) -- .NET +- Java + - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) +- Scala + - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) +- Kotlin + - [AORM](https://github.com/TanVD/AORM) +- C# - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) - - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) - C++ - [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp/) - Elixir - [clickhousex](https://github.com/appodeal/clickhousex/) - - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) -- Java - - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md new file mode 100644 index 00000000000..eaaa4dcec46 --- /dev/null +++ b/docs/fa/interfaces/third-party/integrations.md @@ -0,0 +1,24 @@ +
    + +# کتابخانه ادغام ثالث + +!!! warning "سلب مسئولیت" + Yandex نه حفظ کتابخانه ها در زیر ذکر شده و نشده انجام هر آزمایش های گسترده ای برای اطمینان از کیفیت آنها. + +- Python + - [SQLAlchemy](https://www.sqlalchemy.org) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Scala + - [Akka](https://akka.io) + - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) +- C# + - [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) + - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) + - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) + - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) +- Elixir + - [Ecto](https://github.com/elixir-ecto/ecto) + - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) + +
    +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party/integrations/) diff --git a/docs/ru/interfaces/third-party/client_libraries.md b/docs/ru/interfaces/third-party/client_libraries.md index 469cea5b61b..562b863922e 100644 --- a/docs/ru/interfaces/third-party/client_libraries.md +++ b/docs/ru/interfaces/third-party/client_libraries.md @@ -1,11 +1,10 @@ -# Библиотеки от сторонних разработчиков +# Клиентские библиотеки от сторонних разработчиков !!! warning "Disclaimer" Яндекс не поддерживает перечисленные ниже библиотеки и не проводит тщательного тестирования для проверки их качества. - Python: - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) - [clickhouse-driver](https://github.com/mymarilyn/clickhouse-driver) - [clickhouse-client](https://github.com/yurial/clickhouse-client) - [aiochclient](https://github.com/maximdanilchenko/aiochclient) @@ -31,21 +30,19 @@ - R - [clickhouse-r](https://github.com/hannesmuehleisen/clickhouse-r) - [RClickhouse](https://github.com/IMSMWU/RClickhouse) +- Java + - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) - Scala - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) -- .NET +- Kotlin + - [AORM](https://github.com/TanVD/AORM) +- C# - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) - - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) - C++ - [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp/) - Elixir - [clickhousex](https://github.com/appodeal/clickhousex/) - - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) -- Java - - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) -- Kotlin - - [AORM](https://github.com/TanVD/AORM) - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md new file mode 100644 index 00000000000..e9c8a462d81 --- /dev/null +++ b/docs/ru/interfaces/third-party/integrations.md @@ -0,0 +1,21 @@ +# Библиотеки для интеграции от сторонних разработчиков + +!!! warning "Disclaimer" + Яндекс не поддерживает перечисленные ниже библиотеки и не проводит тщательного тестирования для проверки их качества. + +- Python + - [SQLAlchemy](https://www.sqlalchemy.org) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Scala + - [Akka](https://akka.io) + - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) +- C# + - [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) + - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) + - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) + - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) +- Elixir + - [Ecto](https://github.com/elixir-ecto/ecto) + - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party/integrations/) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 95520d4b0a7..e99f79bd6ee 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -27,6 +27,7 @@ nav: - 'ODBC driver': 'interfaces/odbc.md' - 'Third-party': - 'Client libraries': 'interfaces/third-party/client_libraries.md' + - 'Integrations': 'interfaces/third-party/integrations.md' - 'Visual Interfaces': 'interfaces/third-party/gui.md' - 'Data types': diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 349cdaafc7c..00cb1f8fa9e 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -27,6 +27,7 @@ nav: - ' درایور ODBC': 'interfaces/odbc.md' - 'Third-party': - 'کتابخانه های مشتری': 'interfaces/third-party/client_libraries.md' + - 'یکپارچگی': 'interfaces/third-party/integrations.md' - 'رابط های بصری': 'interfaces/third-party/gui.md' - 'Data types': diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 40e0da9a2d5..3e0eb4583ae 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -27,6 +27,7 @@ nav: - 'ODBC-драйвер': 'interfaces/odbc.md' - 'От сторонних разработчиков': - 'Клиентские библиотеки': 'interfaces/third-party/client_libraries.md' + - 'Интеграции': 'interfaces/third-party/integrations.md' - 'Визуальные интерфейсы': 'interfaces/third-party/gui.md' - 'Типы данных': diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 206486aef46..651a0ca3a68 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -27,6 +27,7 @@ nav: - 'ODBC 驱动': 'interfaces/odbc.md' - '第三方': - '客户端库': 'interfaces/third-party/client_libraries.md' + - '集成': 'interfaces/third-party/integrations.md' - '可视界面': 'interfaces/third-party/gui.md' - '数据类型': diff --git a/docs/zh/interfaces/third-party/client_libraries.md b/docs/zh/interfaces/third-party/client_libraries.md index 776746a94dc..f0a4eba2ba3 100644 --- a/docs/zh/interfaces/third-party/client_libraries.md +++ b/docs/zh/interfaces/third-party/client_libraries.md @@ -5,7 +5,6 @@ - Python - [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) - [clickhouse-driver](https://github.com/mymarilyn/clickhouse-driver) - [clickhouse-client](https://github.com/yurial/clickhouse-client) - PHP @@ -30,19 +29,19 @@ - R - [clickhouse-r](https://github.com/hannesmuehleisen/clickhouse-r) - [RClickhouse](https://github.com/IMSMWU/RClickhouse) +- Java + - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) - Scala - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) -- .NET +- Kotlin + - [AORM](https://github.com/TanVD/AORM) +- C# - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) - - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) - C++ - [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp/) - Elixir - [clickhousex](https://github.com/appodeal/clickhousex/) - - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) -- Java - - [clickhouse-client-java](https://github.com/VirtusAI/clickhouse-client-java) - Nim - [nim-clickhouse](https://github.com/leonardoce/nim-clickhouse) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md new file mode 100644 index 00000000000..b64bd2cf77e --- /dev/null +++ b/docs/zh/interfaces/third-party/integrations.md @@ -0,0 +1,22 @@ +# 第三方集成库 + +!!! warning "放弃" + Yandex不维护下面列出的库,也没有进行任何广泛的测试以确保其质量。 + +- Python + - [SQLAlchemy](https://www.sqlalchemy.org) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Scala + - [Akka](https://akka.io) + - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) +- C# + - [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) + - [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net) + - [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net) + - [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations) +- Elixir + - [Ecto](https://github.com/elixir-ecto/ecto) + - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) + + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party/integrations/) From 20d06343336811dead079f3b03b89cf53988af66 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 26 Nov 2018 17:46:34 +0300 Subject: [PATCH 053/297] Add clickhouse-hdfs-loader link --- docs/en/interfaces/third-party/integrations.md | 3 +++ docs/fa/interfaces/third-party/integrations.md | 3 +++ docs/ru/interfaces/third-party/integrations.md | 3 +++ docs/zh/interfaces/third-party/integrations.md | 3 +++ 4 files changed, 12 insertions(+) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md index 2dcb4b4eb8c..ece64d9dcb3 100644 --- a/docs/en/interfaces/third-party/integrations.md +++ b/docs/en/interfaces/third-party/integrations.md @@ -6,6 +6,9 @@ - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Java + - [Hadoop](http://hadoop.apache.org) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index eaaa4dcec46..08055497848 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -8,6 +8,9 @@ - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Java + - [Hadoop](http://hadoop.apache.org) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index e9c8a462d81..e86a9fb20a8 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -6,6 +6,9 @@ - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Java + - [Hadoop](http://hadoop.apache.org) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index b64bd2cf77e..9b33f455b09 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -6,6 +6,9 @@ - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Java + - [Hadoop](http://hadoop.apache.org) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) From a221281fd122d0288a91dd919aa9ce9117ce8af9 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 10:46:47 +0300 Subject: [PATCH 054/297] Some introduction for "interfaces" section --- docs/en/interfaces/index.md | 14 +++++++++++++- docs/fa/interfaces/index.md | 17 +++++++++++++++-- docs/ru/interfaces/index.md | 15 ++++++++++++++- docs/zh/interfaces/index.md | 13 ++++++++++++- 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/docs/en/interfaces/index.md b/docs/en/interfaces/index.md index 9f445d45229..e11e1a16ebc 100644 --- a/docs/en/interfaces/index.md +++ b/docs/en/interfaces/index.md @@ -2,7 +2,19 @@ # Interfaces -To explore the system's capabilities, download data to tables, or make manual queries, use the clickhouse-client program. +ClickHouse provides two network interfaces (both can be optionally wrapped in TLS for additional security): +* [HTTP](http.md), which is documented and easy to use directly. +* [Native TCP](tcp.md), which has less overhead. + +In most cases it is recommended to use appropriate tool or library instead of interacting with those directly. Officially supported by Yandex are the following: +* [Command-line client](cli.md) +* [JDBC driver](jdbc.md) +* [ODBC driver](odbc.md) + +There are also a wide range of third-party libraries for working with ClickHouse: +* [Client libraries](third-party/client_libraries.md) +* [Integrations](third-party/integrations.md) +* [Visual interfaces](third-party/gui.md) [Original article](https://clickhouse.yandex/docs/en/interfaces/) diff --git a/docs/fa/interfaces/index.md b/docs/fa/interfaces/index.md index d06c8ec8fd0..0c8914939a6 100644 --- a/docs/fa/interfaces/index.md +++ b/docs/fa/interfaces/index.md @@ -2,9 +2,22 @@
    -# Interface ها +# رابط ها -برای کشف قابلیت های سیستم، دانلو داده ها به جداول، یا ساخت query های دستی، از برنامه clikhouse-client استفاده کنید. +ClickHouse دو اینترفیس شبکه را فراهم می کند (هر دو می توانند به صورت اختیاری در TLS برای امنیت اضافی پیچیده شوند): + +* [HTTP](http.md), که مستند شده و به راحتی به طور مستقیم استفاده می شود. +* [بومی TCP](tcp.md), که دارای سربار کمتر است. + +اگرچه در بیشتر موارد توصیه می شود از ابزار یا کتابخانه مناسب استفاده کنید تا به طور مستقیم با آن ها ارتباط برقرار نکنید. به طور رسمی توسط یانداکس پشتیبانی می شوند عبارتند از: +* [خط فرمان خط](cli.md) +* [راننده JDBC](jdbc.md) +* [راننده ODBC](odbc.md) + +همچنین برای کار با ClickHouse طیف گسترده ای از کتابخانه های شخص ثالث وجود دارد: +* [کتابخانه های مشتری](third-party/client_libraries.md) +* [ادغام](third-party/integrations.md) +* [رابط های بصری](third-party/gui.md)
    [مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/) diff --git a/docs/ru/interfaces/index.md b/docs/ru/interfaces/index.md index 4560cda1fb7..bc3b1f2bd79 100644 --- a/docs/ru/interfaces/index.md +++ b/docs/ru/interfaces/index.md @@ -2,6 +2,19 @@ # Интерфейсы -Для изучения возможностей системы, загрузки данных в таблицы, ручных запросов, используйте программу clickhouse-client. +ClickHouse предоставляет два сетевых интерфейса (оба могут быть дополнительно обернуты в TLS для дополнительной безопасности): + +* [HTTP](http.md), который задокументирован и прост для использования напрямую; +* [Native TCP](tcp.md), который имеет меньше накладных расходов. + +В большинстве случаев рекомендуется использовать подходящий инструмент или библиотеку, а не напрямую взаимодействовать с ClickHouse по сути. Официально поддерживаемые Яндексом: +* [Консольный клиент](cli.md); +* [JDBC-драйвер](jdbc.md); +* [ODBC-драйвер](odbc.md). + +Существует также широкий спектр сторонних библиотек для работы с ClickHouse: +* [Клиентские библиотеки](third-party/client_libraries.md); +* [Библиотеки для интеграции](third-party/integrations.md); +* [Визуальные интерфейсы](third-party/gui.md). [Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/) diff --git a/docs/zh/interfaces/index.md b/docs/zh/interfaces/index.md index b5603f81e6f..5334ee2d400 100644 --- a/docs/zh/interfaces/index.md +++ b/docs/zh/interfaces/index.md @@ -2,8 +2,19 @@ # 客户端 -为了探索 ClickHouse 的能力,如导入数据到表中,或做一些手动的查询,可以使用 clickhouse-client 命令行程序来完成 +ClickHouse提供了两个网络接口(两者都可以选择包装在TLS中以提高安全性): +* [HTTP](http.md),记录在案,易于使用. +* [本地人TCP](tcp.md),这有较少的开销. +在大多数情况下,建议使用适当的工具或库,而不是直接与这些工具或库进行交互。 Yandex的官方支持如下: +* [命令行客户端](cli.md) +* [JDBC驱动程序](jdbc.md) +* [ODBC驱动程序](odbc.md) + +还有许多第三方库可供使用ClickHouse: +* [客户端库](third-party/client_libraries.md) +* [集成](third-party/integrations.md) +* [可视界面](third-party/gui.md) [来源文章](https://clickhouse.yandex/docs/zh/interfaces/) From e637942a33f7353917f502a535ae6ae9a3d64e53 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:09:38 +0300 Subject: [PATCH 055/297] Rewrite tcp.md --- docs/en/interfaces/tcp.md | 3 +-- docs/fa/interfaces/tcp.md | 4 ++-- docs/ru/interfaces/tcp.md | 2 +- docs/zh/interfaces/tcp.md | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/en/interfaces/tcp.md b/docs/en/interfaces/tcp.md index 86ef118e882..c17e8c15b5e 100644 --- a/docs/en/interfaces/tcp.md +++ b/docs/en/interfaces/tcp.md @@ -1,6 +1,5 @@ # Native Interface (TCP) -The native interface is used in the "clickhouse-client" command-line client for interaction between servers with distributed query processing, and also in C++ programs. We will only cover the command-line client. - +The native protocol is used in the [command-line client](cli.md), for interserver communication during distributed query processing, and also in other C++ programs. Unfortunately, native ClickHouse protocol does not have formal specification yet, but it can be reverse engineered from ClickHouse source code (starting [around here](https://github.com/yandex/ClickHouse/tree/master/dbms/src/Client)) and/or by intercepting and analyzing TCP traffic. [Original article](https://clickhouse.yandex/docs/en/interfaces/tcp/) diff --git a/docs/fa/interfaces/tcp.md b/docs/fa/interfaces/tcp.md index 5e767b876f8..bd902aedc58 100644 --- a/docs/fa/interfaces/tcp.md +++ b/docs/fa/interfaces/tcp.md @@ -1,8 +1,8 @@
    -# Native interface (TCP) +# رابط بومی (TCP) -native interface در محیط ترمینال "clickhouse-client" برای تعامل بین سرور با پردازش query توزیع شده مورد استفاده قرار می گیرد. همچنین native interface در برنامه های C++ مورد استفاده قرار می گیرد. ما فقط کلاینت command-line را پوشش میدیم. +پروتکل بومی در [خط فرمان خط] (cli.md)، برای برقراری ارتباط بین سرور در طی پردازش پرس و جو توزیع شده، و همچنین در سایر برنامه های C ++ استفاده می شود. متاسفانه، پروتکل ClickHouse بومی هنوز مشخصات رسمی ندارد، اما می توان آن را از کد منبع ClickHouse (شروع [از اینجا](https://github.com/yandex/ClickHouse/tree/master/dbms/src/Client)) و / یا با رهگیری و تجزیه و تحلیل ترافیک TCP.
    [مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/tcp/) diff --git a/docs/ru/interfaces/tcp.md b/docs/ru/interfaces/tcp.md index 98672b505e4..da0ea735644 100644 --- a/docs/ru/interfaces/tcp.md +++ b/docs/ru/interfaces/tcp.md @@ -1,5 +1,5 @@ # Родной интерфейс (TCP) -Родной интерфейс используется в клиенте командной строки clickhouse-client, при межсерверном взаимодействии для распределённой обработки запроса, а также в программах на C++. Будет рассмотрен только клиент командной строки. +Нативный протокол используется в [клиенте командной строки](cli.md), для взаимодействия между серверами во время обработки распределенных запросов, а также в других программах на C++. К сожалению, у родного протокола ClickHouse пока нет формальной спецификации, но в нем можно разобраться с использованием исходного кода ClickHouse (начиная с [примерно этого места](https://github.com/yandex/ClickHouse/tree/master/dbms/src/Client)) и/или путем перехвата и анализа TCP трафика. [Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/tcp/) diff --git a/docs/zh/interfaces/tcp.md b/docs/zh/interfaces/tcp.md index 742e252a25f..c60fc2e09aa 100644 --- a/docs/zh/interfaces/tcp.md +++ b/docs/zh/interfaces/tcp.md @@ -1,6 +1,5 @@ # 原生客户端接口(TCP) -TCP 原生接口用于 `clickhouse-client` 命令行,它可以在分布式查询执行中和服务器进行交互,并且可以用在 C++ 程序中。我们讲解只覆盖命令行客户端。 - +本机协议用于[命令行客户端](cli.md),用于分布式查询处理期间的服务器间通信,以及其他C ++程序。 不幸的是,本机ClickHouse协议还没有正式的规范,但它可以从ClickHouse源代码进行逆向工程[从这里开始](https://github.com/yandex/ClickHouse/tree/master/dbms/src/Client))和/或拦截和分析TCP流量。 [来源文章](https://clickhouse.yandex/docs/zh/interfaces/tcp/) From 8e2ec872f6efc09ac074bd9c05fe26afcd749c46 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:13:03 +0300 Subject: [PATCH 056/297] http_interface.md -> http.md --- docs/en/interfaces/{http_interface.md => http.md} | 0 docs/fa/interfaces/{http_interface.md => http.md} | 0 docs/redirects.txt | 1 + docs/ru/interfaces/{http_interface.md => http.md} | 0 docs/toc_en.yml | 2 +- docs/toc_fa.yml | 2 +- docs/toc_ru.yml | 2 +- docs/toc_zh.yml | 2 +- docs/zh/interfaces/{http_interface.md => http.md} | 0 9 files changed, 5 insertions(+), 4 deletions(-) rename docs/en/interfaces/{http_interface.md => http.md} (100%) rename docs/fa/interfaces/{http_interface.md => http.md} (100%) rename docs/ru/interfaces/{http_interface.md => http.md} (100%) rename docs/zh/interfaces/{http_interface.md => http.md} (100%) diff --git a/docs/en/interfaces/http_interface.md b/docs/en/interfaces/http.md similarity index 100% rename from docs/en/interfaces/http_interface.md rename to docs/en/interfaces/http.md diff --git a/docs/fa/interfaces/http_interface.md b/docs/fa/interfaces/http.md similarity index 100% rename from docs/fa/interfaces/http_interface.md rename to docs/fa/interfaces/http.md diff --git a/docs/redirects.txt b/docs/redirects.txt index d21acde9eea..be807dd547d 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -118,3 +118,4 @@ query_language/queries.md query_language.md introduction/possible_silly_questions.md faq/general.md interfaces/third-party_client_libraries.md interfaces/third-party/client_libraries.md interfaces/third-party_gui.md interfaces/third-party/gui.md +interfaces/http_interface.md interfaces/http.md diff --git a/docs/ru/interfaces/http_interface.md b/docs/ru/interfaces/http.md similarity index 100% rename from docs/ru/interfaces/http_interface.md rename to docs/ru/interfaces/http.md diff --git a/docs/toc_en.yml b/docs/toc_en.yml index e99f79bd6ee..1c3f444890b 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -21,7 +21,7 @@ nav: - 'Introduction': 'interfaces/index.md' - 'Command-line client': 'interfaces/cli.md' - 'Native interface (TCP)': 'interfaces/tcp.md' - - 'HTTP interface': 'interfaces/http_interface.md' + - 'HTTP interface': 'interfaces/http.md' - 'Input and output formats': 'interfaces/formats.md' - 'JDBC driver': 'interfaces/jdbc.md' - 'ODBC driver': 'interfaces/odbc.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 00cb1f8fa9e..d330e84ca5d 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -21,7 +21,7 @@ nav: - 'Interface ها': 'interfaces/index.md' - ' کلاینت Command-line': 'interfaces/cli.md' - 'Native interface (TCP)': 'interfaces/tcp.md' - - 'HTTP interface': 'interfaces/http_interface.md' + - 'HTTP interface': 'interfaces/http.md' - ' فرمت های Input و Output': 'interfaces/formats.md' - ' درایور JDBC': 'interfaces/jdbc.md' - ' درایور ODBC': 'interfaces/odbc.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 3e0eb4583ae..86c5e0a5883 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -21,7 +21,7 @@ nav: - 'Введение': 'interfaces/index.md' - 'Клиент командной строки': 'interfaces/cli.md' - 'Нативный интерфейс (TCP)': 'interfaces/tcp.md' - - 'HTTP-интерфейс': 'interfaces/http_interface.md' + - 'HTTP-интерфейс': 'interfaces/http.md' - 'Форматы входных и выходных данных': 'interfaces/formats.md' - 'JDBC-драйвер': 'interfaces/jdbc.md' - 'ODBC-драйвер': 'interfaces/odbc.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 651a0ca3a68..ac1a8d5bcd1 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -21,7 +21,7 @@ nav: - '介绍': 'interfaces/index.md' - '命令行客户端接口': 'interfaces/cli.md' - '原生客户端接口 (TCP)': 'interfaces/tcp.md' - - 'HTTP 客户端接口': 'interfaces/http_interface.md' + - 'HTTP 客户端接口': 'interfaces/http.md' - '输入输出格式': 'interfaces/formats.md' - 'JDBC 驱动': 'interfaces/jdbc.md' - 'ODBC 驱动': 'interfaces/odbc.md' diff --git a/docs/zh/interfaces/http_interface.md b/docs/zh/interfaces/http.md similarity index 100% rename from docs/zh/interfaces/http_interface.md rename to docs/zh/interfaces/http.md From 585df9958753f1be40a226e92041bb7c422fc9db Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:17:04 +0300 Subject: [PATCH 057/297] fix link --- docs/en/operations/settings/permissions_for_queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/settings/permissions_for_queries.md b/docs/en/operations/settings/permissions_for_queries.md index 8c731ed1ce8..c65b35e60cc 100644 --- a/docs/en/operations/settings/permissions_for_queries.md +++ b/docs/en/operations/settings/permissions_for_queries.md @@ -33,7 +33,7 @@ See [above](#permissions_for_queries) for the division of queries into groups. After setting `readonly = 1`, a user can't change `readonly` and `allow_ddl` settings in the current session. -When using the `GET` method in the [HTTP interface](../../interfaces/http_interface.md#http_interface), `readonly = 1` is set automatically. To modify data use the `POST` method. +When using the `GET` method in the [HTTP interface](../../interfaces/http.md#http_interface), `readonly = 1` is set automatically. To modify data use the `POST` method.
    From 512c18b1a9643d76fd6d8f2e6074291dcb766c87 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:22:05 +0300 Subject: [PATCH 058/297] Remove unconvenient error for now --- docs/tools/concatenate.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index 6fd581f5f4c..8e9bd6f5c2c 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -51,10 +51,6 @@ def concatenate(lang, docs_path, single_page_file): sharp_pos = link.find('#') if sharp_pos > -1: return '[' + text + '](' + link[sharp_pos:] + ')' - else: - raise RuntimeError( - 'ERROR: Link [' + text + '](' + link + ') in file ' + - path + ' has no anchor. Please provide it.') for l in f: # Processing links in a string From 3163bef2bfbf8dabe8b7db4bd23c1ead48d1cc17 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:42:39 +0300 Subject: [PATCH 059/297] try to guess anchor instead of failing --- docs/tools/concatenate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index 8e9bd6f5c2c..ffc49a7fed9 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -44,13 +44,15 @@ def concatenate(lang, docs_path, single_page_file): # function is passed into re.sub() to process links def link_proc(matchObj): - text, link = matchObj.group().strip('[)').split('](') - if link.startswith('http') or '.jpeg' in link or '.jpg' in link or '.png' in link or '.gif' in link: + text, link = matchObj.group().strip('[)').split('](', 1) + if link.startswith('http:') or link.startswith('https:') or '.jpeg' in link or '.jpg' in link or '.png' in link or '.gif' in link: return '[' + text + '](' + link + ')' else: sharp_pos = link.find('#') if sharp_pos > -1: return '[' + text + '](' + link[sharp_pos:] + ')' + else: + return '[' + text + '](#' + link.replace('../', '').replace('/index.md', '').replace('.md', '') + ')' for l in f: # Processing links in a string From ab078461dcdfde6d4447ddc50c930edc49a05de2 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:52:08 +0300 Subject: [PATCH 060/297] remove symlink --- docs/zh/introduction/features_considered_disadvantages.md | 1 - 1 file changed, 1 deletion(-) delete mode 120000 docs/zh/introduction/features_considered_disadvantages.md diff --git a/docs/zh/introduction/features_considered_disadvantages.md b/docs/zh/introduction/features_considered_disadvantages.md deleted file mode 120000 index 45d3cdf563a..00000000000 --- a/docs/zh/introduction/features_considered_disadvantages.md +++ /dev/null @@ -1 +0,0 @@ -../../en/introduction/features_considered_disadvantages.md \ No newline at end of file From e2f1f66cf2e3356ef254fca48736b3d3f0ff012a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 11:53:07 +0300 Subject: [PATCH 061/297] Remove outdated info from introduction --- docs/fa/introduction/features_considered_disadvantages.md | 2 +- docs/ru/introduction/features_considered_disadvantages.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/fa/introduction/features_considered_disadvantages.md b/docs/fa/introduction/features_considered_disadvantages.md index 3a963d05140..f6066bbeadf 100644 --- a/docs/fa/introduction/features_considered_disadvantages.md +++ b/docs/fa/introduction/features_considered_disadvantages.md @@ -3,7 +3,7 @@ # ویژگی های از ClickHouse که می تواند معایبی باشد. 1. بدون پشتیبانی کامل از تراکنش -2. عدم توانایی در تغییر و یا حذف داده های insert شده با rate بالا و latency کم. روشی برای پاک کردن دسته ای داده ها و یا مطابق با قوانین [GDPR](https://gdpr-info.eu) وجود دارد. بروزرسانی دسته ای از July 2018 در حال توسعه می باشد. +2. عدم توانایی برای تغییر و یا حذف داده های در حال حاضر وارد شده با سرعت بالا و تاخیر کم. برای پاک کردن و یا اصلاح داده ها، به عنوان مثال برای پیروی از [GDPR](https://gdpr-info.eu)، دسته ای پاک و به روزرسانی وجود دارد.حال توسعه می باشد. 3. Sparse index باعث می شود ClickHouse چندان مناسب اجرای پرسمان های point query برای دریافت یک ردیف از داده ها با استفاده از کلید آنها نباشد.
    diff --git a/docs/ru/introduction/features_considered_disadvantages.md b/docs/ru/introduction/features_considered_disadvantages.md index 9e04f747c10..f7425efa4b3 100644 --- a/docs/ru/introduction/features_considered_disadvantages.md +++ b/docs/ru/introduction/features_considered_disadvantages.md @@ -1,7 +1,7 @@ # Особенности ClickHouse, которые могут считаться недостатками 1. Отсутствие полноценных транзакций. -2. Возможность изменять или удалять ранее записанные данные с низкими задержками и высокой частотой запросов не предоставляется. Есть массовое удаление данных для очистки более не нужного или соответствия [GDPR](https://gdpr-info.eu). Массовое изменение данных находится в разработке (на момент июля 2018). +2. Возможность изменять или удалять ранее записанные данные с низкими задержками и высокой частотой запросов не предоставляется. Есть массовое удаление и изменение данных для очистки более не нужного или соответствия [GDPR](https://gdpr-info.eu). 3. Разреженный индекс делает ClickHouse плохо пригодным для точечных чтений одиночных строк по своим ключам. From c788814f1e9a021c80197a9019d85113e3308486 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 12:05:26 +0300 Subject: [PATCH 062/297] remove ru roadmap.md --- docs/ru/roadmap.md | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 docs/ru/roadmap.md diff --git a/docs/ru/roadmap.md b/docs/ru/roadmap.md deleted file mode 100644 index 5418cf8a8b1..00000000000 --- a/docs/ru/roadmap.md +++ /dev/null @@ -1,14 +0,0 @@ -# Roadmap - -## Q4 2018 - -- Соответствующий SQL стандарту синтаксис JOIN: - - Несколько `JOIN`ов в одном `SELECT` - -- Улучшения в исполнении JOIN: - - Распределённый JOIN, не ограниченный оперативной памятью - -- Добавление Protobuf и Parquet к ассортименту поддерживаемых форматов ввода-вывода -- Пулы ресурсов для более точного распределения мощностей кластера между его пользователями - -[Оригинальная статья](https://clickhouse.yandex/docs/ru/roadmap/) From aca2e05365a901f58cdc9695c8d0edc3816cb53a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 12:05:53 +0300 Subject: [PATCH 063/297] replace ru roadmap.md with symlink --- docs/ru/roadmap.md | 1 + 1 file changed, 1 insertion(+) create mode 120000 docs/ru/roadmap.md diff --git a/docs/ru/roadmap.md b/docs/ru/roadmap.md new file mode 120000 index 00000000000..24df86352b3 --- /dev/null +++ b/docs/ru/roadmap.md @@ -0,0 +1 @@ +../en/roadmap.md \ No newline at end of file From 9b44482ede76eb9793690e909806872e3fd03393 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 12:08:54 +0300 Subject: [PATCH 064/297] Update roadmap.md --- docs/en/roadmap.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/en/roadmap.md b/docs/en/roadmap.md index 490e570b659..46931d5983b 100644 --- a/docs/en/roadmap.md +++ b/docs/en/roadmap.md @@ -4,11 +4,23 @@ - JOIN syntax compatible with SQL standard: - Mutliple `JOIN`s in single `SELECT` +- Protobuf and Parquet input and output formats + +## Q1 2019 + +- Import/export from HDFS and S3 +- Lower metadata size in ZooKeeper +- Adaptive index granularity for MergeTree engine family + +## Q2 2019 - JOIN execution improvements: - Distributed join not limited by memory - -- Protobuf and Parquet input and output formats - Resource pools for more precise distribution of cluster capacity between users +## Q3 2019 + +- Fine-grained authorization +- Integration with external authentication services + [Original article](https://clickhouse.yandex/docs/en/roadmap/) From b877b30977deafde6cd548ad6c9da0d7db44b387 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 12:09:06 +0300 Subject: [PATCH 065/297] lost file --- docs/zh/introduction/features_considered_disadvantages.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/zh/introduction/features_considered_disadvantages.md diff --git a/docs/zh/introduction/features_considered_disadvantages.md b/docs/zh/introduction/features_considered_disadvantages.md new file mode 100644 index 00000000000..e5cd51ebdcd --- /dev/null +++ b/docs/zh/introduction/features_considered_disadvantages.md @@ -0,0 +1,7 @@ +# ClickHouse可以考虑缺点的功能 + +1. 没有完整的交易。 +2. 缺乏以高速率和低延迟修改或删除已插入数据的能力。 有批次删除和更新可用于清理或修改数据,例如符合[GDPR](https://gdpr-info.eu)。 +3. 稀疏索引使得ClickHouse不适合通过其键检索单行的点查询。 + +[来源文章](https://clickhouse.yandex/docs/zh/introduction/features_considered_disadvantages/) From 1393585917f450d958c99f0a87f020f297415631 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 13:33:57 +0300 Subject: [PATCH 066/297] Title case in toc_en.yml --- docs/toc_en.yml | 168 ++++++++++++++++++++++++------------------------ 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 1c3f444890b..6e9a252e84e 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -2,40 +2,40 @@ nav: - 'Introduction': - 'Overview': 'index.md' - - 'Distinctive features of ClickHouse': 'introduction/distinctive_features.md' - - 'ClickHouse features that can be considered disadvantages': 'introduction/features_considered_disadvantages.md' + - 'Distinctive Features of ClickHouse': 'introduction/distinctive_features.md' + - 'ClickHouse Features that Can Be Considered Disadvantages': 'introduction/features_considered_disadvantages.md' - 'Performance': 'introduction/performance.md' - - 'The Yandex.Metrica task': 'introduction/ya_metrika_task.md' + - 'The Yandex.Metrica Task': 'introduction/ya_metrika_task.md' -- 'Getting started': - - 'Deploying and running': 'getting_started/index.md' - - 'Example datasets': +- 'Getting Started': + - 'Deploying and Running': 'getting_started/index.md' + - 'Example Datasets': - 'OnTime': 'getting_started/example_datasets/ontime.md' - - 'New York Taxi data': 'getting_started/example_datasets/nyc_taxi.md' + - 'New York Taxi Data': 'getting_started/example_datasets/nyc_taxi.md' - 'AMPLab Big Data Benchmark': 'getting_started/example_datasets/amplab_benchmark.md' - 'WikiStat': 'getting_started/example_datasets/wikistat.md' - - 'Terabyte click logs from Criteo': 'getting_started/example_datasets/criteo.md' + - 'Terabyte Click Logs from Criteo': 'getting_started/example_datasets/criteo.md' - 'Star Schema Benchmark': 'getting_started/example_datasets/star_schema.md' - 'Interfaces': - 'Introduction': 'interfaces/index.md' - - 'Command-line client': 'interfaces/cli.md' - - 'Native interface (TCP)': 'interfaces/tcp.md' - - 'HTTP interface': 'interfaces/http.md' - - 'Input and output formats': 'interfaces/formats.md' - - 'JDBC driver': 'interfaces/jdbc.md' - - 'ODBC driver': 'interfaces/odbc.md' - - 'Third-party': - - 'Client libraries': 'interfaces/third-party/client_libraries.md' + - 'Command-Line Client': 'interfaces/cli.md' + - 'Native Interface (TCP)': 'interfaces/tcp.md' + - 'HTTP Interface': 'interfaces/http.md' + - 'Input and Output Formats': 'interfaces/formats.md' + - 'JDBC Driver': 'interfaces/jdbc.md' + - 'ODBC Driver': 'interfaces/odbc.md' + - 'Third-Party': + - 'Client Libraries': 'interfaces/third-party/client_libraries.md' - 'Integrations': 'interfaces/third-party/integrations.md' - 'Visual Interfaces': 'interfaces/third-party/gui.md' -- 'Data types': +- 'Data Types': - 'Introduction': 'data_types/index.md' - 'UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64': 'data_types/int_uint.md' - 'Float32, Float64': 'data_types/float.md' - 'Decimal': 'data_types/decimal.md' - - 'Boolean values': 'data_types/boolean.md' + - 'Boolean': 'data_types/boolean.md' - 'String': 'data_types/string.md' - 'FixedString(N)': 'data_types/fixedstring.md' - 'Date': 'data_types/date.md' @@ -45,58 +45,58 @@ nav: - 'AggregateFunction(name, types_of_arguments...)': 'data_types/nested_data_structures/aggregatefunction.md' - 'Tuple(T1, T2, ...)': 'data_types/tuple.md' - 'Nullable': 'data_types/nullable.md' - - 'Nested data structures': + - 'Nested Data Structures': - 'hidden': 'data_types/nested_data_structures/index.md' - 'Nested(Name1 Type1, Name2 Type2, ...)': 'data_types/nested_data_structures/nested.md' - - 'Special data types': + - 'Special Data Types': - 'hidden': 'data_types/special_data_types/index.md' - 'Expression': 'data_types/special_data_types/expression.md' - 'Set': 'data_types/special_data_types/set.md' - 'Nothing': 'data_types/special_data_types/nothing.md' -- 'SQL reference': +- 'SQL Reference': - 'hidden': 'query_language/index.md' - 'SELECT': 'query_language/select.md' - 'INSERT INTO': 'query_language/insert_into.md' - 'CREATE': 'query_language/create.md' - 'ALTER': 'query_language/alter.md' - - 'Other kinds of queries': 'query_language/misc.md' + - 'Other Kinds of Queries': 'query_language/misc.md' - 'Functions': - 'Introduction': 'query_language/functions/index.md' - - 'Arithmetic functions': 'query_language/functions/arithmetic_functions.md' - - 'Comparison functions': 'query_language/functions/comparison_functions.md' - - 'Logical functions': 'query_language/functions/logical_functions.md' - - 'Type conversion functions': 'query_language/functions/type_conversion_functions.md' - - 'Functions for working with dates and times': 'query_language/functions/date_time_functions.md' - - 'Functions for working with strings': 'query_language/functions/string_functions.md' - - 'Functions for searching strings': 'query_language/functions/string_search_functions.md' - - 'Functions for searching and replacing in strings': 'query_language/functions/string_replace_functions.md' - - 'Conditional functions': 'query_language/functions/conditional_functions.md' - - 'Mathematical functions': 'query_language/functions/math_functions.md' - - 'Rounding functions': 'query_language/functions/rounding_functions.md' - - 'Functions for working with arrays': 'query_language/functions/array_functions.md' - - 'Functions for splitting and merging strings and arrays': 'query_language/functions/splitting_merging_functions.md' - - 'Bit functions': 'query_language/functions/bit_functions.md' - - 'Hash functions': 'query_language/functions/hash_functions.md' - - 'Functions for generating pseudo-random numbers': 'query_language/functions/random_functions.md' - - 'Encoding functions': 'query_language/functions/encoding_functions.md' - - 'Functions for working with URLs': 'query_language/functions/url_functions.md' - - 'Functions for working with IP addresses': 'query_language/functions/ip_address_functions.md' - - 'Functions for working with JSON.': 'query_language/functions/json_functions.md' - - 'Higher-order functions': 'query_language/functions/higher_order_functions.md' - - 'Other functions': 'query_language/functions/other_functions.md' - - 'Functions for working with external dictionaries': 'query_language/functions/ext_dict_functions.md' - - 'Functions for working with Yandex.Metrica dictionaries': 'query_language/functions/ym_dict_functions.md' - - 'Functions for implementing the IN operator': 'query_language/functions/in_functions.md' - - 'arrayJoin function': 'query_language/functions/array_join.md' - - 'Functions for working with geographical coordinates': 'query_language/functions/geo.md' - - 'Functions for working with Nullable arguments': 'query_language/functions/functions_for_nulls.md' - - 'Aggregate functions': + - 'Arithmetic': 'query_language/functions/arithmetic_functions.md' + - 'Comparison': 'query_language/functions/comparison_functions.md' + - 'Logical': 'query_language/functions/logical_functions.md' + - 'Type Conversion': 'query_language/functions/type_conversion_functions.md' + - 'Working with Dates and Times': 'query_language/functions/date_time_functions.md' + - 'Working with strings': 'query_language/functions/string_functions.md' + - 'For Searching Strings': 'query_language/functions/string_search_functions.md' + - 'For Replacing in Strings': 'query_language/functions/string_replace_functions.md' + - 'Conditional ': 'query_language/functions/conditional_functions.md' + - 'Mathematical': 'query_language/functions/math_functions.md' + - 'Rounding': 'query_language/functions/rounding_functions.md' + - 'Working with Arrays': 'query_language/functions/array_functions.md' + - 'Splitting and Merging Strings and Arrays': 'query_language/functions/splitting_merging_functions.md' + - 'Bit': 'query_language/functions/bit_functions.md' + - 'Hash': 'query_language/functions/hash_functions.md' + - 'Generating Pseudo-Random Numbers': 'query_language/functions/random_functions.md' + - 'Encoding': 'query_language/functions/encoding_functions.md' + - 'Working with URLs': 'query_language/functions/url_functions.md' + - 'Working with IP Addresses': 'query_language/functions/ip_address_functions.md' + - 'Working with JSON.': 'query_language/functions/json_functions.md' + - 'Higher-Order': 'query_language/functions/higher_order_functions.md' + - 'Working with External Dictionaries': 'query_language/functions/ext_dict_functions.md' + - 'Working with Yandex.Metrica Dictionaries': 'query_language/functions/ym_dict_functions.md' + - 'Implementing the IN Operator': 'query_language/functions/in_functions.md' + - 'arrayJoin': 'query_language/functions/array_join.md' + - 'Working with geographical coordinates': 'query_language/functions/geo.md' + - 'Working with Nullable arguments': 'query_language/functions/functions_for_nulls.md' + - 'Other': 'query_language/functions/other_functions.md' + - 'Aggregate Functions': - 'Introduction': 'query_language/agg_functions/index.md' - - 'Function reference': 'query_language/agg_functions/reference.md' + - 'Reference': 'query_language/agg_functions/reference.md' - 'Aggregate function combinators': 'query_language/agg_functions/combinators.md' - 'Parametric aggregate functions': 'query_language/agg_functions/parametric_functions.md' - - 'Table functions': + - 'Table Functions': - 'Introduction': 'query_language/table_functions/index.md' - 'file': 'query_language/table_functions/file.md' - 'merge': 'query_language/table_functions/merge.md' @@ -106,31 +106,31 @@ nav: - 'jdbc': 'query_language/table_functions/jdbc.md' - 'Dictionaries': - 'Introduction': 'query_language/dicts/index.md' - - 'External dictionaries': - - 'General description': 'query_language/dicts/external_dicts.md' - - 'Configuring an external dictionary': 'query_language/dicts/external_dicts_dict.md' - - 'Storing dictionaries in memory': 'query_language/dicts/external_dicts_dict_layout.md' - - 'Dictionary updates': 'query_language/dicts/external_dicts_dict_lifetime.md' - - 'Sources of external dictionaries': 'query_language/dicts/external_dicts_dict_sources.md' - - 'Dictionary key and fields': 'query_language/dicts/external_dicts_dict_structure.md' - - 'Internal dictionaries': 'query_language/dicts/internal_dicts.md' + - 'External Dictionaries': + - 'General Description': 'query_language/dicts/external_dicts.md' + - 'Configuring an External Dictionary': 'query_language/dicts/external_dicts_dict.md' + - 'Storing Dictionaries in Memory': 'query_language/dicts/external_dicts_dict_layout.md' + - 'Dictionary Updates': 'query_language/dicts/external_dicts_dict_lifetime.md' + - 'Sources of External Dictionaries': 'query_language/dicts/external_dicts_dict_sources.md' + - 'Dictionary Key and Fields': 'query_language/dicts/external_dicts_dict_structure.md' + - 'Internal Dictionaries': 'query_language/dicts/internal_dicts.md' - 'Operators': 'query_language/operators.md' - - 'General syntax': 'query_language/syntax.md' + - 'General Syntax': 'query_language/syntax.md' - 'Operations': - 'hidden': 'operations/index.md' - - 'Table engines': + - 'Table Engines': - 'Introduction': 'operations/table_engines/index.md' - - 'MergeTree family': + - 'MergeTree Family': - 'MergeTree': 'operations/table_engines/mergetree.md' - - 'Data replication': 'operations/table_engines/replication.md' - - 'Custom partitioning key': 'operations/table_engines/custom_partitioning_key.md' + - 'Data Replication': 'operations/table_engines/replication.md' + - 'Custom Partitioning Key': 'operations/table_engines/custom_partitioning_key.md' - 'ReplacingMergeTree': 'operations/table_engines/replacingmergetree.md' - 'SummingMergeTree': 'operations/table_engines/summingmergetree.md' - 'AggregatingMergeTree': 'operations/table_engines/aggregatingmergetree.md' - 'CollapsingMergeTree': 'operations/table_engines/collapsingmergetree.md' - 'GraphiteMergeTree': 'operations/table_engines/graphitemergetree.md' - - 'For small data': + - 'For Small Data': - 'TinyLog': 'operations/table_engines/tinylog.md' - 'Log': 'operations/table_engines/log.md' - 'Memory': 'operations/table_engines/memory.md' @@ -150,37 +150,37 @@ nav: - 'Integrations': - 'Kafka': 'operations/table_engines/kafka.md' - 'MySQL': 'operations/table_engines/mysql.md' - - 'Access rights': 'operations/access_rights.md' - - 'Configuration files': 'operations/configuration_files.md' + - 'Access Rights': 'operations/access_rights.md' + - 'Configuration Files': 'operations/configuration_files.md' - 'Quotas': 'operations/quotas.md' - - 'System tables': 'operations/system_tables.md' - - 'Usage recommendations': 'operations/tips.md' - - 'Server configuration parameters': + - 'System Tables': 'operations/system_tables.md' + - 'Usage Recommendations': 'operations/tips.md' + - 'Server Configuration Parameters': - 'Introduction': 'operations/server_settings/index.md' - - 'Server settings': 'operations/server_settings/settings.md' + - 'Server Settings': 'operations/server_settings/settings.md' - 'Settings': - 'Introduction': 'operations/settings/index.md' - - 'Permissions for queries': 'operations/settings/permissions_for_queries.md' - - 'Restrictions on query complexity': 'operations/settings/query_complexity.md' + - 'Permissions for Queries': 'operations/settings/permissions_for_queries.md' + - 'Restrictions on Query Complexity': 'operations/settings/query_complexity.md' - 'Settings': 'operations/settings/settings.md' - - 'Settings profiles': 'operations/settings/settings_profiles.md' + - 'Settings Profiles': 'operations/settings/settings_profiles.md' - 'Utilities': - 'Overview': 'operations/utils/index.md' - 'clickhouse-copier': 'operations/utils/clickhouse-copier.md' - 'clickhouse-local': 'operations/utils/clickhouse-local.md' - 'F.A.Q.': - - 'General questions': 'faq/general.md' + - 'General Questions': 'faq/general.md' - 'Development': - 'hidden': 'development/index.md' - - 'Overview of ClickHouse architecture': 'development/architecture.md' - - 'How to build ClickHouse on Linux': 'development/build.md' - - 'How to build ClickHouse on Mac OS X': 'development/build_osx.md' - - 'How to write C++ code': 'development/style.md' - - 'How to run ClickHouse tests': 'development/tests.md' + - 'Overview of ClickHouse Architecture': 'development/architecture.md' + - 'How to Build ClickHouse on Linux': 'development/build.md' + - 'How to Build ClickHouse on Mac OS X': 'development/build_osx.md' + - 'How to Write C++ code': 'development/style.md' + - 'How to Run ClickHouse Tests': 'development/tests.md' -- 'What''s new': +- 'What''s New': - 'Roadmap': 'roadmap.md' - 'Changelog': 'changelog.md' - - 'Security changelog': 'security_changelog.md' + - 'Security Changelog': 'security_changelog.md' From 1de89ed489edd5548acde33cc1cb94ddf4da9cf8 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 13:36:18 +0300 Subject: [PATCH 067/297] Sync "Functions" ToC section with en --- docs/toc_fa.yml | 54 ++++++++++++++++++++++++----------------------- docs/toc_ru.yml | 3 +-- docs/toc_zh.yml | 56 ++++++++++++++++++++++++------------------------- 3 files changed, 57 insertions(+), 56 deletions(-) diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index d330e84ca5d..cc0aa901c1a 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -62,32 +62,34 @@ nav: - 'Other kinds of queries': 'query_language/misc.md' - 'Functions': - 'Introduction': 'query_language/functions/index.md' - - 'Arithmetic functions': 'query_language/functions/arithmetic_functions.md' - - 'Comparison functions': 'query_language/functions/comparison_functions.md' - - 'Logical functions': 'query_language/functions/logical_functions.md' - - 'Type conversion functions': 'query_language/functions/type_conversion_functions.md' - - 'Functions for working with dates and times': 'query_language/functions/date_time_functions.md' - - 'Functions for working with strings': 'query_language/functions/string_functions.md' - - 'Functions for searching strings': 'query_language/functions/string_search_functions.md' - - 'Functions for searching and replacing in strings': 'query_language/functions/string_replace_functions.md' - - 'Conditional functions': 'query_language/functions/conditional_functions.md' - - 'Mathematical functions': 'query_language/functions/math_functions.md' - - 'Rounding functions': 'query_language/functions/rounding_functions.md' - - 'Functions for working with arrays': 'query_language/functions/array_functions.md' - - 'Functions for splitting and merging strings and arrays': 'query_language/functions/splitting_merging_functions.md' - - 'Bit functions': 'query_language/functions/bit_functions.md' - - 'Hash functions': 'query_language/functions/hash_functions.md' - - 'Functions for generating pseudo-random numbers': 'query_language/functions/random_functions.md' - - 'Encoding functions': 'query_language/functions/encoding_functions.md' - - 'Functions for working with URLs': 'query_language/functions/url_functions.md' - - 'Functions for working with IP addresses': 'query_language/functions/ip_address_functions.md' - - 'Functions for working with JSON.': 'query_language/functions/json_functions.md' - - 'Higher-order functions': 'query_language/functions/higher_order_functions.md' - - 'Other functions': 'query_language/functions/other_functions.md' - - 'Functions for working with external dictionaries': 'query_language/functions/ext_dict_functions.md' - - 'Functions for working with Yandex.Metrica dictionaries': 'query_language/functions/ym_dict_functions.md' - - 'Functions for implementing the IN operator': 'query_language/functions/in_functions.md' - - 'arrayJoin function': 'query_language/functions/array_join.md' + - 'Arithmetic': 'query_language/functions/arithmetic_functions.md' + - 'Comparison': 'query_language/functions/comparison_functions.md' + - 'Logical': 'query_language/functions/logical_functions.md' + - 'Type Conversion': 'query_language/functions/type_conversion_functions.md' + - 'Working with Dates and Times': 'query_language/functions/date_time_functions.md' + - 'Working with strings': 'query_language/functions/string_functions.md' + - 'For Searching Strings': 'query_language/functions/string_search_functions.md' + - 'For Replacing in Strings': 'query_language/functions/string_replace_functions.md' + - 'Conditional ': 'query_language/functions/conditional_functions.md' + - 'Mathematical': 'query_language/functions/math_functions.md' + - 'Rounding': 'query_language/functions/rounding_functions.md' + - 'Working with Arrays': 'query_language/functions/array_functions.md' + - 'Splitting and Merging Strings and Arrays': 'query_language/functions/splitting_merging_functions.md' + - 'Bit': 'query_language/functions/bit_functions.md' + - 'Hash': 'query_language/functions/hash_functions.md' + - 'Generating Pseudo-Random Numbers': 'query_language/functions/random_functions.md' + - 'Encoding': 'query_language/functions/encoding_functions.md' + - 'Working with URLs': 'query_language/functions/url_functions.md' + - 'Working with IP Addresses': 'query_language/functions/ip_address_functions.md' + - 'Working with JSON.': 'query_language/functions/json_functions.md' + - 'Higher-Order': 'query_language/functions/higher_order_functions.md' + - 'Working with External Dictionaries': 'query_language/functions/ext_dict_functions.md' + - 'Working with Yandex.Metrica Dictionaries': 'query_language/functions/ym_dict_functions.md' + - 'Implementing the IN Operator': 'query_language/functions/in_functions.md' + - 'arrayJoin': 'query_language/functions/array_join.md' + - 'Working with geographical coordinates': 'query_language/functions/geo.md' + - 'Working with Nullable arguments': 'query_language/functions/functions_for_nulls.md' + - 'Other': 'query_language/functions/other_functions.md' - 'Aggregate functions': - 'Introduction': 'query_language/agg_functions/index.md' - 'Function reference': 'query_language/agg_functions/reference.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 86c5e0a5883..b4f4d60fd93 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -84,14 +84,13 @@ nav: - 'Функции для работы с IP-адресами': 'query_language/functions/ip_address_functions.md' - 'Функции для работы с JSON.': 'query_language/functions/json_functions.md' - 'Функции высшего порядка': 'query_language/functions/higher_order_functions.md' - - 'Прочие функции': 'query_language/functions/other_functions.md' - 'Функции для работы с внешними словарями': 'query_language/functions/ext_dict_functions.md' - 'Функции для работы со словарями Яндекс.Метрики': 'query_language/functions/ym_dict_functions.md' - 'Функции для реализации оператора IN.': 'query_language/functions/in_functions.md' - 'Функция arrayJoin': 'query_language/functions/array_join.md' - 'Функции для работы с географическими координатами': 'query_language/functions/geo.md' - 'Функции c Nullable агрументами': 'query_language/functions/functions_for_nulls.md' - + - 'Прочие функции': 'query_language/functions/other_functions.md' - 'Агрегатные функции': - 'Введение': 'query_language/agg_functions/index.md' - 'Справочник функций': 'query_language/agg_functions/reference.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index ac1a8d5bcd1..dd2811223af 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -63,34 +63,34 @@ nav: - 'Other kinds of queries': 'query_language/misc.md' - 'Functions': - 'Introduction': 'query_language/functions/index.md' - - 'Arithmetic functions': 'query_language/functions/arithmetic_functions.md' - - 'Comparison functions': 'query_language/functions/comparison_functions.md' - - 'Logical functions': 'query_language/functions/logical_functions.md' - - 'Type conversion functions': 'query_language/functions/type_conversion_functions.md' - - 'Functions for working with dates and times': 'query_language/functions/date_time_functions.md' - - 'Functions for working with strings': 'query_language/functions/string_functions.md' - - 'Functions for searching strings': 'query_language/functions/string_search_functions.md' - - 'Functions for searching and replacing in strings': 'query_language/functions/string_replace_functions.md' - - 'Conditional functions': 'query_language/functions/conditional_functions.md' - - 'Mathematical functions': 'query_language/functions/math_functions.md' - - 'Rounding functions': 'query_language/functions/rounding_functions.md' - - 'Functions for working with arrays': 'query_language/functions/array_functions.md' - - 'Functions for splitting and merging strings and arrays': 'query_language/functions/splitting_merging_functions.md' - - 'Bit functions': 'query_language/functions/bit_functions.md' - - 'Hash functions': 'query_language/functions/hash_functions.md' - - 'Functions for generating pseudo-random numbers': 'query_language/functions/random_functions.md' - - 'Encoding functions': 'query_language/functions/encoding_functions.md' - - 'Functions for working with URLs': 'query_language/functions/url_functions.md' - - 'Functions for working with IP addresses': 'query_language/functions/ip_address_functions.md' - - 'Functions for working with JSON.': 'query_language/functions/json_functions.md' - - 'Higher-order functions': 'query_language/functions/higher_order_functions.md' - - 'Other functions': 'query_language/functions/other_functions.md' - - 'Functions for working with external dictionaries': 'query_language/functions/ext_dict_functions.md' - - 'Functions for working with Yandex.Metrica dictionaries': 'query_language/functions/ym_dict_functions.md' - - 'Functions for implementing the IN operator': 'query_language/functions/in_functions.md' - - 'arrayJoin function': 'query_language/functions/array_join.md' - - 'Functions for working with geographical coordinates': 'query_language/functions/geo.md' - - 'Functions for working with Nullable arguments': 'query_language/functions/functions_for_nulls.md' + - 'Arithmetic': 'query_language/functions/arithmetic_functions.md' + - 'Comparison': 'query_language/functions/comparison_functions.md' + - 'Logical': 'query_language/functions/logical_functions.md' + - 'Type Conversion': 'query_language/functions/type_conversion_functions.md' + - 'Working with Dates and Times': 'query_language/functions/date_time_functions.md' + - 'Working with strings': 'query_language/functions/string_functions.md' + - 'For Searching Strings': 'query_language/functions/string_search_functions.md' + - 'For Replacing in Strings': 'query_language/functions/string_replace_functions.md' + - 'Conditional ': 'query_language/functions/conditional_functions.md' + - 'Mathematical': 'query_language/functions/math_functions.md' + - 'Rounding': 'query_language/functions/rounding_functions.md' + - 'Working with Arrays': 'query_language/functions/array_functions.md' + - 'Splitting and Merging Strings and Arrays': 'query_language/functions/splitting_merging_functions.md' + - 'Bit': 'query_language/functions/bit_functions.md' + - 'Hash': 'query_language/functions/hash_functions.md' + - 'Generating Pseudo-Random Numbers': 'query_language/functions/random_functions.md' + - 'Encoding': 'query_language/functions/encoding_functions.md' + - 'Working with URLs': 'query_language/functions/url_functions.md' + - 'Working with IP Addresses': 'query_language/functions/ip_address_functions.md' + - 'Working with JSON.': 'query_language/functions/json_functions.md' + - 'Higher-Order': 'query_language/functions/higher_order_functions.md' + - 'Working with External Dictionaries': 'query_language/functions/ext_dict_functions.md' + - 'Working with Yandex.Metrica Dictionaries': 'query_language/functions/ym_dict_functions.md' + - 'Implementing the IN Operator': 'query_language/functions/in_functions.md' + - 'arrayJoin': 'query_language/functions/array_join.md' + - 'Working with geographical coordinates': 'query_language/functions/geo.md' + - 'Working with Nullable arguments': 'query_language/functions/functions_for_nulls.md' + - 'Other': 'query_language/functions/other_functions.md' - 'Aggregate functions': - 'Introduction': 'query_language/agg_functions/index.md' - 'Function reference': 'query_language/agg_functions/reference.md' From 1caabe28264854544a58587d0367037610d740e6 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 13:43:45 +0300 Subject: [PATCH 068/297] Remove reference to pretty old ClickHouse release from docs --- docs/en/operations/table_engines/custom_partitioning_key.md | 2 -- docs/ru/operations/table_engines/custom_partitioning_key.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/en/operations/table_engines/custom_partitioning_key.md b/docs/en/operations/table_engines/custom_partitioning_key.md index 55940db8ca9..5bf686ea872 100644 --- a/docs/en/operations/table_engines/custom_partitioning_key.md +++ b/docs/en/operations/table_engines/custom_partitioning_key.md @@ -2,8 +2,6 @@ # Custom Partitioning Key -Starting with version 1.1.54310, you can create tables in the MergeTree family with any partitioning expression (not only partitioning by month). - The partition key can be an expression from the table columns, or a tuple of such expressions (similar to the primary key). The partition key can be omitted. When creating a table, specify the partition key in the ENGINE description with the new syntax: ``` diff --git a/docs/ru/operations/table_engines/custom_partitioning_key.md b/docs/ru/operations/table_engines/custom_partitioning_key.md index 8d228f5c498..6aa3cad3d0f 100644 --- a/docs/ru/operations/table_engines/custom_partitioning_key.md +++ b/docs/ru/operations/table_engines/custom_partitioning_key.md @@ -2,8 +2,6 @@ # Произвольный ключ партиционирования -Начиная с версии 1.1.54310 доступна возможность создания таблиц семейства MergeTree с произвольным выражением партиционирования (не только по месяцу). - Ключ партиционирования может представлять собой произвольное выражение из столбцов таблицы, а также кортеж из таких выражений (аналогично первичному ключу). Ключ партиционирования может отсутствовать. При создании таблицы ключ партиционирования указывается в описании движка (ENGINE) с новым синтаксисом: ``` From 57a9f4483624b47612d18f4dbb0918ba37fc95b0 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 27 Nov 2018 13:55:37 +0300 Subject: [PATCH 069/297] couple lost symlinks in fa --- docs/fa/query_language/functions/functions_for_nulls.md | 1 + docs/fa/query_language/functions/geo.md | 1 + 2 files changed, 2 insertions(+) create mode 120000 docs/fa/query_language/functions/functions_for_nulls.md create mode 120000 docs/fa/query_language/functions/geo.md diff --git a/docs/fa/query_language/functions/functions_for_nulls.md b/docs/fa/query_language/functions/functions_for_nulls.md new file mode 120000 index 00000000000..fa57e10ad15 --- /dev/null +++ b/docs/fa/query_language/functions/functions_for_nulls.md @@ -0,0 +1 @@ +../../../en/query_language/functions/functions_for_nulls.md \ No newline at end of file diff --git a/docs/fa/query_language/functions/geo.md b/docs/fa/query_language/functions/geo.md new file mode 120000 index 00000000000..86fa3a85d34 --- /dev/null +++ b/docs/fa/query_language/functions/geo.md @@ -0,0 +1 @@ +../../../en/query_language/functions/geo.md \ No newline at end of file From c9546b08281beff829550a630c7f22e3173f5c3d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 3 Dec 2018 14:40:17 +0300 Subject: [PATCH 070/297] Close quote in proper place --- docs/en/getting_started/index.md | 2 +- docs/fa/getting_started/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index 53a8fa495fc..a2c747344c0 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -84,7 +84,7 @@ To start the server (as a daemon), run: sudo service clickhouse-server start ``` -See the logs in the `/var/log/clickhouse-server/ directory.` +See the logs in the `/var/log/clickhouse-server/` directory. If the server doesn't start, check the configurations in the file `/etc/clickhouse-server/config.xml.` diff --git a/docs/fa/getting_started/index.md b/docs/fa/getting_started/index.md index dba3d4d080f..880c746c9bf 100644 --- a/docs/fa/getting_started/index.md +++ b/docs/fa/getting_started/index.md @@ -100,7 +100,7 @@ sudo service clickhouse-server start
    -لاگ های دایرکتوری `/var/log/clickhouse-server/ directory.` را مشاهده کنید. +لاگ های دایرکتوری `/var/log/clickhouse-server/` directory. را مشاهده کنید. اگر سرور استارت نشد، فایل تنظیمات را بررسی کنید `/etc/clickhouse-server/config.xml.` From fcb7f32229f6da5a224250f9fc03a0081b7521de Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 14:44:22 +0300 Subject: [PATCH 071/297] Rewrite en/getting_started/index.md --- docs/en/getting_started/index.md | 98 +++++++++++++++----------------- docs/fa/getting_started/index.md | 4 +- docs/ru/getting_started/index.md | 6 +- docs/zh/getting_started/index.md | 8 +-- 4 files changed, 53 insertions(+), 63 deletions(-) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index a2c747344c0..48df4aabe1e 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -2,35 +2,29 @@ ## System Requirements -Installation from the official repository requires Linux with x86_64 architecture and support for the SSE 4.2 instruction set. +ClickHouse can run on any Linux, FreeBSD or Mac OS X with x86\_64 architecture. -To check for SSE 4.2: +Though pre-built binaries are typically compiled to leverage SSE 4.2 instruction set, so unless otherwise stated usage of CPU that supports them becomes an additional system requirement. Here's the command to check if current CPU has support for SSE 4.2: -```bash -grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" +``` bash +$ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" ``` -We recommend using Ubuntu or Debian. The terminal must use UTF-8 encoding. - -For rpm-based systems, you can use 3rd-party packages: https://packagecloud.io/altinity/clickhouse or install debian packages. - -ClickHouse also works on FreeBSD and Mac OS X. It can be compiled for x86_64 processors without SSE 4.2 support, and for AArch64 CPUs. - ## Installation -For testing and development, the system can be installed on a single server or on a desktop computer. +### From DEB Packages -### Installing from Packages for Debian/Ubuntu +Yandex recommends using official pre-compiled `deb` packages for Debian or Ubuntu. -In `/etc/apt/sources.list` (or in a separate `/etc/apt/sources.list.d/clickhouse.list` file), add the repository: +To install official packages add the Yandex repository in `/etc/apt/sources.list` or in a separate `/etc/apt/sources.list.d/clickhouse.list` file: ``` deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ ``` -If you want to use the most recent test version, replace 'stable' with 'testing'. +If you want to use the most recent version, replace `stable` with `testing` (this is not recommended for production environments). -Then run: +Then run these commands to actually install packages: ```bash sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4 # optional @@ -40,45 +34,47 @@ sudo apt-get install clickhouse-client clickhouse-server You can also download and install packages manually from here: . -ClickHouse contains access restriction settings. They are located in the 'users.xml' file (next to 'config.xml'). -By default, access is allowed from anywhere for the 'default' user, without a password. See 'user/default/networks'. -For more information, see the section "Configuration files". +### From RPM Packages -### Installing from Sources +Yandex does not run ClickHouse on `rpm` based distributions and `rpm` packages are not as thoroughly tested. So use them at your own risk, but there are many other companies that do successfully run them in production without any major issues. -To compile, follow the instructions: build.md +So for CentOS, RHEL or Fedora you have the following options: +* Packages from are generated from official `deb` packages by Yandex and have byte-identical binaries. +* Packages from are built by independent company Altinity, but are used widely without any complaints. +* Or you can use Docker (see below). -You can compile packages and install them. -You can also use programs without installing packages. +### From Docker Image + +Just follow the guide on [Docker Hub](https://hub.docker.com/r/yandex/clickhouse-server/). + +Inside it uses official `deb` packages, so SSE 4.2 support is also required. + +### From Sources + +To manually compile ClickHouse, follow the instructions for [Linux](../development/build.md) or [Mac OS X](../development/build_osx.md). + +You can compile packages and install them or use programs without installing packages. Also by building manually you can disable SSE 4.2 requirement or build for AArch64 CPUs. ``` Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server ``` -For the server, create a catalog with data, such as: - +
    Additional notes +You'll need to create a data and metadata folders and `chown` them for the desired. Their paths can be changed in server config, by default they are: ``` /opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/ ``` -(Configurable in the server config.) -Run 'chown' for the desired user. - Note the path to logs in the server config (src/dbms/programs/server/config.xml). +
    -### Other Installation Methods - -Docker image: - -RPM packages for CentOS or RHEL: - -Gentoo: `emerge clickhouse` +On Gentoo you can just use `emerge clickhouse` to install ClickHouse from sources. ## Launch -To start the server (as a daemon), run: +To start the server as a daemon, run: ```bash sudo service clickhouse-server start @@ -86,36 +82,36 @@ sudo service clickhouse-server start See the logs in the `/var/log/clickhouse-server/` directory. -If the server doesn't start, check the configurations in the file `/etc/clickhouse-server/config.xml.` +If the server doesn't start, check the configurations in the file `/etc/clickhouse-server/config.xml`. -You can also launch the server from the console: +You can also manually launch the server from the console: ```bash clickhouse-server --config-file=/etc/clickhouse-server/config.xml ``` In this case, the log will be printed to the console, which is convenient during development. -If the configuration file is in the current directory, you don't need to specify the '--config-file' parameter. By default, it uses './config.xml'. +If the configuration file is in the current directory, you don't need to specify the `--config-file` parameter. By default, it uses `./config.xml`. -You can use the command-line client to connect to the server: +ClickHouse supports access restriction settings. They are located in the `users.xml` file (next to `config.xml`). +By default, access is allowed from anywhere for the `default` user, without a password. See `user/default/networks`. +For more information, see the section ["Configuration Files"](../operations/configuration_files.md). + +After launching server, you can use the command-line client to connect to it: ```bash clickhouse-client ``` -The default parameters indicate connecting with localhost:9000 on behalf of the user 'default' without a password. -The client can be used for connecting to a remote server. Example: +By default it connects to `localhost:9000` on behalf of the user `default` without a password. It can also be used to connect to a remote server using `--host` argument. +The terminal must use UTF-8 encoding. + +For more information, see the section ["Command-line client"](../interfaces/cli.md). + +Example: ```bash -clickhouse-client --host=example.com -``` - -For more information, see the section "Command-line client". - -Checking the system: - -```bash -milovidov@hostname:~/work/metrica/src/dbms/src/Client$ ./clickhouse-client +$ ./clickhouse-client ClickHouse client version 0.0.18749. Connecting to localhost:9000. Connected to ClickHouse server version 0.0.18749. @@ -135,7 +131,7 @@ SELECT 1 **Congratulations, the system works!** -To continue experimenting, you can try to download from the test data sets. +To continue experimenting, you can try to download from the test data sets or go through [tutorial](https://clickhouse.yandex/tutorial.html). [Original article](https://clickhouse.yandex/docs/en/getting_started/) diff --git a/docs/fa/getting_started/index.md b/docs/fa/getting_started/index.md index 880c746c9bf..3fbe345b888 100644 --- a/docs/fa/getting_started/index.md +++ b/docs/fa/getting_started/index.md @@ -4,7 +4,7 @@ ## نیازمندی های سیستم -این یک سیستم چند سکویی (Cross-Platform) نمی باشد. این ابزار نیاز به Linux Ubuntu Precise (12.04) یا جدیدتر، با معماری x86_64 و پشتیبانی از SSE 4.2 می باشد. برای چک کردن SSE 4.2 خروجی دستور زیر را بررسی کنید: +این یک سیستم چند سکویی (Cross-Platform) نمی باشد. این ابزار نیاز به Linux Ubuntu Precise (12.04) یا جدیدتر، با معماری x86\_64 و پشتیبانی از SSE 4.2 می باشد. برای چک کردن SSE 4.2 خروجی دستور زیر را بررسی کنید:
    @@ -18,8 +18,6 @@ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not su ## نصب -برای تست و توسعه، ClickHouse می تواند در یک سرور یا در یک کامپیوتر desktop نصب شود. - ### نصب از طریق پکیج های Debian/Ubuntu در فایل `/etc/apt/sources.list` (یا در یک فایل جدا `/etc/apt/sources.list.d/clickhouse.list`)، Repo زیر را اضافه کنید: diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index 037dfb7379b..36c373de6ac 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -2,7 +2,7 @@ ## Системные требования -Для установки из официального репозитория требуется ОС Linux; архитектура x86_64 с поддержкой набора инструкций SSE 4.2. +Для установки из официального репозитория требуется ОС Linux; архитектура x86\_64 с поддержкой набора инструкций SSE 4.2. Для проверки наличия SSE 4.2, выполните: @@ -14,12 +14,10 @@ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not su Для rpm-based систем вы можете использовать 3rd-party пакеты: https://packagecloud.io/altinity/clickhouse либо установить debian пакеты. -ClickHouse также работает на FreeBSD и Mac OS X; может быть собран для процессоров x86_64 без поддержки SSE 4.2, и для процессоров AArch64. +ClickHouse также работает на FreeBSD и Mac OS X; может быть собран для процессоров x86\_64 без поддержки SSE 4.2, и для процессоров AArch64. ## Установка -В целях тестирования и разработки, система может быть установлена на один сервер или на рабочий компьютер. - ### Установка из пакетов для Debian/Ubuntu Пропишите в `/etc/apt/sources.list` (или в отдельный файл `/etc/apt/sources.list.d/clickhouse.list`) репозитории: diff --git a/docs/zh/getting_started/index.md b/docs/zh/getting_started/index.md index 2820719990a..ca108db655a 100644 --- a/docs/zh/getting_started/index.md +++ b/docs/zh/getting_started/index.md @@ -2,7 +2,7 @@ ## 系统要求 -如果从官方仓库安装,需要确保您使用的是x86_64处理器构架的Linux并且支持SSE 4.2指令集 +如果从官方仓库安装,需要确保您使用的是x86\_64处理器构架的Linux并且支持SSE 4.2指令集 检查是否支持SSE 4.2: @@ -14,12 +14,10 @@ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not su 基于rpm的系统,你可以使用第三方的安装包:https://packagecloud.io/altinity/clickhouse 或者直接安装debian安装包。 -ClickHouse还可以在FreeBSD与Mac OS X上工作。同时它可以在不支持SSE 4.2的x86_64构架和AArch64 CPUs上编译。 +ClickHouse还可以在FreeBSD与Mac OS X上工作。同时它可以在不支持SSE 4.2的x86\_64构架和AArch64 CPUs上编译。 ## 安装 -为了测试和开发,系统可以安装在单个服务器或普通PC机上。 - ### 为Debian/Ubuntu安装 在`/etc/apt/sources.list` (或创建`/etc/apt/sources.list.d/clickhouse.list`文件)中添加仓库: @@ -54,7 +52,7 @@ ClickHouse包含访问控制配置,它们位于`users.xml`文件中(与'config ```text Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server -``` + ``` 在服务器中为数据创建如下目录: From 1837f06d00ceeb04ccefeec90a71673c4344277a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 16:20:43 +0300 Subject: [PATCH 072/297] Sync en<>ru getting_started/index.md --- docs/en/getting_started/index.md | 35 +++++------ docs/ru/getting_started/index.md | 104 ++++++++++++++----------------- 2 files changed, 61 insertions(+), 78 deletions(-) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index 48df4aabe1e..11c8fbcb4ae 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -2,7 +2,7 @@ ## System Requirements -ClickHouse can run on any Linux, FreeBSD or Mac OS X with x86\_64 architecture. +ClickHouse can run on any Linux, FreeBSD or Mac OS X with x86\_64 CPU architecture. Though pre-built binaries are typically compiled to leverage SSE 4.2 instruction set, so unless otherwise stated usage of CPU that supports them becomes an additional system requirement. Here's the command to check if current CPU has support for SSE 4.2: @@ -36,18 +36,16 @@ You can also download and install packages manually from here: are generated from official `deb` packages by Yandex and have byte-identical binaries. * Packages from are built by independent company Altinity, but are used widely without any complaints. * Or you can use Docker (see below). ### From Docker Image -Just follow the guide on [Docker Hub](https://hub.docker.com/r/yandex/clickhouse-server/). - -Inside it uses official `deb` packages, so SSE 4.2 support is also required. +Just follow the guide on [Docker Hub](https://hub.docker.com/r/yandex/clickhouse-server/). Those images use official `deb` packages inside. ### From Sources @@ -60,24 +58,20 @@ Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server ``` -
    Additional notes -You'll need to create a data and metadata folders and `chown` them for the desired. Their paths can be changed in server config, by default they are: +You'll need to create a data and metadata folders and `chown` them for the desired user. Their paths can be changed in server config (src/dbms/programs/server/config.xml), by default they are: ``` /opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/ ``` -Note the path to logs in the server config (src/dbms/programs/server/config.xml). -
    - On Gentoo you can just use `emerge clickhouse` to install ClickHouse from sources. ## Launch To start the server as a daemon, run: -```bash -sudo service clickhouse-server start +``` bash +$ sudo service clickhouse-server start ``` See the logs in the `/var/log/clickhouse-server/` directory. @@ -86,8 +80,8 @@ If the server doesn't start, check the configurations in the file `/etc/clickhou You can also manually launch the server from the console: -```bash -clickhouse-server --config-file=/etc/clickhouse-server/config.xml +``` bash +$ clickhouse-server --config-file=/etc/clickhouse-server/config.xml ``` In this case, the log will be printed to the console, which is convenient during development. @@ -99,18 +93,17 @@ For more information, see the section ["Configuration Files"](../operations/conf After launching server, you can use the command-line client to connect to it: -```bash -clickhouse-client +``` bash +$ clickhouse-client ``` By default it connects to `localhost:9000` on behalf of the user `default` without a password. It can also be used to connect to a remote server using `--host` argument. -The terminal must use UTF-8 encoding. - +The terminal must use UTF-8 encoding For more information, see the section ["Command-line client"](../interfaces/cli.md). Example: -```bash +``` bash $ ./clickhouse-client ClickHouse client version 0.0.18749. Connecting to localhost:9000. @@ -131,7 +124,7 @@ SELECT 1 **Congratulations, the system works!** -To continue experimenting, you can try to download from the test data sets or go through [tutorial](https://clickhouse.yandex/tutorial.html). +To continue experimenting, you can download one of test data sets or go through [tutorial](https://clickhouse.yandex/tutorial.html). [Original article](https://clickhouse.yandex/docs/en/getting_started/) diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index 36c373de6ac..2601583c287 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -2,33 +2,29 @@ ## Системные требования -Для установки из официального репозитория требуется ОС Linux; архитектура x86\_64 с поддержкой набора инструкций SSE 4.2. +ClickHouse может работать на любом Linux, FreeBSD или Mac OS X с архитектурой процессора x86\_64. -Для проверки наличия SSE 4.2, выполните: +Хотя предсобранные релизы обычно компилируются с использованием набора инструкций SSE 4.2, что добавляет использование поддерживающего его процессора в список системных требований. Команда для п проверки наличия поддержки инструкций SSE 4.2 на текущем процессоре: ```bash -grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" +$ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" ``` -Рекомендуется использовать Ubuntu или Debian. Терминал должен работать в кодировке UTF-8. - -Для rpm-based систем вы можете использовать 3rd-party пакеты: https://packagecloud.io/altinity/clickhouse либо установить debian пакеты. - -ClickHouse также работает на FreeBSD и Mac OS X; может быть собран для процессоров x86\_64 без поддержки SSE 4.2, и для процессоров AArch64. - ## Установка -### Установка из пакетов для Debian/Ubuntu +### Из DEB пакетов -Пропишите в `/etc/apt/sources.list` (или в отдельный файл `/etc/apt/sources.list.d/clickhouse.list`) репозитории: +Яндекс рекомендует использовать официальные скомпилированные `deb` пакеты для Debian или Ubuntu. + +Чтобы установить официальные пакеты, пропишите репозиторий Яндекс в `/etc/apt/sources.list` или в отдельный файл `/etc/apt/sources.list.d/clickhouse.list`: ``` deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ ``` -Если вы хотите использовать наиболее свежую тестовую версию, замените stable на testing. +Если вы хотите использовать наиболее свежую тестовую, замените `stable` на `testing` (не рекомендуется для production окружений). -Затем выполните: +Затем для самой установки пакетов выполните: ```bash sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4 # optional @@ -36,84 +32,78 @@ sudo apt-get update sudo apt-get install clickhouse-client clickhouse-server ``` -Также можно скачать и установить пакеты вручную, отсюда: . +Также эти пакеты можно скачать и установить вручную отсюда: . -ClickHouse содержит настройки ограничения доступа. Они расположены в файле users.xml (рядом с config.xml). -По умолчанию, разрешён доступ отовсюду для пользователя default без пароля. См. секцию users/default/networks. -Подробнее смотрите в разделе "конфигурационные файлы". +### Из RPM пакетов -### Установка из исходников +Яндекс не использует ClickHouse на поддерживающих `rpm` дистрибутивах Linux, а также `rpm` пакеты менее тщательно тестируются. Таким образом, использовать их стоит на свой страх и риск, но, тем не менее, многие другие компании успешно работают на них в production без каких-либо серьезных проблем. -Для сборки воспользуйтесь инструкцией: build.md +Для CentOS, RHEL и Fedora возможны следующие варианты: +* Пакеты из генерируются на основе официальных `deb` пакетов от Яндекса и содержат в точности тот же исполняемый файл. +* Пакеты из собираются независимой компанией Altinity, но широко используются без каких-либо нареканий. +* Либо можно использовать Docker (см. ниже). -Вы можете собрать пакеты и установить их. -Также вы можете использовать программы без установки пакетов. +### Из Docker образа + +Для запуска ClickHouse в Docker нужно следовать инструкции на [Docker Hub](https://hub.docker.com/r/yandex/clickhouse-server/). Внутри образов используются официальные `deb` пакеты. + +### Из исходникого кода + +Для компиляции ClickHouse вручную, испольщуйте инструкцию для [Linux](../development/build.md) или [Mac OS X](../development/build_osx.md). + +Можно скомпилировать пакеты и установить их, либо использовать программы без установки пакетов. Также при ручой сборке можно отключить необходимость поддержки набора инструкций SSE 4.2 или собрать под процессоры архитектуры AArch64. ``` Client: dbms/programs/clickhouse-client Server: dbms/programs/clickhouse-server ``` -Для сервера создаёте директории с данными, например: +Для работы собранного вручную сервера необходимо создать директории для данных и метаданных, а также сделать их `chown` для желаемого пользователя. Пути к этим директориям могут быть изменены в конфигурационном файле сервера (src/dbms/programs/server/config.xml), по умолчанию используются следующие: ``` /opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/ ``` -(Настраивается в конфиге сервера.) -Сделайте chown под нужного пользователя. - -Обратите внимание на путь к логам в конфиге сервера (src/dbms/programs/server/config.xml). - -### Другие методы установки - -Docker образ: - -RPM пакеты для CentOS, RHEL: - -Gentoo: `emerge clickhouse` +На Gentoo для установки ClickHouse из исходного кода можно использовать просто `emerge clickhouse`. ## Запуск -Для запуска сервера (в качестве демона), выполните: +Для запуска сервера в качестве демона, выполните: -```bash -sudo service clickhouse-server start +``` bash +% sudo service clickhouse-server start ``` -Смотрите логи в директории `/var/log/clickhouse-server/` +Смотрите логи в директории `/var/log/clickhouse-server/`. -Если сервер не стартует - проверьте правильность конфигурации в файле `/etc/clickhouse-server/config.xml` +Если сервер не стартует, проверьте корректность конфигурации в файле `/etc/clickhouse-server/config.xml` -Также можно запустить сервер из консоли: +Также можно запустить сервер вручную из консоли: -```bash -clickhouse-server --config-file=/etc/clickhouse-server/config.xml +``` bash +$ clickhouse-server --config-file=/etc/clickhouse-server/config.xml ``` -При этом, лог будет выводиться в консоль - удобно для разработки. -Если конфигурационный файл лежит в текущей директории, то указывать параметр --config-file не требуется - по умолчанию будет использован файл ./config.xml +При этом, лог будет выводиться в консоль, что удобно для разработки. +Если конфигурационный файл лежит в текущей директории, то указывать параметр `--config-file` не требуется, по умолчанию будет использован файл `./config.xml`. -Соединиться с сервером можно с помощью клиента командной строки: +После запуска сервера, соединиться с ним можно с помощью клиента командной строки: -```bash -clickhouse-client +``` bash +$ clickhouse-client ``` -Параметры по умолчанию обозначают - соединяться с localhost:9000, от имени пользователя default без пароля. -Клиент может быть использован для соединения с удалённым сервером. Пример: +По умолчанию он соединяется с localhost:9000, от имени пользователя `default` без пароля. Также клиент может быть использован для соединения с удалённым сервером с помощью аргемента `--host`. -```bash -clickhouse-client --host=example.com -``` +Терминал должен использлвать кодировку UTF-8. -Подробнее смотри раздел "Клиент командной строки". +Более подробная информация о клиенте располагается в разделе [«Клиент командной строки»](../interfaces/cli.md). -Проверим работоспособность системы: +Пример проверки работоспособности системы: -```bash -milovidov@hostname:~/work/metrica/src/dbms/src/Client$ ./clickhouse-client +``` bash +$ ./clickhouse-client ClickHouse client version 0.0.18749. Connecting to localhost:9000. Connected to ClickHouse server version 0.0.18749. @@ -133,6 +123,6 @@ SELECT 1 **Поздравляем, система работает!** -Для дальнейших экспериментов можно попробовать загрузить из тестовых наборов данных. +Для дальнейших экспериментов можно попробовать загрузить один из тестовых наборов данных или пройти [пошаговое руководство для начинающих](https://clickhouse.yandex/tutorial.html). [Оригинальная статья](https://clickhouse.yandex/docs/ru/getting_started/) From f2c2057b98f5090378bb6db15cc5bead7928449f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:06:30 +0300 Subject: [PATCH 073/297] minor changes --- docs/en/getting_started/index.md | 8 ++++---- docs/ru/getting_started/index.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index 11c8fbcb4ae..f78cb5dc03a 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -4,7 +4,7 @@ ClickHouse can run on any Linux, FreeBSD or Mac OS X with x86\_64 CPU architecture. -Though pre-built binaries are typically compiled to leverage SSE 4.2 instruction set, so unless otherwise stated usage of CPU that supports them becomes an additional system requirement. Here's the command to check if current CPU has support for SSE 4.2: +Though pre-built binaries are typically compiled to leverage SSE 4.2 instruction set, so unless otherwise stated usage of CPU that supports it becomes an additional system requirement. Here's the command to check if current CPU has support for SSE 4.2: ``` bash $ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported" @@ -14,7 +14,7 @@ $ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not ### From DEB Packages -Yandex recommends using official pre-compiled `deb` packages for Debian or Ubuntu. +Yandex ClickHouse team recommends using official pre-compiled `deb` packages for Debian or Ubuntu. To install official packages add the Yandex repository in `/etc/apt/sources.list` or in a separate `/etc/apt/sources.list.d/clickhouse.list` file: @@ -45,7 +45,7 @@ For CentOS, RHEL or Fedora there are the following options: ### From Docker Image -Just follow the guide on [Docker Hub](https://hub.docker.com/r/yandex/clickhouse-server/). Those images use official `deb` packages inside. +To run ClickHouse inside Docker follow the guide on [Docker Hub](https://hub.docker.com/r/yandex/clickhouse-server/). Those images use official `deb` packages inside. ### From Sources @@ -99,7 +99,7 @@ $ clickhouse-client By default it connects to `localhost:9000` on behalf of the user `default` without a password. It can also be used to connect to a remote server using `--host` argument. -The terminal must use UTF-8 encoding +The terminal must use UTF-8 encoding. For more information, see the section ["Command-line client"](../interfaces/cli.md). Example: diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index 2601583c287..5ed654e1634 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -16,7 +16,7 @@ $ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not Яндекс рекомендует использовать официальные скомпилированные `deb` пакеты для Debian или Ubuntu. -Чтобы установить официальные пакеты, пропишите репозиторий Яндекс в `/etc/apt/sources.list` или в отдельный файл `/etc/apt/sources.list.d/clickhouse.list`: +Чтобы установить официальные пакеты, пропишите репозиторий Яндекса в `/etc/apt/sources.list` или в отдельный файл `/etc/apt/sources.list.d/clickhouse.list`: ``` deb http://repo.yandex.ru/clickhouse/deb/stable/ main/ From 679ee89b4f6392c5e6175b73f122ea9cffe597e4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:29:27 +0300 Subject: [PATCH 074/297] Some gui.md refactoring --- docs/en/interfaces/third-party/gui.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/en/interfaces/third-party/gui.md b/docs/en/interfaces/third-party/gui.md index 855e9fffc7a..013b154cbde 100644 --- a/docs/en/interfaces/third-party/gui.md +++ b/docs/en/interfaces/third-party/gui.md @@ -4,7 +4,7 @@ Web interface for ClickHouse in the [Tabix](https://github.com/tabixio/tabix) project. -Main features: +Features: - Works with ClickHouse directly from the browser, without the need to install additional software. - Query editor with syntax highlighting. @@ -18,7 +18,7 @@ Main features: [HouseOps](https://github.com/HouseOps/HouseOps) is a UI/IDE for OSX, Linux and Windows. -Main features: +Features: - Query builder with syntax highlighting. View the response in a table or JSON view. - Export query results as CSV or JSON. @@ -40,7 +40,7 @@ The following features are planned for development: [DBeaver](https://dbeaver.io/) - universal desktop database client with ClickHouse support. -Key features: +Features: - Query development with syntax highlight. - Table preview. @@ -48,13 +48,13 @@ Key features: ## DataGrip -[DataGrip](https://www.jetbrains.com/datagrip/) - Database IDE from JetBrains with dedicated support for ClickHouse. The same is embedded into other IntelliJ-based tools: PyCharm, IntelliJIDEA, GoLand, PhpStorm etc. +[DataGrip](https://www.jetbrains.com/datagrip/) is a database IDE from JetBrains with dedicated support for ClickHouse. It is also embedded into other IntelliJ-based tools: PyCharm, IntelliJ IDEA, GoLand, PhpStorm and others. Features: - Very fast code completion. -- Clickhouse synthax highlighting. -- Specific Clickhouse features support in SQL, i.e. nested columns, table engines. +- ClickHouse synthax highlighting. +- Support for features specific to ClickHouse, for example nested columns, table engines. - Data Editor. - Refactorings. - Search and Navigation. From 20ff15c330ddcd98d50a659ec3fe1151fc63db64 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:32:50 +0300 Subject: [PATCH 075/297] Translate DataGrip section to ru --- docs/ru/interfaces/third-party/gui.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/ru/interfaces/third-party/gui.md b/docs/ru/interfaces/third-party/gui.md index 33b3e59ab8d..f8e7bb98388 100644 --- a/docs/ru/interfaces/third-party/gui.md +++ b/docs/ru/interfaces/third-party/gui.md @@ -49,4 +49,17 @@ - Просмотр таблиц; - Автодополнение команд. +## DataGrip + +[DataGrip](https://www.jetbrains.com/datagrip/) — это IDE для баз данных о JetBrains с выделенной поддержкой ClickHouse. Он также встроен в другие инструменты на основе IntelliJ: PyCharm, IntelliJ IDEA, GoLand, PhpStorm и другие. + +Основные возможности: + +- Очень быстрое дополнение кода. +- Подсветка синтаксиса для SQL диалекта ClickHouse. +- Поддержка функций, специфичных для ClickHouse, например вложенных столбцов, движков таблиц. +- Редактор данных. +- Рефакторинги. +- Поиск и навигация. + [Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party_gui/) From aa4e81cb75dbeab763f2d30c465d1fc2e8d38c4f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:41:51 +0300 Subject: [PATCH 076/297] Translate DataGrip section to zh --- docs/en/interfaces/third-party/gui.md | 2 +- docs/zh/interfaces/third-party/gui.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/en/interfaces/third-party/gui.md b/docs/en/interfaces/third-party/gui.md index 013b154cbde..ea90e27df4d 100644 --- a/docs/en/interfaces/third-party/gui.md +++ b/docs/en/interfaces/third-party/gui.md @@ -53,7 +53,7 @@ Features: Features: - Very fast code completion. -- ClickHouse synthax highlighting. +- ClickHouse syntax highlighting. - Support for features specific to ClickHouse, for example nested columns, table engines. - Data Editor. - Refactorings. diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index e9f20405234..ade3361b59c 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -37,4 +37,18 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 监控副本情况以及 Kafka 引擎表 + +## DataGrip + +[DataGrip](https://www.jetbrains.com/datagrip/)是JetBrains的数据库IDE,专门支持ClickHouse。 它还嵌入到其他基于IntelliJ的工具中:PyCharm,IntelliJ IDEA,GoLand,PhpStorm等。 + +特征: + + - 非常快速的代码完成。 + - ClickHouse语法高亮显示。 + - 支持ClickHouse特有的功能,例如嵌套列,表引擎。 + - 数据编辑器。 + - 重构。 + - 搜索和导航。 + [来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party_gui/) From c837f5174f3aef5721e38f1691962889bfed2590 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:43:01 +0300 Subject: [PATCH 077/297] Translate DataGrip section to fa --- docs/fa/interfaces/third-party/gui.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/fa/interfaces/third-party/gui.md b/docs/fa/interfaces/third-party/gui.md index 7f537b1c26e..8de3f38ce27 100644 --- a/docs/fa/interfaces/third-party/gui.md +++ b/docs/fa/interfaces/third-party/gui.md @@ -6,7 +6,8 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github.com/tabixio/tabix). -### ویژگی ها: +ویژگی ها: + - کار با ClickHouse به صورت مستقیم و از طریق مرورگر، بدون نیاز به نرم افزار اضافی. - ادیتور query به همراه syntax highlighting. - ویژگی Auto-completion برای دستورات. @@ -20,7 +21,8 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github [HouseOps](https://github.com/HouseOps/HouseOps) نرم افزار Desktop برای سیستم عامل های Linux و OSX و Windows می باشد.. -### ویژگی ها: +ویژگی ها: + - ابزار Query builder به همراه syntax highlighting. نمایش نتایج به صورت جدول و JSON Object. - خروجی نتایج به صورت csv و JSON Object. - Pنمایش Processes List ها به همراه توضیحات، ویژگی حالت record و kill کردن process ها. @@ -35,5 +37,18 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - مانیتورینگ کافکا و جداول replicate (بزودی); - و بسیاری از ویژگی های دیگر برای شما. +## DataGrip + +[DataGrip] (https://www.jetbrains.com/datagrip/) IDE پایگاه داده از JetBrains با پشتیبانی اختصاصی برای ClickHouse است. این ابزار همچنین به سایر ابزارهای مبتنی بر IntelliJ تعبیه شده است: PyCharm، IntelliJ IDEA، GoLand، PhpStorm و دیگران. + +امکانات: + +- تکمیل کد بسیار سریع +- نحو برجسته ClickHouse. +- پشتیبانی از ویژگی های خاص برای ClickHouse، برای مثال ستون های توپی، موتورهای جدول. +- ویرایشگر داده. +- Refactorings. +- جستجو و ناوبری + [مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party_gui/) From 49b1e981a0947bd15fd6220a6a78064ff382066c Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:44:35 +0300 Subject: [PATCH 078/297] Translate DBeaver section to fa --- docs/fa/interfaces/third-party/gui.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/fa/interfaces/third-party/gui.md b/docs/fa/interfaces/third-party/gui.md index 8de3f38ce27..a3378ad2393 100644 --- a/docs/fa/interfaces/third-party/gui.md +++ b/docs/fa/interfaces/third-party/gui.md @@ -37,9 +37,19 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - مانیتورینگ کافکا و جداول replicate (بزودی); - و بسیاری از ویژگی های دیگر برای شما. +## DBeaver + +[DBeaver](https://dbeaver.io/) - مشتری دسکتاپ دسکتاپ دسکتاپ با پشتیبانی ClickHouse. + +امکانات: + +- توسعه پرس و جو با برجسته نحو +- پیش نمایش جدول +- تکمیل خودکار + ## DataGrip -[DataGrip] (https://www.jetbrains.com/datagrip/) IDE پایگاه داده از JetBrains با پشتیبانی اختصاصی برای ClickHouse است. این ابزار همچنین به سایر ابزارهای مبتنی بر IntelliJ تعبیه شده است: PyCharm، IntelliJ IDEA، GoLand، PhpStorm و دیگران. +[DataGrip](https://www.jetbrains.com/datagrip/) IDE پایگاه داده از JetBrains با پشتیبانی اختصاصی برای ClickHouse است. این ابزار همچنین به سایر ابزارهای مبتنی بر IntelliJ تعبیه شده است: PyCharm، IntelliJ IDEA، GoLand، PhpStorm و دیگران. امکانات: From 2508a56355bac32187c50e6aeccfbd95c80c825d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 17:45:23 +0300 Subject: [PATCH 079/297] Translate DBeaver section to zh --- docs/zh/interfaces/third-party/gui.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index ade3361b59c..be946c1a20a 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -36,7 +36,15 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 集群管理 - 监控副本情况以及 Kafka 引擎表 +## DBeaver +[DBeaver](https://dbeaver.io/) - 具有ClickHouse支持的通用桌面数据库客户端。 + +特征: + + - 使用语法高亮显示查询开发。 + - 表格预览。 + - 自动完成。 ## DataGrip From 6784d64ba544805501574ae41c202a71394311b6 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 18:12:36 +0300 Subject: [PATCH 080/297] Split third-party GUI to open-source and commercial --- docs/en/interfaces/third-party/gui.md | 12 ++++++++---- docs/fa/interfaces/third-party/gui.md | 12 ++++++++---- docs/ru/interfaces/third-party/gui.md | 12 ++++++++---- docs/zh/interfaces/third-party/gui.md | 12 ++++++++---- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/docs/en/interfaces/third-party/gui.md b/docs/en/interfaces/third-party/gui.md index ea90e27df4d..a424741efce 100644 --- a/docs/en/interfaces/third-party/gui.md +++ b/docs/en/interfaces/third-party/gui.md @@ -1,6 +1,8 @@ # Visual Interfaces from Third-party Developers -## Tabix +## Open-Source + +### Tabix Web interface for ClickHouse in the [Tabix](https://github.com/tabixio/tabix) project. @@ -14,7 +16,7 @@ Features: [Tabix documentation](https://tabix.io/doc/). -## HouseOps +### HouseOps [HouseOps](https://github.com/HouseOps/HouseOps) is a UI/IDE for OSX, Linux and Windows. @@ -36,7 +38,9 @@ The following features are planned for development: - Cluster management. - Monitoring replicated and Kafka tables. -## DBeaver +## Commercial + +### DBeaver [DBeaver](https://dbeaver.io/) - universal desktop database client with ClickHouse support. @@ -46,7 +50,7 @@ Features: - Table preview. - Autocompletion. -## DataGrip +### DataGrip [DataGrip](https://www.jetbrains.com/datagrip/) is a database IDE from JetBrains with dedicated support for ClickHouse. It is also embedded into other IntelliJ-based tools: PyCharm, IntelliJ IDEA, GoLand, PhpStorm and others. diff --git a/docs/fa/interfaces/third-party/gui.md b/docs/fa/interfaces/third-party/gui.md index a3378ad2393..b2c71664af2 100644 --- a/docs/fa/interfaces/third-party/gui.md +++ b/docs/fa/interfaces/third-party/gui.md @@ -2,7 +2,9 @@ # interface های visual توسعه دهندگان third-party -## Tabix +## متن باز + +### Tabix interface تحت وب برای ClickHouse در پروژه [Tabix](https://github.com/tabixio/tabix). @@ -17,7 +19,7 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github [مستندات Tabix](https://tabix.io/doc/). -## HouseOps +### HouseOps [HouseOps](https://github.com/HouseOps/HouseOps) نرم افزار Desktop برای سیستم عامل های Linux و OSX و Windows می باشد.. @@ -37,7 +39,9 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - مانیتورینگ کافکا و جداول replicate (بزودی); - و بسیاری از ویژگی های دیگر برای شما. -## DBeaver +## تجاری + +### DBeaver [DBeaver](https://dbeaver.io/) - مشتری دسکتاپ دسکتاپ دسکتاپ با پشتیبانی ClickHouse. @@ -47,7 +51,7 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - پیش نمایش جدول - تکمیل خودکار -## DataGrip +### DataGrip [DataGrip](https://www.jetbrains.com/datagrip/) IDE پایگاه داده از JetBrains با پشتیبانی اختصاصی برای ClickHouse است. این ابزار همچنین به سایر ابزارهای مبتنی بر IntelliJ تعبیه شده است: PyCharm، IntelliJ IDEA، GoLand، PhpStorm و دیگران. diff --git a/docs/ru/interfaces/third-party/gui.md b/docs/ru/interfaces/third-party/gui.md index f8e7bb98388..34598dd7119 100644 --- a/docs/ru/interfaces/third-party/gui.md +++ b/docs/ru/interfaces/third-party/gui.md @@ -1,6 +1,8 @@ # Визуальные интерфейсы от сторонних разработчиков -## Tabix +## С открытым исходным кодом + +### Tabix Веб-интерфейс для ClickHouse в проекте [Tabix](https://github.com/tabixio/tabix). @@ -14,7 +16,7 @@ [Документация Tabix](https://tabix.io/doc/). -## HouseOps +### HouseOps [HouseOps](https://github.com/HouseOps/HouseOps) — UI/IDE для OSX, Linux и Windows. @@ -39,7 +41,9 @@ - Управление кластером; - Мониторинг реплицированных и Kafka таблиц. -## DBeaver +## Коммерческие + +### DBeaver [DBeaver](https://dbeaver.io/) - универсальный desktop клиент баз данных с поддержкой ClickHouse. @@ -49,7 +53,7 @@ - Просмотр таблиц; - Автодополнение команд. -## DataGrip +### DataGrip [DataGrip](https://www.jetbrains.com/datagrip/) — это IDE для баз данных о JetBrains с выделенной поддержкой ClickHouse. Он также встроен в другие инструменты на основе IntelliJ: PyCharm, IntelliJ IDEA, GoLand, PhpStorm и другие. diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index be946c1a20a..063cb6e09d3 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -1,6 +1,8 @@ # 第三方开发的可视化界面 -## Tabix +## 开源 + +### Tabix ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). @@ -15,7 +17,7 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). [Tabix 文档](https://tabix.io/doc/). -## HouseOps +### HouseOps [HouseOps](https://github.com/HouseOps/HouseOps) 是一个交互式 UI/IDE 工具,可以运行在 OSX, Linux and Windows 平台中。 @@ -36,7 +38,9 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 集群管理 - 监控副本情况以及 Kafka 引擎表 -## DBeaver +## 广告 + +### DBeaver [DBeaver](https://dbeaver.io/) - 具有ClickHouse支持的通用桌面数据库客户端。 @@ -46,7 +50,7 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 表格预览。 - 自动完成。 -## DataGrip +### DataGrip [DataGrip](https://www.jetbrains.com/datagrip/)是JetBrains的数据库IDE,专门支持ClickHouse。 它还嵌入到其他基于IntelliJ的工具中:PyCharm,IntelliJ IDEA,GoLand,PhpStorm等。 From 97a057d7a8b2ea1641b781d81ddb8f2d291270f4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 19:11:11 +0300 Subject: [PATCH 081/297] Mention some RDBMS integrations + ad-hoc translation fixes --- docs/en/interfaces/third-party/integrations.md | 7 ++++++- docs/fa/interfaces/third-party/integrations.md | 9 +++++++-- docs/ru/interfaces/third-party/integrations.md | 9 +++++++-- docs/zh/interfaces/third-party/integrations.md | 9 +++++++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md index ece64d9dcb3..a55d69d8bc2 100644 --- a/docs/en/interfaces/third-party/integrations.md +++ b/docs/en/interfaces/third-party/integrations.md @@ -3,6 +3,11 @@ !!! warning "Disclaimer" Yandex does **not** maintain the libraries listed below and haven't done any extensive testing to ensure their quality. +- Relational database management systems + - [MySQL](https://www.mysql.com) + - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [PostgreSQL](https://www.postgresql.org) + - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) @@ -22,4 +27,4 @@ - [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto) -[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/integrations/) \ No newline at end of file +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/integrations/) diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index 08055497848..c11b7237653 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -5,12 +5,17 @@ !!! warning "سلب مسئولیت" Yandex نه حفظ کتابخانه ها در زیر ذکر شده و نشده انجام هر آزمایش های گسترده ای برای اطمینان از کیفیت آنها. +- سیستم های مدیریت پایگاه داده رابطه ای + - [MySQL](https://www.mysql.com) + - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [PostgreSQL](https://www.postgresql.org) + - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (استفاده می کند [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (استفاده می کند [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Java - [Hadoop](http://hadoop.apache.org) - - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (استفاده می کند [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index e86a9fb20a8..ed7a20b5880 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -3,12 +3,17 @@ !!! warning "Disclaimer" Яндекс не поддерживает перечисленные ниже библиотеки и не проводит тщательного тестирования для проверки их качества. +- Реляционные системы управления базами данных + - [MySQL](https://www.mysql.com) + - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [PostgreSQL](https://www.postgresql.org) + - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (использует [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (использует [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Java - [Hadoop](http://hadoop.apache.org) - - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (использует [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index 9b33f455b09..e74a56bf215 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -3,12 +3,17 @@ !!! warning "放弃" Yandex不维护下面列出的库,也没有进行任何广泛的测试以确保其质量。 +- 关系数据库管理系统 + - [MySQL](https://www.mysql.com) + - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [PostgreSQL](https://www.postgresql.org) + - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (使用 [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (使用 [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) - Java - [Hadoop](http://hadoop.apache.org) - - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) + - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (使用 [JDBC](../jdbc.md)) - Scala - [Akka](https://akka.io) - [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client) From 18d67ba5f0d66cf3864f1479e92177131c5a4c8d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 20:09:08 +0300 Subject: [PATCH 082/297] Add rel="external nofollow" to outgoing links from docs --- docs/tools/mdx_clickhouse.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index c38d6ddcf16..a29182bedcd 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -2,20 +2,46 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import markdown.inlinepatterns import markdown.extensions import markdown.util +class NofollowMixin(object): + def handleMatch(self, m): + try: + el = super(NofollowMixin, self).handleMatch(m) + except IndexError: + return + + if el is not None: + href = el.get('href') or '' + if href.startswith('http') and not href.startswith('https://clickhouse.yandex'): + el.set('rel', 'external nofollow') + return el + + +class NofollowAutolinkPattern(NofollowMixin, markdown.inlinepatterns.AutolinkPattern): + pass + + +class NofollowLinkPattern(NofollowMixin, markdown.inlinepatterns.LinkPattern): + pass + + class ClickHousePreprocessor(markdown.util.Processor): def run(self, lines): for line in lines: if '' not in line: yield line + class ClickHouseMarkdown(markdown.extensions.Extension): def extendMarkdown(self, md, md_globals): md.preprocessors['clickhouse'] = ClickHousePreprocessor() + md.inlinePatterns['link'] = NofollowLinkPattern(markdown.inlinepatterns.LINK_RE, md) + md.inlinePatterns['autolink'] = NofollowLinkPattern(markdown.inlinepatterns.AUTOLINK_RE, md) def makeExtension(**kwargs): From ba7072015806ffbc9dbb7ed9004fb62d0410c256 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 20:19:40 +0300 Subject: [PATCH 083/297] Lost blank lines --- docs/en/getting_started/index.md | 1 + docs/ru/getting_started/index.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/en/getting_started/index.md b/docs/en/getting_started/index.md index f78cb5dc03a..77c626152e4 100644 --- a/docs/en/getting_started/index.md +++ b/docs/en/getting_started/index.md @@ -39,6 +39,7 @@ You can also download and install packages manually from here: are generated from official `deb` packages by Yandex and have byte-identical binaries. * Packages from are built by independent company Altinity, but are used widely without any complaints. * Or you can use Docker (see below). diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index 5ed654e1634..26da2a4654f 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -39,6 +39,7 @@ sudo apt-get install clickhouse-client clickhouse-server Яндекс не использует ClickHouse на поддерживающих `rpm` дистрибутивах Linux, а также `rpm` пакеты менее тщательно тестируются. Таким образом, использовать их стоит на свой страх и риск, но, тем не менее, многие другие компании успешно работают на них в production без каких-либо серьезных проблем. Для CentOS, RHEL и Fedora возможны следующие варианты: + * Пакеты из генерируются на основе официальных `deb` пакетов от Яндекса и содержат в точности тот же исполняемый файл. * Пакеты из собираются независимой компанией Altinity, но широко используются без каких-либо нареканий. * Либо можно использовать Docker (см. ниже). From 743c904b3f621e401385169cb9158b212c8db7ef Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 4 Dec 2018 20:20:39 +0300 Subject: [PATCH 084/297] Fix class name --- docs/tools/mdx_clickhouse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index a29182bedcd..7c5c592b28e 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -41,7 +41,7 @@ class ClickHouseMarkdown(markdown.extensions.Extension): def extendMarkdown(self, md, md_globals): md.preprocessors['clickhouse'] = ClickHousePreprocessor() md.inlinePatterns['link'] = NofollowLinkPattern(markdown.inlinepatterns.LINK_RE, md) - md.inlinePatterns['autolink'] = NofollowLinkPattern(markdown.inlinepatterns.AUTOLINK_RE, md) + md.inlinePatterns['autolink'] = NofollowAutolinkPattern(markdown.inlinepatterns.AUTOLINK_RE, md) def makeExtension(**kwargs): From a0e860fd6a297ff4234f6358e2ec4cb05571f2e0 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 00:11:47 +0300 Subject: [PATCH 085/297] More rel="external nofollow" --- docs/tools/mkdocs-material-theme/base.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index b3d3ae2d0e4..a8950c53c0a 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -136,10 +136,10 @@
    {% block content %} {% if config.extra.single_page %} - + {% else %} {% if page.edit_url %} - + {% endif %} {% endif %} {% if not "\x3ch1" in page.content %} @@ -155,7 +155,7 @@

    {{ lang.t("meta.source") }}

    {% set path = page.meta.path | default([""]) %} {% set file = page.meta.source %} - + {{ file }} {% endif %} From c4145c7e619fd3d07e0b99fa6be2e58d3d5edfb4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 10:44:47 +0300 Subject: [PATCH 086/297] Apply suggestions by @sundy-li --- docs/zh/interfaces/third-party/gui.md | 2 +- docs/zh/interfaces/third-party/integrations.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index 063cb6e09d3..e0173b8b91d 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -38,7 +38,7 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 集群管理 - 监控副本情况以及 Kafka 引擎表 -## 广告 +## 商业 ### DBeaver diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index e74a56bf215..d4e9a6abdbe 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -1,6 +1,6 @@ # 第三方集成库 -!!! warning "放弃" +!!! warning "声明" Yandex不维护下面列出的库,也没有进行任何广泛的测试以确保其质量。 - 关系数据库管理系统 From ffbaeebdd0aaea5c6a3a008be0db991aa66a17da Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 13:33:36 +0300 Subject: [PATCH 087/297] Mobile version of front page improvements --- website/index.css | 1 + website/index.html | 1 + 2 files changed, 2 insertions(+) diff --git a/website/index.css b/website/index.css index c5061595a9c..b303ac7ffbe 100644 --- a/website/index.css +++ b/website/index.css @@ -409,6 +409,7 @@ img { } #index_ul { + padding-bottom: 30px; padding-left: 0; margin: 0 0 30px -16px; font-size: 90%; diff --git a/website/index.html b/website/index.html index 048b46f60e4..dab2cbf30bb 100644 --- a/website/index.html +++ b/website/index.html @@ -3,6 +3,7 @@ + ClickHouse — open source distributed column-oriented DBMS From 0d93284f019b327312caa56374ef13e8a4e7a69a Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 14:38:59 +0300 Subject: [PATCH 088/297] test --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 75d3bda7798..a87cfdf47e8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2016-2018 YANDEX LLC +Copyright 2018 YANDEX LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From feeace51fc85b598f12106b39023a92d922b3481 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 14:41:32 +0300 Subject: [PATCH 089/297] test 2 --- LICENSE | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index a87cfdf47e8..5cbccc06fd2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,192 @@ -Copyright 2018 YANDEX LLC + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2018 YANDEX LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 63462e0ce9ddf3a5136cb57f6416399838db999f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 14:42:09 +0300 Subject: [PATCH 090/297] test 3 --- LICENSE | 188 -------------------------------------------------------- 1 file changed, 188 deletions(-) diff --git a/LICENSE b/LICENSE index 5cbccc06fd2..39e958fce21 100644 --- a/LICENSE +++ b/LICENSE @@ -1,191 +1,3 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - Copyright 2016-2018 YANDEX LLC Licensed under the Apache License, Version 2.0 (the "License"); From 6432aabf38cd66323d8249bc244070b8797736d2 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 5 Dec 2018 14:50:42 +0300 Subject: [PATCH 091/297] Update LICENSE --- LICENSE | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 39e958fce21..1460730b3ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,192 @@ - Copyright 2016-2018 YANDEX LLC + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2018 Yandex LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From f736526774ae1b38057d7be64b81b1c0b97e449e Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 6 Dec 2018 15:17:26 +0300 Subject: [PATCH 092/297] minor docs fix --- docs/en/introduction/distinctive_features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/introduction/distinctive_features.md b/docs/en/introduction/distinctive_features.md index a25de6562ef..1dbc710659d 100644 --- a/docs/en/introduction/distinctive_features.md +++ b/docs/en/introduction/distinctive_features.md @@ -14,7 +14,7 @@ Some column-oriented DBMSs (InfiniDB CE and MonetDB) do not use data compression ## Disk Storage of Data -Mving a data physically sorted by primary key makes it possible to extract data for it's specific values or value ranges with low latency, less than few dozen milliseconds. some column-oriented DBMSs (such as SAP HANA and Google PowerDrill) can only work in RAM. This approach encourages the allocation of a larger hardware budget than is actually necessary for real-time analysis. ClickHouse is designed to work on regular hard drives, which means the cost per GB of data storage is low, but SSD and additional RAM are also fully used if available. +Keeping data physically sorted by primary key makes it possible to extract data for it's specific values or value ranges with low latency, less than few dozen milliseconds. Some column-oriented DBMSs (such as SAP HANA and Google PowerDrill) can only work in RAM. This approach encourages the allocation of a larger hardware budget than is actually necessary for real-time analysis. ClickHouse is designed to work on regular hard drives, which means the cost per GB of data storage is low, but SSD and additional RAM are also fully used if available. ## Parallel Processing on Multiple Cores From 8fd9d8144f497b62b577276ced642d098cffe316 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 7 Dec 2018 18:27:29 +0300 Subject: [PATCH 093/297] Highlight current article as suggested by @sundy-li --- docs/tools/mkdocs-material-theme/partials/nav-item.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/mkdocs-material-theme/partials/nav-item.html b/docs/tools/mkdocs-material-theme/partials/nav-item.html index 32b86583d7a..4b31a079912 100644 --- a/docs/tools/mkdocs-material-theme/partials/nav-item.html +++ b/docs/tools/mkdocs-material-theme/partials/nav-item.html @@ -40,7 +40,7 @@ {% endif %} - {{ nav_item.title }} + {{ nav_item.title }} {% if toc_ | first is defined %} {% include "partials/toc.html" %} From aa1fae38c135c8a1988ebda0a90c020e8364b538 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Sat, 8 Dec 2018 22:56:23 +0300 Subject: [PATCH 094/297] fix link destination --- docs/zh/query_language/select.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/query_language/select.md b/docs/zh/query_language/select.md index 713aec76dc3..ae67b48d3d9 100644 --- a/docs/zh/query_language/select.md +++ b/docs/zh/query_language/select.md @@ -983,4 +983,4 @@ SELECT uniq(UserID) FROM local_table WHERE CounterID = 101500 AND UserID GLOBAL 在所有的其他情况下,我们不建议使用星号,因为它是列式数据库的缺点而不是优点。 -[来源文章](https://clickhouse.yandex/docs/en/query_language/select/) +[来源文章](https://clickhouse.yandex/docs/zh/query_language/select/) From b540df4973080a659a0a68576f8c6d0b5730f752 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 13:47:40 +0300 Subject: [PATCH 095/297] Introduce backup.md (only "en" for now) --- docs/en/operations/backup.md | 31 +++++++++++++++++++++++++++++++ docs/en/query_language/alter.md | 11 ++--------- docs/fa/operations/backup.md | 1 + docs/ru/operations/backup.md | 1 + docs/ru/query_language/alter.md | 11 ++--------- docs/zh/backup.md | 1 + docs/zh/operations/backup.md | 1 + 7 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 docs/en/operations/backup.md create mode 120000 docs/fa/operations/backup.md create mode 120000 docs/ru/operations/backup.md create mode 120000 docs/zh/backup.md create mode 120000 docs/zh/operations/backup.md diff --git a/docs/en/operations/backup.md b/docs/en/operations/backup.md new file mode 100644 index 00000000000..324a04bf2d4 --- /dev/null +++ b/docs/en/operations/backup.md @@ -0,0 +1,31 @@ +# Data Backup + +While [replication](../table_engines/replication.md#table_engines-replication) provides protection from hardware failures, it does not protect against human errors: accidentally deleting data, deleting the wrong table or on the wrong cluster, software bugs leading to incorrect data processing or data corruption. In many cases commands like these will affect all replicas. ClickHouse has built-in safeguards to prevent some of mistakes, for example by default [you can't just drop tables with MergeTree-like engine containing more than 50Gb of data](https://github.com/yandex/ClickHouse/blob/v18.14.18-stable/dbms/programs/server/config.xml#L322-L330), but they don't cover all possible cases and can be circumvented. + +So in order to effectively mitigate possible human errors, you should carefully prepare your backup and restore strategy **in advance**. + +Each company has different resources available and different business requirements so there's no universal solution for ClickHouse backups and restores that will fit any situation. What works for gigabyte of data likely won't work for tens of petabytes. There are different possible approaches with their own pros and cons, which will be discussed below. Often it makes to employ few of those instead of just one to compensate their trade-offs. + +!!! note "Note" + Keep in mind that if you backed something up and never tried to restore it, chances are that restore will not work properly when you'll need it (or at least will take longer than business can tolerate). So whatever backup approach you'll choose, make sure to automate restore process too and practice it on spare ClickHouse cluster regularly. + +## Duplicating Source Data Somewhere Else + +Often data that is ingested into ClickHouse is delivered through some sort of persistent queue, for example [Apache Kafka](https://kafka.apache.org). In this case it is possible to set up additional set of subscribers that will read same data stream as is written to ClickHouse and store it in some cold storage. Most companies already have some default recommended cold storage, it could be an object store or a distributed filesystem, for example [HDFS](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html). + +## Filesystem Snapshots + +Some local filesystems provide functionality to create snapshots, for example [ZFS](https://en.wikipedia.org/wiki/ZFS), but they might be not best choice for serving live queries. Possible solution is to create additional replicas with this kind of filesystems and exclude them from distributed tables that are used for SELECT queries. Snapshots on such replicas will be out of reach of any queries modifying data. As a bonus these replicas might have different hardware configuration with much more disks attached per server, which will be cost-effective. + +## clickhouse-copier + +[clickhouse-copier](utils/clickhouse-copier.md) is a versatile tool initially created to re-shard petabytes-sized tables, but it can be used for backup and restore purposes as well because it just reliably copies data between ClickHouse tables and clusters. + +## Manipulations with Parts + +ClickHouse allows to create a local copy of table partitions using `ALTER TABLE ... FREZE PARTITION ...` query. It's implemented using hardlinks to `/var/lib/clickhouse/shadow/` folder, so for old data it usually does not consume extra disk space. As created file copies are no longer touched by ClickHouse server, you can just leave them there: it's still be a simple backup that doesn't require any additional external system, but will be prone to hardware issues since. It's better to remotely copy them somewhere and then probably remove the local copies. Distributed filesystems and object stores are still a good options for this, but normal file servers attached with large enough capacity might work as well (in this case the transfer will happen via network filesystem or maybe [rsync](https://en.wikipedia.org/wiki/Rsync)). + +More details on queries related to partition manipulations can be found in [respective section of ALTER documentation](../query_language/alter.md#query_language-manipulation-with-partitions-and-parts). + + +[Original article](https://clickhouse.yandex/docs/en/operations/access_rights/) \ No newline at end of file diff --git a/docs/en/query_language/alter.md b/docs/en/query_language/alter.md index cdb46b9a15d..fbdc5c79ae1 100644 --- a/docs/en/query_language/alter.md +++ b/docs/en/query_language/alter.md @@ -85,6 +85,8 @@ The command is lightweight in a sense that it only changes metadata. To keep the rows are ordered by the sorting key expression you cannot add expressions containing existing columns to the sorting key (only columns added by the `ADD COLUMN` command in the same `ALTER` query). + + ### Manipulations With Partitions and Parts It only works for tables in the [`MergeTree`](../operations/table_engines/mergetree.md) family (including @@ -206,15 +208,6 @@ To restore from a backup: In this way, data from the backup will be added to the table. Restoring from a backup doesn't require stopping the server. -### Backups and Replication - -Replication provides protection from device failures. If all data disappeared on one of your replicas, follow the instructions in the "Restoration after failure" section to restore it. - -For protection from device failures, you must use replication. For more information about replication, see the section "Data replication". - -Backups protect against human error (accidentally deleting data, deleting the wrong data or in the wrong cluster, or corrupting data). -For high-volume databases, it can be difficult to copy backups to remote servers. In such cases, to protect from human error, you can keep a backup on the same server (it will reside in `/var/lib/clickhouse/shadow/`). - ``` sql ALTER TABLE [db.]table FETCH PARTITION 'name' FROM 'path-in-zookeeper' ``` diff --git a/docs/fa/operations/backup.md b/docs/fa/operations/backup.md new file mode 120000 index 00000000000..1003fb30e61 --- /dev/null +++ b/docs/fa/operations/backup.md @@ -0,0 +1 @@ +../../en/operations/backup.md \ No newline at end of file diff --git a/docs/ru/operations/backup.md b/docs/ru/operations/backup.md new file mode 120000 index 00000000000..1003fb30e61 --- /dev/null +++ b/docs/ru/operations/backup.md @@ -0,0 +1 @@ +../../en/operations/backup.md \ No newline at end of file diff --git a/docs/ru/query_language/alter.md b/docs/ru/query_language/alter.md index fcf8eed099b..744c1063d88 100644 --- a/docs/ru/query_language/alter.md +++ b/docs/ru/query_language/alter.md @@ -82,6 +82,8 @@ MODIFY ORDER BY new_expression сортировки, разрешено добавлять в ключ только новые столбцы (т.е. столбцы, добавляемые командой `ADD COLUMN` в том же запросе `ALTER`), у которых нет выражения по умолчанию. + + ### Манипуляции с партициями и кусками Работает только для таблиц семейства [`MergeTree`](../operations/table_engines/mergetree.md) (в том числе [реплицированных](../operations/table_engines/replication.md)). Существуют следующие виды @@ -203,15 +205,6 @@ ALTER TABLE [db.]table FREEZE PARTITION 'name' Таким образом, данные из бэкапа будут добавлены в таблицу. Восстановление из бэкапа, так же, не требует остановки сервера. -### Бэкапы и репликация - -Репликация защищает от аппаратных сбоев. В случае, если на одной из реплик у вас исчезли все данные, то восстановление делается по инструкции в разделе "Восстановление после сбоя". - -Для защиты от аппаратных сбоев, обязательно используйте репликацию. Подробнее про репликацию написано в разделе "Репликация данных". - -Бэкапы защищают от человеческих ошибок (случайно удалили данные, удалили не те данные или не на том кластере, испортили данные). -Для баз данных большого объёма, бывает затруднительно копировать бэкапы на удалённые серверы. В этих случаях, для защиты от человеческой ошибки, можно держать бэкап на том же сервере (он будет лежать в `/var/lib/clickhouse/shadow/`). - ``` sql ALTER TABLE [db.]table FETCH PARTITION 'name' FROM 'path-in-zookeeper' ``` diff --git a/docs/zh/backup.md b/docs/zh/backup.md new file mode 120000 index 00000000000..1003fb30e61 --- /dev/null +++ b/docs/zh/backup.md @@ -0,0 +1 @@ +../../en/operations/backup.md \ No newline at end of file diff --git a/docs/zh/operations/backup.md b/docs/zh/operations/backup.md new file mode 120000 index 00000000000..1003fb30e61 --- /dev/null +++ b/docs/zh/operations/backup.md @@ -0,0 +1 @@ +../../en/operations/backup.md \ No newline at end of file From 1458d8f8addf4174a896ac6f2ffebfced014ec12 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 14:12:24 +0300 Subject: [PATCH 096/297] Mention INSERT+SELECT in backup.md --- docs/en/operations/backup.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/operations/backup.md b/docs/en/operations/backup.md index 324a04bf2d4..407b4eabe48 100644 --- a/docs/en/operations/backup.md +++ b/docs/en/operations/backup.md @@ -19,7 +19,9 @@ Some local filesystems provide functionality to create snapshots, for example [Z ## clickhouse-copier -[clickhouse-copier](utils/clickhouse-copier.md) is a versatile tool initially created to re-shard petabytes-sized tables, but it can be used for backup and restore purposes as well because it just reliably copies data between ClickHouse tables and clusters. +[clickhouse-copier](utils/clickhouse-copier.md) is a versatile tool initially created to re-shard petabytes-sized tables, but it can be used for backup and restore purposes as well because it just reliably copies data between ClickHouse tables and clusters. + +For smaller volumes of data simple `INSERT INTO ... SELECT ...` to remote tables might work as well. ## Manipulations with Parts From 4b075aa269449d32c27235afd3f54535824e09e1 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 14:39:09 +0300 Subject: [PATCH 097/297] Some improvements for replication.md --- .../operations/table_engines/replication.md | 6 +++-- .../operations/table_engines/replication.md | 23 ++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/en/operations/table_engines/replication.md b/docs/en/operations/table_engines/replication.md index 01245edf744..387fed63171 100644 --- a/docs/en/operations/table_engines/replication.md +++ b/docs/en/operations/table_engines/replication.md @@ -93,7 +93,7 @@ ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) ``` -Example in deprecated syntax: +
    Example in deprecated syntax ```sql CREATE TABLE table_name @@ -104,6 +104,8 @@ CREATE TABLE table_name ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/hits', '{replica}', EventDate, intHash32(UserID), (CounterID, EventDate, intHash32(UserID), EventTime), 8192) ``` +
    + As the example shows, these parameters can contain substitutions in curly brackets. The substituted values are taken from the 'macros' section of the configuration file. Example: ```xml @@ -180,7 +182,7 @@ There is no restriction on network bandwidth during recovery. Keep this in mind We use the term `MergeTree` to refer to all table engines in the ` MergeTree family`, the same as for `ReplicatedMergeTree`. -If you had a `MergeTree` table that was manually replicated, you can convert it to a replicatable table. You might need to do this if you have already collected a large amount of data in a `MergeTree` table and now you want to enable replication. +If you had a `MergeTree` table that was manually replicated, you can convert it to a replicated table. You might need to do this if you have already collected a large amount of data in a `MergeTree` table and now you want to enable replication. If the data differs on various replicas, first sync it, or delete this data on all the replicas except one. diff --git a/docs/ru/operations/table_engines/replication.md b/docs/ru/operations/table_engines/replication.md index ec40645a8f6..1da2ea892b7 100644 --- a/docs/ru/operations/table_engines/replication.md +++ b/docs/ru/operations/table_engines/replication.md @@ -78,10 +78,31 @@ Пример: +```sql +CREATE TABLE table_name +( + EventDate DateTime, + CounterID UInt32, + UserID UInt32 +) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/hits', '{replica}') +PARTITION BY toYYYYMM(EventDate) +ORDER BY (CounterID, EventDate, intHash32(UserID)) +SAMPLE BY intHash32(UserID) ``` -ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/hits', '{replica}', EventDate, intHash32(UserID), (CounterID, EventDate, intHash32(UserID), EventTime), 8192) + +
    Пример в устаревшем синтаксисе + +```sql +CREATE TABLE table_name +( + EventDate DateTime, + CounterID UInt32, + UserID UInt32 +) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/hits', '{replica}', EventDate, intHash32(UserID), (CounterID, EventDate, intHash32(UserID), EventTime), 8192) ``` +
    + Как видно в примере, эти параметры могут содержать подстановки в фигурных скобках. Подставляемые значения достаются из конфигурационного файла, из секции macros. Пример: ```xml From 0f254c977c0c189753106602bf7e681bc47886d4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 14:45:08 +0300 Subject: [PATCH 098/297] Add backup.md to toc --- docs/toc_en.yml | 1 + docs/toc_fa.yml | 1 + docs/toc_ru.yml | 1 + docs/toc_zh.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 6e9a252e84e..13a4a436e37 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -151,6 +151,7 @@ nav: - 'Kafka': 'operations/table_engines/kafka.md' - 'MySQL': 'operations/table_engines/mysql.md' - 'Access Rights': 'operations/access_rights.md' + - 'Data Backup': 'operations/backup.md' - 'Configuration Files': 'operations/configuration_files.md' - 'Quotas': 'operations/quotas.md' - 'System Tables': 'operations/system_tables.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index cc0aa901c1a..cde327d49e4 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -150,6 +150,7 @@ nav: - 'Kafka': 'operations/table_engines/kafka.md' - 'MySQL': 'operations/table_engines/mysql.md' - 'Access rights': 'operations/access_rights.md' + - 'Data Backup': 'operations/backup.md' - 'Configuration files': 'operations/configuration_files.md' - 'Quotas': 'operations/quotas.md' - 'System tables': 'operations/system_tables.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index b4f4d60fd93..4d19dbd518a 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -151,6 +151,7 @@ nav: - 'Kafka': 'operations/table_engines/kafka.md' - 'MySQL': 'operations/table_engines/mysql.md' - 'Права доступа': 'operations/access_rights.md' + - 'Резервное копирование': 'operations/backup.md' - 'Конфигурационные файлы': 'operations/configuration_files.md' - 'Квоты': 'operations/quotas.md' - 'Системные таблицы': 'operations/system_tables.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index dd2811223af..60255424fb6 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -151,6 +151,7 @@ nav: - 'Kafka': 'operations/table_engines/kafka.md' - 'MySQL': 'operations/table_engines/mysql.md' - 'Access rights': 'operations/access_rights.md' + - 'Data backup': 'operations/backup.md' - 'Configuration files': 'operations/configuration_files.md' - 'Quotas': 'operations/quotas.md' - 'System tables': 'operations/system_tables.md' From aac8aeff64ca8c526dbd452b612914c97175ed91 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 15:23:28 +0300 Subject: [PATCH 099/297] Mention clickhouse-backup tool --- docs/en/interfaces/third-party/integrations.md | 3 +++ docs/en/operations/backup.md | 2 ++ docs/fa/interfaces/third-party/integrations.md | 3 +++ docs/ru/interfaces/third-party/integrations.md | 3 +++ docs/zh/interfaces/third-party/integrations.md | 3 +++ 5 files changed, 14 insertions(+) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md index a55d69d8bc2..0b11630510f 100644 --- a/docs/en/interfaces/third-party/integrations.md +++ b/docs/en/interfaces/third-party/integrations.md @@ -8,6 +8,9 @@ - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Object store + - S3 + - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) diff --git a/docs/en/operations/backup.md b/docs/en/operations/backup.md index 407b4eabe48..c13514a76e1 100644 --- a/docs/en/operations/backup.md +++ b/docs/en/operations/backup.md @@ -29,5 +29,7 @@ ClickHouse allows to create a local copy of table partitions using `ALTER TABLE More details on queries related to partition manipulations can be found in [respective section of ALTER documentation](../query_language/alter.md#query_language-manipulation-with-partitions-and-parts). +There's a third-party tool to automate this approach: [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup). + [Original article](https://clickhouse.yandex/docs/en/operations/access_rights/) \ No newline at end of file diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index c11b7237653..7bb4a5cae28 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -10,6 +10,9 @@ - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (استفاده می کند [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- فروشگاه شی + - S3 + - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (استفاده می کند [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index ed7a20b5880..de75ed9c7ee 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -8,6 +8,9 @@ - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (использует [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- Хранилища объектов + - S3 + - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (использует [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index d4e9a6abdbe..f84d68d94a5 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -8,6 +8,9 @@ - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (使用 [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) +- 对象存储 + - S3 + - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (使用 [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) From 44fc5263ac64ef972e605c2c397aaeecc1570af9 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 15:42:22 +0300 Subject: [PATCH 100/297] Mention LightHouse in third-party GUI list --- docs/en/interfaces/third-party/gui.md | 10 ++++++++++ docs/fa/interfaces/third-party/gui.md | 10 ++++++++++ docs/ru/interfaces/third-party/gui.md | 10 ++++++++++ docs/zh/interfaces/third-party/gui.md | 12 +++++++++++- 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/en/interfaces/third-party/gui.md b/docs/en/interfaces/third-party/gui.md index a424741efce..567a95aced7 100644 --- a/docs/en/interfaces/third-party/gui.md +++ b/docs/en/interfaces/third-party/gui.md @@ -38,6 +38,16 @@ The following features are planned for development: - Cluster management. - Monitoring replicated and Kafka tables. +### LightHouse + +[LightHouse](https://github.com/VKCOM/lighthouse) is a lightweight web interface for ClickHouse. + +Features: + +- Table list with filtering and metadata. +- Table preview with filtering and sorting. +- Read-only queries execution. + ## Commercial ### DBeaver diff --git a/docs/fa/interfaces/third-party/gui.md b/docs/fa/interfaces/third-party/gui.md index b2c71664af2..e5a4af2bcc7 100644 --- a/docs/fa/interfaces/third-party/gui.md +++ b/docs/fa/interfaces/third-party/gui.md @@ -39,6 +39,16 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - مانیتورینگ کافکا و جداول replicate (بزودی); - و بسیاری از ویژگی های دیگر برای شما. +### LightHouse + +[LightHouse](https://github.com/VKCOM/lighthouse) رابط کاربری سبک وزن برای ClickHouse است. + +امکانات: + +- لیست جدول با فیلتر کردن و ابرداده. +- پیش نمایش جدول با فیلتر کردن و مرتب سازی. +- اعداد نمایش داده شده فقط خواندنی + ## تجاری ### DBeaver diff --git a/docs/ru/interfaces/third-party/gui.md b/docs/ru/interfaces/third-party/gui.md index 34598dd7119..adeed76f8fd 100644 --- a/docs/ru/interfaces/third-party/gui.md +++ b/docs/ru/interfaces/third-party/gui.md @@ -41,6 +41,16 @@ - Управление кластером; - Мониторинг реплицированных и Kafka таблиц. +### LightHouse + +[LightHouse](https://github.com/VKCOM/lighthouse) — это легковесный веб-интерфейс для ClickHouse. + +Основные возможности: + +- Список таблиц с фильтрацией и метаданными. +- Предварительный просмотр таблицы с фильтрацией и сортировкой. +- Выполнение запросов только для чтения. + ## Коммерческие ### DBeaver diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index e0173b8b91d..d9ce8047676 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -38,11 +38,21 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 集群管理 - 监控副本情况以及 Kafka 引擎表 +### LightHouse + +[LightHouse](https://github.com/VKCOM/lighthouse)是ClickHouse的轻量级Web界面。 + +特征: + + - 包含过滤和元数据的表列表。 + - 带有过滤和排序的表格预览。 + - 只读查询执行。 + ## 商业 ### DBeaver -[DBeaver](https://dbeaver.io/) - 具有ClickHouse支持的通用桌面数据库客户端。 +[DBeaver](https://dbeaver.io/)具有ClickHouse支持的通用桌面数据库客户端。 特征: From 91098f5b51822b9f0f8fc48e1f9ec21327b5fc47 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 16:03:00 +0300 Subject: [PATCH 101/297] Introduce interfaces/third-party/proxy.md --- docs/en/interfaces/third-party/gui.md | 2 +- docs/en/interfaces/third-party/proxy.md | 26 +++++++++++++++++++++++ docs/fa/interfaces/third-party/gui.md | 2 +- docs/fa/interfaces/third-party/proxy.md | 28 +++++++++++++++++++++++++ docs/ru/interfaces/third-party/gui.md | 2 +- docs/ru/interfaces/third-party/proxy.md | 27 ++++++++++++++++++++++++ docs/toc_en.yml | 1 + docs/toc_fa.yml | 1 + docs/toc_ru.yml | 1 + docs/toc_zh.yml | 1 + docs/zh/interfaces/third-party/gui.md | 2 +- docs/zh/interfaces/third-party/proxy.md | 25 ++++++++++++++++++++++ 12 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 docs/en/interfaces/third-party/proxy.md create mode 100644 docs/fa/interfaces/third-party/proxy.md create mode 100644 docs/ru/interfaces/third-party/proxy.md create mode 100644 docs/zh/interfaces/third-party/proxy.md diff --git a/docs/en/interfaces/third-party/gui.md b/docs/en/interfaces/third-party/gui.md index 567a95aced7..82228039b21 100644 --- a/docs/en/interfaces/third-party/gui.md +++ b/docs/en/interfaces/third-party/gui.md @@ -73,4 +73,4 @@ Features: - Refactorings. - Search and Navigation. -[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party_gui/) +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/gui/) diff --git a/docs/en/interfaces/third-party/proxy.md b/docs/en/interfaces/third-party/proxy.md new file mode 100644 index 00000000000..e8512132994 --- /dev/null +++ b/docs/en/interfaces/third-party/proxy.md @@ -0,0 +1,26 @@ +# Proxy Servers from Third-party Developers + +## chproxy + +[chproxy](https://github.com/Vertamedia/chproxy), is an http proxy and load balancer for ClickHouse database. + +Features: + +* Per-user routing and response caching. +* Flexible limits. +* Automatic SSL cerificate renewal. + +Implemented in Go. + +## KittenHouse + +[KittenHouse](https://github.com/VKCOM/kittenhouse) is designed to be a local proxy between ClickHouse and application server in case it's impossible or inconvenient to buffer INSERT data on your application side. + +Features: + +* In-memory and on-disk data buffering. +* Per-table routing. +* Load-balancing and health checking. + +Implemented in Go. +[Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/proxy/) diff --git a/docs/fa/interfaces/third-party/gui.md b/docs/fa/interfaces/third-party/gui.md index e5a4af2bcc7..d49457d18a6 100644 --- a/docs/fa/interfaces/third-party/gui.md +++ b/docs/fa/interfaces/third-party/gui.md @@ -75,4 +75,4 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - جستجو و ناوبری -[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party_gui/) +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party/gui/) diff --git a/docs/fa/interfaces/third-party/proxy.md b/docs/fa/interfaces/third-party/proxy.md new file mode 100644 index 00000000000..73587304ed6 --- /dev/null +++ b/docs/fa/interfaces/third-party/proxy.md @@ -0,0 +1,28 @@ +
    +# سرورهای پروکسی از توسعه دهندگان شخص ثالث + +[chproxy](https://github.com/Vertamedia/chproxy)، یک پراکسی HTTP و تعادل بار برای پایگاه داده ClickHouse است. + +امکانات + +* مسیریابی و پاسخ دهی کاربر به کاربر. +* محدودیت انعطاف پذیر +* تمدید SSL cerificate به صورت خودکار. + +اجرا شده در برو + +## KittenHouse + +[KittenHouse](https://github.com/VKCOM/kittenhouse) طراحی شده است که یک پروکسی محلی بین ClickHouse و سرور برنامه باشد در صورتی که غیر ممکن است یا ناخوشایند بافر کردن اطلاعات INSERT در قسمت درخواست شما. + +امکانات: + +* بافر حافظه در حافظه و درایو. +* مسیریابی در جدول +* تعادل بار و بررسی سلامت. + +اجرا شده در برو + +
    + +[مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party/proxy/) diff --git a/docs/ru/interfaces/third-party/gui.md b/docs/ru/interfaces/third-party/gui.md index adeed76f8fd..21b1d93b926 100644 --- a/docs/ru/interfaces/third-party/gui.md +++ b/docs/ru/interfaces/third-party/gui.md @@ -76,4 +76,4 @@ - Рефакторинги. - Поиск и навигация. -[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party_gui/) +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party/gui/) diff --git a/docs/ru/interfaces/third-party/proxy.md b/docs/ru/interfaces/third-party/proxy.md new file mode 100644 index 00000000000..3393dfefd79 --- /dev/null +++ b/docs/ru/interfaces/third-party/proxy.md @@ -0,0 +1,27 @@ +# Прокси-серверы от сторонних разработчиков + +## chproxy + +[chproxy] (https://github.com/Vertamedia/chproxy) - это http-прокси и балансировщик нагрузки для базы данных ClickHouse. + +Основные возможности: + +* Индивидуальная маршрутизация и кэширование ответов; +* Гибкие ограничения; +* Автоматическое продление SSL сертификатов. + +Реализован на Go. + +## KittenHouse + +[KittenHouse] (https://github.com/VKCOM/kittenhouse) предназначен для использования в качестве локального прокси-сервера между ClickHouse и вашим сервером приложений в случае, если буферизовать данные INSERT на стороне приложения не представляется возможным или не удобно. + +Основные возможности: + +* Буферизация данных в памяти и на диске. +* Маршрутизация по таблицам. +* Балансировка нагрузки и проверка работоспособности. + +Реализован на Go. + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party/proxy/) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 13a4a436e37..17eed44fa9d 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -29,6 +29,7 @@ nav: - 'Client Libraries': 'interfaces/third-party/client_libraries.md' - 'Integrations': 'interfaces/third-party/integrations.md' - 'Visual Interfaces': 'interfaces/third-party/gui.md' + - 'Proxy': 'interfaces/third-party/proxy.md' - 'Data Types': - 'Introduction': 'data_types/index.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index cde327d49e4..9606f0295e4 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -29,6 +29,7 @@ nav: - 'کتابخانه های مشتری': 'interfaces/third-party/client_libraries.md' - 'یکپارچگی': 'interfaces/third-party/integrations.md' - 'رابط های بصری': 'interfaces/third-party/gui.md' + - 'پروکسی': 'interfaces/third-party/proxy.md' - 'Data types': - 'Introduction': 'data_types/index.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 4d19dbd518a..0923c1be308 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -29,6 +29,7 @@ nav: - 'Клиентские библиотеки': 'interfaces/third-party/client_libraries.md' - 'Интеграции': 'interfaces/third-party/integrations.md' - 'Визуальные интерфейсы': 'interfaces/third-party/gui.md' + - 'Прокси': 'interfaces/third-party/proxy.md' - 'Типы данных': - 'Введение': 'data_types/index.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 60255424fb6..adddfbcaa94 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -29,6 +29,7 @@ nav: - '客户端库': 'interfaces/third-party/client_libraries.md' - '集成': 'interfaces/third-party/integrations.md' - '可视界面': 'interfaces/third-party/gui.md' + - '代理': 'interfaces/third-party/proxy.md' - '数据类型': - '介绍': 'data_types/index.md' diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index d9ce8047676..8f873bbe535 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -73,4 +73,4 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 重构。 - 搜索和导航。 -[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party_gui/) +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party/gui/) diff --git a/docs/zh/interfaces/third-party/proxy.md b/docs/zh/interfaces/third-party/proxy.md new file mode 100644 index 00000000000..2dc1a9a57ce --- /dev/null +++ b/docs/zh/interfaces/third-party/proxy.md @@ -0,0 +1,25 @@ +# 来自第三方开发人员的代理服务器 + +[chproxy](https://github.com/Vertamedia/chproxy)是ClickHouse数据库的http代理和负载均衡器。 + +特征 + +*每用户路由和响应缓存。 +*灵活的限制。 +*自动SSL证书续订。 + +在Go中实现。 + +## KittenHouse + +[KittenHouse](https://github.com/VKCOM/kittenhouse)设计为ClickHouse和应用程序服务器之间的本地代理,以防在应用程序端缓冲INSERT数据是不可能或不方便的。 + +特征: + +*内存和磁盘数据缓冲。 +*每表路由。 +*负载平衡和健康检查。 + +在Go中实现。 + +[来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party/proxy/) From 5000f9763061b81013c2ee42d7dccf8f4535d59d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 16:29:01 +0300 Subject: [PATCH 102/297] Add clickhouse-bulk to proxy.md --- docs/en/interfaces/third-party/proxy.md | 13 +++++++++++++ docs/fa/interfaces/third-party/proxy.md | 12 ++++++++++++ docs/ru/interfaces/third-party/proxy.md | 12 ++++++++++++ docs/zh/interfaces/third-party/proxy.md | 12 ++++++++++++ 4 files changed, 49 insertions(+) diff --git a/docs/en/interfaces/third-party/proxy.md b/docs/en/interfaces/third-party/proxy.md index e8512132994..9ccd39040d4 100644 --- a/docs/en/interfaces/third-party/proxy.md +++ b/docs/en/interfaces/third-party/proxy.md @@ -23,4 +23,17 @@ Features: * Load-balancing and health checking. Implemented in Go. + +## ClickHouse-Bulk + +[ClickHouse-Bulk](https://github.com/nikepan/clickhouse-bulk) is a simple ClickHouse insert collector. + +Features: + +* Group requests and send by threshold or interval. +* Multiple remote servers. +* Basic authentication. + +Implemented in Go. + [Original article](https://clickhouse.yandex/docs/en/interfaces/third-party/proxy/) diff --git a/docs/fa/interfaces/third-party/proxy.md b/docs/fa/interfaces/third-party/proxy.md index 73587304ed6..74405201b8f 100644 --- a/docs/fa/interfaces/third-party/proxy.md +++ b/docs/fa/interfaces/third-party/proxy.md @@ -23,6 +23,18 @@ اجرا شده در برو +## ClickHouse-Bulk + +[ClickHouse-Bulk](https://github.com/nikepan/clickhouse-bulk) یک ClickHouse جمع کننده ساده است. + +امکانات: + +* درخواست گروهی و ارسال توسط آستانه یا فاصله. +* چند سرور از راه دور +* احراز هویت پایه + +اجرا شده در برو + [مقاله اصلی](https://clickhouse.yandex/docs/fa/interfaces/third-party/proxy/) diff --git a/docs/ru/interfaces/third-party/proxy.md b/docs/ru/interfaces/third-party/proxy.md index 3393dfefd79..2c5e8b9c154 100644 --- a/docs/ru/interfaces/third-party/proxy.md +++ b/docs/ru/interfaces/third-party/proxy.md @@ -24,4 +24,16 @@ Реализован на Go. +## ClickHouse-Bulk + +[ClickHouse-Bulk](https://github.com/nikepan/clickhouse-bulk) - простой сборщик вставок ClickHouse. + +Особенности: + +* Группировка запросов и отправка по порогу или интервалу. +* Несколько удаленных серверов. +* Базовая аутентификация. + +Реализован на Go. + [Оригинальная статья](https://clickhouse.yandex/docs/ru/interfaces/third-party/proxy/) diff --git a/docs/zh/interfaces/third-party/proxy.md b/docs/zh/interfaces/third-party/proxy.md index 2dc1a9a57ce..f4f7c528440 100644 --- a/docs/zh/interfaces/third-party/proxy.md +++ b/docs/zh/interfaces/third-party/proxy.md @@ -22,4 +22,16 @@ 在Go中实现。 +## ClickHouse-Bulk + +[ClickHouse-Bulk](https://github.com/nikepan/clickhouse-bulk)是一个简单的ClickHouse插入收集器。 + +特征: + +*分组请求并按阈值或间隔发送。 +*多个远程服务器。 +*基本身份验证。 + +在Go中实现。 + [来源文章](https://clickhouse.yandex/docs/zh/interfaces/third-party/proxy/) From 701286a29254eadca1476cf855a48eee1bef948d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 16:41:29 +0300 Subject: [PATCH 103/297] Major extension of integrations.md contents --- .../en/interfaces/third-party/integrations.md | 34 +++++++++++++++++-- .../fa/interfaces/third-party/integrations.md | 30 +++++++++++++++- .../ru/interfaces/third-party/integrations.md | 30 ++++++++++++++-- .../zh/interfaces/third-party/integrations.md | 28 ++++++++++++++- 4 files changed, 115 insertions(+), 7 deletions(-) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md index 0b11630510f..8d5283ae7ef 100644 --- a/docs/en/interfaces/third-party/integrations.md +++ b/docs/en/interfaces/third-party/integrations.md @@ -1,19 +1,47 @@ # Integration Libraries from Third-party Developers !!! warning "Disclaimer" - Yandex does **not** maintain the libraries listed below and haven't done any extensive testing to ensure their quality. + Yandex does **not** maintain the tools and libraries listed below and haven't done any extensive testing to ensure their quality. + +## Infrastructure Products - Relational database management systems - [MySQL](https://www.mysql.com) - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [clickhouse-mysql-data-reader](https://github.com/Altinity/clickhouse-mysql-data-reader) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) -- Object store - - S3 + - [MSSQL](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) + - [ClickHouseMigrator](https://github.com/zlzforever/ClickHouseMigrator) +- Message queues + - [Kafka](https://kafka.apache.org) + - [clickhouse_sinker](https://github.com/housepower/clickhouse_sinker) (uses [Go client](https://github.com/kshvakov/clickhouse/)) +- Object storages + - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- Monitoring + - [Graphite](https://graphiteapp.org) + - [graphouse](https://github.com/yandex/graphouse) + - [carbon-clickhouse](https://github.com/lomik/carbon-clickhouse) + - [Grafana](https://grafana.com/) + - [clickhouse-grafana](https://github.com/Vertamedia/clickhouse-grafana) + - [Prometheus](https://prometheus.io/) + - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) + - [PromHouse](https://github.com/Percona-Lab/PromHouse) +- Logging + - [fluentd](https://www.fluentd.org) + - [loghouse](https://github.com/flant/loghouse) (for [Kubernetes](https://kubernetes.io)) + +## Programming Language Ecosystems + - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [pandas](https://pandas.pydata.org) + - [pandahouse](https://github.com/kszucs/pandahouse) +- R + - [dplyr](https://db.rstudio.com/dplyr/) + - [RClickhouse](https://github.com/IMSMWU/RClickhouse) (uses [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp)) - Java - [Hadoop](http://hadoop.apache.org) - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../jdbc.md)) diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index 7bb4a5cae28..f596e05b6df 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -5,17 +5,45 @@ !!! warning "سلب مسئولیت" Yandex نه حفظ کتابخانه ها در زیر ذکر شده و نشده انجام هر آزمایش های گسترده ای برای اطمینان از کیفیت آنها. +## محصولات زیربنایی + - سیستم های مدیریت پایگاه داده رابطه ای - [MySQL](https://www.mysql.com) - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [clickhouse-mysql-data-reader](https://github.com/Altinity/clickhouse-mysql-data-reader) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (استفاده می کند [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [MSSQL](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) + - [ClickHouseMightrator](https://github.com/zlzforever/ClickHouseMigrator) +- صف پیام + - [Kafka](https://kafka.apache.org) + - [clickhouse_sinker](https://github.com/housepower/clickhouse_sinker) (استفاده می کند [Go client](https://github.com/kshvakov/clickhouse/)) - فروشگاه شی - - S3 + - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- نظارت بر + - [Graphite](https://graphiteapp.org) + - [graphouse](https://github.com/yandex/graphouse) + - [carbon-clickhouse](https://github.com/lomik/carbon-clickhouse) + - [Grafana](https://grafana.com/) + - [clickhouse-grafana](https://github.com/Vertamedia/clickhouse-grafana) + - [Prometheus](https://prometheus.io/) + - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) + - [PromHouse](https://github.com/Percona-Lab/PromHouse) +- ثبت نام + - [fluentd](https://www.fluentd.org) + - [loghouse](https://github.com/flant/loghouse) (برای [Kubernetes](https://kubernetes.io)) + +## اکوسیستم زبان برنامه نویسی + - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (استفاده می کند [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [pandas](https://pandas.pydata.org) + - [pandahouse](https://github.com/kszucs/pandahouse) +- R + - [dplyr](https://db.rstudio.com/dplyr/) + - [RClickhouse](https://github.com/IMSMWU/RClickhouse) (استفاده می کند [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp)) - Java - [Hadoop](http://hadoop.apache.org) - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (استفاده می کند [JDBC](../jdbc.md)) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index de75ed9c7ee..757127551f0 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -1,19 +1,45 @@ # Библиотеки для интеграции от сторонних разработчиков !!! warning "Disclaimer" - Яндекс не поддерживает перечисленные ниже библиотеки и не проводит тщательного тестирования для проверки их качества. + Яндекс не занимается поддержкой перечисленных ниже инструментов и библиотек и не проводит тщательного тестирования для проверки их качества. +## Инфраструктурные продукты - Реляционные системы управления базами данных - [MySQL](https://www.mysql.com) - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [clickhouse-mysql-data-reader](https://github.com/Altinity/clickhouse-mysql-data-reader) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (использует [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [MSSQL](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) + - [ClickHouseMightrator](https://github.com/zlzforever/ClickHouseMigrator) +- Очереди ообщений + - [Kafka](https://kafka.apache.org) + - [clickhouse_sinker](https://github.com/housepower/clickhouse_sinker) (использует [Go client](https://github.com/kshvakov/clickhouse/)) - Хранилища объектов - - S3 + - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- Мониторинг + - [Graphite](https://graphiteapp.org) + - [graphouse](https://github.com/yandex/graphouse) + - [carbon-clickhouse](https://github.com/lomik/carbon-clickhouse) + - [Grafana](https://grafana.com/) + - [clickhouse-grafana](https://github.com/Vertamedia/clickhouse-grafana) + - [Prometheus](https://prometheus.io/) + - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) + - [PromHouse](https://github.com/Percona-Lab/PromHouse) +- Логирование + - [fluentd](https://www.fluentd.org) + - [loghouse](https://github.com/flant/loghouse) (для [Kubernetes](https://kubernetes.io)) + +## Экосистемы вокруг языков программирования - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (использует [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [pandas](https://pandas.pydata.org) + - [pandahouse](https://github.com/kszucs/pandahouse) +- R + - [dplyr](https://db.rstudio.com/dplyr/) + - [RClickhouse](https://github.com/IMSMWU/RClickhouse) (использует [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp)) - Java - [Hadoop](http://hadoop.apache.org) - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (использует [JDBC](../jdbc.md)) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index f84d68d94a5..1029a4c657b 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -3,17 +3,43 @@ !!! warning "声明" Yandex不维护下面列出的库,也没有进行任何广泛的测试以确保其质量。 +## 基建产品 - 关系数据库管理系统 - [MySQL](https://www.mysql.com) - [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support) + - [clickhouse-mysql-data-reader](https://github.com/Altinity/clickhouse-mysql-data-reader) - [PostgreSQL](https://www.postgresql.org) - [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (使用 [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [MSSQL](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) + - [ClickHouseMightrator](https://github.com/zlzforever/ClickHouseMigrator) +- 消息队列 + - [Kafka](https://kafka.apache.org) + - [clickhouse_sinker](https://github.com/housepower/clickhouse_sinker) (使用 [Go client](https://github.com/kshvakov/clickhouse/)) - 对象存储 - - S3 + - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- 监控 + - [Graphite](https://graphiteapp.org) + - [graphouse](https://github.com/yandex/graphouse) + - [carbon-clickhouse](https://github.com/lomik/carbon-clickhouse) + - [Grafana](https://grafana.com/) + - [clickhouse-grafana](https://github.com/Vertamedia/clickhouse-grafana) + - [Prometheus](https://prometheus.io/) + - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) + - [PromHouse](https://github.com/Percona-Lab/PromHouse) +- 记录 + - [fluentd](https://www.fluentd.org) + - [loghouse](https://github.com/flant/loghouse) (对于 [Kubernetes](https://kubernetes.io)) + +## 编程语言生态系统 - Python - [SQLAlchemy](https://www.sqlalchemy.org) - [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (使用 [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm)) + - [pandas](https://pandas.pydata.org) + - [pandahouse](https://github.com/kszucs/pandahouse) +- R + - [dplyr](https://db.rstudio.com/dplyr/) + - [RClickhouse](https://github.com/IMSMWU/RClickhouse) (使用 [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp)) - Java - [Hadoop](http://hadoop.apache.org) - [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (使用 [JDBC](../jdbc.md)) From f9fa9252fc523eb582e323f55a51a345d36901b1 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 16:46:22 +0300 Subject: [PATCH 104/297] fix link target --- docs/en/operations/backup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/backup.md b/docs/en/operations/backup.md index c13514a76e1..7513e7faad0 100644 --- a/docs/en/operations/backup.md +++ b/docs/en/operations/backup.md @@ -1,6 +1,6 @@ # Data Backup -While [replication](../table_engines/replication.md#table_engines-replication) provides protection from hardware failures, it does not protect against human errors: accidentally deleting data, deleting the wrong table or on the wrong cluster, software bugs leading to incorrect data processing or data corruption. In many cases commands like these will affect all replicas. ClickHouse has built-in safeguards to prevent some of mistakes, for example by default [you can't just drop tables with MergeTree-like engine containing more than 50Gb of data](https://github.com/yandex/ClickHouse/blob/v18.14.18-stable/dbms/programs/server/config.xml#L322-L330), but they don't cover all possible cases and can be circumvented. +While [replication](table_engines/replication.md#table_engines-replication) provides protection from hardware failures, it does not protect against human errors: accidentally deleting data, deleting the wrong table or on the wrong cluster, software bugs leading to incorrect data processing or data corruption. In many cases commands like these will affect all replicas. ClickHouse has built-in safeguards to prevent some of mistakes, for example by default [you can't just drop tables with MergeTree-like engine containing more than 50Gb of data](https://github.com/yandex/ClickHouse/blob/v18.14.18-stable/dbms/programs/server/config.xml#L322-L330), but they don't cover all possible cases and can be circumvented. So in order to effectively mitigate possible human errors, you should carefully prepare your backup and restore strategy **in advance**. From e15df86d063cc879910c201ed1c14ff2eaf0f6b8 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 16:49:58 +0300 Subject: [PATCH 105/297] remove unneeded file --- docs/zh/backup.md | 1 - 1 file changed, 1 deletion(-) delete mode 120000 docs/zh/backup.md diff --git a/docs/zh/backup.md b/docs/zh/backup.md deleted file mode 120000 index 1003fb30e61..00000000000 --- a/docs/zh/backup.md +++ /dev/null @@ -1 +0,0 @@ -../../en/operations/backup.md \ No newline at end of file From c0ca60e88326bc38586123f617b62fef1f843261 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 17:43:48 +0300 Subject: [PATCH 106/297] better toc item name --- docs/toc_en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index e5729e78ae8..fd0e7dbd769 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -29,7 +29,7 @@ nav: - 'Client Libraries': 'interfaces/third-party/client_libraries.md' - 'Integrations': 'interfaces/third-party/integrations.md' - 'Visual Interfaces': 'interfaces/third-party/gui.md' - - 'Proxy': 'interfaces/third-party/proxy.md' + - 'Proxies': 'interfaces/third-party/proxy.md' - 'Data Types': - 'Introduction': 'data_types/index.md' From ebf34db38fb8d0b3e20109f479985a1652c57054 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 17:45:49 +0300 Subject: [PATCH 107/297] fix markdown --- docs/ru/interfaces/third-party/proxy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ru/interfaces/third-party/proxy.md b/docs/ru/interfaces/third-party/proxy.md index 2c5e8b9c154..07f20150f32 100644 --- a/docs/ru/interfaces/third-party/proxy.md +++ b/docs/ru/interfaces/third-party/proxy.md @@ -2,7 +2,7 @@ ## chproxy -[chproxy] (https://github.com/Vertamedia/chproxy) - это http-прокси и балансировщик нагрузки для базы данных ClickHouse. +[chproxy](https://github.com/Vertamedia/chproxy) - это http-прокси и балансировщик нагрузки для базы данных ClickHouse. Основные возможности: @@ -14,7 +14,7 @@ ## KittenHouse -[KittenHouse] (https://github.com/VKCOM/kittenhouse) предназначен для использования в качестве локального прокси-сервера между ClickHouse и вашим сервером приложений в случае, если буферизовать данные INSERT на стороне приложения не представляется возможным или не удобно. +[KittenHouse](https://github.com/VKCOM/kittenhouse) предназначен для использования в качестве локального прокси-сервера между ClickHouse и вашим сервером приложений в случае, если буферизовать данные INSERT на стороне приложения не представляется возможным или не удобно. Основные возможности: From 5bcb681947ade4570cd330d08890611021378fc9 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 17:49:54 +0300 Subject: [PATCH 108/297] better ru punctuation --- docs/ru/interfaces/third-party/proxy.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ru/interfaces/third-party/proxy.md b/docs/ru/interfaces/third-party/proxy.md index 07f20150f32..9292d937330 100644 --- a/docs/ru/interfaces/third-party/proxy.md +++ b/docs/ru/interfaces/third-party/proxy.md @@ -18,8 +18,8 @@ Основные возможности: -* Буферизация данных в памяти и на диске. -* Маршрутизация по таблицам. +* Буферизация данных в памяти и на диске; +* Маршрутизация по таблицам; * Балансировка нагрузки и проверка работоспособности. Реализован на Go. @@ -30,8 +30,8 @@ Особенности: -* Группировка запросов и отправка по порогу или интервалу. -* Несколько удаленных серверов. +* Группировка запросов и отправка по порогу или интервалу; +* Несколько удаленных серверов; * Базовая аутентификация. Реализован на Go. From 8bf9e3953ac61b09b088495f7a4c10c8be624696 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 11 Dec 2018 19:53:44 +0300 Subject: [PATCH 109/297] Add yet another possible backup approach --- docs/en/operations/backup.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/en/operations/backup.md b/docs/en/operations/backup.md index 7513e7faad0..3e2f110130a 100644 --- a/docs/en/operations/backup.md +++ b/docs/en/operations/backup.md @@ -31,5 +31,8 @@ More details on queries related to partition manipulations can be found in [resp There's a third-party tool to automate this approach: [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup). +## Data Dump + +[Console client](../interfaces/cli.md) can be used to run queries like `SELECT * FROM my_table;` to dump the tables into files using any of the [supported serialization formats](../interfaces/formats.md#formats). Though if you are using ClickHouse as intended and have large enough volumes of data, this will hardly be practical. [Original article](https://clickhouse.yandex/docs/en/operations/access_rights/) \ No newline at end of file From 842142fe462e2cc94402e72f38ff3e15b153192e Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 12:56:54 +0300 Subject: [PATCH 110/297] Simplify copying permalinks to headers --- docs/tools/build.py | 7 ++++++- .../mkdocs-material-theme/assets/stylesheets/custom.css | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/tools/build.py b/docs/tools/build.py index 96a2a74ea70..1f812184fc9 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -107,7 +107,12 @@ def build_for_lang(lang, args): 'admonition', 'attr_list', 'codehilite', - 'extra' + 'extra', + { + 'toc': { + 'permalink': True + } + } ], plugins=[{ 'search': { diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css index 8569b1d033d..51bbaf1727b 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css @@ -165,3 +165,7 @@ h1, h2, h3, .md-logo { display: none; } } + +.headerlink:hover { + text-decoration: none; +} From 4e4d5477caecc3d1f21c5590ef0c83c9bdd82901 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 13:21:29 +0300 Subject: [PATCH 111/297] Support non-eng link anchors in docs + update some deps --- docs/tools/build.py | 4 +++- docs/tools/mdx_clickhouse.py | 4 ++++ docs/tools/requirements.txt | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/tools/build.py b/docs/tools/build.py index 1f812184fc9..de27920a0e7 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -21,6 +21,7 @@ from mkdocs import exceptions from mkdocs.commands import build as mkdocs_build from concatenate import concatenate +import mdx_clickhouse @contextlib.contextmanager def temp_dir(): @@ -110,7 +111,8 @@ def build_for_lang(lang, args): 'extra', { 'toc': { - 'permalink': True + 'permalink': True, + 'slugify': mdx_clickhouse.slugify } } ], diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index 7c5c592b28e..62b7941bcea 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -6,6 +6,7 @@ import markdown.inlinepatterns import markdown.extensions import markdown.util +import slugify as slugify_impl class NofollowMixin(object): def handleMatch(self, m): @@ -46,3 +47,6 @@ class ClickHouseMarkdown(markdown.extensions.Extension): def makeExtension(**kwargs): return ClickHouseMarkdown(**kwargs) + +def slugify(value, separator): + return slugify_impl.slugify(value, separator=separator, word_boundary=True, save_order=True) diff --git a/docs/tools/requirements.txt b/docs/tools/requirements.txt index dd44ae9717a..879c697e67d 100644 --- a/docs/tools/requirements.txt +++ b/docs/tools/requirements.txt @@ -13,12 +13,13 @@ Jinja2==2.10 livereload==2.5.1 Markdown==2.6.11 MarkupSafe==1.0 -mkdocs==1.0 +mkdocs==1.0.4 Pygments==2.2.0 +python-slugify==1.2.6 pytz==2017.3 PyYAML==3.12 recommonmark==0.4.0 -requests==2.20.0 +requests==2.21.0 singledispatch==3.4.0.3 six==1.11.0 snowballstemmer==1.2.1 @@ -26,4 +27,5 @@ Sphinx==1.6.5 sphinxcontrib-websupport==1.0.1 tornado==5.1 typing==3.6.2 +Unidecode==1.0.23 urllib3==1.22 From a433f1fd258197c062c8d097cf311b1177ff69fe Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 15:54:47 +0300 Subject: [PATCH 112/297] Generate anchors for single-page mode automatically --- docs/tools/build.py | 2 ++ docs/tools/concatenate.py | 37 ++++++++++++------------------------ docs/tools/mdx_clickhouse.py | 25 ++++++++++++++++-------- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/docs/tools/build.py b/docs/tools/build.py index de27920a0e7..9b5ccf1fae3 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -54,6 +54,7 @@ markdown.extensions.ClickHouseMarkdown = ClickHouseMarkdown def build_for_lang(lang, args): logging.info('Building %s docs' % lang) + os.environ['SINGLE_PAGE'] = '0' config_path = os.path.join(args.docs_dir, 'toc_%s.yml' % lang) @@ -139,6 +140,7 @@ def build_for_lang(lang, args): def build_single_page_version(lang, args, cfg): logging.info('Building single page version for ' + lang) + os.environ['SINGLE_PAGE'] = '1' with autoremoved_file(os.path.join(args.docs_dir, lang, 'single.md')) as single_md: concatenate(lang, args.docs_dir, single_md) diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index ffc49a7fed9..c0c438ce193 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -37,34 +37,21 @@ def concatenate(lang, docs_path, single_page_file): first_file = True for path in files_to_concatenate: - - single_page_file.write('\n\n') - with open(os.path.join(lang_path, path)) as f: + tmp_path = path.replace('.md', '/') + prefixes = ['', '../', '../../', '../../../'] + parts = tmp_path.split('/') + single_page_file.write('\n' % parts[-2]) + single_page_file.write('\n\n') - # function is passed into re.sub() to process links - def link_proc(matchObj): - text, link = matchObj.group().strip('[)').split('](', 1) - if link.startswith('http:') or link.startswith('https:') or '.jpeg' in link or '.jpg' in link or '.png' in link or '.gif' in link: - return '[' + text + '](' + link + ')' - else: - sharp_pos = link.find('#') - if sharp_pos > -1: - return '[' + text + '](' + link[sharp_pos:] + ')' - else: - return '[' + text + '](#' + link.replace('../', '').replace('/index.md', '').replace('.md', '') + ')' - + for part in parts[0:-2]: + for prefix in prefixes: + single_page_file.write('\n' % (prefix + tmp_path)) + tmp_path = tmp_path.replace(part, '..') + for l in f: - # Processing links in a string - l = re.sub(r'\[.+?\]\(.+?\)', link_proc, l) - - # Correcting headers levels - if not first_file: - if l.startswith('#'): - l = '#' + l - else: - first_file = False - + if l.startswith('#'): + l = '#' + l single_page_file.write(l) single_page_file.flush() diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index 62b7941bcea..aa6037bcab7 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -2,31 +2,41 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import os + import markdown.inlinepatterns import markdown.extensions import markdown.util import slugify as slugify_impl -class NofollowMixin(object): +class ClickHouseLinkMixin(object): + def handleMatch(self, m): + single_page = (os.environ.get('SINGLE_PAGE') == '1') try: - el = super(NofollowMixin, self).handleMatch(m) + el = super(ClickHouseLinkMixin, self).handleMatch(m) except IndexError: return if el is not None: href = el.get('href') or '' - if href.startswith('http') and not href.startswith('https://clickhouse.yandex'): + is_external = href.startswith('http:') or href.startswith('https:') + if is_external and not href.startswith('https://clickhouse.yandex'): el.set('rel', 'external nofollow') + elif single_page: + if '#' in href: + el.set('href', '#' + href.split('#', 1)[1]) + else: + el.set('href', '#' + href.replace('.md', '/')) return el -class NofollowAutolinkPattern(NofollowMixin, markdown.inlinepatterns.AutolinkPattern): +class ClickHouseAutolinkPattern(ClickHouseLinkMixin, markdown.inlinepatterns.AutolinkPattern): pass -class NofollowLinkPattern(NofollowMixin, markdown.inlinepatterns.LinkPattern): +class ClickHouseLinkPattern(ClickHouseLinkMixin, markdown.inlinepatterns.LinkPattern): pass @@ -41,9 +51,8 @@ class ClickHouseMarkdown(markdown.extensions.Extension): def extendMarkdown(self, md, md_globals): md.preprocessors['clickhouse'] = ClickHousePreprocessor() - md.inlinePatterns['link'] = NofollowLinkPattern(markdown.inlinepatterns.LINK_RE, md) - md.inlinePatterns['autolink'] = NofollowAutolinkPattern(markdown.inlinepatterns.AUTOLINK_RE, md) - + md.inlinePatterns['link'] = ClickHouseLinkPattern(markdown.inlinepatterns.LINK_RE, md) + md.inlinePatterns['autolink'] = ClickHouseAutolinkPattern(markdown.inlinepatterns.AUTOLINK_RE, md) def makeExtension(**kwargs): return ClickHouseMarkdown(**kwargs) From 5d5bde71742201c20808bf3acfb366b0e03ca715 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 16:30:55 +0300 Subject: [PATCH 113/297] Remove anchors to top of pages --- docs/en/data_types/array.md | 2 +- docs/en/data_types/enum.md | 4 +- docs/en/data_types/float.md | 2 +- .../aggregatefunction.md | 4 +- docs/en/data_types/nullable.md | 4 +- .../data_types/special_data_types/nothing.md | 2 +- docs/en/data_types/tuple.md | 4 +- docs/en/images/column_oriented.gif | Bin 45485 -> 40437 bytes docs/en/images/row_oriented.gif | Bin 41571 -> 37591 bytes docs/en/interfaces/formats.md | 16 ++++---- docs/en/introduction/distinctive_features.md | 2 +- docs/en/introduction/performance.md | 2 +- docs/en/operations/access_rights.md | 5 +-- docs/en/operations/backup.md | 4 +- docs/en/operations/configuration_files.md | 2 +- .../en/operations/server_settings/settings.md | 34 ++++++++-------- docs/en/operations/settings/settings.md | 38 +++++++++--------- docs/en/operations/system_tables.md | 2 +- .../table_engines/aggregatingmergetree.md | 11 +++-- .../table_engines/collapsingmergetree.md | 8 ++-- .../en/operations/table_engines/dictionary.md | 2 +- docs/en/operations/table_engines/file.md | 7 ++-- .../table_engines/graphitemergetree.md | 8 ++-- docs/en/operations/table_engines/kafka.md | 2 +- .../table_engines/materializedview.md | 2 +- docs/en/operations/table_engines/mergetree.md | 27 ++++++------- docs/en/operations/table_engines/mysql.md | 2 +- .../table_engines/replacingmergetree.md | 6 +-- .../operations/table_engines/replication.md | 6 +-- .../table_engines/summingmergetree.md | 14 +++---- .../versionedcollapsingmergetree.md | 8 ++-- docs/en/operations/utils/index.md | 4 +- .../agg_functions/parametric_functions.md | 2 +- .../query_language/agg_functions/reference.md | 4 +- docs/en/query_language/alter.md | 2 +- .../en/query_language/dicts/external_dicts.md | 10 ++--- .../dicts/external_dicts_dict.md | 8 ++-- .../dicts/external_dicts_dict_layout.md | 31 +++++++------- .../dicts/external_dicts_dict_lifetime.md | 4 +- .../dicts/external_dicts_dict_sources.md | 28 ++++++------- .../dicts/external_dicts_dict_structure.md | 8 ++-- docs/en/query_language/dicts/index.md | 4 +- .../functions/array_functions.md | 3 +- .../functions/ext_dict_functions.md | 2 +- .../functions/functions_for_nulls.md | 7 ++-- docs/en/query_language/functions/geo.md | 4 +- .../query_language/functions/in_functions.md | 2 +- .../functions/other_functions.md | 6 +-- .../functions/type_conversion_functions.md | 4 +- docs/en/query_language/index.md | 6 +-- docs/en/query_language/insert_into.md | 2 +- docs/en/query_language/misc.md | 2 +- docs/en/query_language/operators.md | 6 +-- docs/en/query_language/select.md | 22 +++++----- docs/en/query_language/syntax.md | 8 ++-- .../query_language/table_functions/remote.md | 2 +- docs/fa/data_types/float.md | 2 +- docs/fa/images/column_oriented.gif | Bin 45485 -> 40437 bytes docs/fa/images/row_oriented.gif | Bin 41571 -> 37591 bytes docs/fa/interfaces/formats.md | 2 +- docs/fa/introduction/distinctive_features.md | 2 +- docs/fa/introduction/performance.md | 2 +- docs/ru/data_types/array.md | 2 +- docs/ru/data_types/enum.md | 4 +- docs/ru/data_types/float.md | 2 +- .../aggregatefunction.md | 4 +- docs/ru/data_types/nullable.md | 4 +- .../data_types/special_data_types/nothing.md | 4 +- docs/ru/data_types/tuple.md | 4 +- docs/ru/images/column_oriented.gif | Bin 45485 -> 40437 bytes docs/ru/images/row_oriented.gif | Bin 41571 -> 37591 bytes docs/ru/interfaces/formats.md | 17 ++++---- docs/ru/introduction/distinctive_features.md | 4 +- docs/ru/introduction/performance.md | 2 +- docs/ru/operations/access_rights.md | 5 +-- docs/ru/operations/configuration_files.md | 2 +- .../ru/operations/server_settings/settings.md | 34 ++++++++-------- docs/ru/operations/settings/settings.md | 37 +++++++++-------- docs/ru/operations/system_tables.md | 2 +- .../table_engines/aggregatingmergetree.md | 8 ++-- .../ru/operations/table_engines/dictionary.md | 2 +- docs/ru/operations/table_engines/file.md | 6 +-- .../table_engines/graphitemergetree.md | 4 +- docs/ru/operations/table_engines/kafka.md | 2 +- .../table_engines/materializedview.md | 2 +- docs/ru/operations/table_engines/mergetree.md | 29 ++++++------- docs/ru/operations/table_engines/mysql.md | 2 +- .../table_engines/replacingmergetree.md | 6 +-- .../operations/table_engines/replication.md | 8 ++-- .../table_engines/summingmergetree.md | 14 +++---- docs/ru/operations/utils/index.md | 3 +- .../agg_functions/parametric_functions.md | 2 +- .../query_language/agg_functions/reference.md | 4 +- docs/ru/query_language/alter.md | 2 +- .../ru/query_language/dicts/external_dicts.md | 20 ++++----- .../dicts/external_dicts_dict.md | 6 +-- .../dicts/external_dicts_dict_layout.md | 30 +++++++------- .../dicts/external_dicts_dict_lifetime.md | 4 +- .../dicts/external_dicts_dict_sources.md | 28 ++++++------- .../dicts/external_dicts_dict_structure.md | 8 ++-- docs/ru/query_language/dicts/index.md | 4 +- .../functions/array_functions.md | 3 +- .../functions/ext_dict_functions.md | 2 +- .../functions/functions_for_nulls.md | 6 +-- docs/ru/query_language/functions/geo.md | 3 +- .../query_language/functions/in_functions.md | 2 +- .../functions/other_functions.md | 6 +-- .../functions/type_conversion_functions.md | 4 +- docs/ru/query_language/index.md | 6 +-- docs/ru/query_language/insert_into.md | 2 +- docs/ru/query_language/operators.md | 6 +-- docs/ru/query_language/select.md | 22 +++++----- docs/ru/query_language/syntax.md | 6 +-- .../query_language/table_functions/remote.md | 2 +- .../assets/javascripts/modernizr.js | 2 +- .../application-palette.792431c1.css | 2 +- .../stylesheets/application.2a88008a.css | 3 +- .../stylesheets/application.ac64251e.css | 3 +- docs/zh/data_types/array.md | 2 +- docs/zh/data_types/enum.md | 4 +- docs/zh/data_types/float.md | 2 +- docs/zh/data_types/nullable.md | 4 +- .../data_types/special_data_types/nothing.md | 2 +- docs/zh/data_types/tuple.md | 4 +- docs/zh/images/column_oriented.gif | Bin 45485 -> 40437 bytes docs/zh/images/row_oriented.gif | Bin 41571 -> 37591 bytes docs/zh/interfaces/cli.md | 2 +- docs/zh/interfaces/formats.md | 16 ++++---- docs/zh/interfaces/http.md | 4 +- docs/zh/introduction/distinctive_features.md | 2 +- docs/zh/introduction/performance.md | 2 +- docs/zh/operations/access_rights.md | 5 +-- docs/zh/operations/configuration_files.md | 2 +- .../zh/operations/server_settings/settings.md | 34 ++++++++-------- docs/zh/operations/settings/settings.md | 36 ++++++++--------- docs/zh/operations/system_tables.md | 2 +- .../table_engines/aggregatingmergetree.md | 11 +++-- .../table_engines/collapsingmergetree.md | 8 ++-- docs/zh/operations/table_engines/file.md | 7 ++-- .../table_engines/graphitemergetree.md | 8 ++-- docs/zh/operations/table_engines/kafka.md | 2 +- .../table_engines/materializedview.md | 2 +- docs/zh/operations/table_engines/mergetree.md | 23 +++++------ docs/zh/operations/table_engines/mysql.md | 2 +- .../table_engines/replacingmergetree.md | 6 +-- .../operations/table_engines/replication.md | 6 +-- .../table_engines/summingmergetree.md | 14 +++---- docs/zh/operations/utils/index.md | 4 +- docs/zh/query_language/insert_into.md | 2 +- docs/zh/query_language/select.md | 23 +++++------ 150 files changed, 517 insertions(+), 544 deletions(-) diff --git a/docs/en/data_types/array.md b/docs/en/data_types/array.md index f8d909cfae5..18bce65bb03 100644 --- a/docs/en/data_types/array.md +++ b/docs/en/data_types/array.md @@ -50,7 +50,7 @@ SELECT ## Working with data types -When creating an array on the fly, ClickHouse automatically defines the argument type as the narrowest data type that can store all the listed arguments. If there are any [NULL](../query_language/syntax.md#null-literal) or [Nullable](nullable.md#data_type-nullable) type arguments, the type of array elements is [Nullable](nullable.md#data_type-nullable). +When creating an array on the fly, ClickHouse automatically defines the argument type as the narrowest data type that can store all the listed arguments. If there are any [NULL](../query_language/syntax.md#null-literal) or [Nullable](nullable.md#data_type-nullable) type arguments, the type of array elements is [Nullable](nullable.md). If ClickHouse couldn't determine the data type, it will generate an exception. For instance, this will happen when trying to create an array with strings and numbers simultaneously (`SELECT array(1, 'a')`). diff --git a/docs/en/data_types/enum.md b/docs/en/data_types/enum.md index 7faeecf5b4c..bd5168016d3 100644 --- a/docs/en/data_types/enum.md +++ b/docs/en/data_types/enum.md @@ -77,9 +77,9 @@ SELECT toTypeName(CAST('a', 'Enum8(\'a\' = 1, \'b\' = 2)')) Each of the values is assigned a number in the range `-128 ... 127` for `Enum8` or in the range `-32768 ... 32767` for `Enum16`. All the strings and numbers must be different. An empty string is allowed. If this type is specified (in a table definition), numbers can be in an arbitrary order. However, the order does not matter. -Neither the string nor the numeric value in an `Enum` can be [NULL](../query_language/syntax.md#null-literal). +Neither the string nor the numeric value in an `Enum` can be [NULL](../query_language/syntax.md). -An `Enum` can be contained in [Nullable](nullable.md#data_type-nullable) type. So if you create a table using the query +An `Enum` can be contained in [Nullable](nullable.md) type. So if you create a table using the query ``` CREATE TABLE t_enum_nullable diff --git a/docs/en/data_types/float.md b/docs/en/data_types/float.md index c106640e85a..894b50d8237 100644 --- a/docs/en/data_types/float.md +++ b/docs/en/data_types/float.md @@ -67,7 +67,7 @@ SELECT 0 / 0 └──────────────┘ ``` - See the rules for `NaN` sorting in the section [ORDER BY clause](../query_language/select.md#query_language-queries-order_by). + See the rules for `NaN` sorting in the section [ORDER BY clause](../query_language/select.md). [Original article](https://clickhouse.yandex/docs/en/data_types/float/) diff --git a/docs/en/data_types/nested_data_structures/aggregatefunction.md b/docs/en/data_types/nested_data_structures/aggregatefunction.md index 377c165a103..c1a0b7af3a8 100644 --- a/docs/en/data_types/nested_data_structures/aggregatefunction.md +++ b/docs/en/data_types/nested_data_structures/aggregatefunction.md @@ -25,7 +25,7 @@ CREATE TABLE t ) ENGINE = ... ``` -[uniq](../../query_language/agg_functions/reference.md#agg_function-uniq), anyIf ([any](../../query_language/agg_functions/reference.md#agg_function-any)+[If](../../query_language/agg_functions/combinators.md#agg-functions-combine-if)) and [quantiles](../../query_language/agg_functions/reference.md#agg_function-quantiles) are the aggregate functions supported in ClickHouse. +[uniq](../../query_language/agg_functions/reference.md#agg_function-uniq), anyIf ([any](../../query_language/agg_functions/reference.md#agg_function-any)+[If](../../query_language/agg_functions/combinators.md#agg-functions-combine-if)) and [quantiles](../../query_language/agg_functions/reference.md) are the aggregate functions supported in ClickHouse. ## Usage @@ -60,7 +60,7 @@ SELECT uniqMerge(state) FROM (SELECT uniqState(UserID) AS state FROM table GROUP ## Usage Example -See [AggregatingMergeTree](../../operations/table_engines/aggregatingmergetree.md#table_engine-aggregatingmergetree) engine description. +See [AggregatingMergeTree](../../operations/table_engines/aggregatingmergetree.md) engine description. [Original article](https://clickhouse.yandex/docs/en/data_types/nested_data_structures/aggregatefunction/) diff --git a/docs/en/data_types/nullable.md b/docs/en/data_types/nullable.md index 87d0ac0c337..a3e48720e86 100644 --- a/docs/en/data_types/nullable.md +++ b/docs/en/data_types/nullable.md @@ -2,9 +2,9 @@ # Nullable(TypeName) -Allows to store special marker ([NULL](../query_language/syntax.md#null-literal)) that denotes "missing value" alongside normal values allowed by `TypeName`. For example, a `Nullable(Int8)` type column can store `Int8` type values, and the rows that don't have a value will store `NULL`. +Allows to store special marker ([NULL](../query_language/syntax.md)) that denotes "missing value" alongside normal values allowed by `TypeName`. For example, a `Nullable(Int8)` type column can store `Int8` type values, and the rows that don't have a value will store `NULL`. -For a `TypeName`, you can't use composite data types [Array](array.md#data_type is array) and [Tuple](tuple.md#data_type-tuple). Composite data types can contain `Nullable` type values, such as `Array(Nullable(Int8))`. +For a `TypeName`, you can't use composite data types [Array](array.md#data_type is array) and [Tuple](tuple.md). Composite data types can contain `Nullable` type values, such as `Array(Nullable(Int8))`. A `Nullable` type field can't be included in table indexes. diff --git a/docs/en/data_types/special_data_types/nothing.md b/docs/en/data_types/special_data_types/nothing.md index 5b916b05557..79384766295 100644 --- a/docs/en/data_types/special_data_types/nothing.md +++ b/docs/en/data_types/special_data_types/nothing.md @@ -4,7 +4,7 @@ The only purpose of this data type is to represent cases where value is not expected. So you can't create a `Nothing` type value. -For example, literal [NULL](../../query_language/syntax.md#null-literal) has type of `Nullable(Nothing)`. See more about [Nullable](../../data_types/nullable.md#data_type-nullable). +For example, literal [NULL](../../query_language/syntax.md#null-literal) has type of `Nullable(Nothing)`. See more about [Nullable](../../data_types/nullable.md). The `Nothing` type can also used to denote empty arrays: diff --git a/docs/en/data_types/tuple.md b/docs/en/data_types/tuple.md index 6079af47cb9..1f9cf3ec86f 100644 --- a/docs/en/data_types/tuple.md +++ b/docs/en/data_types/tuple.md @@ -4,7 +4,7 @@ A tuple of elements, each having an individual [type](index.md#data_types). -You can't store tuples in tables (other than Memory tables). They are used for temporary column grouping. Columns can be grouped when an IN expression is used in a query, and for specifying certain formal parameters of lambda functions. For more information, see the sections [IN operators](../query_language/select.md#query_language-in_operators) and [Higher order functions](../query_language/functions/higher_order_functions.md#higher_order_functions). +You can't store tuples in tables (other than Memory tables). They are used for temporary column grouping. Columns can be grouped when an IN expression is used in a query, and for specifying certain formal parameters of lambda functions. For more information, see the sections [IN operators](../query_language/select.md) and [Higher order functions](../query_language/functions/higher_order_functions.md#higher_order_functions). Tuples can be the result of a query. In this case, for text formats other than JSON, values are comma-separated in brackets. In JSON formats, tuples are output as arrays (in square brackets). @@ -34,7 +34,7 @@ SELECT ## Working with data types -When creating a tuple on the fly, ClickHouse automatically detects the type of each argument as the minimum of the types which can store the argument value. If the argument is [NULL](../query_language/syntax.md#null-literal), the type of the tuple element is [Nullable](nullable.md#data_type-nullable). +When creating a tuple on the fly, ClickHouse automatically detects the type of each argument as the minimum of the types which can store the argument value. If the argument is [NULL](../query_language/syntax.md#null-literal), the type of the tuple element is [Nullable](nullable.md). Example of automatic data type detection: diff --git a/docs/en/images/column_oriented.gif b/docs/en/images/column_oriented.gif index 15f4b12e697ac40c60bf77f964645316410da946..5a0e5b8e15ef0314540506256cacd898a1d3a71e 100644 GIT binary patch delta 83 zcmV-Z0IdJ5;{x@&0m;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7y @@ -141,7 +141,7 @@ SearchPhrase=curtain designs count()=1064 SearchPhrase=baku count()=1000 ``` -[NULL](../query_language/syntax.md#null-literal) is formatted as `\N`. +[NULL](../query_language/syntax.md) is formatted as `\N`. ``` sql SELECT * FROM t_null FORMAT TSKV @@ -267,7 +267,7 @@ If the query contains GROUP BY, rows_before_limit_at_least is the exact number o This format is only appropriate for outputting a query result, but not for parsing (retrieving data to insert in a table). -ClickHouse supports [NULL](../query_language/syntax.md#null-literal), which is displayed as `null` in the JSON output. +ClickHouse supports [NULL](../query_language/syntax.md), which is displayed as `null` in the JSON output. See also the JSONEachRow format. @@ -361,7 +361,7 @@ Outputs data as Unicode-art tables, also using ANSI-escape sequences for setting A full grid of the table is drawn, and each row occupies two lines in the terminal. Each result block is output as a separate table. This is necessary so that blocks can be output without buffering results (buffering would be necessary in order to pre-calculate the visible width of all the values). -[NULL](../query_language/syntax.md#null-literal) is output as `ᴺᵁᴸᴸ`. +[NULL](../query_language/syntax.md) is output as `ᴺᵁᴸᴸ`. ``` sql SELECT * FROM t_null @@ -457,11 +457,11 @@ FixedString is represented simply as a sequence of bytes. Array is represented as a varint length (unsigned [LEB128](https://en.wikipedia.org/wiki/LEB128)), followed by successive elements of the array. -For [NULL](../query_language/syntax.md#null-literal) support, an additional byte containing 1 or 0 is added before each [Nullable](../data_types/nullable.md#data_type-nullable) value. If 1, then the value is `NULL` and this byte is interpreted as a separate value. If 0, the value after the byte is not `NULL`. +For [NULL](../query_language/syntax.md#null-literal) support, an additional byte containing 1 or 0 is added before each [Nullable](../data_types/nullable.md) value. If 1, then the value is `NULL` and this byte is interpreted as a separate value. If 0, the value after the byte is not `NULL`. ## Values -Prints every row in brackets. Rows are separated by commas. There is no comma after the last row. The values inside the brackets are also comma-separated. Numbers are output in decimal format without quotes. Arrays are output in square brackets. Strings, dates, and dates with times are output in quotes. Escaping rules and parsing are similar to the [TabSeparated](#tabseparated) format. During formatting, extra spaces aren't inserted, but during parsing, they are allowed and skipped (except for spaces inside array values, which are not allowed). [NULL](../query_language/syntax.md#null-literal) is represented as `NULL`. +Prints every row in brackets. Rows are separated by commas. There is no comma after the last row. The values inside the brackets are also comma-separated. Numbers are output in decimal format without quotes. Arrays are output in square brackets. Strings, dates, and dates with times are output in quotes. Escaping rules and parsing are similar to the [TabSeparated](#tabseparated) format. During formatting, extra spaces aren't inserted, but during parsing, they are allowed and skipped (except for spaces inside array values, which are not allowed). [NULL](../query_language/syntax.md) is represented as `NULL`. The minimum set of characters that you need to escape when passing data in Values ​​format: single quotes and backslashes. @@ -473,7 +473,7 @@ This is the format that is used in `INSERT INTO t VALUES ...`, but you can also Prints each value on a separate line with the column name specified. This format is convenient for printing just one or a few rows, if each row consists of a large number of columns. -[NULL](../query_language/syntax.md#null-literal) is output as `ᴺᵁᴸᴸ`. +[NULL](../query_language/syntax.md) is output as `ᴺᵁᴸᴸ`. Example: @@ -618,7 +618,7 @@ struct Message { } ``` -Schema files are in the file that is located in the directory specified in [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) in the server configuration. +Schema files are in the file that is located in the directory specified in [ format_schema_path](../operations/server_settings/settings.md) in the server configuration. Deserialization is effective and usually doesn't increase the system load. diff --git a/docs/en/introduction/distinctive_features.md b/docs/en/introduction/distinctive_features.md index 1dbc710659d..ed3543ddf34 100644 --- a/docs/en/introduction/distinctive_features.md +++ b/docs/en/introduction/distinctive_features.md @@ -59,6 +59,6 @@ ClickHouse provides various ways to trade accuracy for performance: Uses asynchronous multimaster replication. After being written to any available replica, data is distributed to all the remaining replicas in the background. The system maintains identical data on different replicas. Recovery after most failures is performed automatically, and in complex cases — semi-automatically. -For more information, see the section [Data replication](../operations/table_engines/replication.md#table_engines-replication). +For more information, see the section [Data replication](../operations/table_engines/replication.md). [Original article](https://clickhouse.yandex/docs/en/introduction/distinctive_features/) diff --git a/docs/en/introduction/performance.md b/docs/en/introduction/performance.md index 47d4a3b946d..14c0404b289 100644 --- a/docs/en/introduction/performance.md +++ b/docs/en/introduction/performance.md @@ -2,7 +2,7 @@ According to internal testing results at Yandex, ClickHouse shows the best performance (both the highest throughput for long queries and the lowest latency on short queries) for comparable operating scenarios among systems of its class that were available for testing. You can view the test results on a [separate page](https://clickhouse.yandex/benchmark.html). -This has also been confirmed by numerous independent benchmarks. They are not difficult to find using an internet search, or you can see [our small collection of related links](https://clickhouse.yandex/#independent-bookmarks). +This has also been confirmed by numerous independent benchmarks. They are not difficult to find using an internet search, or you can see [our small collection of related links](https://clickhouse.yandex/). ## Throughput for a Single Large Query diff --git a/docs/en/operations/access_rights.md b/docs/en/operations/access_rights.md index 451be2c7322..22c3b3e7714 100644 --- a/docs/en/operations/access_rights.md +++ b/docs/en/operations/access_rights.md @@ -61,7 +61,7 @@ Users are recorded in the `users` section. Here is a fragment of the `users.xml` You can see a declaration from two users: `default`and`web`. We added the `web` user separately. -The `default` user is chosen in cases when the username is not passed. The `default` user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the `user` and `password` (see the section on the [Distributed](../operations/table_engines/distributed.md#table_engines-distributed) engine). +The `default` user is chosen in cases when the username is not passed. The `default` user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the `user` and `password` (see the section on the [Distributed](../operations/table_engines/distributed.md) engine). The user that is used for exchanging information between servers combined in a cluster must not have substantial restrictions or quotas – otherwise, distributed queries will fail. @@ -87,8 +87,7 @@ The config includes comments explaining how to open access from everywhere. For use in production, only specify `ip` elements (IP addresses and their masks), since using `host` and `hoost_regexp` might cause extra latency. -Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md#settings_profiles)"). You can specify the default profile, `default'`. The profile can have any name. You can specify the same profile for different users. The most important thing you can write in the settings profile is `readonly=1`, which ensures read-only access. - +Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md Then specify the quota to be used (see the section "[Quotas](quotas.md#quotas)"). You can specify the default quota: `default`. It is set in the config by default to only count resource usage, without restricting it. The quota can have any name. You can specify the same quota for different users – in this case, resource usage is calculated for each user individually. In the optional `` section, you can also specify a list of databases that the user can access. By default, all databases are available to the user. You can specify the `default` database. In this case, the user will receive access to the database by default. diff --git a/docs/en/operations/backup.md b/docs/en/operations/backup.md index 3e2f110130a..fddcaba78f7 100644 --- a/docs/en/operations/backup.md +++ b/docs/en/operations/backup.md @@ -1,6 +1,6 @@ # Data Backup -While [replication](table_engines/replication.md#table_engines-replication) provides protection from hardware failures, it does not protect against human errors: accidentally deleting data, deleting the wrong table or on the wrong cluster, software bugs leading to incorrect data processing or data corruption. In many cases commands like these will affect all replicas. ClickHouse has built-in safeguards to prevent some of mistakes, for example by default [you can't just drop tables with MergeTree-like engine containing more than 50Gb of data](https://github.com/yandex/ClickHouse/blob/v18.14.18-stable/dbms/programs/server/config.xml#L322-L330), but they don't cover all possible cases and can be circumvented. +While [replication](table_engines/replication.md#table_engines-replication) provides protection from hardware failures, it does not protect against human errors: accidentally deleting data, deleting the wrong table or on the wrong cluster, software bugs leading to incorrect data processing or data corruption. In many cases commands like these will affect all replicas. ClickHouse has built-in safeguards to prevent some of mistakes, for example by default [you can't just drop tables with MergeTree-like engine containing more than 50Gb of data](https://github.com/yandex/ClickHouse/blob/v18.14.18-stable/dbms/programs/server/config.xml), but they don't cover all possible cases and can be circumvented. So in order to effectively mitigate possible human errors, you should carefully prepare your backup and restore strategy **in advance**. @@ -27,7 +27,7 @@ For smaller volumes of data simple `INSERT INTO ... SELECT ...` to remote tables ClickHouse allows to create a local copy of table partitions using `ALTER TABLE ... FREZE PARTITION ...` query. It's implemented using hardlinks to `/var/lib/clickhouse/shadow/` folder, so for old data it usually does not consume extra disk space. As created file copies are no longer touched by ClickHouse server, you can just leave them there: it's still be a simple backup that doesn't require any additional external system, but will be prone to hardware issues since. It's better to remotely copy them somewhere and then probably remove the local copies. Distributed filesystems and object stores are still a good options for this, but normal file servers attached with large enough capacity might work as well (in this case the transfer will happen via network filesystem or maybe [rsync](https://en.wikipedia.org/wiki/Rsync)). -More details on queries related to partition manipulations can be found in [respective section of ALTER documentation](../query_language/alter.md#query_language-manipulation-with-partitions-and-parts). +More details on queries related to partition manipulations can be found in [respective section of ALTER documentation](../query_language/alter.md). There's a third-party tool to automate this approach: [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup). diff --git a/docs/en/operations/configuration_files.md b/docs/en/operations/configuration_files.md index 799b9e5de75..eb0e8c699a0 100644 --- a/docs/en/operations/configuration_files.md +++ b/docs/en/operations/configuration_files.md @@ -14,7 +14,7 @@ If `replace` is specified, it replaces the entire element with the specified one If `remove` is specified, it deletes the element. -The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros](server_settings/settings.md#server_settings-macros)). +The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros](server_settings/settings.md)). Substitutions can also be performed from ZooKeeper. To do this, specify the attribute `from_zk = "/path/to/node"`. The element value is replaced with the contents of the node at `/path/to/node` in ZooKeeper. You can also put an entire XML subtree on the ZooKeeper node and it will be fully inserted into the source element. diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index f1546fbe62d..e7c6ba88876 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -78,7 +78,7 @@ To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc. Default settings profile. -Settings profiles are located in the file specified in the parameter [user_config](#server_settings-users_config). +Settings profiles are located in the file specified in the parameter [user_config](). **Example** @@ -97,7 +97,7 @@ Path: - Specify the absolute path or the path relative to the server config file. - The path can contain wildcards \* and ?. -See also "[External dictionaries](../../query_language/dicts/external_dicts.md#dicts-external_dicts)". +See also "[External dictionaries](../../query_language/dicts/external_dicts.md)". **Example** @@ -176,7 +176,7 @@ You can configure multiple `` clauses. For instance, you can use this Settings for thinning data for Graphite. -For more details, see [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md#table_engines-graphitemergetree). +For more details, see [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md). **Example** @@ -206,7 +206,7 @@ For more details, see [GraphiteMergeTree](../../operations/table_engines/graphit The port for connecting to the server over HTTP(s). -If `https_port` is specified, [openSSL](#server_settings-openSSL) must be configured. +If `https_port` is specified, [openSSL]() must be configured. If `http_port` is specified, the openSSL configuration is ignored even if it is set. @@ -357,7 +357,7 @@ Parameter substitutions for replicated tables. Can be omitted if replicated tables are not used. -For more information, see the section "[Creating replicated tables](../../operations/table_engines/replication.md#table_engines-replication-creation_of_rep_tables)". +For more information, see the section "[Creating replicated tables](../../operations/table_engines/replication.md)". **Example** @@ -369,7 +369,7 @@ For more information, see the section "[Creating replicated tables](../../operat ## mark_cache_size -Approximate size (in bytes) of the cache of "marks" used by [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Approximate size (in bytes) of the cache of "marks" used by [MergeTree](../../operations/table_engines/mergetree.md). The cache is shared for the server and memory is allocated as needed. The cache size must be at least 5368709120. @@ -425,7 +425,7 @@ We recommend using this option in Mac OS X, since the `getrlimit()` function ret Restriction on deleting tables. -If the size of a [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a DROP query. +If the size of a [MergeTree](../../operations/table_engines/mergetree.md) table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a DROP query. If you still need to delete the table without restarting the ClickHouse server, create the `/flags/force_drop_table` file and run the DROP query. @@ -443,7 +443,7 @@ The value 0 means that you can delete all tables without any restrictions. ## merge_tree -Fine tuning for tables in the [ MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Fine tuning for tables in the [ MergeTree](../../operations/table_engines/mergetree.md). For more information, see the MergeTreeSettings.h header file. @@ -520,7 +520,7 @@ Keys for server/client settings: ## part_log -Logging events that are associated with [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process. +Logging events that are associated with [MergeTree](../../operations/table_engines/mergetree.md). For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process. Queries are logged in the ClickHouse table, not in a separate file. @@ -541,7 +541,7 @@ Use the following parameters to configure logging: - database – Name of the database. - table – Name of the table. -- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key). +- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md). - flush_interval_milliseconds – Interval for flushing data from the buffer in memory to the table. **Example** @@ -574,7 +574,7 @@ The path to the directory containing data. ## query_log -Setting for logging queries received with the [log_queries=1](../settings/settings.md#settings_settings-log_queries) setting. +Setting for logging queries received with the [log_queries=1](../settings/settings.md) setting. Queries are logged in the ClickHouse table, not in a separate file. @@ -582,7 +582,7 @@ Use the following parameters to configure logging: - database – Name of the database. - table – Name of the table. -- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key). +- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md). - flush_interval_milliseconds – Interval for flushing data from the buffer in memory to the table. If the table doesn't exist, ClickHouse will create it. If the structure of the query log changed when the ClickHouse server was updated, the table with the old structure is renamed, and a new table is created automatically. @@ -604,7 +604,7 @@ If the table doesn't exist, ClickHouse will create it. If the structure of the q Configuration of clusters used by the Distributed table engine. -For more information, see the section "[Table engines/Distributed](../../operations/table_engines/distributed.md#table_engines-distributed)". +For more information, see the section "[Table engines/Distributed](../../operations/table_engines/distributed.md)". **Example** @@ -661,9 +661,9 @@ Path to temporary data for processing large queries. ## uncompressed_cache_size -Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree](../../operations/table_engines/mergetree.md). -There is one shared cache for the server. Memory is allocated on demand. The cache is used if the option [use_uncompressed_cache](../settings/settings.md#settings-use_uncompressed_cache) is enabled. +There is one shared cache for the server. Memory is allocated on demand. The cache is used if the option [use_uncompressed_cache](../settings/settings.md) is enabled. The uncompressed cache is advantageous for very short queries in individual cases. @@ -675,7 +675,7 @@ The uncompressed cache is advantageous for very short queries in individual case ## user_files_path -The directory with user files. Used in the table function [file()](../../query_language/table_functions/file.md#table_functions-file). +The directory with user files. Used in the table function [file()](../../query_language/table_functions/file.md). **Example** @@ -710,7 +710,7 @@ ClickHouse uses ZooKeeper for storing replica metadata when using replicated tab This parameter can be omitted if replicated tables are not used. -For more information, see the section "[Replication](../../operations/table_engines/replication.md#table_engines-replication)". +For more information, see the section "[Replication](../../operations/table_engines/replication.md)". **Example** diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index 64f086930ef..e23b83f2386 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -4,7 +4,7 @@ ## distributed_product_mode -Changes the behavior of [distributed subqueries](../../query_language/select.md#queries-distributed-subrequests). +Changes the behavior of [distributed subqueries](../../query_language/select.md). ClickHouse applies this setting when the query contains the product of distributed tables, i.e. when the query for a distributed table contains a non-GLOBAL subquery for the distributed table. @@ -13,7 +13,7 @@ Restrictions: - Only applied for IN and JOIN subqueries. - Only if the FROM section uses a distributed table containing more than one shard. - If the subquery concerns a distributed table containing more than one shard, -- Not used for a table-valued [remote](../../query_language/table_functions/remote.md#table_functions-remote) function. +- Not used for a table-valued [remote](../../query_language/table_functions/remote.md) function. The possible values ​​are: @@ -26,7 +26,7 @@ The possible values ​​are: ## fallback_to_stale_replicas_for_distributed_queries -Forces a query to an out-of-date replica if updated data is not available. See "[Replication](../../operations/table_engines/replication.md#table_engines-replication)". +Forces a query to an out-of-date replica if updated data is not available. See "[Replication](../../operations/table_engines/replication.md)". ClickHouse selects the most relevant from the outdated replicas of the table. @@ -42,7 +42,7 @@ Disables query execution if the index can't be used by date. Works with tables in the MergeTree family. -If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". +If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". @@ -52,7 +52,7 @@ Disables query execution if indexing by the primary key is not possible. Works with tables in the MergeTree family. -If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". +If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". @@ -91,7 +91,7 @@ If `input_format_allow_errors_ratio` is exceeded, ClickHouse throws an exception ## join_default_strictness -Sets default strictness for [JOIN clause](../../query_language/select.md#query-language-join). +Sets default strictness for [JOIN clause](../../query_language/select.md). **Possible values** @@ -123,7 +123,7 @@ Disabled by default (set to 0). It only works when reading from MergeTree engine Setting up query logging. -Queries sent to ClickHouse with this setup are logged according to the rules in the [query_log](../server_settings/settings.md#server_settings-query_log) server configuration parameter. +Queries sent to ClickHouse with this setup are logged according to the rules in the [query_log](../server_settings/settings.md) server configuration parameter. **Example**: @@ -147,7 +147,7 @@ This is slightly more than `max_block_size`. The reason for this is because cert ## max_replica_delay_for_distributed_queries -Disables lagging replicas for distributed queries. See "[Replication](../../operations/table_engines/replication.md#table_engines-replication)". +Disables lagging replicas for distributed queries. See "[Replication](../../operations/table_engines/replication.md)". Sets the time in seconds. If a replica lags more than the set value, this replica is not used. @@ -180,7 +180,7 @@ Don't confuse blocks for compression (a chunk of memory consisting of bytes) and ## min_compress_block_size -For [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)" tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least 'min_compress_block_size'. By default, 65,536. +For [MergeTree](../../operations/table_engines/mergetree.md)" tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least 'min_compress_block_size'. By default, 65,536. The actual size of the block, if the uncompressed data is less than 'max_compress_block_size', is no less than this value and no less than the volume of data for one mark. @@ -281,7 +281,7 @@ This parameter is useful when you are using formats that require a schema defini ## stream_flush_interval_ms -Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size](#settings-settings-max_insert_block_size) rows. +Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size]() rows. The default value is 7500. @@ -371,9 +371,9 @@ The character interpreted as a delimiter in the CSV data. By default, the delimi ## join_use_nulls -Affects the behavior of [JOIN](../../query_language/select.md#query_language-join). +Affects the behavior of [JOIN](../../query_language/select.md). -With `join_use_nulls=1,` `JOIN` behaves like in standard SQL, i.e. if empty cells appear when merging, the type of the corresponding field is converted to [Nullable](../../data_types/nullable.md#data_type-nullable), and empty cells are filled with [NULL](../../query_language/syntax.md#null-literal). +With `join_use_nulls=1,` `JOIN` behaves like in standard SQL, i.e. if empty cells appear when merging, the type of the corresponding field is converted to [Nullable](../../data_types/nullable.md#data_type-nullable), and empty cells are filled with [NULL](../../query_language/syntax.md). @@ -392,7 +392,7 @@ The default value is 0. All the replicas in the quorum are consistent, i.e., they contain data from all previous `INSERT` queries. The `INSERT` sequence is linearized. -When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency](#setting-select_sequential_consistency) option. +When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency]() option. **ClickHouse generates an exception** @@ -401,8 +401,8 @@ When reading the data written from the `insert_quorum`, you can use the[select_s **See also the following parameters:** -- [insert_quorum_timeout](#setting-insert_quorum_timeout) -- [select_sequential_consistency](#setting-select_sequential_consistency) +- [insert_quorum_timeout]() +- [select_sequential_consistency]() @@ -414,8 +414,8 @@ By default, 60 seconds. **See also the following parameters:** -- [insert_quorum](#setting-insert_quorum) -- [select_sequential_consistency](#setting-select_sequential_consistency) +- [insert_quorum]() +- [select_sequential_consistency]() @@ -430,8 +430,8 @@ When sequential consistency is enabled, ClickHouse allows the client to execute See also the following parameters: -- [insert_quorum](#setting-insert_quorum) -- [insert_quorum_timeout](#setting-insert_quorum_timeout) +- [insert_quorum]() +- [insert_quorum_timeout]() [Original article](https://clickhouse.yandex/docs/en/operations/settings/settings/) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index a67fec3f9c5..21e4cd37eb8 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -128,7 +128,7 @@ This is similar to the DUAL table found in other DBMSs. ## system.parts -Contains information about parts of [MergeTree](table_engines/mergetree.md#table_engines-mergetree) tables. +Contains information about parts of [MergeTree](table_engines/mergetree.md) tables. Each row describes one part of the data. diff --git a/docs/en/operations/table_engines/aggregatingmergetree.md b/docs/en/operations/table_engines/aggregatingmergetree.md index 80835c2920f..f8d5c372d7d 100644 --- a/docs/en/operations/table_engines/aggregatingmergetree.md +++ b/docs/en/operations/table_engines/aggregatingmergetree.md @@ -2,11 +2,11 @@ # AggregatingMergeTree -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree), altering the logic for data parts merging. ClickHouse replaces all rows with the same primary key (or more accurately, with the same [sorting key](mergetree.md#table_engines-mergetree-sorting_key)) with a single row (within a one data part) that stores a combination of states of aggregate functions. +The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree), altering the logic for data parts merging. ClickHouse replaces all rows with the same primary key (or more accurately, with the same [sorting key](mergetree.md)) with a single row (within a one data part) that stores a combination of states of aggregate functions. You can use `AggregatingMergeTree` tables for incremental data aggregation, including for aggregated materialized views. -The engine processes all columns with [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) type. +The engine processes all columns with [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md) type. It is appropriate to use `AggregatingMergeTree` if it reduces the number of rows by orders. @@ -25,11 +25,11 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **Query clauses** -When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table @@ -50,8 +50,7 @@ All of the parameters have the same meaning as in `MergeTree`. ## SELECT and INSERT -To insert data, use [INSERT SELECT](../../query_language/insert_into.md#queries-insert-select) query with aggregate `-State`- functions. - +To insert data, use [INSERT SELECT](../../query_language/insert_into.md When selecting data from `AggregatingMergeTree` table, use `GROUP BY` clause and the same aggregate functions as when inserting data, but using `-Merge` suffix. In the results of `SELECT` query the values of `AggregateFunction` type have implementation-specific binary representation for all of the ClickHouse output formats. If dump data into, for example, `TabSeparated` format with `SELECT` query then this dump can be loaded back using `INSERT` query. diff --git a/docs/en/operations/table_engines/collapsingmergetree.md b/docs/en/operations/table_engines/collapsingmergetree.md index 16fefcd4bab..db41150159d 100644 --- a/docs/en/operations/table_engines/collapsingmergetree.md +++ b/docs/en/operations/table_engines/collapsingmergetree.md @@ -2,9 +2,9 @@ # CollapsingMergeTree -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree) and adds the logic of rows collapsing to data parts merge algorithm. +The engine inherits from [MergeTree](mergetree.md) and adds the logic of rows collapsing to data parts merge algorithm. -`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing](#collapsingmergetree-collapsing) section of the document. +`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing]() section of the document. The engine may significantly reduce the volume of storage and increase efficiency of `SELECT` query as a consequence. @@ -23,7 +23,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of query parameters, see [query description](../../query_language/create.md#query_language-queries-create_table). +For a description of query parameters, see [query description](../../query_language/create.md). **CollapsingMergeTree Parameters** @@ -33,7 +33,7 @@ For a description of query parameters, see [query description](../../query_langu **Query clauses** -When creating a `CollapsingMergeTree` table, the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `CollapsingMergeTree` table, the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table diff --git a/docs/en/operations/table_engines/dictionary.md b/docs/en/operations/table_engines/dictionary.md index 067611605ba..00caba03ac0 100644 --- a/docs/en/operations/table_engines/dictionary.md +++ b/docs/en/operations/table_engines/dictionary.md @@ -2,7 +2,7 @@ # Dictionary -The `Dictionary` engine displays the [dictionary](../../query_language/dicts/external_dicts.md#dicts-external_dicts) data as a ClickHouse table. +The `Dictionary` engine displays the [dictionary](../../query_language/dicts/external_dicts.md) data as a ClickHouse table. As an example, consider a dictionary of `products` with the following configuration: diff --git a/docs/en/operations/table_engines/file.md b/docs/en/operations/table_engines/file.md index ed49a693630..816b8d94cd6 100644 --- a/docs/en/operations/table_engines/file.md +++ b/docs/en/operations/table_engines/file.md @@ -18,11 +18,11 @@ File(Format) `Format` should be supported for either `INSERT` and `SELECT`. For the full list of supported formats see [Formats](../../interfaces/formats.md#formats). -ClickHouse does not allow to specify filesystem path for`File`. It will use folder defined by [path](../server_settings/settings.md#server_settings-path) setting in server configuration. +ClickHouse does not allow to specify filesystem path for`File`. It will use folder defined by [path](../server_settings/settings.md) setting in server configuration. When creating table using `File(Format)` it creates empty subdirectory in that folder. When data is written to that table, it's put into `data.Format` file in that subdirectory. -You may manually create this subfolder and file in server filesystem and then [ATTACH](../../query_language/misc.md#queries-attach) it to table information with matching name, so you can query data from that file. +You may manually create this subfolder and file in server filesystem and then [ATTACH](../../query_language/misc.md) it to table information with matching name, so you can query data from that file. !!! warning Be careful with this funcionality, because ClickHouse does not keep track of external changes to such files. The result of simultaneous writes via ClickHouse and outside of ClickHouse is undefined. @@ -60,8 +60,7 @@ SELECT * FROM file_engine_table ## Usage in Clickhouse-local -In [clickhouse-local](../utils/clickhouse-local.md#utils-clickhouse-local) File engine accepts file path in addition to `Format`. Default input/output streams can be specified using numeric or human-readable names like `0` or `stdin`, `1` or `stdout`. - +In [clickhouse-local](../utils/clickhouse-local.md **Example:** ```bash diff --git a/docs/en/operations/table_engines/graphitemergetree.md b/docs/en/operations/table_engines/graphitemergetree.md index 0aad07a13c3..843185ff83d 100644 --- a/docs/en/operations/table_engines/graphitemergetree.md +++ b/docs/en/operations/table_engines/graphitemergetree.md @@ -6,7 +6,7 @@ This engine is designed for rollup (thinning and aggregating/averaging) [Graphit You can use any ClickHouse table engine to store the Graphite data if you don't need rollup, but if you need a rollup use `GraphiteMergeTree`. The engine reduces the volume of storage and increases the efficiency of queries from Graphite. -The engine inherits properties from [MergeTree](mergetree.md#table_engines-mergetree). +The engine inherits properties from [MergeTree](mergetree.md). ## Creating a Table @@ -25,7 +25,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). A table for the Graphite date should have the following columns: @@ -44,7 +44,7 @@ The names of these columns should be set in the rollup configuration. **Query clauses** -When creating a `GraphiteMergeTree` table, the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `GraphiteMergeTree` table, the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table @@ -70,7 +70,7 @@ All of the parameters excepting `config_section` have the same meaning as in `Me ## Rollup configuration -The settings for rollup are defined by the [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) parameter in the server configuration. The name of the parameter could be any. You can create several configurations and use them for different tables. +The settings for rollup are defined by the [graphite_rollup](../server_settings/settings.md) parameter in the server configuration. The name of the parameter could be any. You can create several configurations and use them for different tables. Rollup configuration structure: diff --git a/docs/en/operations/table_engines/kafka.md b/docs/en/operations/table_engines/kafka.md index 3ee70146409..9a0756d1ea7 100644 --- a/docs/en/operations/table_engines/kafka.md +++ b/docs/en/operations/table_engines/kafka.md @@ -106,7 +106,7 @@ Example: SELECT level, sum(total) FROM daily GROUP BY level; ``` -To improve performance, received messages are grouped into blocks the size of [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size). If the block wasn't formed within [stream_flush_interval_ms](../settings/settings.md#settings-settings_stream_flush_interval_ms) milliseconds, the data will be flushed to the table regardless of the completeness of the block. +To improve performance, received messages are grouped into blocks the size of [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size). If the block wasn't formed within [stream_flush_interval_ms](../settings/settings.md) milliseconds, the data will be flushed to the table regardless of the completeness of the block. To stop receiving topic data or to change the conversion logic, detach the materialized view: diff --git a/docs/en/operations/table_engines/materializedview.md b/docs/en/operations/table_engines/materializedview.md index c13a1ac8710..1e0a1615874 100644 --- a/docs/en/operations/table_engines/materializedview.md +++ b/docs/en/operations/table_engines/materializedview.md @@ -1,6 +1,6 @@ # MaterializedView -Used for implementing materialized views (for more information, see [CREATE TABLE](../../query_language/create.md#query_language-queries-create_table)). For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine. +Used for implementing materialized views (for more information, see [CREATE TABLE](../../query_language/create.md)). For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine. [Original article](https://clickhouse.yandex/docs/en/operations/table_engines/materializedview/) diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index 2f2b0253c49..9422b2028b2 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -12,20 +12,20 @@ Main features: This allows you to create a small sparse index that helps find data faster. -- This allows you to use partitions if the [partitioning key](custom_partitioning_key.md#table_engines-custom_partitioning_key) is specified. +- This allows you to use partitions if the [partitioning key](custom_partitioning_key.md) is specified. ClickHouse supports certain operations with partitions that are more effective than general operations on the same data with the same result. ClickHouse also automatically cuts off the partition data where the partitioning key is specified in the query. This also increases the query performance. - Data replication support. - The family of `ReplicatedMergeTree` tables is used for this. For more information, see the [Data replication](replication.md#table_engines-replication) section. + The family of `ReplicatedMergeTree` tables is used for this. For more information, see the [Data replication](replication.md) section. - Data sampling support. If necessary, you can set the data sampling method in the table. !!! info - The [Merge](merge.md#table_engine-merge) engine does not belong to the `*MergeTree` family. + The [Merge](merge.md) engine does not belong to the `*MergeTree` family. @@ -45,21 +45,21 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **Query clauses** - `ENGINE` - Name and parameters of the engine. `ENGINE = MergeTree()`. `MergeTree` engine does not have parameters. -- `PARTITION BY` — The [partitioning key](custom_partitioning_key.md#table_engines-custom_partitioning_key). +- `PARTITION BY` — The [partitioning key](custom_partitioning_key.md). - For partitioning by month, use the `toYYYYMM(date_column)` expression, where `date_column` is a column with a date of the type [Date](../../data_types/date.md#data_type-date). The partition names here have the `"YYYYMM"` format. + For partitioning by month, use the `toYYYYMM(date_column)` expression, where `date_column` is a column with a date of the type [Date](../../data_types/date.md). The partition names here have the `"YYYYMM"` format. - `ORDER BY` — The sorting key. A tuple of columns or arbitrary expressions. Example: `ORDER BY (CounterID, EventDate)`. -- `PRIMARY KEY` - The primary key if it [differs from the sorting key](mergetree.md#table_engines-mergetree-sorting_key). +- `PRIMARY KEY` - The primary key if it [differs from the sorting key](mergetree.md). By default the primary key is the same as the sorting key (which is specified by the `ORDER BY` clause). Thus in most cases it is unnecessary to specify a separate `PRIMARY KEY` clause. @@ -80,7 +80,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa In the example, we set partitioning by month. -We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md#select-section-sample) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. +We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. `index_granularity` could be omitted because 8192 is the default value. @@ -100,10 +100,9 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] **MergeTree() parameters** -- `date-column` — The name of a column of the type [Date](../../data_types/date.md#data_type-date). ClickHouse automatically creates partitions by month on the basis of this column. The partition names are in the `"YYYYMM"` format. +- `date-column` — The name of a column of the type [Date](../../data_types/date.md). ClickHouse automatically creates partitions by month on the basis of this column. The partition names are in the `"YYYYMM"` format. - `sampling_expression` — an expression for sampling. -- `(primary, key)` — primary key. Type — [Tuple()](../../data_types/tuple.md#data_type-tuple). It may consist of arbitrary expressions, but it typically is a tuple of columns. It must include an expression for sampling if it is set. It must not include a column with a `date-column` date. -- `index_granularity` — The granularity of an index. The number of data rows between the "marks" of an index. The value 8192 is appropriate for most tasks. +- `(primary, key)` — primary key. Type — [Tuple()](../../data_types/tuple.md- `index_granularity` — The granularity of an index. The number of data rows between the "marks" of an index. The value 8192 is appropriate for most tasks. **Example** @@ -167,7 +166,7 @@ The number of columns in the primary key is not explicitly limited. Depending on ClickHouse sorts data by primary key, so the higher the consistency, the better the compression. -- Provide additional logic when data parts merging in the [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) and [SummingMergeTree](summingmergetree.md#table_engine-summingmergetree) engines. +- Provide additional logic when data parts merging in the [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) and [SummingMergeTree](summingmergetree.md) engines. In this case it makes sense to specify the *sorting key* that is different from the primary key. @@ -192,7 +191,7 @@ added dimensions. In this case it makes sense to leave only a few columns in the primary key that will provide efficient range scans and add the remaining dimension columns to the sorting key tuple. -[ALTER of the sorting key](../../query_language/alter.md#query_language-queries-alter-key_alters) is a +[ALTER of the sorting key](../../query_language/alter.md) is a lightweight operation because when a new column is simultaneously added to the table and to the sorting key data parts need not be changed (they remain sorted by the new sorting key expression). @@ -226,7 +225,7 @@ In the example below, the index can't be used. SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%' ``` -To check whether ClickHouse can use the index when running a query, use the settings [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) and [force_primary_key](../settings/settings.md#settings-settings-force_primary_key). +To check whether ClickHouse can use the index when running a query, use the settings [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) and [force_primary_key](../settings/settings.md). The key for partitioning by month allows reading only those data blocks which contain dates from the proper range. In this case, the data block may contain data for many dates (up to an entire month). Within a block, data is sorted by primary key, which might not contain the date as the first column. Because of this, using a query with only a date condition that does not specify the primary key prefix will cause more data to be read than for a single date. diff --git a/docs/en/operations/table_engines/mysql.md b/docs/en/operations/table_engines/mysql.md index 9c3a84a4b6e..5f3122faf00 100644 --- a/docs/en/operations/table_engines/mysql.md +++ b/docs/en/operations/table_engines/mysql.md @@ -28,7 +28,7 @@ At this time, simple `WHERE` clauses such as ` =, !=, >, >=, <, <=` are executed The rest of the conditions and the `LIMIT` sampling constraint are executed in ClickHouse only after the query to MySQL finishes. -The `MySQL` engine does not support the [Nullable](../../data_types/nullable.md#data_type-nullable) data type, so when reading data from MySQL tables, `NULL` is converted to default values for the specified column type (usually 0 or an empty string). +The `MySQL` engine does not support the [Nullable](../../data_types/nullable.md) data type, so when reading data from MySQL tables, `NULL` is converted to default values for the specified column type (usually 0 or an empty string). [Original article](https://clickhouse.yandex/docs/en/operations/table_engines/mysql/) diff --git a/docs/en/operations/table_engines/replacingmergetree.md b/docs/en/operations/table_engines/replacingmergetree.md index 0cc53475dde..a147e9c8dd6 100644 --- a/docs/en/operations/table_engines/replacingmergetree.md +++ b/docs/en/operations/table_engines/replacingmergetree.md @@ -1,6 +1,6 @@ # ReplacingMergeTree -The engine differs from [MergeTree](mergetree.md#table_engines-mergetree) in that it removes duplicate entries with the same primary key value (or more accurately, with the same [sorting key](mergetree.md#table_engines-mergetree-sorting_key) value). +The engine differs from [MergeTree](mergetree.md#table_engines-mergetree) in that it removes duplicate entries with the same primary key value (or more accurately, with the same [sorting key](mergetree.md) value). Data deduplication occurs only during a merge. Merging occurs in the background at an unknown time, so you can't plan for it. Some of the data may remain unprocessed. Although you can run an unscheduled merge using the `OPTIMIZE` query, don't count on using it, because the `OPTIMIZE` query will read and write a large amount of data. @@ -21,7 +21,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **ReplacingMergeTree Parameters** @@ -33,7 +33,7 @@ For a description of request parameters, see [request description](../../query_l **Query clauses** -When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table diff --git a/docs/en/operations/table_engines/replication.md b/docs/en/operations/table_engines/replication.md index a6298fb5595..09392bb3740 100644 --- a/docs/en/operations/table_engines/replication.md +++ b/docs/en/operations/table_engines/replication.md @@ -49,7 +49,7 @@ You can specify any existing ZooKeeper cluster and the system will use a directo If ZooKeeper isn't set in the config file, you can't create replicated tables, and any existing replicated tables will be read-only. -ZooKeeper is not used in `SELECT` queries because replication does not affect the performance of `SELECT` and queries run just as fast as they do for non-replicated tables. When querying distributed replicated tables, ClickHouse behavior is controlled by the settings [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) and [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries). +ZooKeeper is not used in `SELECT` queries because replication does not affect the performance of `SELECT` and queries run just as fast as they do for non-replicated tables. When querying distributed replicated tables, ClickHouse behavior is controlled by the settings [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) and [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md). For each `INSERT` query, approximately ten entries are added to ZooKeeper through several transactions. (To be more precise, this is for each inserted block of data; an INSERT query contains one block or one block per `max_insert_block_size = 1048576` rows.) This leads to slightly longer latencies for `INSERT` compared to non-replicated tables. But if you follow the recommendations to insert data in batches of no more than one `INSERT` per second, it doesn't create any problems. The entire ClickHouse cluster used for coordinating one ZooKeeper cluster has a total of several hundred `INSERTs` per second. The throughput on data inserts (the number of rows per second) is just as high as for non-replicated data. @@ -61,7 +61,7 @@ By default, an INSERT query waits for confirmation of writing the data from only Each block of data is written atomically. The INSERT query is divided into blocks up to `max_insert_block_size = 1048576` rows. In other words, if the `INSERT` query has less than 1048576 rows, it is made atomically. -Data blocks are deduplicated. For multiple writes of the same data block (data blocks of the same size containing the same rows in the same order), the block is only written once. The reason for this is in case of network failures when the client application doesn't know if the data was written to the DB, so the `INSERT` query can simply be repeated. It doesn't matter which replica INSERTs were sent to with identical data. `INSERTs` are idempotent. Deduplication parameters are controlled by [merge_tree](../server_settings/settings.md#server_settings-merge_tree) server settings. +Data blocks are deduplicated. For multiple writes of the same data block (data blocks of the same size containing the same rows in the same order), the block is only written once. The reason for this is in case of network failures when the client application doesn't know if the data was written to the DB, so the `INSERT` query can simply be repeated. It doesn't matter which replica INSERTs were sent to with identical data. `INSERTs` are idempotent. Deduplication parameters are controlled by [merge_tree](../server_settings/settings.md) server settings. During replication, only the source data to insert is transferred over the network. Further data transformation (merging) is coordinated and performed on all the replicas in the same way. This minimizes network usage, which means that replication works well when replicas reside in different datacenters. (Note that duplicating data in different datacenters is the main goal of replication.) @@ -173,7 +173,7 @@ If all data and metadata disappeared from one of the servers, follow these steps Then start the server (restart, if it is already running). Data will be downloaded from replicas. -An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicatable tables](#table_engines-replication-creation_of_rep_tables)". +An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicatable tables]()". There is no restriction on network bandwidth during recovery. Keep this in mind if you are restoring many replicas at once. diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index bd6c2d651f6..c74cee277ce 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -2,7 +2,7 @@ # SummingMergeTree -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree). The difference is that when merging data parts for `SummingMergeTree` tables ClickHouse replaces all the rows with the same primary key (or more accurately, with the same [sorting key](mergetree.md#table_engines-mergetree-sorting_key)) with one row which contains summarized values for the columns with the numeric data type. If the sorting key is composed in a way that a single key value corresponds to large number of rows, this significantly reduces storage volume and speeds up data selection. +The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree). The difference is that when merging data parts for `SummingMergeTree` tables ClickHouse replaces all the rows with the same primary key (or more accurately, with the same [sorting key](mergetree.md)) with one row which contains summarized values for the columns with the numeric data type. If the sorting key is composed in a way that a single key value corresponds to large number of rows, this significantly reduces storage volume and speeds up data selection. We recommend to use the engine together with `MergeTree`. Store complete data in `MergeTree` table, and use `SummingMergeTree` for aggregated data storing, for example, when preparing reports. Such an approach will prevent you from losing valuable data due to an incorrectly composed primary key. @@ -21,7 +21,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **Parameters of SummingMergeTree** @@ -32,7 +32,7 @@ The columns must be of a numeric type and must not be in the primary key. **Query clauses** -When creating a `SummingMergeTree` table the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `SummingMergeTree` table the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table @@ -73,7 +73,7 @@ Insert data to it: :) INSERT INTO summtt Values(1,1),(1,2),(2,1) ``` -ClickHouse may sum all the rows not completely ([see below](#summary-data-processing)), so we use an aggregate function `sum` and `GROUP BY` clause in the query. +ClickHouse may sum all the rows not completely ([see below]()), so we use an aggregate function `sum` and `GROUP BY` clause in the query. ```sql SELECT key, sum(value) FROM summtt GROUP BY key @@ -92,7 +92,7 @@ SELECT key, sum(value) FROM summtt GROUP BY key When data are inserted into a table, they are saved as-is. Clickhouse merges the inserted parts of data periodically and this is when rows with the same primary key are summed and replaced with one for each resulting part of data. -ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md#agg_function-sum) and `GROUP BY` clause should be used in a query as described in the example above. +ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md) and `GROUP BY` clause should be used in a query as described in the example above. ### Common rules for summation @@ -106,7 +106,7 @@ The values are not summarized for columns in the primary key. ### The Summation in the AggregateFunction Columns -For columns of [AggregateFunction type](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) ClickHouse behaves as [AggregatingMergeTree](aggregatingmergetree.md#table_engine-aggregatingmergetree) engine aggregating according to the function. +For columns of [AggregateFunction type](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) ClickHouse behaves as [AggregatingMergeTree](aggregatingmergetree.md) engine aggregating according to the function. ### Nested Structures @@ -128,7 +128,7 @@ Examples: [(1, 100), (2, 150)] + [(1, -100)] -> [(2, 150)] ``` -When requesting data, use the [sumMap(key, value)](../../query_language/agg_functions/reference.md#agg_function-summary) function for aggregation of `Map`. +When requesting data, use the [sumMap(key, value)](../../query_language/agg_functions/reference.md) function for aggregation of `Map`. For nested data structure, you do not need to specify its columns in the tuple of columns for summation. diff --git a/docs/en/operations/table_engines/versionedcollapsingmergetree.md b/docs/en/operations/table_engines/versionedcollapsingmergetree.md index 42feeaffcce..330e2bd4fe7 100644 --- a/docs/en/operations/table_engines/versionedcollapsingmergetree.md +++ b/docs/en/operations/table_engines/versionedcollapsingmergetree.md @@ -7,9 +7,9 @@ This engine: - Allows quick writing of continually changing states of objects. - Deletes old states of objects in the background. It causes to significant reduction of the volume of storage. -See the section [Collapsing](#versionedcollapsingmergetree-collapsing) for details. +See the section [Collapsing]() for details. -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree) and adds the logic of rows collapsing to data parts merge algorithm. `VersionedCollapsingMergeTree` solves the same problem as the [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) but uses another algorithm of collapsing. It allows inserting the data in any order with multiple threads. The particular `Version` column helps to collapse the rows properly even if they are inserted in the wrong order. `CollapsingMergeTree` allows only strictly consecutive insertion. +The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree) and adds the logic of rows collapsing to data parts merge algorithm. `VersionedCollapsingMergeTree` solves the same problem as the [CollapsingMergeTree](collapsingmergetree.md) but uses another algorithm of collapsing. It allows inserting the data in any order with multiple threads. The particular `Version` column helps to collapse the rows properly even if they are inserted in the wrong order. `CollapsingMergeTree` allows only strictly consecutive insertion. ## Creating a Table @@ -26,7 +26,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of query parameters, see [query description](../../query_language/create.md#query_language-queries-create_table). +For a description of query parameters, see [query description](../../query_language/create.md). **Engine Parameters** @@ -44,7 +44,7 @@ VersionedCollapsingMergeTree(sign, version) **Query Clauses** -When creating a `VersionedCollapsingMergeTree` table, the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `VersionedCollapsingMergeTree` table, the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table diff --git a/docs/en/operations/utils/index.md b/docs/en/operations/utils/index.md index 6406b486cc8..ca0f0954150 100644 --- a/docs/en/operations/utils/index.md +++ b/docs/en/operations/utils/index.md @@ -1,7 +1,7 @@ # ClickHouse Utility -* [clickhouse-local](clickhouse-local.md#utils-clickhouse-local) — Allows running SQL queries on data without stopping the ClickHouse server, similar to how `awk` does this. -* [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) — Copies (and reshards) data from one cluster to another cluster. +* [clickhouse-local](clickhouse-local.md) — Allows running SQL queries on data without stopping the ClickHouse server, similar to how `awk` does this. +* [clickhouse-copier](clickhouse-copier.md) — Copies (and reshards) data from one cluster to another cluster. [Original article](https://clickhouse.yandex/docs/en/operations/utils/) diff --git a/docs/en/query_language/agg_functions/parametric_functions.md b/docs/en/query_language/agg_functions/parametric_functions.md index 134b4a4b985..61951379d56 100644 --- a/docs/en/query_language/agg_functions/parametric_functions.md +++ b/docs/en/query_language/agg_functions/parametric_functions.md @@ -61,7 +61,7 @@ windowFunnel(window)(timestamp, cond1, cond2, cond3, ...) **Parameters:** - `window` — Length of the sliding window in seconds. -- `timestamp` — Name of the column containing the timestamp. Data type: [DateTime](../../data_types/datetime.md#data_type-datetime) or [UInt32](../../data_types/int_uint.md#data_type-int). +- `timestamp` — Name of the column containing the timestamp. Data type: [DateTime](../../data_types/datetime.md#data_type-datetime) or [UInt32](../../data_types/int_uint.md). - `cond1`, `cond2`... — Conditions or data describing the chain of events. Data type: `UInt8`. Values can be 0 or 1. **Algorithm** diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md index c33d258d63d..ace9f5769b3 100644 --- a/docs/en/query_language/agg_functions/reference.md +++ b/docs/en/query_language/agg_functions/reference.md @@ -35,7 +35,7 @@ anyHeavy(column) **Example** -Take the [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) data set and select any frequently occurring value in the `AirlineID` column. +Take the [OnTime](../../getting_started/example_datasets/ontime.md) data set and select any frequently occurring value in the `AirlineID` column. ``` sql SELECT anyHeavy(AirlineID) AS res @@ -462,7 +462,7 @@ We recommend using the `N < 10 ` value; performance is reduced with large `N` va **Example** -Take the [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) data set and select the three most frequently occurring values in the `AirlineID` column. +Take the [OnTime](../../getting_started/example_datasets/ontime.md) data set and select the three most frequently occurring values in the `AirlineID` column. ``` sql SELECT topK(3)(AirlineID) AS res diff --git a/docs/en/query_language/alter.md b/docs/en/query_language/alter.md index fbdc5c79ae1..59c88b169a4 100644 --- a/docs/en/query_language/alter.md +++ b/docs/en/query_language/alter.md @@ -78,7 +78,7 @@ MODIFY ORDER BY new_expression It only works for tables in the [`MergeTree`](../operations/table_engines/mergetree.md) family (including [replicated](../operations/table_engines/replication.md) tables). The command changes the -[sorting key](../operations/table_engines/mergetree.md#table_engines-mergetree-sorting_key) of the table +[sorting key](../operations/table_engines/mergetree.md) of the table to `new_expression` (an expression or a tuple of expressions). Primary key remains the same. The command is lightweight in a sense that it only changes metadata. To keep the property that data part diff --git a/docs/en/query_language/dicts/external_dicts.md b/docs/en/query_language/dicts/external_dicts.md index 8840218e49f..6b807289ed6 100644 --- a/docs/en/query_language/dicts/external_dicts.md +++ b/docs/en/query_language/dicts/external_dicts.md @@ -2,16 +2,16 @@ # External Dictionaries -You can add your own dictionaries from various data sources. The data source for a dictionary can be a local text or executable file, an HTTP(s) resource, or another DBMS. For more information, see "[Sources for external dictionaries](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources)". +You can add your own dictionaries from various data sources. The data source for a dictionary can be a local text or executable file, an HTTP(s) resource, or another DBMS. For more information, see "[Sources for external dictionaries](external_dicts_dict_sources.md)". ClickHouse: > - Fully or partially stores dictionaries in RAM. - Periodically updates dictionaries and dynamically loads missing values. In other words, dictionaries can be loaded dynamically. -The configuration of external dictionaries is located in one or more files. The path to the configuration is specified in the [dictionaries_config](../../operations/server_settings/settings.md#server_settings-dictionaries_config) parameter. +The configuration of external dictionaries is located in one or more files. The path to the configuration is specified in the [dictionaries_config](../../operations/server_settings/settings.md) parameter. -Dictionaries can be loaded at server startup or at first use, depending on the [dictionaries_lazy_load](../../operations/server_settings/settings.md#server_settings-dictionaries_lazy_load) setting. +Dictionaries can be loaded at server startup or at first use, depending on the [dictionaries_lazy_load](../../operations/server_settings/settings.md) setting. The dictionary config file has the following format: @@ -35,11 +35,11 @@ The dictionary config file has the following format: ``` -You can [configure](external_dicts_dict.md#dicts-external_dicts_dict) any number of dictionaries in the same file. The file format is preserved even if there is only one dictionary (i.e. ` diff --git a/docs/en/query_language/dicts/external_dicts_dict.md b/docs/en/query_language/dicts/external_dicts_dict.md index ca070c8084b..bbfe6d82a72 100644 --- a/docs/en/query_language/dicts/external_dicts_dict.md +++ b/docs/en/query_language/dicts/external_dicts_dict.md @@ -27,9 +27,9 @@ The dictionary configuration has the following structure: ``` - name – The identifier that can be used to access the dictionary. Use the characters `[a-zA-Z0-9_\-]`. -- [source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources) — Source of the dictionary. -- [layout](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) — Dictionary layout in memory. -- [structure](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) — Structure of the dictionary . A key and attributes that can be retrieved by this key. -- [lifetime](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) — Frequency of dictionary updates. +- [source](external_dicts_dict_sources.md) — Source of the dictionary. +- [layout](external_dicts_dict_layout.md) — Dictionary layout in memory. +- [structure](external_dicts_dict_structure.md) — Structure of the dictionary . A key and attributes that can be retrieved by this key. +- [lifetime](external_dicts_dict_lifetime.md) — Frequency of dictionary updates. [Original article](https://clickhouse.yandex/docs/en/query_language/dicts/external_dicts_dict/) diff --git a/docs/en/query_language/dicts/external_dicts_dict_layout.md b/docs/en/query_language/dicts/external_dicts_dict_layout.md index 932d90db605..150f129ce94 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/en/query_language/dicts/external_dicts_dict_layout.md @@ -2,11 +2,11 @@ # Storing Dictionaries in Memory -There are a [variety of ways](#dicts-external_dicts_dict_layout-manner) to store dictionaries in memory. +There are a [variety of ways]() to store dictionaries in memory. -We recommend [flat](#dicts-external_dicts_dict_layout-flat), [hashed](#dicts-external_dicts_dict_layout-hashed)and[complex_key_hashed](#dicts-external_dicts_dict_layout-complex_key_hashed). which provide optimal processing speed. +We recommend [flat](#dicts-external_dicts_dict_layout-flat), [hashed](#dicts-external_dicts_dict_layout-hashed)and[complex_key_hashed](). which provide optimal processing speed. -Caching is not recommended because of potentially poor performance and difficulties in selecting optimal parameters. Read more in the section "[cache](#dicts-external_dicts_dict_layout-cache)". +Caching is not recommended because of potentially poor performance and difficulties in selecting optimal parameters. Read more in the section "[cache]()". There are several ways to improve dictionary performance: @@ -40,13 +40,13 @@ The configuration looks like this: ## Ways to Store Dictionaries in Memory -- [flat](#dicts-external_dicts_dict_layout-flat) -- [hashed](#dicts-external_dicts_dict_layout-hashed) -- [cache](#dicts-external_dicts_dict_layout-cache) -- [range_hashed](#dicts-external_dicts_dict_layout-range_hashed) -- [complex_key_hashed](#dicts-external_dicts_dict_layout-complex_key_hashed) -- [complex_key_cache](#dicts-external_dicts_dict_layout-complex_key_cache) -- [ip_trie](#dicts-external_dicts_dict_layout-ip_trie) +- [flat]() +- [hashed]() +- [cache]() +- [range_hashed]() +- [complex_key_hashed]() +- [complex_key_cache]() +- [ip_trie]() @@ -88,7 +88,7 @@ Configuration example: ### complex_key_hashed -This type of storage is for use with composite [keys](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure). Similar to `hashed`. +This type of storage is for use with composite [keys](external_dicts_dict_structure.md). Similar to `hashed`. Configuration example: @@ -120,7 +120,7 @@ Example: The table contains discounts for each advertiser in the format: +---------------+---------------------+-------------------+--------+ ``` -To use a sample for date ranges, define the `range_min` and `range_max` elements in the [structure](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure). +To use a sample for date ranges, define the `range_min` and `range_max` elements in the [structure](external_dicts_dict_structure.md). Example: @@ -193,13 +193,12 @@ The dictionary is stored in a cache that has a fixed number of cells. These cell When searching for a dictionary, the cache is searched first. For each block of data, all keys that are not found in the cache or are outdated are requested from the source using ` SELECT attrs... FROM db.table WHERE id IN (k1, k2, ...)`. The received data is then written to the cache. -For cache dictionaries, the expiration [lifetime](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) of data in the cache can be set. If more time than `lifetime` has passed since loading the data in a cell, the cell's value is not used, and it is re-requested the next time it needs to be used. - +For cache dictionaries, the expiration [lifetime](external_dicts_dict_lifetime.md This is the least effective of all the ways to store dictionaries. The speed of the cache depends strongly on correct settings and the usage scenario. A cache type dictionary performs well only when the hit rates are high enough (recommended 99% and higher). You can view the average hit rate in the `system.dictionaries` table. To improve cache performance, use a subquery with ` LIMIT`, and call the function with the dictionary externally. -Supported [sources](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources): MySQL, ClickHouse, executable, HTTP. +Supported [sources](external_dicts_dict_sources.md): MySQL, ClickHouse, executable, HTTP. Example of settings: @@ -226,7 +225,7 @@ Set a large enough cache size. You need to experiment to select the number of ce ### complex_key_cache -This type of storage is for use with composite [keys](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure). Similar to `cache`. +This type of storage is for use with composite [keys](external_dicts_dict_structure.md). Similar to `cache`. diff --git a/docs/en/query_language/dicts/external_dicts_dict_lifetime.md b/docs/en/query_language/dicts/external_dicts_dict_lifetime.md index 7ce661ab5a8..b8df6bebedc 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_lifetime.md +++ b/docs/en/query_language/dicts/external_dicts_dict_lifetime.md @@ -33,7 +33,7 @@ Example of settings: ``` -When upgrading the dictionaries, the ClickHouse server applies different logic depending on the type of [ source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources): +When upgrading the dictionaries, the ClickHouse server applies different logic depending on the type of [ source](external_dicts_dict_sources.md): - For a text file, it checks the time of modification. If the time differs from the previously recorded time, the dictionary is updated. - For MyISAM tables, the time of modification is checked using a `SHOW TABLE STATUS` query. @@ -42,7 +42,7 @@ When upgrading the dictionaries, the ClickHouse server applies different logic d For MySQL (InnoDB), ODBC and ClickHouse sources, you can set up a query that will update the dictionaries only if they really changed, rather than each time. To do this, follow these steps: - The dictionary table must have a field that always changes when the source data is updated. -- The settings of the source must specify a query that retrieves the changing field. The ClickHouse server interprets the query result as a row, and if this row has changed relative to its previous state, the dictionary is updated. Specify the query in the `` field in the settings for the [source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources). +- The settings of the source must specify a query that retrieves the changing field. The ClickHouse server interprets the query result as a row, and if this row has changed relative to its previous state, the dictionary is updated. Specify the query in the `` field in the settings for the [source](external_dicts_dict_sources.md). Example of settings: diff --git a/docs/en/query_language/dicts/external_dicts_dict_sources.md b/docs/en/query_language/dicts/external_dicts_dict_sources.md index 01952e18717..ef61edbf1a2 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/en/query_language/dicts/external_dicts_dict_sources.md @@ -25,14 +25,14 @@ The source is configured in the `source` section. Types of sources (`source_type`): -- [Local file](#dicts-external_dicts_dict_sources-local_file) -- [Executable file](#dicts-external_dicts_dict_sources-executable) -- [HTTP(s)](#dicts-external_dicts_dict_sources-http) +- [Local file]() +- [Executable file]() +- [HTTP(s)]() - DBMS - - [MySQL](#dicts-external_dicts_dict_sources-mysql) - - [ClickHouse](#dicts-external_dicts_dict_sources-clickhouse) - - [MongoDB](#dicts-external_dicts_dict_sources-mongodb) - - [ODBC](#dicts-external_dicts_dict_sources-odbc) + - [MySQL]() + - [ClickHouse]() + - [MongoDB]() + - [ODBC]() @@ -58,7 +58,7 @@ Setting fields: ## Executable File -Working with executable files depends on [how the dictionary is stored in memory](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout). If the dictionary is stored using `cache` and `complex_key_cache`, ClickHouse requests the necessary keys by sending a request to the executable file's `STDIN`. +Working with executable files depends on [how the dictionary is stored in memory](external_dicts_dict_layout.md). If the dictionary is stored using `cache` and `complex_key_cache`, ClickHouse requests the necessary keys by sending a request to the executable file's `STDIN`. Example of settings: @@ -80,7 +80,7 @@ Setting fields: ## HTTP(s) -Working with an HTTP(s) server depends on [how the dictionary is stored in memory](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout). If the dictionary is stored using `cache` and `complex_key_cache`, ClickHouse requests the necessary keys by sending a request via the `POST` method. +Working with an HTTP(s) server depends on [how the dictionary is stored in memory](external_dicts_dict_layout.md). If the dictionary is stored using `cache` and `complex_key_cache`, ClickHouse requests the necessary keys by sending a request via the `POST` method. Example of settings: @@ -93,7 +93,7 @@ Example of settings: ``` -In order for ClickHouse to access an HTTPS resource, you must [configure openSSL](../../operations/server_settings/settings.md#server_settings-openSSL) in the server configuration. +In order for ClickHouse to access an HTTPS resource, you must [configure openSSL](../../operations/server_settings/settings.md) in the server configuration. Setting fields: @@ -122,7 +122,7 @@ Setting fields: - `db` – Name of the database. Omit it if the database name is set in the `` parameters. - `table` – Name of the table and schema if exists. - `connection_string` – Connection string. -- `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime). +- `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](external_dicts_dict_lifetime.md). ClickHouse receives quoting symbols from ODBC-driver and quote all settings in queries to driver, so it's necessary to set table name accordingly to table name case in database. @@ -350,7 +350,7 @@ Setting fields: - `where ` – The selection criteria. Optional parameter. -- `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime). +- `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](external_dicts_dict_lifetime.md). MySQL can be connected on a local host via sockets. To do this, set `host` and `socket`. @@ -393,14 +393,14 @@ Example of settings: Setting fields: -- `host` – The ClickHouse host. If it is a local host, the query is processed without any network activity. To improve fault tolerance, you can create a [Distributed](../../operations/table_engines/distributed.md#table_engines-distributed) table and enter it in subsequent configurations. +- `host` – The ClickHouse host. If it is a local host, the query is processed without any network activity. To improve fault tolerance, you can create a [Distributed](../../operations/table_engines/distributed.md) table and enter it in subsequent configurations. - `port` – The port on the ClickHouse server. - `user` – Name of the ClickHouse user. - `password` – Password of the ClickHouse user. - `db` – Name of the database. - `table` – Name of the table. - `where ` – The selection criteria. May be omitted. -- `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime). +- `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Updating dictionaries](external_dicts_dict_lifetime.md). diff --git a/docs/en/query_language/dicts/external_dicts_dict_structure.md b/docs/en/query_language/dicts/external_dicts_dict_structure.md index b499a474a4d..eb8f46dba66 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_structure.md +++ b/docs/en/query_language/dicts/external_dicts_dict_structure.md @@ -25,8 +25,8 @@ Overall structure: Columns are described in the structure: -- `` - [key column](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure-key). -- `` - [data column](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure-attributes). There can be a large number of columns. +- `` - [key column](external_dicts_dict_structure.md). +- `` - [data column](external_dicts_dict_structure.md). There can be a large number of columns. @@ -60,12 +60,12 @@ Configuration fields: ### Composite Key -The key can be a `tuple` from any types of fields. The [layout](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) in this case must be `complex_key_hashed` or `complex_key_cache`. +The key can be a `tuple` from any types of fields. The [layout](external_dicts_dict_layout.md) in this case must be `complex_key_hashed` or `complex_key_cache`. !!! tip A composite key can consist of a single element. This makes it possible to use a string as the key, for instance. -The key structure is set in the element ``. Key fields are specified in the same format as the dictionary [attributes](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure-attributes). Example: +The key structure is set in the element ``. Key fields are specified in the same format as the dictionary [attributes](external_dicts_dict_structure.md). Example: ```xml diff --git a/docs/en/query_language/dicts/index.md b/docs/en/query_language/dicts/index.md index 1c61a6534f6..a553a51fb28 100644 --- a/docs/en/query_language/dicts/index.md +++ b/docs/en/query_language/dicts/index.md @@ -4,12 +4,12 @@ A dictionary is a mapping (`key -> attributes`) that is convenient for various t ClickHouse supports special functions for working with dictionaries that can be used in queries. It is easier and more efficient to use dictionaries with functions than a `JOIN` with reference tables. -[NULL](../syntax.md#null-literal) values can't be stored in a dictionary. +[NULL](../syntax.md) values can't be stored in a dictionary. ClickHouse supports: - [Built-in dictionaries](internal_dicts.md#internal_dicts) with a specific [set of functions](../functions/ym_dict_functions.md#ym_dict_functions). -- [Plug-in (external) dictionaries](external_dicts.md#dicts-external_dicts) with a [set of functions](../functions/ext_dict_functions.md#ext_dict_functions). +- [Plug-in (external) dictionaries](external_dicts.md) with a [set of functions](../functions/ext_dict_functions.md#ext_dict_functions). [Original article](https://clickhouse.yandex/docs/en/query_language/dicts/) diff --git a/docs/en/query_language/functions/array_functions.md b/docs/en/query_language/functions/array_functions.md index 1a8858b8dcc..975fd9022cb 100644 --- a/docs/en/query_language/functions/array_functions.md +++ b/docs/en/query_language/functions/array_functions.md @@ -55,8 +55,7 @@ arrayConcat(arrays) **Parameters** -- `arrays` – Arbitrary number of arguments of [Array][../../data_types/array.md#data_type-array] type. - +- `arrays` – Arbitrary number of arguments of [Array][../../data_types/array.md **Example** ``` sql diff --git a/docs/en/query_language/functions/ext_dict_functions.md b/docs/en/query_language/functions/ext_dict_functions.md index ea692769404..d7b40ff6d6d 100644 --- a/docs/en/query_language/functions/ext_dict_functions.md +++ b/docs/en/query_language/functions/ext_dict_functions.md @@ -2,7 +2,7 @@ # Functions for working with external dictionaries -For information on connecting and configuring external dictionaries, see "[External dictionaries](../dicts/external_dicts.md#dicts-external_dicts)". +For information on connecting and configuring external dictionaries, see "[External dictionaries](../dicts/external_dicts.md)". ## dictGetUInt8, dictGetUInt16, dictGetUInt32, dictGetUInt64 diff --git a/docs/en/query_language/functions/functions_for_nulls.md b/docs/en/query_language/functions/functions_for_nulls.md index d25de3332e5..67927dc879a 100644 --- a/docs/en/query_language/functions/functions_for_nulls.md +++ b/docs/en/query_language/functions/functions_for_nulls.md @@ -2,7 +2,7 @@ ## isNull -Checks whether the argument is [NULL](../syntax.md#null-literal). +Checks whether the argument is [NULL](../syntax.md). ``` isNull(x) @@ -46,7 +46,7 @@ WHERE isNull(y) ## isNotNull -Checks whether the argument is [NULL](../syntax.md#null-literal). +Checks whether the argument is [NULL](../syntax.md). ``` isNotNull(x) @@ -207,8 +207,7 @@ SELECT nullIf(1, 2) ## assumeNotNull -Results in a value of type [Nullable](../../data_types/nullable.md#data_type-nullable) for a non- `Nullable`, if the value is not `NULL`. - +Results in a value of type [Nullable](../../data_types/nullable.md ``` assumeNotNull(x) ``` diff --git a/docs/en/query_language/functions/geo.md b/docs/en/query_language/functions/geo.md index 0620dbbe776..13fc8673746 100644 --- a/docs/en/query_language/functions/geo.md +++ b/docs/en/query_language/functions/geo.md @@ -77,8 +77,8 @@ pointInPolygon((x, y), [(a, b), (c, d) ...], ...) **Input values** -- `(x, y)` — Coordinates of a point on the plane. Data type — [Tuple](../../data_types/tuple.md#data_type-tuple) — A tuple of two numbers. -- `[(a, b), (c, d) ...]` — Polygon vertices. Data type — [Array](../../data_types/array.md#data_type-array). Each vertex is represented by a pair of coordinates `(a, b)`. Vertices should be specified in a clockwise or counterclockwise order. The minimum number of vertices is 3. The polygon must be constant. +- `(x, y)` — Coordinates of a point on the plane. Data type — [Tuple](../../data_types/tuple.md) — A tuple of two numbers. +- `[(a, b), (c, d) ...]` — Polygon vertices. Data type — [Array](../../data_types/array.md). Each vertex is represented by a pair of coordinates `(a, b)`. Vertices should be specified in a clockwise or counterclockwise order. The minimum number of vertices is 3. The polygon must be constant. - The function also supports polygons with holes (cut out sections). In this case, add polygons that define the cut out sections using additional arguments of the function. The function does not support non-simply-connected polygons. **Returned values** diff --git a/docs/en/query_language/functions/in_functions.md b/docs/en/query_language/functions/in_functions.md index 3e267e55dd7..be43498c5a4 100644 --- a/docs/en/query_language/functions/in_functions.md +++ b/docs/en/query_language/functions/in_functions.md @@ -2,7 +2,7 @@ ## in, notIn, globalIn, globalNotIn -See the section [IN operators](../select.md/#query_language-in_operators). +See the section [IN operators](../select.md/). ## tuple(x, y, ...), operator (x, y, ...) diff --git a/docs/en/query_language/functions/other_functions.md b/docs/en/query_language/functions/other_functions.md index a8090fc30d4..674fd97ae08 100644 --- a/docs/en/query_language/functions/other_functions.md +++ b/docs/en/query_language/functions/other_functions.md @@ -298,7 +298,7 @@ Accepts a MAC address in the format AA:BB:CC:DD:EE:FF (colon-separated numbers i ## getSizeOfEnumType -Returns the number of fields in [Enum](../../data_types/enum.md#data_type-enum). +Returns the number of fields in [Enum](../../data_types/enum.md). ``` getSizeOfEnumType(value) @@ -407,7 +407,7 @@ defaultValueOfArgumentType(expression) - `0` for numbers. - Empty string for strings. -- `ᴺᵁᴸᴸ` for [Nullable](../../data_types/nullable.md#data_type-nullable). +- `ᴺᵁᴸᴸ` for [Nullable](../../data_types/nullable.md). **Example** @@ -445,7 +445,7 @@ The expression passed to the function is not calculated, but ClickHouse applies **Example** -Here is a table with the test data for [ontime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime). +Here is a table with the test data for [ontime](../../getting_started/example_datasets/ontime.md). ``` SELECT count() FROM ontime diff --git a/docs/en/query_language/functions/type_conversion_functions.md b/docs/en/query_language/functions/type_conversion_functions.md index 9753533e2e3..9eff4491bc6 100644 --- a/docs/en/query_language/functions/type_conversion_functions.md +++ b/docs/en/query_language/functions/type_conversion_functions.md @@ -14,7 +14,7 @@ ## toDecimal32(value, S), toDecimal64(value, S), toDecimal128(value, S) -Converts `value` to [Decimal](../../data_types/decimal.md#data_type-decimal) of precision `S`. The `value` can be a number or a string. The `S` (scale) parameter specifies the number of decimal places. +Converts `value` to [Decimal](../../data_types/decimal.md) of precision `S`. The `value` can be a number or a string. The `S` (scale) parameter specifies the number of decimal places. ## toString @@ -125,7 +125,7 @@ SELECT Conversion to FixedString(N) only works for arguments of type String or FixedString(N). -Type conversion to [Nullable](../../data_types/nullable.md#data_type-nullable) and back is supported. Example: +Type conversion to [Nullable](../../data_types/nullable.md) and back is supported. Example: ``` SELECT toTypeName(x) FROM t_null diff --git a/docs/en/query_language/index.md b/docs/en/query_language/index.md index bc8b8cfd876..3f0ba2c8a51 100644 --- a/docs/en/query_language/index.md +++ b/docs/en/query_language/index.md @@ -1,10 +1,10 @@ # SQL Reference * [SELECT](select.md#select) -* [INSERT INTO](insert_into.md#queries-insert) -* [CREATE](create.md#create-database) +* [INSERT INTO](insert_into.md) +* [CREATE](create.md) * [ALTER](alter.md#query_language_queries_alter) -* [Other types of queries](misc.md#miscellanous-queries) +* [Other types of queries](misc.md) [Original article](https://clickhouse.yandex/docs/en/query_language/) diff --git a/docs/en/query_language/insert_into.md b/docs/en/query_language/insert_into.md index 8af0c949191..9b1edab2ac8 100644 --- a/docs/en/query_language/insert_into.md +++ b/docs/en/query_language/insert_into.md @@ -15,7 +15,7 @@ The query can specify a list of columns to insert `[(c1, c2, c3)]`. In this case - The values calculated from the `DEFAULT` expressions specified in the table definition. - Zeros and empty strings, if `DEFAULT` expressions are not defined. -If [strict_insert_defaults=1](../operations/settings/settings.md#settings-strict_insert_defaults), columns that do not have `DEFAULT` defined must be listed in the query. +If [strict_insert_defaults=1](../operations/settings/settings.md), columns that do not have `DEFAULT` defined must be listed in the query. Data can be passed to the INSERT in any [format](../interfaces/formats.md#formats) supported by ClickHouse. The format must be specified explicitly in the query: diff --git a/docs/en/query_language/misc.md b/docs/en/query_language/misc.md index 16b2b7a007c..148f4fe69f9 100644 --- a/docs/en/query_language/misc.md +++ b/docs/en/query_language/misc.md @@ -213,7 +213,7 @@ TRUNCATE TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] Removes all data from a table. When the clause `IF EXISTS` is omitted, the query returns an error if the table does not exist. -The `TRUNCATE` query is not supported for [View](../operations/table_engines/view.md#table_engines-view), [File](../operations/table_engines/file.md#table_engines-file), [URL](../operations/table_engines/url.md#table_engines-url) and [Null](../operations/table_engines/null.md#table_engines-null) table engines. +The `TRUNCATE` query is not supported for [View](../operations/table_engines/view.md#table_engines-view), [File](../operations/table_engines/file.md#table_engines-file), [URL](../operations/table_engines/url.md#table_engines-url) and [Null](../operations/table_engines/null.md) table engines. ## USE diff --git a/docs/en/query_language/operators.md b/docs/en/query_language/operators.md index 35ce7ced71e..cef9ec07f99 100644 --- a/docs/en/query_language/operators.md +++ b/docs/en/query_language/operators.md @@ -53,7 +53,7 @@ Groups of operators are listed in order of priority (the higher it is in the lis ## Operators for Working With Data Sets -*See the section [IN operators](select.md/#query_language-in_operators).* +*See the section [IN operators](select.md/).* `a IN ...` – The `in(a, b) function` @@ -134,7 +134,7 @@ ClickHouse supports the `IS NULL` and `IS NOT NULL` operators. ### IS NULL -- For [Nullable](../data_types/nullable.md#data_type-nullable) type values, the `IS NULL` operator returns: +- For [Nullable](../data_types/nullable.md) type values, the `IS NULL` operator returns: - `1`, if the value is `NULL`. - `0` otherwise. - For other values, the `IS NULL` operator always returns `0`. @@ -157,7 +157,7 @@ WHERE isNull(y) ### IS NOT NULL -- For [Nullable](../data_types/nullable.md#data_type-nullable) type values, the `IS NOT NULL` operator returns: +- For [Nullable](../data_types/nullable.md) type values, the `IS NOT NULL` operator returns: - `0`, if the value is `NULL`. - `1` otherwise. - For other values, the `IS NOT NULL` operator always returns `1`. diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index b93fb23cba4..8eda93e5a4e 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -341,7 +341,7 @@ The corresponding conversion can be performed before the WHERE/PREWHERE clause ( Joins the data in the usual [SQL JOIN](https://en.wikipedia.org/wiki/Join_(SQL)) sense. !!! info "Note" - Not related to [ARRAY JOIN](#select-array-join). + Not related to [ARRAY JOIN](). ``` sql @@ -351,7 +351,7 @@ FROM (ON )|(USING ) ... ``` -The table names can be specified instead of `` and ``. This is equivalent to the `SELECT * FROM table` subquery, except in a special case when the table has the [Join](../operations/table_engines/join.md#table-engine-join) engine – an array prepared for joining. +The table names can be specified instead of `` and ``. This is equivalent to the `SELECT * FROM table` subquery, except in a special case when the table has the [Join](../operations/table_engines/join.md) engine – an array prepared for joining. **Supported types of `JOIN`** @@ -368,7 +368,7 @@ You may skip the `OUTER` keyword it is implied by default. If `ALL` is specified and the right table has several matching rows, the data will be multiplied by the number of these rows. It is a normal `JOIN` behavior from standard SQL. If `ANY` is specified and the right table has several matching rows, only the first one found is joined. If the right table has only one matching row, the results of `ANY` and `ALL` are the same. -You can set the default value of strictness with session configuration parameter [join_default_strictness](../operations/settings/settings.md#session-setting-join_default_strictness). +You can set the default value of strictness with session configuration parameter [join_default_strictness](../operations/settings/settings.md). **`GLOBAL` distribution** @@ -376,7 +376,7 @@ When using a normal `JOIN`, the query is sent to remote servers. Subqueries are When using `GLOBAL ... JOIN`, first the requestor server runs a subquery to calculate the right table. This temporary table is passed to each remote server, and queries are run on them using the temporary data that was transmitted. -Be careful when using `GLOBAL`. For more information, see the section [Distributed subqueries](#queries-distributed-subqueries). +Be careful when using `GLOBAL`. For more information, see the section [Distributed subqueries](). **Usage Recommendations** @@ -439,13 +439,13 @@ Each time a query is run with the same `JOIN`, the subquery is run again – the In some cases, it is more efficient to use `IN` instead of `JOIN`. Among the various types of `JOIN`, the most efficient is `ANY LEFT JOIN`, then `ANY INNER JOIN`. The least efficient are `ALL LEFT JOIN` and `ALL INNER JOIN`. -If you need a `JOIN` for joining with dimension tables (these are relatively small tables that contain dimension properties, such as names for advertising campaigns), a `JOIN` might not be very convenient due to the bulky syntax and the fact that the right table is re-accessed for every query. For such cases, there is an "external dictionaries" feature that you should use instead of `JOIN`. For more information, see the section [External dictionaries](dicts/external_dicts.md#dicts-external_dicts). +If you need a `JOIN` for joining with dimension tables (these are relatively small tables that contain dimension properties, such as names for advertising campaigns), a `JOIN` might not be very convenient due to the bulky syntax and the fact that the right table is re-accessed for every query. For such cases, there is an "external dictionaries" feature that you should use instead of `JOIN`. For more information, see the section [External dictionaries](dicts/external_dicts.md). #### NULL processing -The JOIN behavior is affected by the [join_use_nulls](../operations/settings/settings.md#settings-join_use_nulls) setting. With `join_use_nulls=1`, `JOIN` works like in standard SQL. +The JOIN behavior is affected by the [join_use_nulls](../operations/settings/settings.md) setting. With `join_use_nulls=1`, `JOIN` works like in standard SQL. -If the JOIN keys are [Nullable](../data_types/nullable.md#data_types-nullable) fields, the rows where at least one of the keys has the value [NULL](syntax.md#null-literal) are not joined. +If the JOIN keys are [Nullable](../data_types/nullable.md#data_types-nullable) fields, the rows where at least one of the keys has the value [NULL](syntax.md) are not joined. @@ -515,7 +515,7 @@ A constant can't be specified as arguments for aggregate functions. Example: sum #### NULL processing -For grouping, ClickHouse interprets [NULL](syntax.md#null-literal) as a value, and `NULL=NULL`. +For grouping, ClickHouse interprets [NULL](syntax.md) as a value, and `NULL=NULL`. Here's an example to show what this means. @@ -698,7 +698,7 @@ The result will be the same as if GROUP BY were specified across all the fields DISTINCT is not supported if SELECT has at least one array column. -`DISTINCT` works with [NULL](syntax.md#null-literal) as if `NULL` were a specific value, and `NULL=NULL`. In other words, in the `DISTINCT` results, different combinations with `NULL` only occur once. +`DISTINCT` works with [NULL](syntax.md) as if `NULL` were a specific value, and `NULL=NULL`. In other words, in the `DISTINCT` results, different combinations with `NULL` only occur once. ### LIMIT Clause @@ -819,7 +819,7 @@ A subquery in the IN clause is always run just one time on a single server. Ther #### NULL processing -During request processing, the IN operator assumes that the result of an operation with [NULL](syntax.md#null-literal) is always equal to `0`, regardless of whether `NULL` is on the right or left side of the operator. `NULL` values are not included in any dataset, do not correspond to each other and cannot be compared. +During request processing, the IN operator assumes that the result of an operation with [NULL](syntax.md) is always equal to `0`, regardless of whether `NULL` is on the right or left side of the operator. `NULL` values are not included in any dataset, do not correspond to each other and cannot be compared. Here is an example with the `t_null` table: @@ -857,7 +857,7 @@ FROM t_null There are two options for IN-s with subqueries (similar to JOINs): normal `IN` / `JOIN` and `GLOBAL IN` / `GLOBAL JOIN`. They differ in how they are run for distributed query processing. !!! attention - Remember that the algorithms described below may work differently depending on the [settings](../operations/settings/settings.md#settings-distributed_product_mode) `distributed_product_mode` setting. + Remember that the algorithms described below may work differently depending on the [settings](../operations/settings/settings.md) `distributed_product_mode` setting. When using the regular IN, the query is sent to remote servers, and each of them runs the subqueries in the `IN` or `JOIN` clause. diff --git a/docs/en/query_language/syntax.md b/docs/en/query_language/syntax.md index 3ab5d44a526..cd8152664b4 100644 --- a/docs/en/query_language/syntax.md +++ b/docs/en/query_language/syntax.md @@ -78,13 +78,13 @@ Tuples have a special purpose for use in the IN clause of a SELECT query. Tuples Indicates that the value is missing. -In order to store `NULL` in a table field, it must be of the [Nullable](../data_types/nullable.md#data_type-nullable) type. +In order to store `NULL` in a table field, it must be of the [Nullable](../data_types/nullable.md) type. Depending on the data format (input or output), `NULL` may have a different representation. For more information, see the documentation for [data formats](../interfaces/formats.md#formats). There are many nuances to processing `NULL`. For example, if at least one of the arguments of a comparison operation is `NULL`, the result of this operation will also be `NULL`. The same is true for multiplication, addition, and other operations. For more information, read the documentation for each operation. -In queries, you can check `NULL` using the [IS NULL](operators.md#operator-is-null) and [IS NOT NULL](operators.md#operator-is-not-null) operators and the related functions `isNull` and `isNotNull`. +In queries, you can check `NULL` using the [IS NULL](operators.md#operator-is-null) and [IS NOT NULL](operators.md) operators and the related functions `isNull` and `isNotNull`. ## Functions @@ -113,13 +113,13 @@ expr AS alias For example, `SELECT b.column_name from t b`. - In the [CAST function](functions/type_conversion_functions.md#type_conversion_function-cast), the `AS` keyword has another meaning. See the description of the function. + In the [CAST function](functions/type_conversion_functions.md), the `AS` keyword has another meaning. See the description of the function. - `expr` — any expression supported by ClickHouse. For example `SELECT column_name * 2 AS double FROM some_table`. -- `alias` — [string literal](#syntax-string_literal). If an alias contains spaces, enclose it in double quotes or backticks. +- `alias` — [string literal](). If an alias contains spaces, enclose it in double quotes or backticks. For example, `SELECT "table t".col_name FROM t AS "table t"`. diff --git a/docs/en/query_language/table_functions/remote.md b/docs/en/query_language/table_functions/remote.md index 834dbf30be7..49ba0f83cc3 100644 --- a/docs/en/query_language/table_functions/remote.md +++ b/docs/en/query_language/table_functions/remote.md @@ -49,7 +49,7 @@ example01-{01..02}-1 If you have multiple pairs of curly brackets, it generates the direct product of the corresponding sets. -Addresses and parts of addresses in curly brackets can be separated by the pipe symbol (|). In this case, the corresponding sets of addresses are interpreted as replicas, and the query will be sent to the first healthy replica. However, the replicas are iterated in the order currently set in the [load_balancing](../../operations/settings/settings.md#settings-load_balancing) setting. +Addresses and parts of addresses in curly brackets can be separated by the pipe symbol (|). In this case, the corresponding sets of addresses are interpreted as replicas, and the query will be sent to the first healthy replica. However, the replicas are iterated in the order currently set in the [load_balancing](../../operations/settings/settings.md) setting. Example: diff --git a/docs/fa/data_types/float.md b/docs/fa/data_types/float.md index 77a17d6eca7..6c48b71d9a4 100644 --- a/docs/fa/data_types/float.md +++ b/docs/fa/data_types/float.md @@ -84,7 +84,7 @@ SELECT 0 / 0
    -قوانین مربوط به مرتب سازی ` Nan ` را در بخش [ORDER BY clause](../query_language/select.md#query_language-queries-order_by) ببینید. +قوانین مربوط به مرتب سازی ` Nan ` را در بخش [ORDER BY clause](../query_language/select.md) ببینید.
    [مقاله اصلی](https://clickhouse.yandex/docs/fa/data_types/float/) diff --git a/docs/fa/images/column_oriented.gif b/docs/fa/images/column_oriented.gif index 15f4b12e697ac40c60bf77f964645316410da946..5a0e5b8e15ef0314540506256cacd898a1d3a71e 100644 GIT binary patch delta 83 zcmV-Z0IdJ5;{x@&0m;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7y -فایل های Schema در فایلی قرار دارند که این فایل در دایرکتوری مشخص شده کانفیگ [ format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) قرار گرفته اند. +فایل های Schema در فایلی قرار دارند که این فایل در دایرکتوری مشخص شده کانفیگ [ format_schema_path](../operations/server_settings/settings.md) قرار گرفته اند. عملیات Deserialization موثر است و معمولا لود سیستم را افزایش نمی دهد. diff --git a/docs/fa/introduction/distinctive_features.md b/docs/fa/introduction/distinctive_features.md index 94d4198e12e..1eafdbd6863 100644 --- a/docs/fa/introduction/distinctive_features.md +++ b/docs/fa/introduction/distinctive_features.md @@ -61,7 +61,7 @@ ClickHouse روش های مختلفی برای کسب دقیق performance ار ClickHouse از روش asynchronous multimaster replication استفاده می کند. بعد از نوشتن داده در یکی از replica های موجود، داده به صورت توزیع شده به بقیه replica ها منتقل می شود. این سیستم داده های مشابه را در replica های مختلف نگه داری می کند. در اکثر موارد که سیستم fail می شوند، داده ها به صورت اتوماتیک restore می شوند و یا در موارد پیچیده به صورت نیمه اتوماتیک restore می شوند. -برای اطلاعات بیشتر، به بخش [replication داده ها](../operations/table_engines/replication.md#table_engines-replication) مراجعه کنید. +برای اطلاعات بیشتر، به بخش [replication داده ها](../operations/table_engines/replication.md) مراجعه کنید. [مقاله اصلی](https://clickhouse.yandex/docs/fa/introduction/distinctive_features/) diff --git a/docs/fa/introduction/performance.md b/docs/fa/introduction/performance.md index 2fb2a9dc036..517bb340198 100644 --- a/docs/fa/introduction/performance.md +++ b/docs/fa/introduction/performance.md @@ -4,7 +4,7 @@ با توجه به نتایج تست های Yandex، ClickHouse بهترین عملکرد را برای سناریوهای عملیاتی قابل مقایسه با دیگر سیستم های در کلاس خود را از خود نشان داد. این تست ها شامل بالاترین توان عملیاتی برای query های طولانی، و کمترین latency برای query های کوتاه بود. نتایج این تست های در [صفحه ی جدا](https://clickhouse.yandex/benchmark.html) موجود است. -benchmark های زیادی وجود دارند که این نتایج را تایید می کنند. میتوانید این نتایج را جستجو کنید و یا [این لینک های benchmark](https://clickhouse.yandex/#independent-benchmarks). مستقل را ببینید. +benchmark های زیادی وجود دارند که این نتایج را تایید می کنند. میتوانید این نتایج را جستجو کنید و یا [این لینک های benchmark](https://clickhouse.yandex/). مستقل را ببینید. ## توان عملیاتی برای یک query بزرگ diff --git a/docs/ru/data_types/array.md b/docs/ru/data_types/array.md index 450c4cf5178..d1864c8e2d8 100644 --- a/docs/ru/data_types/array.md +++ b/docs/ru/data_types/array.md @@ -49,7 +49,7 @@ SELECT ## Особенности работы с типами данных -При создании массива "на лету" ClickHouse автоматически определяет тип аргументов как наиболее узкий тип данных, в котором можно хранить все перечисленные аргументы. Если среди аргументов есть [NULL](../query_language/syntax.md#null-literal) или аргумент типа [Nullable](nullable.md#data_type-nullable), то тип элементов массива — [Nullable](nullable.md#data_type-nullable). +При создании массива "на лету" ClickHouse автоматически определяет тип аргументов как наиболее узкий тип данных, в котором можно хранить все перечисленные аргументы. Если среди аргументов есть [NULL](../query_language/syntax.md#null-literal) или аргумент типа [Nullable](nullable.md#data_type-nullable), то тип элементов массива — [Nullable](nullable.md). Если ClickHouse не смог подобрать тип данных, то он сгенерирует исключение. Это произойдёт, например, при попытке создать массив одновременно со строками и числами `SELECT array(1, 'a')`. diff --git a/docs/ru/data_types/enum.md b/docs/ru/data_types/enum.md index 62250d8667b..9c7a2bb79fb 100644 --- a/docs/ru/data_types/enum.md +++ b/docs/ru/data_types/enum.md @@ -76,9 +76,9 @@ SELECT toTypeName(CAST('a', 'Enum8(\'a\' = 1, \'b\' = 2)')) Для каждого из значений прописывается число в диапазоне `-128 .. 127` для `Enum8` или в диапазоне `-32768 .. 32767` для `Enum16`. Все строки должны быть разными, числа - тоже. Разрешена пустая строка. При указании такого типа (в определении таблицы), числа могут идти не подряд и в произвольном порядке. При этом, порядок не имеет значения. -Ни строка, ни цифровое значение в `Enum` не могут быть [NULL](../query_language/syntax.md#null-literal). +Ни строка, ни цифровое значение в `Enum` не могут быть [NULL](../query_language/syntax.md). -`Enum` может быть передан в тип [Nullable](nullable.md#data_type-nullable). Таким образом, если создать таблицу запросом +`Enum` может быть передан в тип [Nullable](nullable.md). Таким образом, если создать таблицу запросом ``` CREATE TABLE t_enum_nullable diff --git a/docs/ru/data_types/float.md b/docs/ru/data_types/float.md index 8f50419cf92..395d53cda7d 100644 --- a/docs/ru/data_types/float.md +++ b/docs/ru/data_types/float.md @@ -65,6 +65,6 @@ SELECT 0 / 0 └──────────────┘ ``` - Смотрите правила сортировки `NaN` в разделе [Секция ORDER BY](../query_language/select.md#query_language-queries-order_by). + Смотрите правила сортировки `NaN` в разделе [Секция ORDER BY](../query_language/select.md). [Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/float/) diff --git a/docs/ru/data_types/nested_data_structures/aggregatefunction.md b/docs/ru/data_types/nested_data_structures/aggregatefunction.md index 384a432b494..99bc4d9932e 100644 --- a/docs/ru/data_types/nested_data_structures/aggregatefunction.md +++ b/docs/ru/data_types/nested_data_structures/aggregatefunction.md @@ -25,7 +25,7 @@ CREATE TABLE t ) ENGINE = ... ``` -[uniq](../../query_language/agg_functions/reference.md#agg_function-uniq), anyIf ([any](../../query_language/agg_functions/reference.md#agg_function-any)+[If](../../query_language/agg_functions/combinators.md#agg-functions-combinator-if)) и [quantiles](../../query_language/agg_functions/reference.md#agg_function-quantiles) — агрегатные функции, поддержанные в ClickHouse. +[uniq](../../query_language/agg_functions/reference.md#agg_function-uniq), anyIf ([any](../../query_language/agg_functions/reference.md#agg_function-any)+[If](../../query_language/agg_functions/combinators.md#agg-functions-combinator-if)) и [quantiles](../../query_language/agg_functions/reference.md) — агрегатные функции, поддержанные в ClickHouse. ## Особенности использования @@ -60,6 +60,6 @@ SELECT uniqMerge(state) FROM (SELECT uniqState(UserID) AS state FROM table GROUP ## Пример использования -Смотрите в описании движка [AggregatingMergeTree](../../operations/table_engines/aggregatingmergetree.md#table_engine-aggregatingmergetree). +Смотрите в описании движка [AggregatingMergeTree](../../operations/table_engines/aggregatingmergetree.md). [Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/nested_data_structures/aggregatefunction/) diff --git a/docs/ru/data_types/nullable.md b/docs/ru/data_types/nullable.md index e4b3bb830c7..0899e4b896c 100644 --- a/docs/ru/data_types/nullable.md +++ b/docs/ru/data_types/nullable.md @@ -2,9 +2,9 @@ # Nullable(TypeName) -Позволяет работать как со значением типа `TypeName` так и с отсутствием этого значения ([NULL](../query_language/syntax.md#null-literal)) в одной и той же переменной, в том числе хранить `NULL` в таблицах вместе со значения типа `TypeName`. Например, в столбце типа `Nullable(Int8)` можно хранить значения типа `Int8`, а в тех строках, где значения нет, будет храниться `NULL`. +Позволяет работать как со значением типа `TypeName` так и с отсутствием этого значения ([NULL](../query_language/syntax.md)) в одной и той же переменной, в том числе хранить `NULL` в таблицах вместе со значения типа `TypeName`. Например, в столбце типа `Nullable(Int8)` можно хранить значения типа `Int8`, а в тех строках, где значения нет, будет храниться `NULL`. -В качестве `TypeName` нельзя использовать составные типы данных [Array](array.md#data_type-array) и [Tuple](tuple.md#data_type-tuple). Составные типы данных могут содержать значения типа `Nullable`, например `Array(Nullable(Int8))`. +В качестве `TypeName` нельзя использовать составные типы данных [Array](array.md#data_type-array) и [Tuple](tuple.md). Составные типы данных могут содержать значения типа `Nullable`, например `Array(Nullable(Int8))`. Поле типа `Nullable` нельзя включать в индексы. diff --git a/docs/ru/data_types/special_data_types/nothing.md b/docs/ru/data_types/special_data_types/nothing.md index c452aa2f198..296c2df9c91 100644 --- a/docs/ru/data_types/special_data_types/nothing.md +++ b/docs/ru/data_types/special_data_types/nothing.md @@ -2,9 +2,9 @@ # Nothing -Этот тип данных предназначен только для того, чтобы представлять [NULL](../../query_language/syntax.md#null-literal), т.е. отсутствие значения. +Этот тип данных предназначен только для того, чтобы представлять [NULL](../../query_language/syntax.md), т.е. отсутствие значения. -Невозможно создать значение типа `Nothing`, поэтому он используется там, где значение не подразумевается. Например, `NULL` записывается как `Nullable(Nothing)` ([Nullable](../../data_types/nullable.md#data_type-nullable) — это тип данных, позволяющий хранить `NULL` в таблицах). Также тип `Nothing` используется для обозначения пустых массивов: +Невозможно создать значение типа `Nothing`, поэтому он используется там, где значение не подразумевается. Например, `NULL` записывается как `Nullable(Nothing)` ([Nullable](../../data_types/nullable.md) — это тип данных, позволяющий хранить `NULL` в таблицах). Также тип `Nothing` используется для обозначения пустых массивов: ```bash :) SELECT toTypeName(Array()) diff --git a/docs/ru/data_types/tuple.md b/docs/ru/data_types/tuple.md index ad761610b23..6d81ba36531 100644 --- a/docs/ru/data_types/tuple.md +++ b/docs/ru/data_types/tuple.md @@ -4,7 +4,7 @@ Кортеж из элементов любого [типа](index.md#data_types). Элементы кортежа могут быть одного или разных типов. -Кортежи нельзя хранить в таблицах (кроме таблиц типа Memory). Они используется для временной группировки столбцов. Столбцы могут группироваться при использовании выражения IN в запросе, а также для указания нескольких формальных параметров лямбда-функций. Подробнее смотрите разделы [Операторы IN](../query_language/select.md#query_language-in_operators), [Функции высшего порядка](../query_language/functions/higher_order_functions.md#higher_order_functions). +Кортежи нельзя хранить в таблицах (кроме таблиц типа Memory). Они используется для временной группировки столбцов. Столбцы могут группироваться при использовании выражения IN в запросе, а также для указания нескольких формальных параметров лямбда-функций. Подробнее смотрите разделы [Операторы IN](../query_language/select.md), [Функции высшего порядка](../query_language/functions/higher_order_functions.md#higher_order_functions). Кортежи могут быть результатом запроса. В этом случае, в текстовых форматах кроме JSON, значения выводятся в круглых скобках через запятую. В форматах JSON, кортежи выводятся в виде массивов (в квадратных скобках). @@ -34,7 +34,7 @@ SELECT ## Особенности работы с типами данных -При создании кортежа "на лету" ClickHouse автоматически определяет тип каждого аргументов как минимальный из типов, который может сохранить значение аргумента. Если аргумент — [NULL](../query_language/syntax.md#null-literal), то тип элемента кортежа — [Nullable](nullable.md#data_type-nullable). +При создании кортежа "на лету" ClickHouse автоматически определяет тип каждого аргументов как минимальный из типов, который может сохранить значение аргумента. Если аргумент — [NULL](../query_language/syntax.md#null-literal), то тип элемента кортежа — [Nullable](nullable.md). Пример автоматического определения типа данных: diff --git a/docs/ru/images/column_oriented.gif b/docs/ru/images/column_oriented.gif index 15f4b12e697ac40c60bf77f964645316410da946..5a0e5b8e15ef0314540506256cacd898a1d3a71e 100644 GIT binary patch delta 83 zcmV-Z0IdJ5;{x@&0m;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7y @@ -141,7 +141,7 @@ SearchPhrase=дизайн штор count()=1064 SearchPhrase=баку count()=1000 ``` -[NULL](../query_language/syntax.md#null-literal) форматируется в виде `\N`. +[NULL](../query_language/syntax.md) форматируется в виде `\N`. ``` sql SELECT * FROM t_null FORMAT TSKV @@ -266,7 +266,7 @@ JSON совместим с JavaScript. Для этого, дополнитель Этот формат подходит только для вывода результата выполнения запроса, но не для парсинга (приёма данных для вставки в таблицу). -ClickHouse поддерживает [NULL](../query_language/syntax.md#null-literal), который при выводе JSON будет отображен как `null`. +ClickHouse поддерживает [NULL](../query_language/syntax.md), который при выводе JSON будет отображен как `null`. Смотрите также формат JSONEachRow. @@ -360,7 +360,7 @@ ClickHouse поддерживает [NULL](../query_language/syntax.md#null-lite Рисуется полная сетка таблицы и, таким образом, каждая строчка занимает две строки в терминале. Каждый блок результата выводится в виде отдельной таблицы. Это нужно, чтобы можно было выводить блоки без буферизации результата (буферизация потребовалась бы, чтобы заранее вычислить видимую ширину всех значений.) -[NULL](../query_language/syntax.md#null-literal) выводится как `ᴺᵁᴸᴸ`. +[NULL](../query_language/syntax.md) выводится как `ᴺᵁᴸᴸ`. ``` sql SELECT * FROM t_null @@ -455,11 +455,10 @@ FixedString представлены просто как последовате Array представлены как длина в формате varint (unsigned [LEB128](https://en.wikipedia.org/wiki/LEB128)), а затем элементы массива, подряд. -Для поддержки [NULL](../query_language/syntax.md#null-literal) перед каждым значением типа [Nullable](../data_types/nullable.md#data_type-nullable) в строке добавлен дополнительный байт, который содержит 1 или 0. Если 1, то значение — `NULL` и этот байт трактуется как отдельное значение. Если 0, то после байта идёт не `NULL`-значение. - +Для поддержки [NULL](../query_language/syntax.md#null-literal) перед каждым значением типа [Nullable](../data_types/nullable.md ## Values -Выводит каждую строку в скобках. Строки разделены запятыми. После последней строки запятой нет. Значения внутри скобок также разделены запятыми. Числа выводятся в десятичном виде без кавычек. Массивы выводятся в квадратных скобках. Строки, даты, даты-с-временем выводятся в кавычках. Правила экранирования и особенности парсинга аналогичны формату [TabSeparated](#tabseparated). При форматировании, лишние пробелы не ставятся, а при парсинге - допустимы и пропускаются (за исключением пробелов внутри значений типа массив, которые недопустимы). [NULL](../query_language/syntax.md#null-literal) представляется как `NULL`. +Выводит каждую строку в скобках. Строки разделены запятыми. После последней строки запятой нет. Значения внутри скобок также разделены запятыми. Числа выводятся в десятичном виде без кавычек. Массивы выводятся в квадратных скобках. Строки, даты, даты-с-временем выводятся в кавычках. Правила экранирования и особенности парсинга аналогичны формату [TabSeparated](#tabseparated). При форматировании, лишние пробелы не ставятся, а при парсинге - допустимы и пропускаются (за исключением пробелов внутри значений типа массив, которые недопустимы). [NULL](../query_language/syntax.md) представляется как `NULL`. Минимальный набор символов, которых вам необходимо экранировать при передаче в Values формате: одинарная кавычка и обратный слеш. @@ -471,7 +470,7 @@ Array представлены как длина в формате varint (unsig Выводит каждое значение на отдельной строке, с указанием имени столбца. Формат удобно использовать для вывода одной-нескольких строк, если каждая строка состоит из большого количества столбцов. -[NULL](../query_language/syntax.md#null-literal) выводится как `ᴺᵁᴸᴸ`. +[NULL](../query_language/syntax.md) выводится как `ᴺᵁᴸᴸ`. Пример: @@ -614,7 +613,7 @@ struct Message { ``` -Файлы со схемами находятся в файле, который находится в каталоге указанном в параметре [format_schema_path](../operations/server_settings/settings.md#server_settings-format_schema_path) конфигурации сервера. +Файлы со схемами находятся в файле, который находится в каталоге указанном в параметре [format_schema_path](../operations/server_settings/settings.md) конфигурации сервера. Десериализация эффективна и обычно не повышает нагрузку на систему. diff --git a/docs/ru/introduction/distinctive_features.md b/docs/ru/introduction/distinctive_features.md index db00c6af6c9..73d2826d16c 100644 --- a/docs/ru/introduction/distinctive_features.md +++ b/docs/ru/introduction/distinctive_features.md @@ -57,8 +57,8 @@ ClickHouse предоставляет различные способы разм ## Репликация данных и поддержка целостности -Используется асинхронная multimaster репликация. После записи на любую доступную реплику, данные распространяются на все остальные реплики в фоне. Система поддерживает полную идентичность данных на разных репликах. Восстановление после большинства сбоев осуществляется автоматически, а в сложных случаях — полуавтоматически. При необходимости, можно [включить кворумную запись](../operations/settings/settings.md#setting-insert_quorum) данных. +Используется асинхронная multimaster репликация. После записи на любую доступную реплику, данные распространяются на все остальные реплики в фоне. Система поддерживает полную идентичность данных на разных репликах. Восстановление после большинства сбоев осуществляется автоматически, а в сложных случаях — полуавтоматически. При необходимости, можно [включить кворумную запись](../operations/settings/settings.md) данных. -Подробнее смотрите раздел [Репликация данных](../operations/table_engines/replication.md#table_engines-replication). +Подробнее смотрите раздел [Репликация данных](../operations/table_engines/replication.md). [Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/distinctive_features/) diff --git a/docs/ru/introduction/performance.md b/docs/ru/introduction/performance.md index f9ac886971f..09381117764 100644 --- a/docs/ru/introduction/performance.md +++ b/docs/ru/introduction/performance.md @@ -2,7 +2,7 @@ По результатам внутреннего тестирования в Яндексе, ClickHouse обладает наиболее высокой производительностью (как наиболее высокой пропускной способностью на длинных запросах, так и наиболее низкой задержкой на коротких запросах), при соответствующем сценарии работы, среди доступных для тестирования систем подобного класса. Результаты тестирования можно посмотреть на [отдельной странице](https://clickhouse.yandex/benchmark.html). -Также это подтверждают многочисленные независимые бенчмарки. Их не сложно найти в Интернете самостоятельно, либо можно воспользоваться [небольшой коллекцией ссылок по теме](https://clickhouse.yandex/#independent-benchmarks). +Также это подтверждают многочисленные независимые бенчмарки. Их не сложно найти в Интернете самостоятельно, либо можно воспользоваться [небольшой коллекцией ссылок по теме](https://clickhouse.yandex/). ## Пропускная способность при обработке одного большого запроса diff --git a/docs/ru/operations/access_rights.md b/docs/ru/operations/access_rights.md index 93e496b3dc1..602b36e86f6 100644 --- a/docs/ru/operations/access_rights.md +++ b/docs/ru/operations/access_rights.md @@ -61,7 +61,7 @@ Здесь видно объявление двух пользователей - `default` и `web`. Пользователя `web` мы добавили самостоятельно. -Пользователь `default` выбирается в случаях, когда имя пользователя не передаётся. Также пользователь `default` может использоваться при распределённой обработке запроса - если в конфигурации кластера для сервера не указаны `user` и `password`. (см. раздел о движке [Distributed](../operations/table_engines/distributed.md#table_engines-distributed)). +Пользователь `default` выбирается в случаях, когда имя пользователя не передаётся. Также пользователь `default` может использоваться при распределённой обработке запроса - если в конфигурации кластера для сервера не указаны `user` и `password`. (см. раздел о движке [Distributed](../operations/table_engines/distributed.md)). Пользователь, который используется для обмена информацией между серверами, объединенными в кластер, не должен иметь существенных ограничений или квот - иначе распределённые запросы сломаются. @@ -87,8 +87,7 @@ Для продакшен использования, указывайте только элементы вида `ip` (IP-адреса и их маски), так как использование `host` и `host_regexp` может вызывать лишние задержки. -Далее указывается используемый профиль настроек пользователя (смотрите раздел "[Профили настроек](settings/settings_profiles.md#settings_profiles)"). Вы можете указать профиль по умолчанию - `default`. Профиль может называться как угодно; один и тот же профиль может быть указан для разных пользователей. Наиболее важная вещь, которую вы можете прописать в профиле настроек `readonly=1`, что обеспечивает доступ только на чтение. - +Далее указывается используемый профиль настроек пользователя (смотрите раздел "[Профили настроек](settings/settings_profiles.md Затем указывается используемая квота (смотрите раздел "[Квоты](quotas.md#quotas)"). Вы можете указать квоту по умолчанию — `default`. Она настроена в конфиге по умолчанию так, что только считает использование ресурсов, но никак их не ограничивает. Квота может называться как угодно. Одна и та же квота может быть указана для разных пользователей, в этом случае подсчёт использования ресурсов делается для каждого пользователя по отдельности. Также, в необязательном разделе `` можно указать перечень баз, к которым у пользователя будет доступ. По умолчанию пользователю доступны все базы. Можно указать базу данных `default`, в этом случае пользователь получит доступ к базе данных по умолчанию. diff --git a/docs/ru/operations/configuration_files.md b/docs/ru/operations/configuration_files.md index c99351f7308..00bb4865f36 100644 --- a/docs/ru/operations/configuration_files.md +++ b/docs/ru/operations/configuration_files.md @@ -14,7 +14,7 @@ Если указано `remove` - удалить элемент. -Также в конфиге могут быть указаны "подстановки". Если у элемента присутствует атрибут `incl`, то в качестве значения будет использована соответствующая подстановка из файла. По умолчанию, путь к файлу с подстановками - `/etc/metrika.xml`. Он может быть изменён в конфигурации сервера в элементе [include_from](server_settings/settings.md#server_settings-include_from). Значения подстановок указываются в элементах `/yandex/имя_подстановки` этого файла. Если подстановка, заданная в `incl` отсутствует, то в лог попадает соответствующая запись. Чтобы ClickHouse не писал в лог об отсутствии подстановки, необходимо указать атрибут `optional="true"` (например, настройка [macros](server_settings/settings.md#server_settings-macros)). +Также в конфиге могут быть указаны "подстановки". Если у элемента присутствует атрибут `incl`, то в качестве значения будет использована соответствующая подстановка из файла. По умолчанию, путь к файлу с подстановками - `/etc/metrika.xml`. Он может быть изменён в конфигурации сервера в элементе [include_from](server_settings/settings.md#server_settings-include_from). Значения подстановок указываются в элементах `/yandex/имя_подстановки` этого файла. Если подстановка, заданная в `incl` отсутствует, то в лог попадает соответствующая запись. Чтобы ClickHouse не писал в лог об отсутствии подстановки, необходимо указать атрибут `optional="true"` (например, настройка [macros](server_settings/settings.md)). Подстановки могут также выполняться из ZooKeeper. Для этого укажите у элемента атрибут `from_zk = "/path/to/node"`. Значение элемента заменится на содержимое узла `/path/to/node` в ZooKeeper. В ZooKeeper-узел также можно положить целое XML-поддерево, оно будет целиком вставлено в исходный элемент. diff --git a/docs/ru/operations/server_settings/settings.md b/docs/ru/operations/server_settings/settings.md index 3b6360ac9f8..bb86a77385c 100644 --- a/docs/ru/operations/server_settings/settings.md +++ b/docs/ru/operations/server_settings/settings.md @@ -78,7 +78,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Профиль настроек по умолчанию. -Профили настроек находятся в файле, указанном в параметре [user_config](#server_settings-users_config). +Профили настроек находятся в файле, указанном в параметре [user_config](). **Пример** @@ -97,7 +97,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat - Указывается абсолютным или относительно конфигурационного файла сервера. - Может содержать wildcard-ы \* и ?. -Смотрите также "[Внешние словари](../../query_language/dicts/external_dicts.md#dicts-external_dicts)". +Смотрите также "[Внешние словари](../../query_language/dicts/external_dicts.md)". **Пример** @@ -177,7 +177,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Настройка прореживания данных для Graphite. -Подробнее читайте в разделе [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md#table_engines-graphitemergetree). +Подробнее читайте в разделе [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md). **Пример** @@ -207,7 +207,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Порт для обращений к серверу по протоколу HTTP(s). -Если указан `https_port`, то требуется конфигурирование [openSSL](#server_settings-openSSL). +Если указан `https_port`, то требуется конфигурирование [openSSL](). Если указан `http_port`, то настройка openSSL игнорируется, даже если она задана. @@ -357,7 +357,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Можно не указывать, если реплицируемых таблицы не используются. -Подробнее смотрите в разделе "[Создание реплицируемых таблиц](../../operations/table_engines/replication.md#table_engines-replication-creation_of_rep_tables)". +Подробнее смотрите в разделе "[Создание реплицируемых таблиц](../../operations/table_engines/replication.md)". **Пример** @@ -369,7 +369,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ## mark_cache_size -Приблизительный размер (в байтах) кеша "засечек", используемых движками таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Приблизительный размер (в байтах) кеша "засечек", используемых движками таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md). Кеш общий для сервера, память выделяется по мере необходимости. Кеш не может быть меньше, чем 5368709120. @@ -425,7 +425,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Ограничение на удаление таблиц. -Если размер таблицы семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) превышает `max_table_size_to_drop` (в байтах), то ее нельзя удалить запросом DROP. +Если размер таблицы семейства [MergeTree](../../operations/table_engines/mergetree.md) превышает `max_table_size_to_drop` (в байтах), то ее нельзя удалить запросом DROP. Если таблицу все же необходимо удалить, не перезапуская при этом сервер ClickHouse, то необходимо создать файл `/flags/force_drop_table` и выполнить запрос DROP. @@ -443,7 +443,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ## merge_tree -Тонкая настройка таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Тонкая настройка таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md). Подробнее смотрите в заголовочном файле MergeTreeSettings.h. @@ -520,7 +520,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ## part_log -Логгирование событий, связанных с данными типа [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). Например, события добавления или мержа данных. Лог можно использовать для симуляции алгоритмов слияния, чтобы сравнивать их характеристики. Также, можно визуализировать процесс слияния. +Логгирование событий, связанных с данными типа [MergeTree](../../operations/table_engines/mergetree.md). Например, события добавления или мержа данных. Лог можно использовать для симуляции алгоритмов слияния, чтобы сравнивать их характеристики. Также, можно визуализировать процесс слияния. Запросы логгируются не в отдельный файл, а в таблицу ClickHouse. @@ -541,7 +541,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat - database - Имя базы данных. - table - Имя таблицы. -- partition_by - Устанавливает [произвольный ключ партиционирования](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key). +- partition_by - Устанавливает [произвольный ключ партиционирования](../../operations/table_engines/custom_partitioning_key.md). - flush_interval_milliseconds - Период сброса данных из буфера в памяти в таблицу. @@ -575,7 +575,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ## query_log -Настройка логгирования запросов, принятых с настройкой [log_queries=1](../settings/settings.md#settings_settings-log_queries). +Настройка логгирования запросов, принятых с настройкой [log_queries=1](../settings/settings.md). Запросы логгируются не в отдельный файл, а в таблицу ClickHouse. @@ -583,7 +583,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat - database - Имя базы данных. - table - Имя таблицы. -- partition_by - Устанавливает [произвольный ключ партиционирования](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key). +- partition_by - Устанавливает [произвольный ключ партиционирования](../../operations/table_engines/custom_partitioning_key.md). - flush_interval_milliseconds - Период сброса данных из буфера в памяти в таблицу. Если таблица не существует, то ClickHouse создаст её. Если структура журнала запросов изменилась при обновлении сервера ClickHouse, то таблица со старой структурой переименовывается, а новая таблица создается автоматически. @@ -605,7 +605,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Конфигурация кластеров, которые использует движок таблиц Distributed. -Пример настройки смотрите в разделе "[Движки таблиц/Distributed](../../operations/table_engines/distributed.md#table_engines-distributed)". +Пример настройки смотрите в разделе "[Движки таблиц/Distributed](../../operations/table_engines/distributed.md)". **Пример** @@ -663,9 +663,9 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ## uncompressed_cache_size -Размер кеша (в байтах) для несжатых данных, используемых движками таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Размер кеша (в байтах) для несжатых данных, используемых движками таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md). -Кеш единый для сервера. Память выделяется по-требованию. Кеш используется в том случае, если включена опция [use_uncompressed_cache](../settings/settings.md#settings-use_uncompressed_cache). +Кеш единый для сервера. Память выделяется по-требованию. Кеш используется в том случае, если включена опция [use_uncompressed_cache](../settings/settings.md). Несжатый кеш выгодно использовать для очень коротких запросов в отдельных случаях. @@ -677,7 +677,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ## user_files_path -Каталог с пользовательскими файлами. Используется в табличной функции [file()](../../query_language/table_functions/file.md#table_functions-file). +Каталог с пользовательскими файлами. Используется в табличной функции [file()](../../query_language/table_functions/file.md). **Пример** @@ -712,7 +712,7 @@ ClickHouse использует ZooKeeper для хранения метадан Параметр можно не указывать, если реплицированные таблицы не используются. -Подробно читайте в разделе "[Репликация](../../operations/table_engines/replication.md#table_engines-replication)". +Подробно читайте в разделе "[Репликация](../../operations/table_engines/replication.md)". **Пример** diff --git a/docs/ru/operations/settings/settings.md b/docs/ru/operations/settings/settings.md index 91271b2de5f..fd2a480d53a 100644 --- a/docs/ru/operations/settings/settings.md +++ b/docs/ru/operations/settings/settings.md @@ -4,7 +4,7 @@ ## distributed_product_mode -Изменяет поведение [распределенных подзапросов](../../query_language/select.md#queries-distributed-subrequests). +Изменяет поведение [распределенных подзапросов](../../query_language/select.md). ClickHouse применяет настройку в тех случаях, когда запрос содержит произведение распределённых таблиц, т.е. когда запрос к распределенной таблице содержит не-GLOBAL подзапрос к также распределенной таблице. @@ -13,7 +13,7 @@ ClickHouse применяет настройку в тех случаях, ко - Только подзапросы для IN, JOIN. - Только если в секции FROM используется распределённая таблица, содержащая более одного шарда. - Если подзапрос касается распределенной таблицы, содержащей более одного шарда, -- Не используется в случае табличной функции [remote](../../query_language/table_functions/remote.md#table_functions-remote). +- Не используется в случае табличной функции [remote](../../query_language/table_functions/remote.md). Возможные значения: @@ -26,7 +26,7 @@ ClickHouse применяет настройку в тех случаях, ко ## fallback_to_stale_replicas_for_distributed_queries -Форсирует запрос в устаревшую реплику в случае, если актуальные данные недоступны. Смотрите "[Репликация](../../operations/table_engines/replication.md#table_engines-replication)". +Форсирует запрос в устаревшую реплику в случае, если актуальные данные недоступны. Смотрите "[Репликация](../../operations/table_engines/replication.md)". Из устаревших реплик таблицы ClickHouse выбирает наиболее актуальную. @@ -42,7 +42,7 @@ ClickHouse применяет настройку в тех случаях, ко Работает с таблицами семейства MergeTree. -При `force_index_by_date=1` ClickHouse проверяет, есть ли в запросе условие на ключ даты, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Например, условие `Date != '2000-01-01'` подходит даже в том случае, когда соответствует всем данным в таблице (т.е. для выполнения запроса требуется full scan). Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". +При `force_index_by_date=1` ClickHouse проверяет, есть ли в запросе условие на ключ даты, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Например, условие `Date != '2000-01-01'` подходит даже в том случае, когда соответствует всем данным в таблице (т.е. для выполнения запроса требуется full scan). Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md)". @@ -52,7 +52,7 @@ ClickHouse применяет настройку в тех случаях, ко Работает с таблицами семейства MergeTree. -При `force_primary_key=1` ClickHouse проверяет, есть ли в запросе условие на первичный ключ, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". +При `force_primary_key=1` ClickHouse проверяет, есть ли в запросе условие на первичный ключ, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md)". @@ -107,7 +107,7 @@ ClickHouse применяет настройку в тех случаях, ко Установка логгирования запроса. -Запросы, переданные в ClickHouse с этой установкой, логгируются согласно правилам конфигурационного параметра сервера [query_log](../server_settings/settings.md#server_settings-query_log). +Запросы, переданные в ClickHouse с этой установкой, логгируются согласно правилам конфигурационного параметра сервера [query_log](../server_settings/settings.md). **Пример** : @@ -131,7 +131,7 @@ ClickHouse применяет настройку в тех случаях, ко ## max_replica_delay_for_distributed_queries -Отключает отстающие реплики при распределенных запросах. Смотрите "[Репликация](../../operations/table_engines/replication.md#table_engines-replication)". +Отключает отстающие реплики при распределенных запросах. Смотрите "[Репликация](../../operations/table_engines/replication.md)". Устанавливает время в секундах. Если оставание реплики больше установленного значения, то реплика не используется. @@ -163,8 +163,7 @@ ClickHouse применяет настройку в тех случаях, ко ## min_compress_block_size -Для таблиц типа "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". В целях уменьшения задержек при обработке запросов, блок сжимается при записи следующей засечки, если его размер не меньше min_compress_block_size. По умолчанию - 65 536. - +Для таблиц типа "[MergeTree](../../operations/table_engines/mergetree.md Реальный размер блока, если несжатых данных меньше max_compress_block_size, будет не меньше этого значения и не меньше объёма данных на одну засечку. Рассмотрим пример. Пусть index_granularity, указанная при создании таблицы - 8192. @@ -264,7 +263,7 @@ ClickHouse применяет настройку в тех случаях, ко ## stream_flush_interval_ms -Работает для таблиц со стриммингом в случае тайм-аута, или когда поток генерирует [max_insert_block_size](#settings-settings-max_insert_block_size) строк. +Работает для таблиц со стриммингом в случае тайм-аута, или когда поток генерирует [max_insert_block_size]() строк. Значение по умолчанию - 7500. @@ -352,9 +351,9 @@ ClickHouse применяет настройку в тех случаях, ко ## join_use_nulls -Влияет на поведение [JOIN](../../query_language/select.md#query_language-join). +Влияет на поведение [JOIN](../../query_language/select.md). -При `join_use_nulls=1` `JOIN` ведёт себя как в стандартном SQL, т.е. если при слиянии возникают пустые ячейки, то тип соответствующего поля преобразуется к [Nullable](../../data_types/nullable.md#data_type-nullable), а пустые ячейки заполняются значениями [NULL](../../query_language/syntax.md#null-literal). +При `join_use_nulls=1` `JOIN` ведёт себя как в стандартном SQL, т.е. если при слиянии возникают пустые ячейки, то тип соответствующего поля преобразуется к [Nullable](../../data_types/nullable.md#data_type-nullable), а пустые ячейки заполняются значениями [NULL](../../query_language/syntax.md). @@ -373,7 +372,7 @@ ClickHouse применяет настройку в тех случаях, ко Все реплики в кворуме консистентны, т.е. содержат данные всех более ранних запросов `INSERT`. Последовательность `INSERT` линеаризуется. -При чтении данных, записанных с `insert_quorum` можно использовать настройку [select_sequential_consistency](#setting-select_sequential_consistency). +При чтении данных, записанных с `insert_quorum` можно использовать настройку [select_sequential_consistency](). **ClickHouse генерирует исключение** @@ -382,8 +381,8 @@ ClickHouse применяет настройку в тех случаях, ко **См. также параметры** -- [insert_quorum_timeout](#setting-insert_quorum_timeout) -- [select_sequential_consistency](#setting-select_sequential_consistency) +- [insert_quorum_timeout]() +- [select_sequential_consistency]() @@ -395,8 +394,8 @@ ClickHouse применяет настройку в тех случаях, ко **См. также параметры** -- [insert_quorum](#setting-insert_quorum) -- [select_sequential_consistency](#setting-select_sequential_consistency) +- [insert_quorum]() +- [select_sequential_consistency]() @@ -411,7 +410,7 @@ ClickHouse применяет настройку в тех случаях, ко См. также параметры: -- [insert_quorum](#setting-insert_quorum) -- [insert_quorum_timeout](#setting-insert_quorum_timeout) +- [insert_quorum]() +- [insert_quorum_timeout]() [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/settings/settings/) diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index 94713ffae5e..a4a014d225f 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -122,7 +122,7 @@ default_expression String - выражение для значения по ум ## system.parts -Содержит информацию о кусках таблиц семейства [MergeTree](table_engines/mergetree.md#table_engines-mergetree). +Содержит информацию о кусках таблиц семейства [MergeTree](table_engines/mergetree.md). Каждая строка описывает один кусок данных. diff --git a/docs/ru/operations/table_engines/aggregatingmergetree.md b/docs/ru/operations/table_engines/aggregatingmergetree.md index 11c57bba43a..622bc3033ff 100644 --- a/docs/ru/operations/table_engines/aggregatingmergetree.md +++ b/docs/ru/operations/table_engines/aggregatingmergetree.md @@ -2,11 +2,11 @@ # AggregatingMergeTree -Движок наследует функциональность [MergeTree](mergetree.md#table_engines-mergetree), изменяя логику слияния кусков данных. Все строки с одинаковым первичным ключом (точнее, с одинаковым [ключом сортировки](mergetree.md#table_engines-mergetree-sorting_key)) ClickHouse заменяет на одну (в пределах одного куска данных), которая хранит объединение состояний агрегатных функций. +Движок наследует функциональность [MergeTree](mergetree.md#table_engines-mergetree), изменяя логику слияния кусков данных. Все строки с одинаковым первичным ключом (точнее, с одинаковым [ключом сортировки](mergetree.md)) ClickHouse заменяет на одну (в пределах одного куска данных), которая хранит объединение состояний агрегатных функций. Таблицы типа `AggregatingMergeTree` могут использоваться для инкрементальной агрегации данных, в том числе, для агрегирующих материализованных представлений. -Движок обрабатывает все столбцы типа [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction). +Движок обрабатывает все столбцы типа [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md). Использование `AggregatingMergeTree` оправдано только в том случае, когда это уменьшает количество строк на порядки. @@ -25,11 +25,11 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md#query_language-queries-create_table). +Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md). **Секции запроса** -При создании таблицы `AggregatingMergeTree` используются те же [секции](mergetree.md#table_engines-mergetree-configuring), что и при создании таблицы `MergeTree`. +При создании таблицы `AggregatingMergeTree` используются те же [секции](mergetree.md), что и при создании таблицы `MergeTree`.
    Устаревший способ создания таблицы diff --git a/docs/ru/operations/table_engines/dictionary.md b/docs/ru/operations/table_engines/dictionary.md index bc5e8e409ea..6a79f442232 100644 --- a/docs/ru/operations/table_engines/dictionary.md +++ b/docs/ru/operations/table_engines/dictionary.md @@ -2,7 +2,7 @@ # Dictionary -Движок `Dictionary` отображает данные [словаря](../../query_language/dicts/external_dicts.md#dicts-external_dicts) как таблицу ClickHouse. +Движок `Dictionary` отображает данные [словаря](../../query_language/dicts/external_dicts.md) как таблицу ClickHouse. Рассмотрим для примера словарь `products` со следующей конфигурацией: diff --git a/docs/ru/operations/table_engines/file.md b/docs/ru/operations/table_engines/file.md index 2cf9f3ff788..0c920e66edb 100644 --- a/docs/ru/operations/table_engines/file.md +++ b/docs/ru/operations/table_engines/file.md @@ -18,11 +18,11 @@ File(Format) `Format` должен быть таким, который ClickHouse может использовать и в запросах `INSERT` и в запросах `SELECT`. Полный список поддерживаемых форматов смотрите в разделе [Форматы](../../interfaces/formats.md#formats). -Сервер ClickHouse не позволяет указать путь к файлу, с которым будет работать `File`. Используется путь к хранилищу, определенный параметром [path](../server_settings/settings.md#server_settings-path) в конфигурации сервера. +Сервер ClickHouse не позволяет указать путь к файлу, с которым будет работать `File`. Используется путь к хранилищу, определенный параметром [path](../server_settings/settings.md) в конфигурации сервера. При создании таблицы с помощью `File(Format)` сервер ClickHouse создает в хранилище каталог с именем таблицы, а после добавления в таблицу данных помещает туда файл `data.Format`. -Можно вручную создать в хранилище каталог таблицы, поместить туда файл, затем на сервере ClickHouse добавить ([ATTACH](../../query_language/misc.md#queries-attach)) информацию о таблице, соответствующей имени каталога и прочитать из файла данные. +Можно вручную создать в хранилище каталог таблицы, поместить туда файл, затем на сервере ClickHouse добавить ([ATTACH](../../query_language/misc.md)) информацию о таблице, соответствующей имени каталога и прочитать из файла данные. !!! warning Будьте аккуратны с этой функциональностью, поскольку сервер ClickHouse не отслеживает внешние изменения данных. Если в файл будет производиться запись одновременно со стороны сервера ClickHouse и с внешней стороны, то результат непредсказуем. @@ -60,7 +60,7 @@ SELECT * FROM file_engine_table ## Использование движка в clickhouse-local -В [clickhouse-local](../utils/clickhouse-local.md#utils-clickhouse-local) движок в качестве параметра принимает не только формат, но и путь к файлу. В том числе можно указать стандартные потоки ввода/вывода цифровым или буквенным обозначением `0` или `stdin`, `1` или `stdout`. +В [clickhouse-local](../utils/clickhouse-local.md) движок в качестве параметра принимает не только формат, но и путь к файлу. В том числе можно указать стандартные потоки ввода/вывода цифровым или буквенным обозначением `0` или `stdin`, `1` или `stdout`. **Пример:** diff --git a/docs/ru/operations/table_engines/graphitemergetree.md b/docs/ru/operations/table_engines/graphitemergetree.md index fa789857751..60a407016da 100644 --- a/docs/ru/operations/table_engines/graphitemergetree.md +++ b/docs/ru/operations/table_engines/graphitemergetree.md @@ -8,13 +8,13 @@ Graphite хранит в ClickHouse полные данные, а получат - Без прореживания. - Используется движок [MergeTree](mergetree.md#table_engines-mergetree). + Используется движок [MergeTree](mergetree.md). - С прореживанием. Используется движок `GraphiteMergeTree`. -Движок наследует свойства MergeTree. Настройки прореживания данных задаются параметром [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) в конфигурации сервера . +Движок наследует свойства MergeTree. Настройки прореживания данных задаются параметром [graphite_rollup](../server_settings/settings.md) в конфигурации сервера . ## Использование движка diff --git a/docs/ru/operations/table_engines/kafka.md b/docs/ru/operations/table_engines/kafka.md index 8dc7b55e373..f747967cf19 100644 --- a/docs/ru/operations/table_engines/kafka.md +++ b/docs/ru/operations/table_engines/kafka.md @@ -105,7 +105,7 @@ Kafka SETTINGS SELECT level, sum(total) FROM daily GROUP BY level; ``` -Для улучшения производительности полученные сообщения группируются в блоки размера [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size). Если блок не удалось сформировать за [stream_flush_interval_ms](../settings/settings.md#settings-settings_stream_flush_interval_ms) миллисекунд, то данные будут сброшены в таблицу независимо от полноты блока. +Для улучшения производительности полученные сообщения группируются в блоки размера [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size). Если блок не удалось сформировать за [stream_flush_interval_ms](../settings/settings.md) миллисекунд, то данные будут сброшены в таблицу независимо от полноты блока. Чтобы остановить получение данных топика или изменить логику преобразования, отсоедините материализованное представление: diff --git a/docs/ru/operations/table_engines/materializedview.md b/docs/ru/operations/table_engines/materializedview.md index 843f0678a9a..b607dc08c09 100644 --- a/docs/ru/operations/table_engines/materializedview.md +++ b/docs/ru/operations/table_engines/materializedview.md @@ -1,5 +1,5 @@ # MaterializedView -Используется для реализации материализованных представлений (подробнее см. запрос [CREATE TABLE](../../query_language/create.md#query_language-queries-create_table)). Для хранения данных, использует другой движок, который был указан при создании представления. При чтении из таблицы, просто использует этот движок. +Используется для реализации материализованных представлений (подробнее см. запрос [CREATE TABLE](../../query_language/create.md)). Для хранения данных, использует другой движок, который был указан при создании представления. При чтении из таблицы, просто использует этот движок. [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/materializedview/) diff --git a/docs/ru/operations/table_engines/mergetree.md b/docs/ru/operations/table_engines/mergetree.md index 7351968e95b..c73d66374ec 100644 --- a/docs/ru/operations/table_engines/mergetree.md +++ b/docs/ru/operations/table_engines/mergetree.md @@ -5,7 +5,7 @@ Движок `MergeTree`, а также другие движки этого семейства (`*MergeTree`) — это наиболее функциональные движки таблиц ClickHousе. !!!info - Движок [Merge](merge.md#table_engine-merge) не относится к семейству `*MergeTree`. + Движок [Merge](merge.md) не относится к семейству `*MergeTree`. Основные возможности: @@ -13,13 +13,13 @@ Это позволяет создавать разреженный индекс небольшого объёма, который позволяет быстрее находить данные. -- Позволяет оперировать партициями, если задан [ключ партиционирования](custom_partitioning_key.md#table_engines-custom_partitioning_key). +- Позволяет оперировать партициями, если задан [ключ партиционирования](custom_partitioning_key.md). ClickHouse поддерживает отдельные операции с партициями, которые работают эффективнее, чем общие операции с этим же результатом над этими же данными. Также, ClickHouse автоматически отсекает данные по партициям там, где ключ партиционирования указан в запросе. Это также увеличивает эффективность выполнения запросов. - Поддерживает репликацию данных. - Для этого используется семейство таблиц `ReplicatedMergeTree`. Подробнее читайте в разделе [Репликация данных](replication.md#table_engines-replication). + Для этого используется семейство таблиц `ReplicatedMergeTree`. Подробнее читайте в разделе [Репликация данных](replication.md). - Поддерживает сэмплирование данных. @@ -43,21 +43,21 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md#query_language-queries-create_table). +Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md). **Секции запроса** - `ENGINE` — Имя и параметры движка. `ENGINE = MergeTree()`. Движок `MergeTree` не имеет параметров. -- `PARTITION BY` — [ключ партиционирования](custom_partitioning_key.md#table_engines-custom_partitioning_key). +- `PARTITION BY` — [ключ партиционирования](custom_partitioning_key.md). - Для партиционирования по месяцам используйте выражение `toYYYYMM(date_column)`, где `date_column` — столбец с датой типа [Date](../../data_types/date.md#data_type-date). В этом случае имена партиций имеют формат `"YYYYMM"`. + Для партиционирования по месяцам используйте выражение `toYYYYMM(date_column)`, где `date_column` — столбец с датой типа [Date](../../data_types/date.md). В этом случае имена партиций имеют формат `"YYYYMM"`. - `ORDER BY` — ключ сортировки. Кортеж столбцов или произвольных выражений. Пример: `ORDER BY (CounerID, EventDate)`. -- `PRIMARY KEY` - первичный ключ, если он [отличается от ключа сортировки](mergetree.md#table_engines-mergetree-sorting_key). +- `PRIMARY KEY` - первичный ключ, если он [отличается от ключа сортировки](mergetree.md). По умолчанию первичный ключ совпадает с ключом сортировки (который задаётся секцией `ORDER BY`). Поэтому в большинстве случаев секцию `PRIMARY KEY` отдельно указывать не нужно. @@ -79,8 +79,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa В примере мы устанавливаем партиционирование по месяцам. -Также мы задаем выражение для сэмплирования в виде хэша по идентификатору посетителя. Это позволяет псевдослучайным образом перемешать данные в таблице для каждого `CounterID` и `EventDate`. Если при выборке данных задать секцию [SAMPLE](../../query_language/select.md#select-section-sample) то ClickHouse вернёт равномерно-псевдослучайную выборку данных для подмножества посетителей. - +Также мы задаем выражение для сэмплирования в виде хэша по идентификатору посетителя. Это позволяет псевдослучайным образом перемешать данные в таблице для каждого `CounterID` и `EventDate`. Если при выборке данных задать секцию [SAMPLE](../../query_language/select.md `index_granularity` можно было не указывать, поскольку 8192 — это значение по умолчанию.
    Устаревший способ создания таблицы @@ -99,10 +98,9 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] **Параметры MergeTree()** -- `date-column` — имя столбца с типом [Date](../../data_types/date.md#data_type-date). На основе этого столбца ClickHouse автоматически создаёт партиции по месяцам. Имена партиций имеют формат `"YYYYMM"`. +- `date-column` — имя столбца с типом [Date](../../data_types/date.md). На основе этого столбца ClickHouse автоматически создаёт партиции по месяцам. Имена партиций имеют формат `"YYYYMM"`. - `sampling_expression` — выражение для сэмплирования. -- `(primary, key)` — первичный ключ. Тип — [Tuple()](../../data_types/tuple.md#data_type-tuple). Может состоять из произвольных выражений, но обычно это кортеж столбцов. Обязательно должен включать в себя выражение для сэмплирования, если оно задано. Не обязан включать в себя столбец с датой `date-column`. -- `index_granularity` — гранулярность индекса. Число строк данных между «засечками» индекса. Для большинства задач подходит значение 8192. +- `(primary, key)` — первичный ключ. Тип — [Tuple()](../../data_types/tuple.md- `index_granularity` — гранулярность индекса. Число строк данных между «засечками» индекса. Для большинства задач подходит значение 8192. **Пример** @@ -167,7 +165,7 @@ ClickHouse не требует уникального первичного кл ClickHouse сортирует данные по первичному ключу, поэтому чем выше однородность, тем лучше сжатие. -- Обеспечить дополнительную логику при слиянии кусков данных в движках [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) и [SummingMergeTree](summingmergetree.md#table_engine-summingmergetree). +- Обеспечить дополнительную логику при слиянии кусков данных в движках [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) и [SummingMergeTree](summingmergetree.md). В этом случае имеет смысл задать отдельный *ключ сортировки*, отличающийся от первичного ключа. @@ -193,8 +191,7 @@ ClickHouse не требует уникального первичного кл В этом сценарии имеет смысл оставить в первичном ключе всего несколько столбцов, которые обеспечат эффективную фильтрацию по индексу, а остальные столбцы-измерения добавить в выражение ключа сортировки. -[ALTER ключа сортировки](../../query_language/alter.md#query_language-queries-alter-key_alters) - легкая -операция, так как при одновременном добавлении нового столбца в таблицу и ключ сортировки не нужно изменять +[ALTER ключа сортировки](../../query_language/alter.mdоперация, так как при одновременном добавлении нового столбца в таблицу и ключ сортировки не нужно изменять данные кусков (они остаются упорядоченными и по новому выражению ключа). ### Использование индексов и партиций в запросах @@ -227,7 +224,7 @@ ClickHouse будет использовать индекс по первичн SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%' ``` -Чтобы проверить, сможет ли ClickHouse использовать индекс при выполнении запроса, используйте настройки [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) и [force_primary_key](../settings/settings.md#settings-settings-force_primary_key). +Чтобы проверить, сможет ли ClickHouse использовать индекс при выполнении запроса, используйте настройки [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) и [force_primary_key](../settings/settings.md). Ключ партиционирования по месяцам обеспечивает чтение только тех блоков данных, которые содержат даты из нужного диапазона. При этом блок данных может содержать данные за многие даты (до целого месяца). В пределах одного блока данные упорядочены по первичному ключу, который может не содержать дату в качестве первого столбца. В связи с этим, при использовании запроса с указанием условия только на дату, но не на префикс первичного ключа, будет читаться данных больше, чем за одну дату. diff --git a/docs/ru/operations/table_engines/mysql.md b/docs/ru/operations/table_engines/mysql.md index f452d34c4a6..6b2a14f4edc 100644 --- a/docs/ru/operations/table_engines/mysql.md +++ b/docs/ru/operations/table_engines/mysql.md @@ -28,6 +28,6 @@ MySQL('host:port', 'database', 'table', 'user', 'password'[, replace_query, 'on_ Остальные условия и ограничение выборки `LIMIT` будут выполнены в ClickHouse только после выполнения запроса к MySQL. -Движок `MySQL` не поддерживает тип данных [Nullable](../../data_types/nullable.md#data_type-nullable), поэтому при чтении данных из таблиц MySQL `NULL` преобразуются в значения по умолчанию для заданного типа столбца, обычно это 0 или пустая строка. +Движок `MySQL` не поддерживает тип данных [Nullable](../../data_types/nullable.md), поэтому при чтении данных из таблиц MySQL `NULL` преобразуются в значения по умолчанию для заданного типа столбца, обычно это 0 или пустая строка. [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/table_engines/mysql/) diff --git a/docs/ru/operations/table_engines/replacingmergetree.md b/docs/ru/operations/table_engines/replacingmergetree.md index 3f0f20173d1..c364859cf67 100644 --- a/docs/ru/operations/table_engines/replacingmergetree.md +++ b/docs/ru/operations/table_engines/replacingmergetree.md @@ -1,6 +1,6 @@ # ReplacingMergeTree -Движок отличается от [MergeTree](mergetree.md#table_engines-mergetree) тем, что выполняет удаление дублирующихся записей с одинаковым значением первичного ключа (точнее, с одинаковым значением [ключа сортировки](mergetree.md#table_engines-mergetree-sorting_key)). +Движок отличается от [MergeTree](mergetree.md#table_engines-mergetree) тем, что выполняет удаление дублирующихся записей с одинаковым значением первичного ключа (точнее, с одинаковым значением [ключа сортировки](mergetree.md)). Дедупликация данных производится лишь во время слияний. Слияние происходят в фоне в неизвестный момент времени, на который вы не можете ориентироваться. Некоторая часть данных может остаться необработанной. Хотя вы можете вызвать внеочередное слияние с помощью запроса `OPTIMIZE`, на это не стоит рассчитывать, так как запрос `OPTIMIZE` приводит к чтению и записи большого объёма данных. @@ -21,7 +21,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md#query_language-queries-create_table). +Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md). **Параметры ReplacingMergeTree** @@ -34,7 +34,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] **Секции запроса** -При создании таблицы `ReplacingMergeTree` используются те же [секции](mergetree.md#table_engines-mergetree-configuring), что и при создании таблицы `MergeTree`. +При создании таблицы `ReplacingMergeTree` используются те же [секции](mergetree.md), что и при создании таблицы `MergeTree`.
    Устаревший способ создания таблицы diff --git a/docs/ru/operations/table_engines/replication.md b/docs/ru/operations/table_engines/replication.md index 1da2ea892b7..2994138df84 100644 --- a/docs/ru/operations/table_engines/replication.md +++ b/docs/ru/operations/table_engines/replication.md @@ -48,7 +48,7 @@ Если в конфигурационном файле не настроен ZooKeeper, то вы не сможете создать реплицируемые таблицы, а уже имеющиеся реплицируемые таблицы будут доступны в режиме только на чтение. -При запросах `SELECT`, ZooKeeper не используется, т.е. репликация не влияет на производительность `SELECT` и запросы работают так же быстро, как и для нереплицируемых таблиц. При запросах к распределенным реплицированным таблицам поведение ClickHouse регулируется настройками [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) и [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries). +При запросах `SELECT`, ZooKeeper не используется, т.е. репликация не влияет на производительность `SELECT` и запросы работают так же быстро, как и для нереплицируемых таблиц. При запросах к распределенным реплицированным таблицам поведение ClickHouse регулируется настройками [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) и [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md). При каждом запросе `INSERT` (точнее, на каждый вставляемый блок данных; запрос INSERT содержит один блок, или по блоку на каждые `max_insert_block_size = 1048576` строк), делается около десятка записей в ZooKeeper в рамках нескольких транзакций. Это приводит к некоторому увеличению задержек при `INSERT`, по сравнению с нереплицируемыми таблицами. Но если придерживаться обычных рекомендаций - вставлять данные пачками не более одного `INSERT` в секунду, то это не составляет проблем. На всём кластере ClickHouse, использующим для координации один кластер ZooKeeper, может быть в совокупности несколько сотен `INSERT` в секунду. Пропускная способность при вставке данных (количество строчек в секунду) такая же высокая, как для нереплицируемых таблиц. @@ -56,11 +56,11 @@ Репликация асинхронная, мульти-мастер. Запросы `INSERT` (а также `ALTER`) можно отправлять на любой доступный сервер. Данные вставятся на сервер, где выполнен запрос, а затем скопируются на остальные серверы. В связи с асинхронностью, только что вставленные данные появляются на остальных репликах с небольшой задержкой. Если часть реплик недоступна, данные на них запишутся тогда, когда они станут доступны. Если реплика доступна, то задержка составляет столько времени, сколько требуется для передачи блока сжатых данных по сети. -По умолчанию, запрос INSERT ждёт подтверждения записи только от одной реплики. Если данные были успешно записаны только на одну реплику, и сервер с этой репликой перестал существовать, то записанные данные будут потеряны. Вы можете включить подтверждение записи от нескольких реплик, используя настройку [insert_quorum](../settings/settings.md#setting-insert_quorum). +По умолчанию, запрос INSERT ждёт подтверждения записи только от одной реплики. Если данные были успешно записаны только на одну реплику, и сервер с этой репликой перестал существовать, то записанные данные будут потеряны. Вы можете включить подтверждение записи от нескольких реплик, используя настройку [insert_quorum](../settings/settings.md). Каждый блок данных записывается атомарно. Запрос INSERT разбивается на блоки данных размером до `max_insert_block_size = 1048576` строк. То есть, если в запросе `INSERT` менее 1048576 строк, то он делается атомарно. -Блоки данных дедуплицируются. При многократной записи одного и того же блока данных (блоков данных одинакового размера, содержащих одни и те же строчки в одном и том же порядке), блок будет записан только один раз. Это сделано для того, чтобы в случае сбоя в сети, когда клиентское приложение не может понять, были ли данные записаны в БД, можно было просто повторить запрос `INSERT`. При этом не имеет значения, на какую реплику будут отправлены INSERT-ы с одинаковыми данными. То есть, обеспечивается идемпотентность `INSERT`. Параметры дедупликации регулируются настройками сервера [merge_tree](../server_settings/settings.md#server_settings-merge_tree). +Блоки данных дедуплицируются. При многократной записи одного и того же блока данных (блоков данных одинакового размера, содержащих одни и те же строчки в одном и том же порядке), блок будет записан только один раз. Это сделано для того, чтобы в случае сбоя в сети, когда клиентское приложение не может понять, были ли данные записаны в БД, можно было просто повторить запрос `INSERT`. При этом не имеет значения, на какую реплику будут отправлены INSERT-ы с одинаковыми данными. То есть, обеспечивается идемпотентность `INSERT`. Параметры дедупликации регулируются настройками сервера [merge_tree](../server_settings/settings.md). При репликации, по сети передаются только исходные вставляемые данные. Дальнейшие преобразования данных (слияния) координируются и делаются на всех репликах одинаковым образом. За счёт этого минимизируется использование сети, и благодаря этому, репликация хорошо работает при расположении реплик в разных датацентрах. (Стоит заметить, что дублирование данных в разных датацентрах, по сути, является основной задачей репликации). @@ -169,7 +169,7 @@ sudo -u clickhouse touch /var/lib/clickhouse/flags/force_restore_data Затем запустите сервер (перезапустите, если уже запущен). Данные будут скачаны с реплик. -В качестве альтернативного варианта восстановления, вы можете удалить из ZooKeeper информацию о потерянной реплике - `/path_to_table/replica_name`, и затем создать реплику заново, как написано в разделе "[Создание реплицируемых таблиц](#table_engines-replication-creation_of_rep_tables)". +В качестве альтернативного варианта восстановления, вы можете удалить из ZooKeeper информацию о потерянной реплике - `/path_to_table/replica_name`, и затем создать реплику заново, как написано в разделе "[Создание реплицируемых таблиц]()". Отсутствует ограничение на использование сетевой полосы при восстановлении. Имейте это ввиду, если восстанавливаете сразу много реплик. diff --git a/docs/ru/operations/table_engines/summingmergetree.md b/docs/ru/operations/table_engines/summingmergetree.md index 9b98b88bd9b..841060e303d 100644 --- a/docs/ru/operations/table_engines/summingmergetree.md +++ b/docs/ru/operations/table_engines/summingmergetree.md @@ -2,7 +2,7 @@ # SummingMergeTree -Движок наследует функциональность [MergeTree](mergetree.md#table_engines-mergetree). Отличие заключается в том, что для таблиц `SummingMergeTree` при слиянии кусков данных ClickHouse все строки с одинаковым первичным ключом (точнее, с одинаковым [ключом сортировки](mergetree.md#table_engines-mergetree-sorting_key)) заменяет на одну, которая хранит только суммы значений из столбцов с цифровым типом данных. Если ключ сортировки подобран таким образом, что одному значению ключа соответствует много строк, это значительно уменьшает объем хранения и ускоряет последующую выборку данных. +Движок наследует функциональность [MergeTree](mergetree.md#table_engines-mergetree). Отличие заключается в том, что для таблиц `SummingMergeTree` при слиянии кусков данных ClickHouse все строки с одинаковым первичным ключом (точнее, с одинаковым [ключом сортировки](mergetree.md)) заменяет на одну, которая хранит только суммы значений из столбцов с цифровым типом данных. Если ключ сортировки подобран таким образом, что одному значению ключа соответствует много строк, это значительно уменьшает объем хранения и ускоряет последующую выборку данных. Мы рекомендуем использовать движок в паре с `MergeTree`. В `MergeTree` храните полные данные, а `SummingMergeTree` используйте для хранения агрегированных данных, например, при подготовке отчетов. Такой подход позволит не утратить ценные данные из-за неправильно выбранного первичного ключа. @@ -21,7 +21,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md#query_language-queries-create_table). +Описание параметров запроса смотрите в [описании запроса](../../query_language/create.md). **Параметры SummingMergeTree** @@ -32,7 +32,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] **Секции запроса** -При создании таблицы `SummingMergeTree` использутся те же [секции](mergetree.md#table_engines-mergetree-configuring) запроса, что и при создании таблицы `MergeTree`. +При создании таблицы `SummingMergeTree` использутся те же [секции](mergetree.md) запроса, что и при создании таблицы `MergeTree`.
    Устаревший способ создания таблицы @@ -73,7 +73,7 @@ ORDER BY key :) INSERT INTO summtt Values(1,1),(1,2),(2,1) ``` -ClickHouse может не полностью просуммировать все строки ([смотрите ниже по тексту](#summingmergetree-data-processing)), поэтому при запросе мы используем агрегатную функцию `sum` и секцию `GROUP BY`. +ClickHouse может не полностью просуммировать все строки ([смотрите ниже по тексту]()), поэтому при запросе мы используем агрегатную функцию `sum` и секцию `GROUP BY`. ```sql SELECT key, sum(value) FROM summtt GROUP BY key @@ -91,7 +91,7 @@ SELECT key, sum(value) FROM summtt GROUP BY key При вставке данных в таблицу они сохраняются как есть. Периодически ClickHouse выполняет слияние вставленных кусков данных и именно в этот момент производится суммирование и замена многих строк с одинаковым первичным ключом на одну для каждого результирующего куска данных. -ClickHouse может слить куски данных таким образом, что не все строки с одинаковым первичным ключом окажутся в одном финальном куске, т.е. суммирование будет не полным. Поэтому, при выборке данных (`SELECT`) необходимо использовать агрегатную функцию [sum()](../../query_language/agg_functions/reference.md#agg_function-sum) и секцию `GROUP BY` как описано в примере выше. +ClickHouse может слить куски данных таким образом, что не все строки с одинаковым первичным ключом окажутся в одном финальном куске, т.е. суммирование будет не полным. Поэтому, при выборке данных (`SELECT`) необходимо использовать агрегатную функцию [sum()](../../query_language/agg_functions/reference.md) и секцию `GROUP BY` как описано в примере выше. ### Общие правила суммирования @@ -105,7 +105,7 @@ ClickHouse может слить куски данных таким образо ### Суммирование в столбцах AggregateFunction -Для столбцов типа [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) ClickHouse выполняет агрегацию согласно заданной функции, повторяя поведение движка [AggregatingMergeTree](aggregatingmergetree.md#table_engine-aggregatingmergetree). +Для столбцов типа [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) ClickHouse выполняет агрегацию согласно заданной функции, повторяя поведение движка [AggregatingMergeTree](aggregatingmergetree.md). ### Вложенные структуры @@ -127,7 +127,7 @@ ClickHouse может слить куски данных таким образо [(1, 100), (2, 150)] + [(1, -100)] -> [(2, 150)] ``` -При запросе данных используйте функцию [sumMap(key, value)](../../query_language/agg_functions/reference.md#agg_function-summap) для агрегации `Map`. +При запросе данных используйте функцию [sumMap(key, value)](../../query_language/agg_functions/reference.md) для агрегации `Map`. Для вложенной структуры данных не нужно указывать её столбцы в кортеже столбцов для суммирования. diff --git a/docs/ru/operations/utils/index.md b/docs/ru/operations/utils/index.md index aa07954d8c6..06193cadcc4 100644 --- a/docs/ru/operations/utils/index.md +++ b/docs/ru/operations/utils/index.md @@ -1,6 +1,5 @@ # Утилиты ClickHouse -* [clickhouse-local](clickhouse-local.md#utils-clickhouse-local) - позволяет выполнять SQL-запросы над данными без установки сервера ClickHouse подобно тому, как это делает `awk`. -* [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) - копирует (и перешардирует) данные с одного кластера на другой. +* [clickhouse-local](clickhouse-local.md* [clickhouse-copier](clickhouse-copier.md) данные с одного кластера на другой. [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/utils/) diff --git a/docs/ru/query_language/agg_functions/parametric_functions.md b/docs/ru/query_language/agg_functions/parametric_functions.md index 7f7432fb671..999aff99679 100644 --- a/docs/ru/query_language/agg_functions/parametric_functions.md +++ b/docs/ru/query_language/agg_functions/parametric_functions.md @@ -62,7 +62,7 @@ windowFunnel(window)(timestamp, cond1, cond2, cond3, ...) **Параметры** - `window` — ширина скользящего окна по времени в секундах. -- `timestamp` — имя столбца, содержащего отметки времени. Тип данных [DateTime](../../data_types/datetime.md#data_type-datetime) или [UInt32](../../data_types/int_uint.md#data_type-int). +- `timestamp` — имя столбца, содержащего отметки времени. Тип данных [DateTime](../../data_types/datetime.md#data_type-datetime) или [UInt32](../../data_types/int_uint.md). - `cond1`, `cond2`... — условия или данные, описывающие цепочку событий. Тип данных — `UInt8`. Значения могут быть 0 или 1. **Алгоритм** diff --git a/docs/ru/query_language/agg_functions/reference.md b/docs/ru/query_language/agg_functions/reference.md index 557070e3ac5..449d2efd665 100644 --- a/docs/ru/query_language/agg_functions/reference.md +++ b/docs/ru/query_language/agg_functions/reference.md @@ -35,7 +35,7 @@ anyHeavy(column) **Пример** -Возьмём набор данных [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) и выберем произвольное часто встречающееся значение в столбце `AirlineID`. +Возьмём набор данных [OnTime](../../getting_started/example_datasets/ontime.md) и выберем произвольное часто встречающееся значение в столбце `AirlineID`. ```sql SELECT anyHeavy(AirlineID) AS res @@ -463,7 +463,7 @@ topK(N)(column) **Пример** -Возьмём набор данных [OnTime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime) и выберем 3 наиболее часто встречающихся значения в столбце `AirlineID`. +Возьмём набор данных [OnTime](../../getting_started/example_datasets/ontime.md) и выберем 3 наиболее часто встречающихся значения в столбце `AirlineID`. ```sql SELECT topK(3)(AirlineID) AS res diff --git a/docs/ru/query_language/alter.md b/docs/ru/query_language/alter.md index 744c1063d88..e996e0342d8 100644 --- a/docs/ru/query_language/alter.md +++ b/docs/ru/query_language/alter.md @@ -75,7 +75,7 @@ MODIFY ORDER BY new_expression ``` Работает только для таблиц семейства [`MergeTree`](../operations/table_engines/mergetree.md) (в том числе [реплицированных](../operations/table_engines/replication.md)). После выполнения запроса -[ключ сортировки](../operations/table_engines/mergetree.md#table_engines-mergetree-sorting_key) таблицы +[ключ сортировки](../operations/table_engines/mergetree.md) таблицы заменяется на `new_expression` (выражение или кортеж выражений). Первичный ключ при этом остаётся прежним. Операция затрагивает только метаданные. Чтобы сохранить свойство упорядоченности кусков данных по ключу diff --git a/docs/ru/query_language/dicts/external_dicts.md b/docs/ru/query_language/dicts/external_dicts.md index d1df2c4990c..d0c8bdc4465 100644 --- a/docs/ru/query_language/dicts/external_dicts.md +++ b/docs/ru/query_language/dicts/external_dicts.md @@ -2,16 +2,16 @@ # Внешние словари -Существует возможность подключать собственные словари из различных источников данных. Источником данных для словаря может быть локальный текстовый/исполняемый файл, HTTP(s) ресурс или другая СУБД. Подробнее смотрите в разделе "[Источники внешних словарей](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources)". +Существует возможность подключать собственные словари из различных источников данных. Источником данных для словаря может быть локальный текстовый/исполняемый файл, HTTP(s) ресурс или другая СУБД. Подробнее смотрите в разделе "[Источники внешних словарей](external_dicts_dict_sources.md)". ClickHouse: - Полностью или частично хранит словари в оперативной памяти. - Периодически обновляет их и динамически подгружает отсутствующие значения. Т.е. словари можно подгружать динамически. -Конфигурация внешних словарей находится в одном или нескольких файлах. Путь к конфигурации указывается в параметре [dictionaries_config](../../operations/server_settings/settings.md#server_settings-dictionaries_config). +Конфигурация внешних словарей находится в одном или нескольких файлах. Путь к конфигурации указывается в параметре [dictionaries_config](../../operations/server_settings/settings.md). -Словари могут загружаться при старте сервера или при первом использовании, в зависимости от настройки [dictionaries_lazy_load](../../operations/server_settings/settings.md#server_settings-dictionaries_lazy_load). +Словари могут загружаться при старте сервера или при первом использовании, в зависимости от настройки [dictionaries_lazy_load](../../operations/server_settings/settings.md). Конфигурационный файл словарей имеет вид: @@ -35,18 +35,18 @@ ClickHouse: ``` -В одном файле можно [сконфигурировать](external_dicts_dict.md#dicts-external_dicts_dict) произвольное количество словарей. Формат файла сохраняется даже если словарь один (т.е. ` `). +В одном файле можно [сконфигурировать](external_dicts_dict.md). ->Вы можете преобразовывать значения по небольшому словарю, описав его в запросе `SELECT` (см. функцию [transform](../functions/other_functions.md#other_functions-transform)). Эта функциональность не связана с внешними словарями. +>Вы можете преобразовывать значения по небольшому словарю, описав его в запросе `SELECT` (см. функцию [transform](../functions/other_functions.md)). Эта функциональность не связана с внешними словарями. Смотрите также: -- [Настройка внешнего словаря](external_dicts_dict.md#dicts-external_dicts_dict) -- [Хранение словарей в памяти](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) -- [Обновление словарей](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) -- [Источники внешних словарей](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources) -- [Ключ и поля словаря](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) +- [Настройка внешнего словаря](external_dicts_dict.md) +- [Хранение словарей в памяти](external_dicts_dict_layout.md) +- [Обновление словарей](external_dicts_dict_lifetime.md) +- [Источники внешних словарей](external_dicts_dict_sources.md) +- [Ключ и поля словаря](external_dicts_dict_structure.md) - [Функции для работы с внешними словарями](../functions/ext_dict_functions.md#ext_dict_functions) [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict.md b/docs/ru/query_language/dicts/external_dicts_dict.md index 0c56593fdd1..0aeb2d0ed6c 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict.md +++ b/docs/ru/query_language/dicts/external_dicts_dict.md @@ -27,9 +27,5 @@ ``` - name - Идентификатор, под которым словарь будет доступен для использования. Используйте символы `[a-zA-Z0-9_\-]`. -- [source](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources) - Источник словаря. -- [layout](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) - Размещение словаря в памяти. -- [structure](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) - Структура словаря. Ключ и атрибуты, которые можно получить по ключу. -- [lifetime](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) - Периодичность обновления словарей. - +- [source](external_dicts_dict_sources.md- [layout](external_dicts_dict_layout.md- [structure](external_dicts_dict_structure.md- [lifetime](external_dicts_dict_lifetime.md [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict_layout.md b/docs/ru/query_language/dicts/external_dicts_dict_layout.md index 199b6926f7a..f7d50a757d0 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_layout.md @@ -2,11 +2,11 @@ # Хранение словарей в памяти -Словари можно размещать в памяти [множеством способов](#dicts-external_dicts_dict_layout-manner). +Словари можно размещать в памяти [множеством способов](). -Рекомендуем [flat](#dicts-external_dicts_dict_layout-flat), [hashed](#dicts-external_dicts_dict_layout-hashed) и [complex_key_hashed](#dicts-external_dicts_dict_layout-complex_key_hashed). Скорость обработки словарей при этом максимальна. +Рекомендуем [flat](#dicts-external_dicts_dict_layout-flat), [hashed](#dicts-external_dicts_dict_layout-hashed) и [complex_key_hashed](). Скорость обработки словарей при этом максимальна. -Размещение с кэшированием не рекомендуется использовать из-за потенциально низкой производительности и сложностей в подборе оптимальных параметров. Читайте об этом подробнее в разделе "[cache](#dicts-external_dicts_dict_layout-cache)". +Размещение с кэшированием не рекомендуется использовать из-за потенциально низкой производительности и сложностей в подборе оптимальных параметров. Читайте об этом подробнее в разделе "[cache]()". Повысить производительнось словарей можно следующими способами: @@ -40,13 +40,13 @@ ## Способы размещения словарей в памяти -- [flat](#dicts-external_dicts_dict_layout-flat) -- [hashed](#dicts-external_dicts_dict_layout-hashed) -- [cache](#dicts-external_dicts_dict_layout-cache) -- [range_hashed](#dicts-external_dicts_dict_layout-range_hashed) -- [complex_key_hashed](#dicts-external_dicts_dict_layout-complex_key_hashed) -- [complex_key_cache](#dicts-external_dicts_dict_layout-complex_key_cache) -- [ip_trie](#dicts-external_dicts_dict_layout-ip_trie) +- [flat]() +- [hashed]() +- [cache]() +- [range_hashed]() +- [complex_key_hashed]() +- [complex_key_cache]() +- [ip_trie]() @@ -88,7 +88,7 @@ ### complex_key_hashed -Тип размещения предназначен для использования с составными [ключами](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure). Аналогичен `hashed`. +Тип размещения предназначен для использования с составными [ключами](external_dicts_dict_structure.md). Аналогичен `hashed`. Пример конфигурации: @@ -120,7 +120,7 @@ +---------------+---------------------+-------------------+--------+ ``` -Чтобы использовать выборку по диапазонам дат, необходимо в [structure](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure) определить элементы `range_min`, `range_max`. +Чтобы использовать выборку по диапазонам дат, необходимо в [structure](external_dicts_dict_structure.md) определить элементы `range_min`, `range_max`. Пример: @@ -191,13 +191,13 @@ При поиске в словаре сначала просматривается кэш. На каждый блок данных, все не найденные в кэше или устаревшие ключи запрашиваются у источника с помощью `SELECT attrs... FROM db.table WHERE id IN (k1, k2, ...)`. Затем, полученные данные записываются в кэш. -Для cache-словарей может быть задано время устаревания [lifetime](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime) данных в кэше. Если от загрузки данных в ячейке прошло больше времени, чем `lifetime`, то значение не используется, и будет запрошено заново при следующей необходимости его использовать. +Для cache-словарей может быть задано время устаревания [lifetime](external_dicts_dict_lifetime.md) данных в кэше. Если от загрузки данных в ячейке прошло больше времени, чем `lifetime`, то значение не используется, и будет запрошено заново при следующей необходимости его использовать. Это наименее эффективный из всех способов размещения словарей. Скорость работы кэша очень сильно зависит от правильности настройки и сценария использования. Словарь типа cache показывает высокую производительность лишь при достаточно больших hit rate-ах (рекомендуется 99% и выше). Посмотреть средний hit rate можно в таблице `system.dictionaries`. Чтобы увеличить производительность кэша, используйте подзапрос с `LIMIT`, а снаружи вызывайте функцию со словарём. -Поддерживаются [источники](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources): MySQL, ClickHouse, executable, HTTP. +Поддерживаются [источники](external_dicts_dict_sources.md): MySQL, ClickHouse, executable, HTTP. Пример настройки: @@ -224,7 +224,7 @@ ### complex_key_cache -Тип размещения предназначен для использования с составными [ключами](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure). Аналогичен `cache`. +Тип размещения предназначен для использования с составными [ключами](external_dicts_dict_structure.md). Аналогичен `cache`. diff --git a/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md b/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md index 4e78a838165..c3c89715338 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md @@ -33,7 +33,7 @@ ClickHouse периодически обновляет словари. Инте ``` -При обновлении словарей сервер ClickHouse применяет различную логику в зависимости от типа [источника](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources): +При обновлении словарей сервер ClickHouse применяет различную логику в зависимости от типа [источника](external_dicts_dict_sources.md): > - У текстового файла проверяется время модификации. Если время изменилось по отношению к запомненному ранее, то словарь обновляется. > - Для таблиц типа MyISAM, время модификации проверяется запросом `SHOW TABLE STATUS`. @@ -42,7 +42,7 @@ ClickHouse периодически обновляет словари. Инте Для источников MySQL (InnoDB), ODBC и ClickHouse можно настроить запрос, который позволит обновлять словари только в случае их фактического изменения, а не каждый раз. Чтобы это сделать необходимо выполнить следующие условия/действия: > - В таблице словаря должно быть поле, которое гарантированно изменяется при обновлении данных в источнике. -> - В настройках источника указывается запрос, который получает изменяющееся поле. Результат запроса сервер ClickHouse интерпретирует как строку и если эта строка изменилась по отношению к предыдущему состоянию, то словарь обновляется. Запрос следует указывать в поле `` настроек [источника](external_dicts_dict_sources.md#dicts-external_dicts_dict_sources). +> - В настройках источника указывается запрос, который получает изменяющееся поле. Результат запроса сервер ClickHouse интерпретирует как строку и если эта строка изменилась по отношению к предыдущему состоянию, то словарь обновляется. Запрос следует указывать в поле `` настроек [источника](external_dicts_dict_sources.md). Пример настройки: diff --git a/docs/ru/query_language/dicts/external_dicts_dict_sources.md b/docs/ru/query_language/dicts/external_dicts_dict_sources.md index ca9a6d2a43c..b11d1ef2832 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_sources.md @@ -25,14 +25,14 @@ Типы источников (`source_type`): -- [Локальный файл](#dicts-external_dicts_dict_sources-local_file) -- [Исполняемый файл](#dicts-external_dicts_dict_sources-executable) -- [HTTP(s)](#dicts-external_dicts_dict_sources-http) +- [Локальный файл]() +- [Исполняемый файл]() +- [HTTP(s)]() - СУБД: - - [ODBC](#dicts-external_dicts_dict_sources-odbc) - - [MySQL](#dicts-external_dicts_dict_sources-mysql) - - [ClickHouse](#dicts-external_dicts_dict_sources-clickhouse) - - [MongoDB](#dicts-external_dicts_dict_sources-mongodb) + - [ODBC]() + - [MySQL]() + - [ClickHouse]() + - [MongoDB]() @@ -58,7 +58,7 @@ ## Исполняемый файл -Работа с исполняемым файлом зависит от [размещения словаря в памяти](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout). Если тип размещения словаря `cache` и `complex_key_cache`, то ClickHouse запрашивает необходимые ключи, отправляя запрос в `STDIN` исполняемого файла. +Работа с исполняемым файлом зависит от [размещения словаря в памяти](external_dicts_dict_layout.md). Если тип размещения словаря `cache` и `complex_key_cache`, то ClickHouse запрашивает необходимые ключи, отправляя запрос в `STDIN` исполняемого файла. Пример настройки: @@ -80,7 +80,7 @@ ## HTTP(s) -Работа с HTTP(s) сервером зависит от [размещения словаря в памяти](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout). Если тип размещения словаря `cache` и `complex_key_cache`, то ClickHouse запрашивает необходимые ключи, отправляя запрос методом `POST`. +Работа с HTTP(s) сервером зависит от [размещения словаря в памяти](external_dicts_dict_layout.md). Если тип размещения словаря `cache` и `complex_key_cache`, то ClickHouse запрашивает необходимые ключи, отправляя запрос методом `POST`. Пример настройки: @@ -93,7 +93,7 @@ ``` -Чтобы ClickHouse смог обратиться к HTTPS-ресурсу, необходимо [настроить openSSL](../../operations/server_settings/settings.md#server_settings-openSSL) в конфигурации сервера. +Чтобы ClickHouse смог обратиться к HTTPS-ресурсу, необходимо [настроить openSSL](../../operations/server_settings/settings.md) в конфигурации сервера. Поля настройки: @@ -122,7 +122,7 @@ - `db` - имя базы данных. Не указывать, если имя базы задано в параметрах. ``. - `table` - имя таблицы и схемы, если она есть. - `connection_string` - строка соединения. -- `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime). +- `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md). ClickHouse получает от ODBC-драйвера информацию о квотировании и квотирует настройки в запросах к драйверу, поэтому имя таблицы нужно указывать в соответствии с регистром имени таблицы в базе данных. @@ -344,7 +344,7 @@ SELECT * FROM odbc('DSN=gregtest;Servername=some-server.com', 'test_db'); - `db` - имя базы данных. - `table` - имя таблицы. - `where` - условие выбора. Необязательный параметр. -- `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime). +- `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md). MySQL можно подключить на локальном хосте через сокеты, для этого необходимо задать `host` и `socket`. @@ -387,14 +387,14 @@ MySQL можно подключить на локальном хосте чер Поля настройки: -- `host` - хост ClickHouse. Если host локальный, то запрос выполняется без сетевого взаимодействия. Чтобы повысить отказоустойчивость решения, можно создать таблицу типа [Distributed](../../operations/table_engines/distributed.md#table_engines-distributed) и прописать её в дальнейших настройках. +- `host` - хост ClickHouse. Если host локальный, то запрос выполняется без сетевого взаимодействия. Чтобы повысить отказоустойчивость решения, можно создать таблицу типа [Distributed](../../operations/table_engines/distributed.md) и прописать её в дальнейших настройках. - `port` - порт сервера ClickHouse. - `user` - имя пользователя ClickHouse. - `password` - пароль пользователя ClickHouse. - `db` - имя базы данных. - `table` - имя таблицы. - `where` - условие выбора. Может отсутствовать. -- `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md#dicts-external_dicts_dict_lifetime). +- `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md). diff --git a/docs/ru/query_language/dicts/external_dicts_dict_structure.md b/docs/ru/query_language/dicts/external_dicts_dict_structure.md index 76271effe9c..22755baeefc 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_structure.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_structure.md @@ -25,8 +25,8 @@ В структуре описываются столбцы: -- `` - [ключевой столбец](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure-key). -- `` - [столбец данных](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure-attributes). Столбцов может быть много. +- `` - [ключевой столбец](external_dicts_dict_structure.md). +- `` - [столбец данных](external_dicts_dict_structure.md). Столбцов может быть много. @@ -60,12 +60,12 @@ ClickHouse поддерживает следующие виды ключей: ### Составной ключ -Ключом может быть кортеж (`tuple`) из полей произвольных типов. [layout](external_dicts_dict_layout.md#dicts-external_dicts_dict_layout) в этом случае должен быть `complex_key_hashed` или `complex_key_cache`. +Ключом может быть кортеж (`tuple`) из полей произвольных типов. [layout](external_dicts_dict_layout.md) в этом случае должен быть `complex_key_hashed` или `complex_key_cache`. !!! tip "Совет" Cоставной ключ может состоять из одного элемента. Это даёт возможность использовать в качестве ключа, например, строку. -Структура ключа задаётся в элементе ``. Поля ключа задаются в том же формате, что и [атрибуты](external_dicts_dict_structure.md#dicts-external_dicts_dict_structure-attributes) словаря. Пример: +Структура ключа задаётся в элементе ``. Поля ключа задаются в том же формате, что и [атрибуты](external_dicts_dict_structure.md) словаря. Пример: ```xml diff --git a/docs/ru/query_language/dicts/index.md b/docs/ru/query_language/dicts/index.md index 2ea9f67ce26..7ff6f6cbce4 100644 --- a/docs/ru/query_language/dicts/index.md +++ b/docs/ru/query_language/dicts/index.md @@ -4,11 +4,11 @@ ClickHouse поддерживает специальные функции для работы со словарями, которые можно использовать в запросах. Проще и эффективнее использовать словари с помощью функций, чем `JOIN` с таблицами-справочниками. -В словаре нельзя хранить значения [NULL](../syntax.md#null-literal). +В словаре нельзя хранить значения [NULL](../syntax.md). ClickHouse поддерживает: - [Встроенные словари](internal_dicts.md#internal_dicts) со специфическим [набором функций](../functions/ym_dict_functions.md#ym_dict_functions). -- [Подключаемые (внешние) словари](external_dicts.md#dicts-external_dicts) с [набором функций](../functions/ext_dict_functions.md#ext_dict_functions). +- [Подключаемые (внешние) словари](external_dicts.md) с [набором функций](../functions/ext_dict_functions.md#ext_dict_functions). [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/) diff --git a/docs/ru/query_language/functions/array_functions.md b/docs/ru/query_language/functions/array_functions.md index 654bf308648..c01ab568fba 100644 --- a/docs/ru/query_language/functions/array_functions.md +++ b/docs/ru/query_language/functions/array_functions.md @@ -55,8 +55,7 @@ arrayConcat(arrays) **Параметры** -- `arrays` – произвольное количество элементов типа [Array][../../data_types/array.md#data_type-array]. - +- `arrays` – произвольное количество элементов типа [Array][../../data_types/array.md **Пример** ```sql diff --git a/docs/ru/query_language/functions/ext_dict_functions.md b/docs/ru/query_language/functions/ext_dict_functions.md index d80d309a02c..89b23d23671 100644 --- a/docs/ru/query_language/functions/ext_dict_functions.md +++ b/docs/ru/query_language/functions/ext_dict_functions.md @@ -2,7 +2,7 @@ # Функции для работы с внешними словарями -Информация о подключении и настройке внешних словарей смотрите в разделе "[Внешние словари](../dicts/external_dicts.md#dicts-external_dicts)". +Информация о подключении и настройке внешних словарей смотрите в разделе "[Внешние словари](../dicts/external_dicts.md)". ## dictGetUInt8, dictGetUInt16, dictGetUInt32, dictGetUInt64 diff --git a/docs/ru/query_language/functions/functions_for_nulls.md b/docs/ru/query_language/functions/functions_for_nulls.md index 9173b466f5b..6eb716294a8 100644 --- a/docs/ru/query_language/functions/functions_for_nulls.md +++ b/docs/ru/query_language/functions/functions_for_nulls.md @@ -2,7 +2,7 @@ ## isNull -Проверяет является ли аргумент [NULL](../syntax.md#null-literal). +Проверяет является ли аргумент [NULL](../syntax.md). ``` isNull(x) @@ -46,7 +46,7 @@ WHERE isNull(y) ## isNotNull -Проверяет не является ли аргумент [NULL](../syntax.md#null-literal). +Проверяет не является ли аргумент [NULL](../syntax.md). ``` isNotNull(x) @@ -204,7 +204,7 @@ SELECT nullIf(1, 2) ## assumeNotNull -Приводит значение типа [Nullable](../../data_types/nullable.md#data_type-nullable) к не `Nullable`, если значение не `NULL`. +Приводит значение типа [Nullable](../../data_types/nullable.md) к не `Nullable`, если значение не `NULL`. ``` assumeNotNull(x) diff --git a/docs/ru/query_language/functions/geo.md b/docs/ru/query_language/functions/geo.md index 0b33bf5dab9..53ae2e13fab 100644 --- a/docs/ru/query_language/functions/geo.md +++ b/docs/ru/query_language/functions/geo.md @@ -78,8 +78,7 @@ pointInPolygon((x, y), [(a, b), (c, d) ...], ...) **Входные значения** -- `(x, y)` — координаты точки на плоскости. Тип данных — [Tuple](../../data_types/tuple.md#data_type-tuple) - кортеж из двух чисел. -- `[(a, b), (c, d) ...]` — вершины многоугольника. Тип данных — [Array](../../data_types/array.md#data_type-array). Каждая вершина представлена парой координат `(a, b)`. Вершины следует указывать в порядке обхода по или против часовой стрелки. Минимальное количество вершин — 3. Многоугольник должен быть константным. +- `(x, y)` — координаты точки на плоскости. Тип данных — [Tuple](../../data_types/tuple.md- `[(a, b), (c, d) ...]` — вершины многоугольника. Тип данных — [Array](../../data_types/array.md). Каждая вершина представлена парой координат `(a, b)`. Вершины следует указывать в порядке обхода по или против часовой стрелки. Минимальное количество вершин — 3. Многоугольник должен быть константным. - функция поддерживает также многоугольники с дырками (вырезанными кусками). Для этого случая, добавьте многоугольники, описывающие вырезанные куски, дополнительными аргументами функции. Функция не поддерживает неодносвязные многоугольники. **Возвращаемые значения** diff --git a/docs/ru/query_language/functions/in_functions.md b/docs/ru/query_language/functions/in_functions.md index 427f332423d..44934ea0024 100644 --- a/docs/ru/query_language/functions/in_functions.md +++ b/docs/ru/query_language/functions/in_functions.md @@ -1,7 +1,7 @@ # Функции для реализации оператора IN. ## in, notIn, globalIn, globalNotIn -Смотрите раздел [Операторы IN](../select.md/#query_language-in_operators). +Смотрите раздел [Операторы IN](../select.md/). ## tuple(x, y, ...), оператор (x, y, ...) Функция, позволяющая сгруппировать несколько столбцов. diff --git a/docs/ru/query_language/functions/other_functions.md b/docs/ru/query_language/functions/other_functions.md index d7c70d61d52..038129bece4 100644 --- a/docs/ru/query_language/functions/other_functions.md +++ b/docs/ru/query_language/functions/other_functions.md @@ -276,7 +276,7 @@ FROM ## getSizeOfEnumType -Возвращает количество полей в [Enum](../../data_types/enum.md#data_type-enum). +Возвращает количество полей в [Enum](../../data_types/enum.md). ``` getSizeOfEnumType(value) @@ -386,7 +386,7 @@ defaultValueOfArgumentType(expression) - `0` для чисел; - Пустая строка для строк; -- `ᴺᵁᴸᴸ` для [Nullable](../../data_types/nullable.md#data_type-nullable). +- `ᴺᵁᴸᴸ` для [Nullable](../../data_types/nullable.md). **Пример** @@ -426,7 +426,7 @@ SELECT defaultValueOfArgumentType(CAST(1, 'Nullable(Int8)')) **Пример** -Рассмотрим таблицу с тестовыми данными [ontime](../../getting_started/example_datasets/ontime.md#example_datasets-ontime). +Рассмотрим таблицу с тестовыми данными [ontime](../../getting_started/example_datasets/ontime.md). ``` SELECT count() FROM ontime diff --git a/docs/ru/query_language/functions/type_conversion_functions.md b/docs/ru/query_language/functions/type_conversion_functions.md index 6b512574f6e..3fb464ca4f2 100644 --- a/docs/ru/query_language/functions/type_conversion_functions.md +++ b/docs/ru/query_language/functions/type_conversion_functions.md @@ -13,7 +13,7 @@ ## toDate, toDateTime ## toDecimal32(value, S), toDecimal64(value, S), toDecimal128(value, S) -Приводит строку или число value к типу [Decimal](../../data_types/decimal.md#data_type-decimal) указанной точности. +Приводит строку или число value к типу [Decimal](../../data_types/decimal.md) указанной точности. Параметр S (scale) определяет число десятичных знаков после запятой. ## toString @@ -118,7 +118,7 @@ SELECT Преобразование в FixedString(N) работает только для аргументов типа String или FixedString(N). -Поддержано преобразование к типу [Nullable](../../data_types/nullable.md#data_type-nullable) и обратно. Пример: +Поддержано преобразование к типу [Nullable](../../data_types/nullable.md) и обратно. Пример: ``` SELECT toTypeName(x) FROM t_null diff --git a/docs/ru/query_language/index.md b/docs/ru/query_language/index.md index 59313b15f8a..6c919518e1f 100644 --- a/docs/ru/query_language/index.md +++ b/docs/ru/query_language/index.md @@ -1,9 +1,9 @@ # Справка по SQL * [SELECT](select.md#select) -* [INSERT INTO](insert_into.md#queries-insert) -* [CREATE](create.md#create-database) +* [INSERT INTO](insert_into.md) +* [CREATE](create.md) * [ALTER](alter.md#query_language_queries_alter) -* [Прочие виды запросов](misc.md#miscellaneous-queries) +* [Прочие виды запросов](misc.md) [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/) diff --git a/docs/ru/query_language/insert_into.md b/docs/ru/query_language/insert_into.md index 70e4d5529f2..dc7a82e77e5 100644 --- a/docs/ru/query_language/insert_into.md +++ b/docs/ru/query_language/insert_into.md @@ -15,7 +15,7 @@ INSERT INTO [db.]table [(c1, c2, c3)] VALUES (v11, v12, v13), (v21, v22, v23), . - Значения, вычисляемые из `DEFAULT` выражений, указанных в определении таблицы. - Нули и пустые строки, если `DEFAULT` не определены. -Если [strict_insert_defaults=1](../operations/settings/settings.md#settings-strict_insert_defaults), то столбцы, для которых не определены `DEFAULT`, необходимо перечислить в запросе. +Если [strict_insert_defaults=1](../operations/settings/settings.md), то столбцы, для которых не определены `DEFAULT`, необходимо перечислить в запросе. В INSERT можно передавать данные любого [формата](../interfaces/formats.md#formats), который поддерживает ClickHouse. Для этого формат необходимо указать в запросе в явном виде: diff --git a/docs/ru/query_language/operators.md b/docs/ru/query_language/operators.md index ba2f80c8a1d..3f1157f775c 100644 --- a/docs/ru/query_language/operators.md +++ b/docs/ru/query_language/operators.md @@ -53,7 +53,7 @@ ## Операторы для работы с множествами -*Смотрите раздел [Операторы IN](select.md/#query_language-in_operators).* +*Смотрите раздел [Операторы IN](select.md/).* `a IN ...` - функция `in(a, b)` @@ -132,7 +132,7 @@ ClickHouse поддерживает операторы `IS NULL` и `IS NOT NULL ### IS NULL -- Для значений типа [Nullable](../data_types/nullable.md#data_type-nullable) оператор `IS NULL` возвращает: +- Для значений типа [Nullable](../data_types/nullable.md) оператор `IS NULL` возвращает: - `1`, если значение — `NULL`. - `0` в обратном случае. - Для прочих значений оператор `IS NULL` всегда возвращает `0`. @@ -155,7 +155,7 @@ WHERE isNull(y) ### IS NOT NULL -- Для значений типа [Nullable](../data_types/nullable.md#data_type-nullable) оператор `IS NOT NULL` возвращает: +- Для значений типа [Nullable](../data_types/nullable.md) оператор `IS NOT NULL` возвращает: - `0`, если значение — `NULL`. - `1`, в обратном случае. - Для прочих значений оператор `IS NOT NULL` всегда возвращает `1`. diff --git a/docs/ru/query_language/select.md b/docs/ru/query_language/select.md index 9e55aeaf7b1..2a5d9820abc 100644 --- a/docs/ru/query_language/select.md +++ b/docs/ru/query_language/select.md @@ -437,22 +437,22 @@ LIMIT 10 #### Обработка NULL -На поведение JOIN влияет настройка [join_use_nulls](../operations/settings/settings.md#settings-join_use_nulls). При `join_use_nulls=1` `JOIN` работает как в стандартном SQL. +На поведение JOIN влияет настройка [join_use_nulls](../operations/settings/settings.md). При `join_use_nulls=1` `JOIN` работает как в стандартном SQL. -Если ключами JOIN выступают поля типа [Nullable](../data_types/nullable.md#data_types-nullable), то строки, где хотя бы один из ключей имеет значение [NULL](syntax.md#null-literal), не соединяются. +Если ключами JOIN выступают поля типа [Nullable](../data_types/nullable.md#data_types-nullable), то строки, где хотя бы один из ключей имеет значение [NULL](syntax.md), не соединяются. ### Секция WHERE -Позволяет задать выражение, которое ClickHouse использует для фильтрации данных перед всеми другими действиями в запросе кроме выражений, содержащихся в секции [PREWHERE](#query_language-queries-prewhere). Обычно, это выражение с логическими операторами. +Позволяет задать выражение, которое ClickHouse использует для фильтрации данных перед всеми другими действиями в запросе кроме выражений, содержащихся в секции [PREWHERE](). Обычно, это выражение с логическими операторами. Результат выражения должен иметь тип `UInt8`. ClickHouse использует в выражении индексы, если это позволяет [движок таблицы](../operations/table_engines/index.md#table_engines). -Если в секции необходимо проверить [NULL](syntax.md#null-literal), то используйте операторы [IS NULL](operators.md#operator-is-null) и [IS NOT NULL](operators.md#operator-is-not-null), а также соответствующие функции `isNull` и `isNotNull`. В противном случае выражение будет считаться всегда не выполненным. +Если в секции необходимо проверить [NULL](syntax.md#null-literal), то используйте операторы [IS NULL](operators.md#operator-is-null) и [IS NOT NULL](operators.md), а также соответствующие функции `isNull` и `isNotNull`. В противном случае выражение будет считаться всегда не выполненным. Пример проверки на `NULL`: @@ -474,7 +474,7 @@ WHERE isNull(y) ### Секция PREWHERE -Имеет такой же смысл, как и секция [WHERE](#query_language-queries-where). Отличие состоит в том, какие данные читаются из таблицы. +Имеет такой же смысл, как и секция [WHERE](). Отличие состоит в том, какие данные читаются из таблицы. При использовании `PREWHERE`, из таблицы сначала читаются только столбцы, необходимые для выполнения `PREWHERE`. Затем читаются остальные столбцы, нужные для выполнения запроса, но из них только те блоки, в которых выражение в `PREWHERE` истинное. `PREWHERE` имеет смысл использовать, если есть условия фильтрации, которые использует меньшинство столбцов из тех, что есть в запросе, но достаточно сильно фильтрует данные. Таким образом, сокращается количество читаемых данных. @@ -529,7 +529,7 @@ GROUP BY вычисляет для каждого встретившегося #### Обработка NULL -При группировке, ClickHouse рассматривает [NULL](syntax.md#null-literal) как значение, причём `NULL=NULL`. +При группировке, ClickHouse рассматривает [NULL](syntax.md) как значение, причём `NULL=NULL`. Рассмотрим, что это значит на примере. @@ -623,7 +623,7 @@ LIMIT 100 Запрос выберет топ 5 рефереров для каждой пары `domain, device_type`, но не более 100 строк (`LIMIT n BY + LIMIT`). -`LIMIT n BY` работает с [NULL](syntax.md#null-literal) как если бы это было конкретное значение. Т.е. в результате запроса пользователь получит все комбинации полей, указанных в `BY`. +`LIMIT n BY` работает с [NULL](syntax.md) как если бы это было конкретное значение. Т.е. в результате запроса пользователь получит все комбинации полей, указанных в `BY`. ### Секция HAVING @@ -712,9 +712,9 @@ WHERE и HAVING отличаются тем, что WHERE выполняется `DISTINCT` не поддерживается, если в `SELECT` присутствует хотя бы один столбец типа массив. -`DISTINCT` работает с [NULL](syntax.md#null-literal) как если бы `NULL` был конкретным значением, причём `NULL=NULL`. Т.е. в результате `DISTINCT` разные комбинации с `NULL` встретятся только по одному разу. +`DISTINCT` работает с [NULL](syntax.md) как если бы `NULL` был конкретным значением, причём `NULL=NULL`. Т.е. в результате `DISTINCT` разные комбинации с `NULL` встретятся только по одному разу. -`DISTINCT` работает с [NULL](syntax.md#null-literal) как если бы `NULL` был конкретным значением, причём `NULL=NULL`. Т.е. в результате `DISTINCT` разные комбинации с `NULL` встретятся только по одному разу. +`DISTINCT` работает с [NULL](syntax.md) как если бы `NULL` был конкретным значением, причём `NULL=NULL`. Т.е. в результате `DISTINCT` разные комбинации с `NULL` встретятся только по одному разу. ### Секция LIMIT @@ -837,7 +837,7 @@ ORDER BY EventDate ASC #### Обработка NULL -При обработке запроса оператор IN будет считать, что результат операции с [NULL](syntax.md#null-literal) всегда равен `0`, независимо от того, находится `NULL` в правой или левой части оператора. Значения `NULL` не входят ни в какое множество, не соответствуют друг другу и не могут сравниваться. +При обработке запроса оператор IN будет считать, что результат операции с [NULL](syntax.md) всегда равен `0`, независимо от того, находится `NULL` в правой или левой части оператора. Значения `NULL` не входят ни в какое множество, не соответствуют друг другу и не могут сравниваться. Рассмотрим для примера таблицу `t_null`: @@ -875,7 +875,7 @@ FROM t_null Существует два варианта IN-ов с подзапросами (аналогично для JOIN-ов): обычный `IN` / `JOIN` и `GLOBAL IN` / `GLOBAL JOIN`. Они отличаются способом выполнения при распределённой обработке запроса. !!! attention - Помните, что алгоритмы, описанные ниже, могут работать иначе в зависимости от [настройки](../operations/settings/settings.md#settings-distributed_product_mode) `distributed_product_mode`. + Помните, что алгоритмы, описанные ниже, могут работать иначе в зависимости от [настройки](../operations/settings/settings.md) `distributed_product_mode`. При использовании обычного IN-а, запрос отправляется на удалённые серверы, и на каждом из них выполняются подзапросы в секциях `IN` / `JOIN`. diff --git a/docs/ru/query_language/syntax.md b/docs/ru/query_language/syntax.md index a09074a5681..f2008fd8260 100644 --- a/docs/ru/query_language/syntax.md +++ b/docs/ru/query_language/syntax.md @@ -55,7 +55,7 @@ INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def') ### Строковые -Поддерживаются только строковые литералы в одинарных кавычках. Символы внутри могут быть экранированы с помощью обратного слеша. Следующие escape-последовательности имеют соответствующее специальное значение: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\a`, `\v`, `\xHH`. Во всех остальных случаях, последовательности вида `\c`, где c - любой символ, преобразуется в c. Таким образом, могут быть использованы последовательности `\'` и `\\`. Значение будет иметь тип [String](../data_types/string.md#data_types-string). +Поддерживаются только строковые литералы в одинарных кавычках. Символы внутри могут быть экранированы с помощью обратного слеша. Следующие escape-последовательности имеют соответствующее специальное значение: `\b`, `\f`, `\r`, `\n`, `\t`, `\0`, `\a`, `\v`, `\xHH`. Во всех остальных случаях, последовательности вида `\c`, где c - любой символ, преобразуется в c. Таким образом, могут быть использованы последовательности `\'` и `\\`. Значение будет иметь тип [String](../data_types/string.md). Минимальный набор символов, которых вам необходимо экранировать в строковых литералах: `'` и `\`. @@ -73,13 +73,13 @@ INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def') Обозначает, что значение отсутствует. -Чтобы в поле таблицы можно было хранить `NULL`, оно должно быть типа [Nullable](../data_types/nullable.md#data_type-nullable). +Чтобы в поле таблицы можно было хранить `NULL`, оно должно быть типа [Nullable](../data_types/nullable.md). В зависимости от формата данных (входных или выходных) `NULL` может иметь различное представление. Подробнее смотрите в документации для [форматов данных](../interfaces/formats.md#formats). При обработке `NULL` есть множество особенностей. Например, если хотя бы один из аргументов операции сравнения — `NULL`, то результатом такой операции тоже будет `NULL`. Этим же свойством обладают операции умножения, сложения и пр. Подробнее читайте в документации на каждую операцию. -В запросах можно проверить `NULL` с помощью операторов [IS NULL](operators.md#operator-is-null) и [IS NOT NULL](operators.md#operator-is-not-null), а также соответствующих функций `isNull` и `isNotNull`. +В запросах можно проверить `NULL` с помощью операторов [IS NULL](operators.md#operator-is-null) и [IS NOT NULL](operators.md), а также соответствующих функций `isNull` и `isNotNull`. ## Функции diff --git a/docs/ru/query_language/table_functions/remote.md b/docs/ru/query_language/table_functions/remote.md index acd623a583e..24380b31cc1 100644 --- a/docs/ru/query_language/table_functions/remote.md +++ b/docs/ru/query_language/table_functions/remote.md @@ -49,7 +49,7 @@ example01-{01..02}-1 При наличии нескольких пар фигурных скобок, генерируется прямое произведение соответствующих множеств. -Адреса или их фрагменты в фигурных скобках можно указать через символ |. В этом случае, соответствующие множества адресов понимаются как реплики - запрос будет отправлен на первую живую реплику. При этом, реплики перебираются в порядке, согласно текущей настройке [load_balancing](../../operations/settings/settings.md#settings-load_balancing). +Адреса или их фрагменты в фигурных скобках можно указать через символ |. В этом случае, соответствующие множества адресов понимаются как реплики - запрос будет отправлен на первую живую реплику. При этом, реплики перебираются в порядке, согласно текущей настройке [load_balancing](../../operations/settings/settings.md). Пример: diff --git a/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js b/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js index 847a8a3de8c..09d8976825b 100644 --- a/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js +++ b/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js @@ -81,7 +81,7 @@ __webpack_require__(5); ;(function(window){ /*! modernizr 3.5.0 (Custom Build) | MIT * * https://modernizr.com/download/?-checked-csstransforms3d-dataset-details-fetch-json-svg-target-addtest-setclasses !*/ -!function(e,t,n){function r(e,t){return typeof e===t}function i(){var e,t,n,i,o,s,a;for(var l in w)if(w.hasOwnProperty(l)){if(e=[],t=w[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nd;d++)if(m=e[d],g=E.style[m],f(m,"-")&&(m=h(m)),E.style[m]!==n){if(o||r(i,"undefined"))return s(),"pfx"==t?m:!0;try{E.style[m]=i}catch(y){}if(E.style[m]!=g)return s(),"pfx"==t?m:!0}return s(),!1}function g(e,t){return function(){return e.apply(t,arguments)}}function v(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?g(i,n||t):i);return!1}function y(e,t,n,i,o){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+P.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?m(a,t,i,o):(a=(e+" "+A.join(s+" ")+s).split(" "),v(a,t,n))}function S(e,t,r){return y(e,n,n,t,r)}var w=[],C={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){w.push({name:e,fn:t,options:n})},addAsyncTest:function(e){w.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr;var _,b=[],x=t.documentElement,T="svg"===x.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;_=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),C._l={},C.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},C._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;ed;d++)if(m=e[d],g=E.style[m],f(m,"-")&&(m=h(m)),E.style[m]!==n){if(o||r(i,"undefined"))return s(),"pfx"==t?m:!0;try{E.style[m]=i}catch(y){}if(E.style[m]!=g)return s(),"pfx"==t?m:!0}return s(),!1}function g(e,t){return function(){return e.apply(t,arguments)}}function v(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?g(i,n||t):i);return!1}function y(e,t,n,i,o){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+P.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?m(a,t,i,o):(a=(e+" "+A.join(s+" ")+s).split(" "),v(a,t,n))}function S(e,t,r){return y(e,n,n,t,r)}var w=[],C={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){w.push({name:e,fn:t,options:n})},addAsyncTest:function(e){w.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr;var _,b=[],x=t.documentElement,T="svg"===x.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;_=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),C._l={},C.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},C._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e.md-nav__link{color:inherit}button[data-md-color-primary=pink]{background-color:#e91e63}[data-md-color-primary=pink] .md-typeset a{color:#e91e63}[data-md-color-primary=pink] .md-header,[data-md-color-primary=pink] .md-hero{background-color:#e91e63}[data-md-color-primary=pink] .md-nav__link--active,[data-md-color-primary=pink] .md-nav__link:active{color:#e91e63}[data-md-color-primary=pink] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=purple]{background-color:#ab47bc}[data-md-color-primary=purple] .md-typeset a{color:#ab47bc}[data-md-color-primary=purple] .md-header,[data-md-color-primary=purple] .md-hero{background-color:#ab47bc}[data-md-color-primary=purple] .md-nav__link--active,[data-md-color-primary=purple] .md-nav__link:active{color:#ab47bc}[data-md-color-primary=purple] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=deep-purple]{background-color:#7e57c2}[data-md-color-primary=deep-purple] .md-typeset a{color:#7e57c2}[data-md-color-primary=deep-purple] .md-header,[data-md-color-primary=deep-purple] .md-hero{background-color:#7e57c2}[data-md-color-primary=deep-purple] .md-nav__link--active,[data-md-color-primary=deep-purple] .md-nav__link:active{color:#7e57c2}[data-md-color-primary=deep-purple] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=indigo]{background-color:#3f51b5}[data-md-color-primary=indigo] .md-typeset a{color:#3f51b5}[data-md-color-primary=indigo] .md-header,[data-md-color-primary=indigo] .md-hero{background-color:#3f51b5}[data-md-color-primary=indigo] .md-nav__link--active,[data-md-color-primary=indigo] .md-nav__link:active{color:#3f51b5}[data-md-color-primary=indigo] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=blue]{background-color:#2196f3}[data-md-color-primary=blue] .md-typeset a{color:#2196f3}[data-md-color-primary=blue] .md-header,[data-md-color-primary=blue] .md-hero{background-color:#2196f3}[data-md-color-primary=blue] .md-nav__link--active,[data-md-color-primary=blue] .md-nav__link:active{color:#2196f3}[data-md-color-primary=blue] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=light-blue]{background-color:#03a9f4}[data-md-color-primary=light-blue] .md-typeset a{color:#03a9f4}[data-md-color-primary=light-blue] .md-header,[data-md-color-primary=light-blue] .md-hero{background-color:#03a9f4}[data-md-color-primary=light-blue] .md-nav__link--active,[data-md-color-primary=light-blue] .md-nav__link:active{color:#03a9f4}[data-md-color-primary=light-blue] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=cyan]{background-color:#00bcd4}[data-md-color-primary=cyan] .md-typeset a{color:#00bcd4}[data-md-color-primary=cyan] .md-header,[data-md-color-primary=cyan] .md-hero{background-color:#00bcd4}[data-md-color-primary=cyan] .md-nav__link--active,[data-md-color-primary=cyan] .md-nav__link:active{color:#00bcd4}[data-md-color-primary=cyan] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=teal]{background-color:#009688}[data-md-color-primary=teal] .md-typeset a{color:#009688}[data-md-color-primary=teal] .md-header,[data-md-color-primary=teal] .md-hero{background-color:#009688}[data-md-color-primary=teal] .md-nav__link--active,[data-md-color-primary=teal] .md-nav__link:active{color:#009688}[data-md-color-primary=teal] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=green]{background-color:#4caf50}[data-md-color-primary=green] .md-typeset a{color:#4caf50}[data-md-color-primary=green] .md-header,[data-md-color-primary=green] .md-hero{background-color:#4caf50}[data-md-color-primary=green] .md-nav__link--active,[data-md-color-primary=green] .md-nav__link:active{color:#4caf50}[data-md-color-primary=green] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=light-green]{background-color:#7cb342}[data-md-color-primary=light-green] .md-typeset a{color:#7cb342}[data-md-color-primary=light-green] .md-header,[data-md-color-primary=light-green] .md-hero{background-color:#7cb342}[data-md-color-primary=light-green] .md-nav__link--active,[data-md-color-primary=light-green] .md-nav__link:active{color:#7cb342}[data-md-color-primary=light-green] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=lime]{background-color:#c0ca33}[data-md-color-primary=lime] .md-typeset a{color:#c0ca33}[data-md-color-primary=lime] .md-header,[data-md-color-primary=lime] .md-hero{background-color:#c0ca33}[data-md-color-primary=lime] .md-nav__link--active,[data-md-color-primary=lime] .md-nav__link:active{color:#c0ca33}[data-md-color-primary=lime] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=yellow]{background-color:#f9a825}[data-md-color-primary=yellow] .md-typeset a{color:#f9a825}[data-md-color-primary=yellow] .md-header,[data-md-color-primary=yellow] .md-hero{background-color:#f9a825}[data-md-color-primary=yellow] .md-nav__link--active,[data-md-color-primary=yellow] .md-nav__link:active{color:#f9a825}[data-md-color-primary=yellow] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=amber]{background-color:#ffa000}[data-md-color-primary=amber] .md-typeset a{color:#ffa000}[data-md-color-primary=amber] .md-header,[data-md-color-primary=amber] .md-hero{background-color:#ffa000}[data-md-color-primary=amber] .md-nav__link--active,[data-md-color-primary=amber] .md-nav__link:active{color:#ffa000}[data-md-color-primary=amber] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=orange]{background-color:#fb8c00}[data-md-color-primary=orange] .md-typeset a{color:#fb8c00}[data-md-color-primary=orange] .md-header,[data-md-color-primary=orange] .md-hero{background-color:#fb8c00}[data-md-color-primary=orange] .md-nav__link--active,[data-md-color-primary=orange] .md-nav__link:active{color:#fb8c00}[data-md-color-primary=orange] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=deep-orange]{background-color:#ff7043}[data-md-color-primary=deep-orange] .md-typeset a{color:#ff7043}[data-md-color-primary=deep-orange] .md-header,[data-md-color-primary=deep-orange] .md-hero{background-color:#ff7043}[data-md-color-primary=deep-orange] .md-nav__link--active,[data-md-color-primary=deep-orange] .md-nav__link:active{color:#ff7043}[data-md-color-primary=deep-orange] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=brown]{background-color:#795548}[data-md-color-primary=brown] .md-typeset a{color:#795548}[data-md-color-primary=brown] .md-header,[data-md-color-primary=brown] .md-hero{background-color:#795548}[data-md-color-primary=brown] .md-nav__link--active,[data-md-color-primary=brown] .md-nav__link:active{color:#795548}[data-md-color-primary=brown] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=grey]{background-color:#757575}[data-md-color-primary=grey] .md-typeset a{color:#757575}[data-md-color-primary=grey] .md-header,[data-md-color-primary=grey] .md-hero{background-color:#757575}[data-md-color-primary=grey] .md-nav__link--active,[data-md-color-primary=grey] .md-nav__link:active{color:#757575}[data-md-color-primary=grey] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=blue-grey]{background-color:#546e7a}[data-md-color-primary=blue-grey] .md-typeset a{color:#546e7a}[data-md-color-primary=blue-grey] .md-header,[data-md-color-primary=blue-grey] .md-hero{background-color:#546e7a}[data-md-color-primary=blue-grey] .md-nav__link--active,[data-md-color-primary=blue-grey] .md-nav__link:active{color:#546e7a}[data-md-color-primary=blue-grey] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=white]{-webkit-box-shadow:0 0 .1rem rgba(0,0,0,.54) inset;box-shadow:inset 0 0 .1rem rgba(0,0,0,.54)}[data-md-color-primary=white] .md-header,[data-md-color-primary=white] .md-hero,button[data-md-color-primary=white]{background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=white] .md-hero--expand{border-bottom:.1rem solid rgba(0,0,0,.07)}button[data-md-color-accent=red]{background-color:#ff1744}[data-md-color-accent=red] .md-typeset a:active,[data-md-color-accent=red] .md-typeset a:hover{color:#ff1744}[data-md-color-accent=red] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=red] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-nav__link:focus,[data-md-color-accent=red] .md-nav__link:hover,[data-md-color-accent=red] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=red] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=red] .md-typeset .md-clipboard:active:before,[data-md-color-accent=red] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=red] .md-typeset [id] .headerlink:focus,[data-md-color-accent=red] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=red] .md-typeset [id]:target .headerlink{color:#ff1744}[data-md-color-accent=red] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-search-result__link:hover,[data-md-color-accent=red] .md-search-result__link[data-md-state=active]{background-color:rgba(255,23,68,.1)}[data-md-color-accent=red] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-source-file:hover:before{background-color:#ff1744}button[data-md-color-accent=pink]{background-color:#f50057}[data-md-color-accent=pink] .md-typeset a:active,[data-md-color-accent=pink] .md-typeset a:hover{color:#f50057}[data-md-color-accent=pink] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=pink] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-nav__link:focus,[data-md-color-accent=pink] .md-nav__link:hover,[data-md-color-accent=pink] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=pink] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=pink] .md-typeset .md-clipboard:active:before,[data-md-color-accent=pink] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=pink] .md-typeset [id] .headerlink:focus,[data-md-color-accent=pink] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=pink] .md-typeset [id]:target .headerlink{color:#f50057}[data-md-color-accent=pink] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-search-result__link:hover,[data-md-color-accent=pink] .md-search-result__link[data-md-state=active]{background-color:rgba(245,0,87,.1)}[data-md-color-accent=pink] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-source-file:hover:before{background-color:#f50057}button[data-md-color-accent=purple]{background-color:#e040fb}[data-md-color-accent=purple] .md-typeset a:active,[data-md-color-accent=purple] .md-typeset a:hover{color:#e040fb}[data-md-color-accent=purple] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=purple] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-nav__link:focus,[data-md-color-accent=purple] .md-nav__link:hover,[data-md-color-accent=purple] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=purple] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=purple] .md-typeset .md-clipboard:active:before,[data-md-color-accent=purple] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=purple] .md-typeset [id] .headerlink:focus,[data-md-color-accent=purple] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=purple] .md-typeset [id]:target .headerlink{color:#e040fb}[data-md-color-accent=purple] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-search-result__link:hover,[data-md-color-accent=purple] .md-search-result__link[data-md-state=active]{background-color:rgba(224,64,251,.1)}[data-md-color-accent=purple] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-source-file:hover:before{background-color:#e040fb}button[data-md-color-accent=deep-purple]{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-typeset a:active,[data-md-color-accent=deep-purple] .md-typeset a:hover{color:#7c4dff}[data-md-color-accent=deep-purple] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=deep-purple] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-nav__link:focus,[data-md-color-accent=deep-purple] .md-nav__link:hover,[data-md-color-accent=deep-purple] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=deep-purple] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=deep-purple] .md-typeset .md-clipboard:active:before,[data-md-color-accent=deep-purple] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=deep-purple] .md-typeset [id] .headerlink:focus,[data-md-color-accent=deep-purple] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=deep-purple] .md-typeset [id]:target .headerlink{color:#7c4dff}[data-md-color-accent=deep-purple] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-search-result__link:hover,[data-md-color-accent=deep-purple] .md-search-result__link[data-md-state=active]{background-color:rgba(124,77,255,.1)}[data-md-color-accent=deep-purple] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-source-file:hover:before{background-color:#7c4dff}button[data-md-color-accent=indigo]{background-color:#536dfe}[data-md-color-accent=indigo] .md-typeset a:active,[data-md-color-accent=indigo] .md-typeset a:hover{color:#536dfe}[data-md-color-accent=indigo] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=indigo] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-nav__link:focus,[data-md-color-accent=indigo] .md-nav__link:hover,[data-md-color-accent=indigo] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=indigo] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=indigo] .md-typeset .md-clipboard:active:before,[data-md-color-accent=indigo] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=indigo] .md-typeset [id] .headerlink:focus,[data-md-color-accent=indigo] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=indigo] .md-typeset [id]:target .headerlink{color:#536dfe}[data-md-color-accent=indigo] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-search-result__link:hover,[data-md-color-accent=indigo] .md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}[data-md-color-accent=indigo] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-source-file:hover:before{background-color:#536dfe}button[data-md-color-accent=blue]{background-color:#448aff}[data-md-color-accent=blue] .md-typeset a:active,[data-md-color-accent=blue] .md-typeset a:hover{color:#448aff}[data-md-color-accent=blue] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=blue] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-nav__link:focus,[data-md-color-accent=blue] .md-nav__link:hover,[data-md-color-accent=blue] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=blue] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=blue] .md-typeset .md-clipboard:active:before,[data-md-color-accent=blue] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=blue] .md-typeset [id] .headerlink:focus,[data-md-color-accent=blue] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=blue] .md-typeset [id]:target .headerlink{color:#448aff}[data-md-color-accent=blue] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-search-result__link:hover,[data-md-color-accent=blue] .md-search-result__link[data-md-state=active]{background-color:rgba(68,138,255,.1)}[data-md-color-accent=blue] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-source-file:hover:before{background-color:#448aff}button[data-md-color-accent=light-blue]{background-color:#0091ea}[data-md-color-accent=light-blue] .md-typeset a:active,[data-md-color-accent=light-blue] .md-typeset a:hover{color:#0091ea}[data-md-color-accent=light-blue] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=light-blue] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-nav__link:focus,[data-md-color-accent=light-blue] .md-nav__link:hover,[data-md-color-accent=light-blue] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=light-blue] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=light-blue] .md-typeset .md-clipboard:active:before,[data-md-color-accent=light-blue] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=light-blue] .md-typeset [id] .headerlink:focus,[data-md-color-accent=light-blue] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=light-blue] .md-typeset [id]:target .headerlink{color:#0091ea}[data-md-color-accent=light-blue] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-search-result__link:hover,[data-md-color-accent=light-blue] .md-search-result__link[data-md-state=active]{background-color:rgba(0,145,234,.1)}[data-md-color-accent=light-blue] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-source-file:hover:before{background-color:#0091ea}button[data-md-color-accent=cyan]{background-color:#00b8d4}[data-md-color-accent=cyan] .md-typeset a:active,[data-md-color-accent=cyan] .md-typeset a:hover{color:#00b8d4}[data-md-color-accent=cyan] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=cyan] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-nav__link:focus,[data-md-color-accent=cyan] .md-nav__link:hover,[data-md-color-accent=cyan] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=cyan] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=cyan] .md-typeset .md-clipboard:active:before,[data-md-color-accent=cyan] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=cyan] .md-typeset [id] .headerlink:focus,[data-md-color-accent=cyan] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=cyan] .md-typeset [id]:target .headerlink{color:#00b8d4}[data-md-color-accent=cyan] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-search-result__link:hover,[data-md-color-accent=cyan] .md-search-result__link[data-md-state=active]{background-color:rgba(0,184,212,.1)}[data-md-color-accent=cyan] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-source-file:hover:before{background-color:#00b8d4}button[data-md-color-accent=teal]{background-color:#00bfa5}[data-md-color-accent=teal] .md-typeset a:active,[data-md-color-accent=teal] .md-typeset a:hover{color:#00bfa5}[data-md-color-accent=teal] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=teal] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-nav__link:focus,[data-md-color-accent=teal] .md-nav__link:hover,[data-md-color-accent=teal] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=teal] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=teal] .md-typeset .md-clipboard:active:before,[data-md-color-accent=teal] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=teal] .md-typeset [id] .headerlink:focus,[data-md-color-accent=teal] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=teal] .md-typeset [id]:target .headerlink{color:#00bfa5}[data-md-color-accent=teal] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-search-result__link:hover,[data-md-color-accent=teal] .md-search-result__link[data-md-state=active]{background-color:rgba(0,191,165,.1)}[data-md-color-accent=teal] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-source-file:hover:before{background-color:#00bfa5}button[data-md-color-accent=green]{background-color:#00c853}[data-md-color-accent=green] .md-typeset a:active,[data-md-color-accent=green] .md-typeset a:hover{color:#00c853}[data-md-color-accent=green] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=green] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-nav__link:focus,[data-md-color-accent=green] .md-nav__link:hover,[data-md-color-accent=green] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=green] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=green] .md-typeset .md-clipboard:active:before,[data-md-color-accent=green] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=green] .md-typeset [id] .headerlink:focus,[data-md-color-accent=green] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=green] .md-typeset [id]:target .headerlink{color:#00c853}[data-md-color-accent=green] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-search-result__link:hover,[data-md-color-accent=green] .md-search-result__link[data-md-state=active]{background-color:rgba(0,200,83,.1)}[data-md-color-accent=green] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-source-file:hover:before{background-color:#00c853}button[data-md-color-accent=light-green]{background-color:#64dd17}[data-md-color-accent=light-green] .md-typeset a:active,[data-md-color-accent=light-green] .md-typeset a:hover{color:#64dd17}[data-md-color-accent=light-green] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=light-green] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-nav__link:focus,[data-md-color-accent=light-green] .md-nav__link:hover,[data-md-color-accent=light-green] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=light-green] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=light-green] .md-typeset .md-clipboard:active:before,[data-md-color-accent=light-green] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=light-green] .md-typeset [id] .headerlink:focus,[data-md-color-accent=light-green] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=light-green] .md-typeset [id]:target .headerlink{color:#64dd17}[data-md-color-accent=light-green] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-search-result__link:hover,[data-md-color-accent=light-green] .md-search-result__link[data-md-state=active]{background-color:rgba(100,221,23,.1)}[data-md-color-accent=light-green] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-source-file:hover:before{background-color:#64dd17}button[data-md-color-accent=lime]{background-color:#aeea00}[data-md-color-accent=lime] .md-typeset a:active,[data-md-color-accent=lime] .md-typeset a:hover{color:#aeea00}[data-md-color-accent=lime] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=lime] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-nav__link:focus,[data-md-color-accent=lime] .md-nav__link:hover,[data-md-color-accent=lime] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=lime] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=lime] .md-typeset .md-clipboard:active:before,[data-md-color-accent=lime] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=lime] .md-typeset [id] .headerlink:focus,[data-md-color-accent=lime] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=lime] .md-typeset [id]:target .headerlink{color:#aeea00}[data-md-color-accent=lime] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-search-result__link:hover,[data-md-color-accent=lime] .md-search-result__link[data-md-state=active]{background-color:rgba(174,234,0,.1)}[data-md-color-accent=lime] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-source-file:hover:before{background-color:#aeea00}button[data-md-color-accent=yellow]{background-color:#ffd600}[data-md-color-accent=yellow] .md-typeset a:active,[data-md-color-accent=yellow] .md-typeset a:hover{color:#ffd600}[data-md-color-accent=yellow] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=yellow] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-nav__link:focus,[data-md-color-accent=yellow] .md-nav__link:hover,[data-md-color-accent=yellow] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=yellow] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=yellow] .md-typeset .md-clipboard:active:before,[data-md-color-accent=yellow] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=yellow] .md-typeset [id] .headerlink:focus,[data-md-color-accent=yellow] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=yellow] .md-typeset [id]:target .headerlink{color:#ffd600}[data-md-color-accent=yellow] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-search-result__link:hover,[data-md-color-accent=yellow] .md-search-result__link[data-md-state=active]{background-color:rgba(255,214,0,.1)}[data-md-color-accent=yellow] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-source-file:hover:before{background-color:#ffd600}button[data-md-color-accent=amber]{background-color:#ffab00}[data-md-color-accent=amber] .md-typeset a:active,[data-md-color-accent=amber] .md-typeset a:hover{color:#ffab00}[data-md-color-accent=amber] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=amber] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-nav__link:focus,[data-md-color-accent=amber] .md-nav__link:hover,[data-md-color-accent=amber] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=amber] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=amber] .md-typeset .md-clipboard:active:before,[data-md-color-accent=amber] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=amber] .md-typeset [id] .headerlink:focus,[data-md-color-accent=amber] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=amber] .md-typeset [id]:target .headerlink{color:#ffab00}[data-md-color-accent=amber] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-search-result__link:hover,[data-md-color-accent=amber] .md-search-result__link[data-md-state=active]{background-color:rgba(255,171,0,.1)}[data-md-color-accent=amber] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-source-file:hover:before{background-color:#ffab00}button[data-md-color-accent=orange]{background-color:#ff9100}[data-md-color-accent=orange] .md-typeset a:active,[data-md-color-accent=orange] .md-typeset a:hover{color:#ff9100}[data-md-color-accent=orange] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=orange] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-nav__link:focus,[data-md-color-accent=orange] .md-nav__link:hover,[data-md-color-accent=orange] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=orange] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=orange] .md-typeset .md-clipboard:active:before,[data-md-color-accent=orange] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=orange] .md-typeset [id] .headerlink:focus,[data-md-color-accent=orange] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=orange] .md-typeset [id]:target .headerlink{color:#ff9100}[data-md-color-accent=orange] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-search-result__link:hover,[data-md-color-accent=orange] .md-search-result__link[data-md-state=active]{background-color:rgba(255,145,0,.1)}[data-md-color-accent=orange] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-source-file:hover:before{background-color:#ff9100}button[data-md-color-accent=deep-orange]{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-typeset a:active,[data-md-color-accent=deep-orange] .md-typeset a:hover{color:#ff6e40}[data-md-color-accent=deep-orange] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=deep-orange] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-nav__link:focus,[data-md-color-accent=deep-orange] .md-nav__link:hover,[data-md-color-accent=deep-orange] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=deep-orange] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=deep-orange] .md-typeset .md-clipboard:active:before,[data-md-color-accent=deep-orange] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=deep-orange] .md-typeset [id] .headerlink:focus,[data-md-color-accent=deep-orange] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=deep-orange] .md-typeset [id]:target .headerlink{color:#ff6e40}[data-md-color-accent=deep-orange] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-search-result__link:hover,[data-md-color-accent=deep-orange] .md-search-result__link[data-md-state=active]{background-color:rgba(255,110,64,.1)}[data-md-color-accent=deep-orange] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-source-file:hover:before{background-color:#ff6e40}@media only screen and (max-width:59.9375em){[data-md-color-primary=red] .md-nav__source{background-color:rgba(190,66,64,.9675)}[data-md-color-primary=pink] .md-nav__source{background-color:rgba(185,24,79,.9675)}[data-md-color-primary=purple] .md-nav__source{background-color:rgba(136,57,150,.9675)}[data-md-color-primary=deep-purple] .md-nav__source{background-color:rgba(100,69,154,.9675)}[data-md-color-primary=indigo] .md-nav__source{background-color:rgba(50,64,144,.9675)}[data-md-color-primary=blue] .md-nav__source{background-color:rgba(26,119,193,.9675)}[data-md-color-primary=light-blue] .md-nav__source{background-color:rgba(2,134,194,.9675)}[data-md-color-primary=cyan] .md-nav__source{background-color:rgba(0,150,169,.9675)}[data-md-color-primary=teal] .md-nav__source{background-color:rgba(0,119,108,.9675)}[data-md-color-primary=green] .md-nav__source{background-color:rgba(60,139,64,.9675)}[data-md-color-primary=light-green] .md-nav__source{background-color:rgba(99,142,53,.9675)}[data-md-color-primary=lime] .md-nav__source{background-color:rgba(153,161,41,.9675)}[data-md-color-primary=yellow] .md-nav__source{background-color:rgba(198,134,29,.9675)}[data-md-color-primary=amber] .md-nav__source{background-color:rgba(203,127,0,.9675)}[data-md-color-primary=orange] .md-nav__source{background-color:rgba(200,111,0,.9675)}[data-md-color-primary=deep-orange] .md-nav__source{background-color:rgba(203,89,53,.9675)}[data-md-color-primary=brown] .md-nav__source{background-color:rgba(96,68,57,.9675)}[data-md-color-primary=grey] .md-nav__source{background-color:rgba(93,93,93,.9675)}[data-md-color-primary=blue-grey] .md-nav__source{background-color:rgba(67,88,97,.9675)}[data-md-color-primary=white] .md-nav__source{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.87)}}@media only screen and (max-width:76.1875em){html [data-md-color-primary=red] .md-nav--primary .md-nav__title--site{background-color:#ef5350}html [data-md-color-primary=pink] .md-nav--primary .md-nav__title--site{background-color:#e91e63}html [data-md-color-primary=purple] .md-nav--primary .md-nav__title--site{background-color:#ab47bc}html [data-md-color-primary=deep-purple] .md-nav--primary .md-nav__title--site{background-color:#7e57c2}html [data-md-color-primary=indigo] .md-nav--primary .md-nav__title--site{background-color:#3f51b5}html [data-md-color-primary=blue] .md-nav--primary .md-nav__title--site{background-color:#2196f3}html [data-md-color-primary=light-blue] .md-nav--primary .md-nav__title--site{background-color:#03a9f4}html [data-md-color-primary=cyan] .md-nav--primary .md-nav__title--site{background-color:#00bcd4}html [data-md-color-primary=teal] .md-nav--primary .md-nav__title--site{background-color:#009688}html [data-md-color-primary=green] .md-nav--primary .md-nav__title--site{background-color:#4caf50}html [data-md-color-primary=light-green] .md-nav--primary .md-nav__title--site{background-color:#7cb342}html [data-md-color-primary=lime] .md-nav--primary .md-nav__title--site{background-color:#c0ca33}html [data-md-color-primary=yellow] .md-nav--primary .md-nav__title--site{background-color:#f9a825}html [data-md-color-primary=amber] .md-nav--primary .md-nav__title--site{background-color:#ffa000}html [data-md-color-primary=orange] .md-nav--primary .md-nav__title--site{background-color:#fb8c00}html [data-md-color-primary=deep-orange] .md-nav--primary .md-nav__title--site{background-color:#ff7043}html [data-md-color-primary=brown] .md-nav--primary .md-nav__title--site{background-color:#795548}html [data-md-color-primary=grey] .md-nav--primary .md-nav__title--site{background-color:#757575}html [data-md-color-primary=blue-grey] .md-nav--primary .md-nav__title--site{background-color:#546e7a}html [data-md-color-primary=white] .md-nav--primary .md-nav__title--site{background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=white] .md-hero{border-bottom:.1rem solid rgba(0,0,0,.07)}}@media only screen and (min-width:76.25em){[data-md-color-primary=red] .md-tabs{background-color:#ef5350}[data-md-color-primary=pink] .md-tabs{background-color:#e91e63}[data-md-color-primary=purple] .md-tabs{background-color:#ab47bc}[data-md-color-primary=deep-purple] .md-tabs{background-color:#7e57c2}[data-md-color-primary=indigo] .md-tabs{background-color:#3f51b5}[data-md-color-primary=blue] .md-tabs{background-color:#2196f3}[data-md-color-primary=light-blue] .md-tabs{background-color:#03a9f4}[data-md-color-primary=cyan] .md-tabs{background-color:#00bcd4}[data-md-color-primary=teal] .md-tabs{background-color:#009688}[data-md-color-primary=green] .md-tabs{background-color:#4caf50}[data-md-color-primary=light-green] .md-tabs{background-color:#7cb342}[data-md-color-primary=lime] .md-tabs{background-color:#c0ca33}[data-md-color-primary=yellow] .md-tabs{background-color:#f9a825}[data-md-color-primary=amber] .md-tabs{background-color:#ffa000}[data-md-color-primary=orange] .md-tabs{background-color:#fb8c00}[data-md-color-primary=deep-orange] .md-tabs{background-color:#ff7043}[data-md-color-primary=brown] .md-tabs{background-color:#795548}[data-md-color-primary=grey] .md-tabs{background-color:#757575}[data-md-color-primary=blue-grey] .md-tabs{background-color:#546e7a}[data-md-color-primary=white] .md-tabs{border-bottom:.1rem solid rgba(0,0,0,.07);background-color:#fff;color:rgba(0,0,0,.87)}}@media only screen and (min-width:60em){[data-md-color-primary=white] .md-search__input{background-color:rgba(0,0,0,.07)}[data-md-color-primary=white] .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=white] .md-search__input:-ms-input-placeholder,[data-md-color-primary=white] .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=white] .md-search__input::placeholder{color:rgba(0,0,0,.54)}} +button[data-md-color-accent],button[data-md-color-primary]{width:13rem;margin-bottom:.4rem;padding:2.4rem .8rem .4rem;-webkit-transition:background-color .25s,opacity .25s;transition:background-color .25s,opacity .25s;border-radius:.2rem;color:#fff;font-size:1.28rem;text-align:left;cursor:pointer}button[data-md-color-accent]:hover,button[data-md-color-primary]:hover{opacity:.75}button[data-md-color-primary=red]{background-color:#ef5350}[data-md-color-primary=red] .md-typeset a{color:#ef5350}[data-md-color-primary=red] .md-header,[data-md-color-primary=red] .md-hero{background-color:#ef5350}[data-md-color-primary=red] .md-nav__link--active,[data-md-color-primary=red] .md-nav__link:active{color:#ef5350}[data-md-color-primary=red] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=pink]{background-color:#e91e63}[data-md-color-primary=pink] .md-typeset a{color:#e91e63}[data-md-color-primary=pink] .md-header,[data-md-color-primary=pink] .md-hero{background-color:#e91e63}[data-md-color-primary=pink] .md-nav__link--active,[data-md-color-primary=pink] .md-nav__link:active{color:#e91e63}[data-md-color-primary=pink] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=purple]{background-color:#ab47bc}[data-md-color-primary=purple] .md-typeset a{color:#ab47bc}[data-md-color-primary=purple] .md-header,[data-md-color-primary=purple] .md-hero{background-color:#ab47bc}[data-md-color-primary=purple] .md-nav__link--active,[data-md-color-primary=purple] .md-nav__link:active{color:#ab47bc}[data-md-color-primary=purple] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=deep-purple]{background-color:#7e57c2}[data-md-color-primary=deep-purple] .md-typeset a{color:#7e57c2}[data-md-color-primary=deep-purple] .md-header,[data-md-color-primary=deep-purple] .md-hero{background-color:#7e57c2}[data-md-color-primary=deep-purple] .md-nav__link--active,[data-md-color-primary=deep-purple] .md-nav__link:active{color:#7e57c2}[data-md-color-primary=deep-purple] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=indigo]{background-color:#3f51b5}[data-md-color-primary=indigo] .md-typeset a{color:#3f51b5}[data-md-color-primary=indigo] .md-header,[data-md-color-primary=indigo] .md-hero{background-color:#3f51b5}[data-md-color-primary=indigo] .md-nav__link--active,[data-md-color-primary=indigo] .md-nav__link:active{color:#3f51b5}[data-md-color-primary=indigo] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=blue]{background-color:#2196f3}[data-md-color-primary=blue] .md-typeset a{color:#2196f3}[data-md-color-primary=blue] .md-header,[data-md-color-primary=blue] .md-hero{background-color:#2196f3}[data-md-color-primary=blue] .md-nav__link--active,[data-md-color-primary=blue] .md-nav__link:active{color:#2196f3}[data-md-color-primary=blue] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=light-blue]{background-color:#03a9f4}[data-md-color-primary=light-blue] .md-typeset a{color:#03a9f4}[data-md-color-primary=light-blue] .md-header,[data-md-color-primary=light-blue] .md-hero{background-color:#03a9f4}[data-md-color-primary=light-blue] .md-nav__link--active,[data-md-color-primary=light-blue] .md-nav__link:active{color:#03a9f4}[data-md-color-primary=light-blue] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=cyan]{background-color:#00bcd4}[data-md-color-primary=cyan] .md-typeset a{color:#00bcd4}[data-md-color-primary=cyan] .md-header,[data-md-color-primary=cyan] .md-hero{background-color:#00bcd4}[data-md-color-primary=cyan] .md-nav__link--active,[data-md-color-primary=cyan] .md-nav__link:active{color:#00bcd4}[data-md-color-primary=cyan] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=teal]{background-color:#009688}[data-md-color-primary=teal] .md-typeset a{color:#009688}[data-md-color-primary=teal] .md-header,[data-md-color-primary=teal] .md-hero{background-color:#009688}[data-md-color-primary=teal] .md-nav__link--active,[data-md-color-primary=teal] .md-nav__link:active{color:#009688}[data-md-color-primary=teal] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=green]{background-color:#4caf50}[data-md-color-primary=green] .md-typeset a{color:#4caf50}[data-md-color-primary=green] .md-header,[data-md-color-primary=green] .md-hero{background-color:#4caf50}[data-md-color-primary=green] .md-nav__link--active,[data-md-color-primary=green] .md-nav__link:active{color:#4caf50}[data-md-color-primary=green] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=light-green]{background-color:#7cb342}[data-md-color-primary=light-green] .md-typeset a{color:#7cb342}[data-md-color-primary=light-green] .md-header,[data-md-color-primary=light-green] .md-hero{background-color:#7cb342}[data-md-color-primary=light-green] .md-nav__link--active,[data-md-color-primary=light-green] .md-nav__link:active{color:#7cb342}[data-md-color-primary=light-green] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=lime]{background-color:#c0ca33}[data-md-color-primary=lime] .md-typeset a{color:#c0ca33}[data-md-color-primary=lime] .md-header,[data-md-color-primary=lime] .md-hero{background-color:#c0ca33}[data-md-color-primary=lime] .md-nav__link--active,[data-md-color-primary=lime] .md-nav__link:active{color:#c0ca33}[data-md-color-primary=lime] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=yellow]{background-color:#f9a825}[data-md-color-primary=yellow] .md-typeset a{color:#f9a825}[data-md-color-primary=yellow] .md-header,[data-md-color-primary=yellow] .md-hero{background-color:#f9a825}[data-md-color-primary=yellow] .md-nav__link--active,[data-md-color-primary=yellow] .md-nav__link:active{color:#f9a825}[data-md-color-primary=yellow] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=amber]{background-color:#ffa000}[data-md-color-primary=amber] .md-typeset a{color:#ffa000}[data-md-color-primary=amber] .md-header,[data-md-color-primary=amber] .md-hero{background-color:#ffa000}[data-md-color-primary=amber] .md-nav__link--active,[data-md-color-primary=amber] .md-nav__link:active{color:#ffa000}[data-md-color-primary=amber] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=orange]{background-color:#fb8c00}[data-md-color-primary=orange] .md-typeset a{color:#fb8c00}[data-md-color-primary=orange] .md-header,[data-md-color-primary=orange] .md-hero{background-color:#fb8c00}[data-md-color-primary=orange] .md-nav__link--active,[data-md-color-primary=orange] .md-nav__link:active{color:#fb8c00}[data-md-color-primary=orange] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=deep-orange]{background-color:#ff7043}[data-md-color-primary=deep-orange] .md-typeset a{color:#ff7043}[data-md-color-primary=deep-orange] .md-header,[data-md-color-primary=deep-orange] .md-hero{background-color:#ff7043}[data-md-color-primary=deep-orange] .md-nav__link--active,[data-md-color-primary=deep-orange] .md-nav__link:active{color:#ff7043}[data-md-color-primary=deep-orange] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=brown]{background-color:#795548}[data-md-color-primary=brown] .md-typeset a{color:#795548}[data-md-color-primary=brown] .md-header,[data-md-color-primary=brown] .md-hero{background-color:#795548}[data-md-color-primary=brown] .md-nav__link--active,[data-md-color-primary=brown] .md-nav__link:active{color:#795548}[data-md-color-primary=brown] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=grey]{background-color:#757575}[data-md-color-primary=grey] .md-typeset a{color:#757575}[data-md-color-primary=grey] .md-header,[data-md-color-primary=grey] .md-hero{background-color:#757575}[data-md-color-primary=grey] .md-nav__link--active,[data-md-color-primary=grey] .md-nav__link:active{color:#757575}[data-md-color-primary=grey] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=blue-grey]{background-color:#546e7a}[data-md-color-primary=blue-grey] .md-typeset a{color:#546e7a}[data-md-color-primary=blue-grey] .md-header,[data-md-color-primary=blue-grey] .md-hero{background-color:#546e7a}[data-md-color-primary=blue-grey] .md-nav__link--active,[data-md-color-primary=blue-grey] .md-nav__link:active{color:#546e7a}[data-md-color-primary=blue-grey] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=white]{-webkit-box-shadow:0 0 .1rem rgba(0,0,0,.54) inset;box-shadow:inset 0 0 .1rem rgba(0,0,0,.54)}[data-md-color-primary=white] .md-header,[data-md-color-primary=white] .md-hero,button[data-md-color-primary=white]{background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=white] .md-hero--expand{border-bottom:.1rem solid rgba(0,0,0,.07)}button[data-md-color-accent=red]{background-color:#ff1744}[data-md-color-accent=red] .md-typeset a:active,[data-md-color-accent=red] .md-typeset a:hover{color:#ff1744}[data-md-color-accent=red] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=red] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-nav__link:focus,[data-md-color-accent=red] .md-nav__link:hover,[data-md-color-accent=red] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=red] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=red] .md-typeset .md-clipboard:active:before,[data-md-color-accent=red] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=red] .md-typeset [id] .headerlink:focus,[data-md-color-accent=red] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=red] .md-typeset [id]:target .headerlink{color:#ff1744}[data-md-color-accent=red] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-search-result__link:hover,[data-md-color-accent=red] .md-search-result__link[data-md-state=active]{background-color:rgba(255,23,68,.1)}[data-md-color-accent=red] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-source-file:hover:before{background-color:#ff1744}button[data-md-color-accent=pink]{background-color:#f50057}[data-md-color-accent=pink] .md-typeset a:active,[data-md-color-accent=pink] .md-typeset a:hover{color:#f50057}[data-md-color-accent=pink] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=pink] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-nav__link:focus,[data-md-color-accent=pink] .md-nav__link:hover,[data-md-color-accent=pink] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=pink] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=pink] .md-typeset .md-clipboard:active:before,[data-md-color-accent=pink] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=pink] .md-typeset [id] .headerlink:focus,[data-md-color-accent=pink] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=pink] .md-typeset [id]:target .headerlink{color:#f50057}[data-md-color-accent=pink] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-search-result__link:hover,[data-md-color-accent=pink] .md-search-result__link[data-md-state=active]{background-color:rgba(245,0,87,.1)}[data-md-color-accent=pink] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-source-file:hover:before{background-color:#f50057}button[data-md-color-accent=purple]{background-color:#e040fb}[data-md-color-accent=purple] .md-typeset a:active,[data-md-color-accent=purple] .md-typeset a:hover{color:#e040fb}[data-md-color-accent=purple] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=purple] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-nav__link:focus,[data-md-color-accent=purple] .md-nav__link:hover,[data-md-color-accent=purple] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=purple] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=purple] .md-typeset .md-clipboard:active:before,[data-md-color-accent=purple] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=purple] .md-typeset [id] .headerlink:focus,[data-md-color-accent=purple] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=purple] .md-typeset [id]:target .headerlink{color:#e040fb}[data-md-color-accent=purple] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-search-result__link:hover,[data-md-color-accent=purple] .md-search-result__link[data-md-state=active]{background-color:rgba(224,64,251,.1)}[data-md-color-accent=purple] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-source-file:hover:before{background-color:#e040fb}button[data-md-color-accent=deep-purple]{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-typeset a:active,[data-md-color-accent=deep-purple] .md-typeset a:hover{color:#7c4dff}[data-md-color-accent=deep-purple] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=deep-purple] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-nav__link:focus,[data-md-color-accent=deep-purple] .md-nav__link:hover,[data-md-color-accent=deep-purple] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=deep-purple] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=deep-purple] .md-typeset .md-clipboard:active:before,[data-md-color-accent=deep-purple] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=deep-purple] .md-typeset [id] .headerlink:focus,[data-md-color-accent=deep-purple] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=deep-purple] .md-typeset [id]:target .headerlink{color:#7c4dff}[data-md-color-accent=deep-purple] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-search-result__link:hover,[data-md-color-accent=deep-purple] .md-search-result__link[data-md-state=active]{background-color:rgba(124,77,255,.1)}[data-md-color-accent=deep-purple] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-source-file:hover:before{background-color:#7c4dff}button[data-md-color-accent=indigo]{background-color:#536dfe}[data-md-color-accent=indigo] .md-typeset a:active,[data-md-color-accent=indigo] .md-typeset a:hover{color:#536dfe}[data-md-color-accent=indigo] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=indigo] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-nav__link:focus,[data-md-color-accent=indigo] .md-nav__link:hover,[data-md-color-accent=indigo] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=indigo] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=indigo] .md-typeset .md-clipboard:active:before,[data-md-color-accent=indigo] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=indigo] .md-typeset [id] .headerlink:focus,[data-md-color-accent=indigo] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=indigo] .md-typeset [id]:target .headerlink{color:#536dfe}[data-md-color-accent=indigo] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-search-result__link:hover,[data-md-color-accent=indigo] .md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}[data-md-color-accent=indigo] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-source-file:hover:before{background-color:#536dfe}button[data-md-color-accent=blue]{background-color:#448aff}[data-md-color-accent=blue] .md-typeset a:active,[data-md-color-accent=blue] .md-typeset a:hover{color:#448aff}[data-md-color-accent=blue] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=blue] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-nav__link:focus,[data-md-color-accent=blue] .md-nav__link:hover,[data-md-color-accent=blue] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=blue] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=blue] .md-typeset .md-clipboard:active:before,[data-md-color-accent=blue] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=blue] .md-typeset [id] .headerlink:focus,[data-md-color-accent=blue] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=blue] .md-typeset [id]:target .headerlink{color:#448aff}[data-md-color-accent=blue] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-search-result__link:hover,[data-md-color-accent=blue] .md-search-result__link[data-md-state=active]{background-color:rgba(68,138,255,.1)}[data-md-color-accent=blue] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-source-file:hover:before{background-color:#448aff}button[data-md-color-accent=light-blue]{background-color:#0091ea}[data-md-color-accent=light-blue] .md-typeset a:active,[data-md-color-accent=light-blue] .md-typeset a:hover{color:#0091ea}[data-md-color-accent=light-blue] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=light-blue] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-nav__link:focus,[data-md-color-accent=light-blue] .md-nav__link:hover,[data-md-color-accent=light-blue] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=light-blue] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=light-blue] .md-typeset .md-clipboard:active:before,[data-md-color-accent=light-blue] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=light-blue] .md-typeset [id] .headerlink:focus,[data-md-color-accent=light-blue] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=light-blue] .md-typeset [id]:target .headerlink{color:#0091ea}[data-md-color-accent=light-blue] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-search-result__link:hover,[data-md-color-accent=light-blue] .md-search-result__link[data-md-state=active]{background-color:rgba(0,145,234,.1)}[data-md-color-accent=light-blue] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-source-file:hover:before{background-color:#0091ea}button[data-md-color-accent=cyan]{background-color:#00b8d4}[data-md-color-accent=cyan] .md-typeset a:active,[data-md-color-accent=cyan] .md-typeset a:hover{color:#00b8d4}[data-md-color-accent=cyan] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=cyan] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-nav__link:focus,[data-md-color-accent=cyan] .md-nav__link:hover,[data-md-color-accent=cyan] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=cyan] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=cyan] .md-typeset .md-clipboard:active:before,[data-md-color-accent=cyan] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=cyan] .md-typeset [id] .headerlink:focus,[data-md-color-accent=cyan] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=cyan] .md-typeset [id]:target .headerlink{color:#00b8d4}[data-md-color-accent=cyan] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-search-result__link:hover,[data-md-color-accent=cyan] .md-search-result__link[data-md-state=active]{background-color:rgba(0,184,212,.1)}[data-md-color-accent=cyan] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-source-file:hover:before{background-color:#00b8d4}button[data-md-color-accent=teal]{background-color:#00bfa5}[data-md-color-accent=teal] .md-typeset a:active,[data-md-color-accent=teal] .md-typeset a:hover{color:#00bfa5}[data-md-color-accent=teal] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=teal] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-nav__link:focus,[data-md-color-accent=teal] .md-nav__link:hover,[data-md-color-accent=teal] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=teal] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=teal] .md-typeset .md-clipboard:active:before,[data-md-color-accent=teal] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=teal] .md-typeset [id] .headerlink:focus,[data-md-color-accent=teal] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=teal] .md-typeset [id]:target .headerlink{color:#00bfa5}[data-md-color-accent=teal] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-search-result__link:hover,[data-md-color-accent=teal] .md-search-result__link[data-md-state=active]{background-color:rgba(0,191,165,.1)}[data-md-color-accent=teal] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-source-file:hover:before{background-color:#00bfa5}button[data-md-color-accent=green]{background-color:#00c853}[data-md-color-accent=green] .md-typeset a:active,[data-md-color-accent=green] .md-typeset a:hover{color:#00c853}[data-md-color-accent=green] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=green] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-nav__link:focus,[data-md-color-accent=green] .md-nav__link:hover,[data-md-color-accent=green] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=green] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=green] .md-typeset .md-clipboard:active:before,[data-md-color-accent=green] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=green] .md-typeset [id] .headerlink:focus,[data-md-color-accent=green] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=green] .md-typeset [id]:target .headerlink{color:#00c853}[data-md-color-accent=green] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-search-result__link:hover,[data-md-color-accent=green] .md-search-result__link[data-md-state=active]{background-color:rgba(0,200,83,.1)}[data-md-color-accent=green] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-source-file:hover:before{background-color:#00c853}button[data-md-color-accent=light-green]{background-color:#64dd17}[data-md-color-accent=light-green] .md-typeset a:active,[data-md-color-accent=light-green] .md-typeset a:hover{color:#64dd17}[data-md-color-accent=light-green] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=light-green] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-nav__link:focus,[data-md-color-accent=light-green] .md-nav__link:hover,[data-md-color-accent=light-green] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=light-green] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=light-green] .md-typeset .md-clipboard:active:before,[data-md-color-accent=light-green] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=light-green] .md-typeset [id] .headerlink:focus,[data-md-color-accent=light-green] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=light-green] .md-typeset [id]:target .headerlink{color:#64dd17}[data-md-color-accent=light-green] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-search-result__link:hover,[data-md-color-accent=light-green] .md-search-result__link[data-md-state=active]{background-color:rgba(100,221,23,.1)}[data-md-color-accent=light-green] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-source-file:hover:before{background-color:#64dd17}button[data-md-color-accent=lime]{background-color:#aeea00}[data-md-color-accent=lime] .md-typeset a:active,[data-md-color-accent=lime] .md-typeset a:hover{color:#aeea00}[data-md-color-accent=lime] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=lime] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-nav__link:focus,[data-md-color-accent=lime] .md-nav__link:hover,[data-md-color-accent=lime] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=lime] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=lime] .md-typeset .md-clipboard:active:before,[data-md-color-accent=lime] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=lime] .md-typeset [id] .headerlink:focus,[data-md-color-accent=lime] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=lime] .md-typeset [id]:target .headerlink{color:#aeea00}[data-md-color-accent=lime] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-search-result__link:hover,[data-md-color-accent=lime] .md-search-result__link[data-md-state=active]{background-color:rgba(174,234,0,.1)}[data-md-color-accent=lime] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-source-file:hover:before{background-color:#aeea00}button[data-md-color-accent=yellow]{background-color:#ffd600}[data-md-color-accent=yellow] .md-typeset a:active,[data-md-color-accent=yellow] .md-typeset a:hover{color:#ffd600}[data-md-color-accent=yellow] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=yellow] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-nav__link:focus,[data-md-color-accent=yellow] .md-nav__link:hover,[data-md-color-accent=yellow] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=yellow] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=yellow] .md-typeset .md-clipboard:active:before,[data-md-color-accent=yellow] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=yellow] .md-typeset [id] .headerlink:focus,[data-md-color-accent=yellow] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=yellow] .md-typeset [id]:target .headerlink{color:#ffd600}[data-md-color-accent=yellow] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-search-result__link:hover,[data-md-color-accent=yellow] .md-search-result__link[data-md-state=active]{background-color:rgba(255,214,0,.1)}[data-md-color-accent=yellow] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-source-file:hover:before{background-color:#ffd600}button[data-md-color-accent=amber]{background-color:#ffab00}[data-md-color-accent=amber] .md-typeset a:active,[data-md-color-accent=amber] .md-typeset a:hover{color:#ffab00}[data-md-color-accent=amber] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=amber] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-nav__link:focus,[data-md-color-accent=amber] .md-nav__link:hover,[data-md-color-accent=amber] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=amber] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=amber] .md-typeset .md-clipboard:active:before,[data-md-color-accent=amber] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=amber] .md-typeset [id] .headerlink:focus,[data-md-color-accent=amber] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=amber] .md-typeset [id]:target .headerlink{color:#ffab00}[data-md-color-accent=amber] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-search-result__link:hover,[data-md-color-accent=amber] .md-search-result__link[data-md-state=active]{background-color:rgba(255,171,0,.1)}[data-md-color-accent=amber] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-source-file:hover:before{background-color:#ffab00}button[data-md-color-accent=orange]{background-color:#ff9100}[data-md-color-accent=orange] .md-typeset a:active,[data-md-color-accent=orange] .md-typeset a:hover{color:#ff9100}[data-md-color-accent=orange] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=orange] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-nav__link:focus,[data-md-color-accent=orange] .md-nav__link:hover,[data-md-color-accent=orange] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=orange] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=orange] .md-typeset .md-clipboard:active:before,[data-md-color-accent=orange] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=orange] .md-typeset [id] .headerlink:focus,[data-md-color-accent=orange] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=orange] .md-typeset [id]:target .headerlink{color:#ff9100}[data-md-color-accent=orange] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-search-result__link:hover,[data-md-color-accent=orange] .md-search-result__link[data-md-state=active]{background-color:rgba(255,145,0,.1)}[data-md-color-accent=orange] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-source-file:hover:before{background-color:#ff9100}button[data-md-color-accent=deep-orange]{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-typeset a:active,[data-md-color-accent=deep-orange] .md-typeset a:hover{color:#ff6e40}[data-md-color-accent=deep-orange] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=deep-orange] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-nav__link:focus,[data-md-color-accent=deep-orange] .md-nav__link:hover,[data-md-color-accent=deep-orange] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=deep-orange] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=deep-orange] .md-typeset .md-clipboard:active:before,[data-md-color-accent=deep-orange] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=deep-orange] .md-typeset [id] .headerlink:focus,[data-md-color-accent=deep-orange] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=deep-orange] .md-typeset [id]:target .headerlink{color:#ff6e40}[data-md-color-accent=deep-orange] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-search-result__link:hover,[data-md-color-accent=deep-orange] .md-search-result__link[data-md-state=active]{background-color:rgba(255,110,64,.1)}[data-md-color-accent=deep-orange] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-source-file:hover:before{background-color:#ff6e40}@media only screen and (max-width:59.9375em){[data-md-color-primary=red] .md-nav__source{background-color:rgba(190,66,64,.9675)}[data-md-color-primary=pink] .md-nav__source{background-color:rgba(185,24,79,.9675)}[data-md-color-primary=purple] .md-nav__source{background-color:rgba(136,57,150,.9675)}[data-md-color-primary=deep-purple] .md-nav__source{background-color:rgba(100,69,154,.9675)}[data-md-color-primary=indigo] .md-nav__source{background-color:rgba(50,64,144,.9675)}[data-md-color-primary=blue] .md-nav__source{background-color:rgba(26,119,193,.9675)}[data-md-color-primary=light-blue] .md-nav__source{background-color:rgba(2,134,194,.9675)}[data-md-color-primary=cyan] .md-nav__source{background-color:rgba(0,150,169,.9675)}[data-md-color-primary=teal] .md-nav__source{background-color:rgba(0,119,108,.9675)}[data-md-color-primary=green] .md-nav__source{background-color:rgba(60,139,64,.9675)}[data-md-color-primary=light-green] .md-nav__source{background-color:rgba(99,142,53,.9675)}[data-md-color-primary=lime] .md-nav__source{background-color:rgba(153,161,41,.9675)}[data-md-color-primary=yellow] .md-nav__source{background-color:rgba(198,134,29,.9675)}[data-md-color-primary=amber] .md-nav__source{background-color:rgba(203,127,0,.9675)}[data-md-color-primary=orange] .md-nav__source{background-color:rgba(200,111,0,.9675)}[data-md-color-primary=deep-orange] .md-nav__source{background-color:rgba(203,89,53,.9675)}[data-md-color-primary=brown] .md-nav__source{background-color:rgba(96,68,57,.9675)}[data-md-color-primary=grey] .md-nav__source{background-color:rgba(93,93,93,.9675)}[data-md-color-primary=blue-grey] .md-nav__source{background-color:rgba(67,88,97,.9675)}[data-md-color-primary=white] .md-nav__source{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.87)}}@media only screen and (max-width:76.1875em){html [data-md-color-primary=red] .md-nav--primary .md-nav__title--site{background-color:#ef5350}html [data-md-color-primary=pink] .md-nav--primary .md-nav__title--site{background-color:#e91e63}html [data-md-color-primary=purple] .md-nav--primary .md-nav__title--site{background-color:#ab47bc}html [data-md-color-primary=deep-purple] .md-nav--primary .md-nav__title--site{background-color:#7e57c2}html [data-md-color-primary=indigo] .md-nav--primary .md-nav__title--site{background-color:#3f51b5}html [data-md-color-primary=blue] .md-nav--primary .md-nav__title--site{background-color:#2196f3}html [data-md-color-primary=light-blue] .md-nav--primary .md-nav__title--site{background-color:#03a9f4}html [data-md-color-primary=cyan] .md-nav--primary .md-nav__title--site{background-color:#00bcd4}html [data-md-color-primary=teal] .md-nav--primary .md-nav__title--site{background-color:#009688}html [data-md-color-primary=green] .md-nav--primary .md-nav__title--site{background-color:#4caf50}html [data-md-color-primary=light-green] .md-nav--primary .md-nav__title--site{background-color:#7cb342}html [data-md-color-primary=lime] .md-nav--primary .md-nav__title--site{background-color:#c0ca33}html [data-md-color-primary=yellow] .md-nav--primary .md-nav__title--site{background-color:#f9a825}html [data-md-color-primary=amber] .md-nav--primary .md-nav__title--site{background-color:#ffa000}html [data-md-color-primary=orange] .md-nav--primary .md-nav__title--site{background-color:#fb8c00}html [data-md-color-primary=deep-orange] .md-nav--primary .md-nav__title--site{background-color:#ff7043}html [data-md-color-primary=brown] .md-nav--primary .md-nav__title--site{background-color:#795548}html [data-md-color-primary=grey] .md-nav--primary .md-nav__title--site{background-color:#757575}html [data-md-color-primary=blue-grey] .md-nav--primary .md-nav__title--site{background-color:#546e7a}html [data-md-color-primary=white] .md-nav--primary .md-nav__title--site{background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=white] .md-hero{border-bottom:.1rem solid rgba(0,0,0,.07)}}@media only screen and (min-width:76.25em){[data-md-color-primary=red] .md-tabs{background-color:#ef5350}[data-md-color-primary=pink] .md-tabs{background-color:#e91e63}[data-md-color-primary=purple] .md-tabs{background-color:#ab47bc}[data-md-color-primary=deep-purple] .md-tabs{background-color:#7e57c2}[data-md-color-primary=indigo] .md-tabs{background-color:#3f51b5}[data-md-color-primary=blue] .md-tabs{background-color:#2196f3}[data-md-color-primary=light-blue] .md-tabs{background-color:#03a9f4}[data-md-color-primary=cyan] .md-tabs{background-color:#00bcd4}[data-md-color-primary=teal] .md-tabs{background-color:#009688}[data-md-color-primary=green] .md-tabs{background-color:#4caf50}[data-md-color-primary=light-green] .md-tabs{background-color:#7cb342}[data-md-color-primary=lime] .md-tabs{background-color:#c0ca33}[data-md-color-primary=yellow] .md-tabs{background-color:#f9a825}[data-md-color-primary=amber] .md-tabs{background-color:#ffa000}[data-md-color-primary=orange] .md-tabs{background-color:#fb8c00}[data-md-color-primary=deep-orange] .md-tabs{background-color:#ff7043}[data-md-color-primary=brown] .md-tabs{background-color:#795548}[data-md-color-primary=grey] .md-tabs{background-color:#757575}[data-md-color-primary=blue-grey] .md-tabs{background-color:#546e7a}[data-md-color-primary=white] .md-tabs{border-bottom:.1rem solid rgba(0,0,0,.07);background-color:)}} /*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24tcGFsZXR0ZS43OTI0MzFjMS5jc3MiLCJzb3VyY2VSb290IjoiIn0=*/ \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css index 8a33734833a..b1bf3aa9583 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css @@ -1,2 +1 @@ -html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;border:0;outline-style:none;background:transparent;font-size:inherit}input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}[dir=rtl] .md-icon--arrow-back:before{content:"\E5C8"}[dir=rtl] .md-icon--arrow-forward:before{content:"\E5C4"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%;direction:ltr}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.3rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.07812em;margin-left:0}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}[dir=rtl] .md-typeset blockquote{padding-right:1.2rem;padding-left:0;border-right:.4rem solid rgba(0,0,0,.26);border-left:initial}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em;margin-left:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em;margin-left:0}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}[dir=rtl] .md-typeset ol li ol,[dir=rtl] .md-typeset ol li ul,[dir=rtl] .md-typeset ul li ol,[dir=rtl] .md-typeset ul li ul{margin-right:.625em;margin-left:0}.md-typeset dd{margin:1em 0 1em 1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em;margin-left:0}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) td:not([align]),[dir=rtl] .md-typeset table:not([class]) th:not([align]){text-align:right}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.07);content:"\E14D"}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{color:rgba(0,0,0,.54)}.md-clipboard:focus:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.no-js .md-header{-webkit-transition:none;transition:none}.md-header[data-md-state=shadow]{-webkit-transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s,-webkit-box-shadow .25s;-webkit-box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2);box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2)}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem)}.no-js .md-header-nav__topic{position:static}.no-js .md-header-nav__topic+.md-header-nav__topic{display:none}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem)}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}[dir=rtl] .md-footer-nav__link--prev{float:right}.md-footer-nav__link--next{width:75%;float:right;text-align:right}[dir=rtl] .md-footer-nav__link--next{float:left;text-align:left}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}[dir=rtl] .md-nav__title:before{content:"\E5C8"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-right:1.2rem;padding-left:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.4rem 0 7.2rem;text-overflow:ellipsis;z-index:2}[dir=rtl] .md-search__input{padding:0 7.2rem 0 4.4rem}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}[dir=rtl] .md-search__icon[for=search]{right:1rem;left:auto}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[dir=rtl] .md-search__icon[type=reset]{right:auto;left:1rem}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}[dir=rtl] .md-search-result__article--document:before{right:0;left:auto}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}[dir=rtl] .md-source{padding-right:0;padding-left:1.2rem}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}[dir=rtl] .md-source__icon svg{margin-right:1.2rem;margin-left:0}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-4.4rem;margin-left:0;padding-right:4rem;padding-left:0}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[dir=rtl] .md-source__fact{float:right}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:0 1.2rem;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem;overflow:auto}[dir=rtl] .md-typeset .admonition,[dir=rtl] .md-typeset details{border-right:.4rem solid #448aff;border-left:none}html .md-typeset .admonition>:last-child,html .md-typeset details>:last-child{margin-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:0 -1.2rem;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}[dir=rtl] .md-typeset .admonition>.admonition-title,[dir=rtl] .md-typeset .admonition>summary,[dir=rtl] .md-typeset details>.admonition-title,[dir=rtl] .md-typeset details>summary{padding:.8rem 4rem .8rem 1.2rem}.md-typeset .admonition>.admonition-title:last-child,.md-typeset .admonition>summary:last-child,.md-typeset details>.admonition-title:last-child,.md-typeset details>summary:last-child{margin-bottom:0}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}[dir=rtl] .md-typeset .admonition>.admonition-title:before,[dir=rtl] .md-typeset .admonition>summary:before,[dir=rtl] .md-typeset details>.admonition-title:before,[dir=rtl] .md-typeset details>summary:before{right:1.2rem;left:auto}.md-typeset .admonition.abstract,.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.abstract,.md-typeset details.summary,.md-typeset details.tldr{border-left-color:#00b0ff}[dir=rtl] .md-typeset .admonition.abstract,[dir=rtl] .md-typeset .admonition.summary,[dir=rtl] .md-typeset .admonition.tldr,[dir=rtl] .md-typeset details.abstract,[dir=rtl] .md-typeset details.summary,[dir=rtl] .md-typeset details.tldr{border-right-color:#00b0ff}.md-typeset .admonition.abstract>.admonition-title,.md-typeset .admonition.abstract>summary,.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.abstract>.admonition-title,.md-typeset details.abstract>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom-color:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.abstract>.admonition-title:before,.md-typeset .admonition.abstract>summary:before,.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.abstract>.admonition-title:before,.md-typeset details.abstract>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left-color:#00b8d4}[dir=rtl] .md-typeset .admonition.info,[dir=rtl] .md-typeset .admonition.todo,[dir=rtl] .md-typeset details.info,[dir=rtl] .md-typeset details.todo{border-right-color:#00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom-color:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left-color:#00bfa5}[dir=rtl] .md-typeset .admonition.hint,[dir=rtl] .md-typeset .admonition.important,[dir=rtl] .md-typeset .admonition.tip,[dir=rtl] .md-typeset details.hint,[dir=rtl] .md-typeset details.important,[dir=rtl] .md-typeset details.tip{border-right-color:#00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom-color:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left-color:#00c853}[dir=rtl] .md-typeset .admonition.check,[dir=rtl] .md-typeset .admonition.done,[dir=rtl] .md-typeset .admonition.success,[dir=rtl] .md-typeset details.check,[dir=rtl] .md-typeset details.done,[dir=rtl] .md-typeset details.success{border-right-color:#00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom-color:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left-color:#64dd17}[dir=rtl] .md-typeset .admonition.faq,[dir=rtl] .md-typeset .admonition.help,[dir=rtl] .md-typeset .admonition.question,[dir=rtl] .md-typeset details.faq,[dir=rtl] .md-typeset details.help,[dir=rtl] .md-typeset details.question{border-right-color:#64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom-color:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left-color:#ff9100}[dir=rtl] .md-typeset .admonition.attention,[dir=rtl] .md-typeset .admonition.caution,[dir=rtl] .md-typeset .admonition.warning,[dir=rtl] .md-typeset details.attention,[dir=rtl] .md-typeset details.caution,[dir=rtl] .md-typeset details.warning{border-right-color:#ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom-color:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left-color:#ff5252}[dir=rtl] .md-typeset .admonition.fail,[dir=rtl] .md-typeset .admonition.failure,[dir=rtl] .md-typeset .admonition.missing,[dir=rtl] .md-typeset details.fail,[dir=rtl] .md-typeset details.failure,[dir=rtl] .md-typeset details.missing{border-right-color:#ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom-color:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left-color:#ff1744}[dir=rtl] .md-typeset .admonition.danger,[dir=rtl] .md-typeset .admonition.error,[dir=rtl] .md-typeset details.danger,[dir=rtl] .md-typeset details.error{border-right-color:#ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom-color:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left-color:#f50057}[dir=rtl] .md-typeset .admonition.bug,[dir=rtl] .md-typeset details.bug{border-right-color:#f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom-color:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.example,.md-typeset details.example{border-left-color:#651fff}[dir=rtl] .md-typeset .admonition.example,[dir=rtl] .md-typeset details.example{border-right-color:#651fff}.md-typeset .admonition.example>.admonition-title,.md-typeset .admonition.example>summary,.md-typeset details.example>.admonition-title,.md-typeset details.example>summary{border-bottom-color:.1rem solid rgba(101,31,255,.1);background-color:rgba(101,31,255,.1)}.md-typeset .admonition.example>.admonition-title:before,.md-typeset .admonition.example>summary:before,.md-typeset details.example>.admonition-title:before,.md-typeset details.example>summary:before{color:#651fff;content:"\E242"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left-color:#9e9e9e}[dir=rtl] .md-typeset .admonition.cite,[dir=rtl] .md-typeset .admonition.quote,[dir=rtl] .md-typeset details.cite,[dir=rtl] .md-typeset details.quote{border-right-color:#9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom-color:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}[dir=rtl] .md-typeset .footnote-backref{-webkit-transform:translateX(-.5rem);transform:translateX(-.5rem)}.md-typeset .footnote-backref:before{display:inline-block;font-size:1.6rem;content:"\E31B"}[dir=rtl] .md-typeset .footnote-backref:before{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}[dir=rtl] .md-typeset .headerlink{margin-right:1rem;margin-left:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}[dir=rtl] .md-typeset details summary{padding-left:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}[dir=rtl] .md-typeset summary:after{right:auto;left:1.2rem}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em;left:auto}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}[dir=rtl] .md-typeset .task-list-control .task-list-indicator:before{right:-1.25em;left:auto}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}html [dir=rtl] .md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[dir=rtl] .md-search__overlay{right:.4rem;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}[dir=rtl] [data-md-toggle=search]:checked~.md-header .md-search__inner{right:0;left:auto}html [dir=rtl] .md-search__inner{right:100%;left:auto;-webkit-transform:translateX(-5%);transform:translateX(-5%)}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}[dir=rtl] .md-search__icon[for=search][for=search]:before{content:"\E5C8"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}html [dir=rtl] .md-nav--primary .md-nav__title--site .md-nav__button,html [dir=rtl] .md-nav--primary .md-nav__title:before{right:.4rem;left:auto}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}[dir=rtl] .md-nav--primary .md-nav__item{padding:0}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E314"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}[dir=rtl] .md-nav--primary .md-nav__link:after{right:auto;left:1.2rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:2.8rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:4rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:5.2rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:6.4rem;padding-left:0}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}[dir=rtl] .md-nav__toggle~.md-nav{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}[dir=rtl] .md-sidebar--primary{right:-24.2rem;left:auto}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-transform:translateX(-24.2rem);transform:translateX(-24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}[dir=rtl] .md-content{margin-right:0;margin-left:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}[dir=rtl] .md-header-nav__source{margin-right:2.8rem;margin-left:0;padding-right:0;padding-left:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[dir=rtl] .md-search__overlay{right:0;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}[dir=rtl] .md-search__inner{float:left}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}[dir=rtl] .md-search__input{padding-right:4.4rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-search-result__meta{padding-left:4.4rem}[dir=rtl] .md-search-result__meta{padding-right:4.4rem;padding-left:0}.md-search-result__article{padding-left:4.4rem}[dir=rtl] .md-search-result__article{padding-right:4.4rem;padding-left:1.6rem}.md-sidebar--secondary{display:block;margin-left:100%;-webkit-transform:translate(-100%);transform:translate(-100%)}[dir=rtl] .md-sidebar--secondary{margin-right:100%;margin-left:0;-webkit-transform:translate(100%);transform:translate(100%)}}@media only screen and (min-width:76.25em){.md-content{margin-left:24.2rem}[dir=rtl] .md-content{margin-right:24.2rem}.md-content__inner{margin-right:2.4rem;margin-left:2.4rem}.md-header-nav__button.md-icon--menu{display:none}.md-nav[data-md-state=animate]{-webkit-transition:max-height .25s cubic-bezier(.86,0,.07,1);transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav__toggle~.md-nav{max-height:0;overflow:hidden}.no-js .md-nav__toggle~.md-nav{display:none}.md-nav[data-md-state=expand],.md-nav__toggle:checked~.md-nav{max-height:100%}.no-js .md-nav[data-md-state=expand],.no-js .md-nav__toggle:checked~.md-nav{display:block}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--nested>.md-nav__link:after{display:inline-block;-webkit-transform-origin:.45em .45em;transform-origin:.45em .45em;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;vertical-align:-.125em}.js .md-nav__item--nested>.md-nav__link:after{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link:after{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:68.8rem}.md-sidebar--secondary{margin-left:122rem}[dir=rtl] .md-sidebar--secondary{margin-right:122rem;margin-left:0}.md-tabs~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{font-size:0;visibility:hidden}.md-tabs--active~.md-main .md-nav--primary .md-nav__title{display:block;padding:0}.md-tabs--active~.md-main .md-nav--primary .md-nav__title--site{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item{font-size:0;visibility:hidden}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{display:none;font-size:1.4rem;overflow:auto;visibility:visible}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--active{display:block}.md-tabs--active~.md-main .md-nav[data-md-level="1"]{max-height:none;overflow:visible}.md-tabs--active~.md-main .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:0}.md-tabs--active~.md-main .md-nav[data-md-level="1"] .md-nav .md-nav__title{display:none}}@media only screen and (min-width:45em){.md-footer-nav__link{width:50%}.md-footer-copyright{max-width:75%;float:left}[dir=rtl] .md-footer-copyright{float:right}.md-footer-social{padding:1.2rem 0;float:right}[dir=rtl] .md-footer-social{float:left}}@media only screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(45);transform:scale(45)}}@media only screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(60);transform:scale(60)}}@media only screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(75);transform:scale(75)}}@media only screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:46.8rem}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}} -/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uMmE4ODAwOGEuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ \ No newline at end of file +html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;border:0;outline-style:none;background:transparent;font-size:inherit}input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}[dir=rtl] .md-icon--arrow-back:before{content:"\E5C8"}[dir=rtl] .md-icon--arrow-forward:before{content:"\E5C4"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%;direction:ltr}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.3rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.07812em;margin-left:0}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}[dir=rtl] .md-typeset blockquote{padding-right:1.2rem;padding-left:0;border-right:.4rem solid rgba(0,0,0,.26);border-left:initial}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em;margin-left:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em;margin-left:0}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}[dir=rtl] .md-typeset ol li ol,[dir=rtl] .md-typeset ol li ul,[dir=rtl] .md-typeset ul li ol,[dir=rtl] .md-typeset ul li ul{margin-right:.625em;margin-left:0}.md-typeset dd{margin:1em 0 1em 1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em;margin-left:0}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) td:not([align]),[dir=rtl] .md-typeset table:not([class]) th:not([align]){text-align:right}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.07);content:"\E14D"}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{color:rgba(0,0,0,.54)}.md-clipboard:focus:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.no-js .md-header{-webkit-transition:none;transition:none}.md-header[data-md-state=shadow]{-webkit-transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s,-webkit-box-shadow .25s;-webkit-box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2);box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2)}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem)}.no-js .md-header-nav__topic{position:static}.no-js .md-header-nav__topic+.md-header-nav__topic{display:none}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem)}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}[dir=rtl] .md-footer-nav__link--prev{float:right}.md-footer-nav__link--next{width:75%;float:right;text-align:right}[dir=rtl] .md-footer-nav__link--next{float:left;text-align:left}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}[dir=rtl] .md-nav__title:before{content:"\E5C8"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-right:1.2rem;padding-left:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.4rem 0 7.2rem;text-overflow:ellipsis;z-index:2}[dir=rtl] .md-search__input{padding:0 7.2rem 0 4.4rem}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}[dir=rtl] .md-search__icon[for=search]{right:1rem;left:auto}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[dir=rtl] .md-search__icon[type=reset]{right:auto;left:1rem}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}[dir=rtl] .md-search-result__article--document:before{right:0;left:auto}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}[dir=rtl] .md-source{padding-right:0;padding-left:1.2rem}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}[dir=rtl] .md-source__icon svg{margin-right:1.2rem;margin-left:0}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-4.4rem;margin-left:0;padding-right:4rem;padding-left:0}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[dir=rtl] .md-source__fact{float:right}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:0 1.2rem;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem;overflow:auto}[dir=rtl] .md-typeset .admonition,[dir=rtl] .md-typeset details{border-right:.4rem solid #448aff;border-left:none}html .md-typeset .admonition>:last-child,html .md-typeset details>:last-child{margin-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:0 -1.2rem;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}[dir=rtl] .md-typeset .admonition>.admonition-title,[dir=rtl] .md-typeset .admonition>summary,[dir=rtl] .md-typeset details>.admonition-title,[dir=rtl] .md-typeset details>summary{padding:.8rem 4rem .8rem 1.2rem}.md-typeset .admonition>.admonition-title:last-child,.md-typeset .admonition>summary:last-child,.md-typeset details>.admonition-title:last-child,.md-typeset details>summary:last-child{margin-bottom:0}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}[dir=rtl] .md-typeset .admonition>.admonition-title:before,[dir=rtl] .md-typeset .admonition>summary:before,[dir=rtl] .md-typeset details>.admonition-title:before,[dir=rtl] .md-typeset details>summary:before{right:1.2rem;left:auto}.md-typeset .admonition.abstract,.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.abstract,.md-typeset details.summary,.md-typeset details.tldr{border-left-color:#00b0ff}[dir=rtl] .md-typeset .admonition.abstract,[dir=rtl] .md-typeset .admonition.summary,[dir=rtl] .md-typeset .admonition.tldr,[dir=rtl] .md-typeset details.abstract,[dir=rtl] .md-typeset details.summary,[dir=rtl] .md-typeset details.tldr{border-right-color:#00b0ff}.md-typeset .admonition.abstract>.admonition-title,.md-typeset .admonition.abstract>summary,.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.abstract>.admonition-title,.md-typeset details.abstract>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom-color:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.abstract>.admonition-title:before,.md-typeset .admonition.abstract>summary:before,.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.abstract>.admonition-title:before,.md-typeset details.abstract>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left-color:#00b8d4}[dir=rtl] .md-typeset .admonition.info,[dir=rtl] .md-typeset .admonition.todo,[dir=rtl] .md-typeset details.info,[dir=rtl] .md-typeset details.todo{border-right-color:#00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom-color:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left-color:#00bfa5}[dir=rtl] .md-typeset .admonition.hint,[dir=rtl] .md-typeset .admonition.important,[dir=rtl] .md-typeset .admonition.tip,[dir=rtl] .md-typeset details.hint,[dir=rtl] .md-typeset details.important,[dir=rtl] .md-typeset details.tip{border-right-color:#00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom-color:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left-color:#00c853}[dir=rtl] .md-typeset .admonition.check,[dir=rtl] .md-typeset .admonition.done,[dir=rtl] .md-typeset .admonition.success,[dir=rtl] .md-typeset details.check,[dir=rtl] .md-typeset details.done,[dir=rtl] .md-typeset details.success{border-right-color:#00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom-color:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left-color:#64dd17}[dir=rtl] .md-typeset .admonition.faq,[dir=rtl] .md-typeset .admonition.help,[dir=rtl] .md-typeset .admonition.question,[dir=rtl] .md-typeset details.faq,[dir=rtl] .md-typeset details.help,[dir=rtl] .md-typeset details.question{border-right-color:#64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom-color:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left-color:#ff9100}[dir=rtl] .md-typeset .admonition.attention,[dir=rtl] .md-typeset .admonition.caution,[dir=rtl] .md-typeset .admonition.warning,[dir=rtl] .md-typeset details.attention,[dir=rtl] .md-typeset details.caution,[dir=rtl] .md-typeset details.warning{border-right-color:#ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom-color:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left-color:#ff5252}[dir=rtl] .md-typeset .admonition.fail,[dir=rtl] .md-typeset .admonition.failure,[dir=rtl] .md-typeset .admonition.missing,[dir=rtl] .md-typeset details.fail,[dir=rtl] .md-typeset details.failure,[dir=rtl] .md-typeset details.missing{border-right-color:#ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom-color:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left-color:#ff1744}[dir=rtl] .md-typeset .admonition.danger,[dir=rtl] .md-typeset .admonition.error,[dir=rtl] .md-typeset details.danger,[dir=rtl] .md-typeset details.error{border-right-color:#ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom-color:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left-color:#f50057}[dir=rtl] .md-typeset .admonition.bug,[dir=rtl] .md-typeset details.bug{border-right-color:#f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom-color:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.example,.md-typeset details.example{border-left-color:#651fff}[dir=rtl] .md-typeset .admonition.example,[dir=rtl] .md-typeset details.example{border-right-color:#651fff}.md-typeset .admonition.example>.admonition-title,.md-typeset .admonition.example>summary,.md-typeset details.example>.admonition-title,.md-typeset details.example>summary{border-bottom-color:.1rem solid rgba(101,31,255,.1);background-color:rgba(101,31,255,.1)}.md-typeset .admonition.example>.admonition-title:before,.md-typeset .admonition.example>summary:before,.md-typeset details.example>.admonition-title:before,.md-typeset details.example>summary:before{color:#651fff;content:"\E242"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left-color:#9e9e9e}[dir=rtl] .md-typeset .admonition.cite,[dir=rtl] .md-typeset .admonition.quote,[dir=rtl] .md-typeset details.cite,[dir=rtl] .md-typeset details.quote{border-right-color:#9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom-color:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}[dir=rtl] .md-typeset .footnote-backref{-webkit-transform:translateX(-.5rem);transform:translateX(-.5rem)}.md-typeset .footnote-backref:before{display:inline-block;font-size:1.6rem;content:"\E31B"}[dir=rtl] .md-typeset .footnote-backref:before{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}[dir=rtl] .md-typeset .headerlink{margin-right:1rem;margin-left:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}[dir=rtl] .md-typeset details summary{padding-left:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}[dir=rtl] .md-typeset summary:after{right:auto;left:1.2rem}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em;left:auto}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}[dir=rtl] .md-typeset .task-list-control .task-list-indicator:before{right:-1.25em;left:auto}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}html [dir=rtl] .md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[dir=rtl] .md-search__overlay{right:.4rem;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}[dir=rtl] [data-md-toggle=search]:checked~.md-header .md-search__inner{right:0;left:auto}html [dir=rtl] .md-search__inner{right:100%;left:auto;-webkit-transform:translateX(-5%);transform:translateX(-5%)}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}[dir=rtl] .md-search__icon[for=search][for=search]:before{content:"\E5C8"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}html [dir=rtl] .md-nav--primary .md-nav__title--site .md-nav__button,html [dir=rtl] .md-nav--primary .md-nav__title:before{right:.4rem;left:auto}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}[dir=rtl] .md-nav--primary .md-nav__item{padding:0}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E314"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}[dir=rtl] .md-nav--primary .md-nav__link:after{right:auto;left:1.2rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:2.8rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:4rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:5.2rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:6.4rem;padding-left:0}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}[dir=rtl] .md-nav__toggle~.md-nav{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}[dir=rtl] .md-sidebar--primary{right:-24.2rem;left:auto}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-transform:translateX(-24.2rem);transform:translateX(-24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}[dir=rtl] .md-content{margin-right:0;margin-left:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}[dir=rtl] .md-header-nav__source{margin-right:2.8rem;margin-left:0;padding-right:0;padding-left:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[dir=rtl] .md-search__overlay{right:0;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}[dir=rtl] .md-search__inner{float:left}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}[dir=rtl] .md-search__input{padding-right:4.4rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uMmE4ODAwOGEuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css index a40cca4969c..340f840b26c 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css @@ -1,2 +1 @@ -html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}a:active,a:hover{outline-width:0}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;background:transparent;font-size:inherit}button,input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.2rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}.md-typeset dd{margin:1em 0 1em 1.875em}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.54);content:"\E14D";opacity:.25}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{opacity:1}.md-clipboard:active:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.no-js .md-header-nav__topic{position:static}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}.md-footer-nav__link--next{width:75%;float:right;text-align:right}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.8rem 0 7.2rem;text-overflow:ellipsis;z-index:2}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:1.2rem 1.2rem 0;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem}.md-typeset .admonition :first-child,.md-typeset details :first-child{margin-top:0}html .md-typeset .admonition :last-child,html .md-typeset details :last-child{margin-bottom:0;padding-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:-1.2rem -1.2rem 0;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}html .md-typeset .admonition>.admonition-title,html .md-typeset .admonition>summary,html .md-typeset details>.admonition-title,html .md-typeset details>summary{padding-bottom:.8rem}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.summary,.md-typeset details.tldr{border-left:.4rem solid #00b0ff}.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left:.4rem solid #00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left:.4rem solid #00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left:.4rem solid #00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left:.4rem solid #64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left:.4rem solid #ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left:.4rem solid #ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left:.4rem solid #ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left:.4rem solid #f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left:.4rem solid #9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}.md-typeset .footnote-backref:before{font-size:1.6rem;content:"\E31B"}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-search-result__article,.md-search-result__meta{padding-left:4.4rem}.md-sidebar--secondary{display:block;margin-left:100%;-webkit-transform:translate(-100%);transform:translate(-100%)}}@media only screen and (min-width:76.25em){.md-content{margin-left:24.2rem}.md-content__inner{margin-right:2.4rem;margin-left:2.4rem}.md-header-nav__button.md-icon--menu{display:none}.md-nav[data-md-state=animate]{-webkit-transition:max-height .25s cubic-bezier(.86,0,.07,1);transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav__toggle~.md-nav{max-height:0;overflow:hidden}.md-nav[data-md-state=expand],.md-nav__toggle:checked~.md-nav{max-height:100%}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--nested>.md-nav__link:after{display:inline-block;-webkit-transform-origin:.45em .45em;transform-origin:.45em .45em;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;vertical-align:-.125em}.js .md-nav__item--nested>.md-nav__link:after{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link:after{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:68.8rem}.md-sidebar--secondary{margin-left:122rem}.md-tabs~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{font-size:0}.md-tabs--active~.md-main .md-nav--primary .md-nav__title--site{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item{font-size:0}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{display:none;font-size:1.4rem;overflow:auto}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link{margin-top:0;font-weight:700;pointer-events:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link:after{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--active{display:block}.md-tabs--active~.md-main .md-nav[data-md-level="1"]{max-height:none}.md-tabs--active~.md-main .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:0}}@media only screen and (min-width:45em){.md-footer-nav__link{width:50%}.md-footer-copyright{max-width:75%;float:left}.md-footer-social{padding:1.2rem 0;float:right}}@media only screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(45);transform:scale(45)}}@media only screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(60);transform:scale(60)}}@media only screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(75);transform:scale(75)}}@media only screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:46.8rem}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}} -/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uYWM2NDI1MWUuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ +html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}a:active,a:hover{outline-width:0}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;background:transparent;font-size:inherit}button,input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.2rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}.md-typeset dd{margin:1em 0 1em 1.875em}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.54);content:"\E14D";opacity:.25}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{opacity:1}.md-clipboard:active:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.no-js .md-header-nav__topic{position:static}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}.md-footer-nav__link--next{width:75%;float:right;text-align:right}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.8rem 0 7.2rem;text-overflow:ellipsis;z-index:2}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:1.2rem 1.2rem 0;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem}.md-typeset .admonition :first-child,.md-typeset details :first-child{margin-top:0}html .md-typeset .admonition :last-child,html .md-typeset details :last-child{margin-bottom:0;padding-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:-1.2rem -1.2rem 0;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}html .md-typeset .admonition>.admonition-title,html .md-typeset .admonition>summary,html .md-typeset details>.admonition-title,html .md-typeset details>summary{padding-bottom:.8rem}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.summary,.md-typeset details.tldr{border-left:.4rem solid #00b0ff}.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left:.4rem solid #00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left:.4rem solid #00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left:.4rem solid #00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left:.4rem solid #64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left:.4rem solid #ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left:.4rem solid #ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left:.4rem solid #ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left:.4rem solid #f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left:.4rem solid #9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}.md-typeset .footnote-backref:before{font-size:1.6rem;content:"\E31B"}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uYWM2NDI1MWUuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ diff --git a/docs/zh/data_types/array.md b/docs/zh/data_types/array.md index 00e07d38be0..845b91b4158 100644 --- a/docs/zh/data_types/array.md +++ b/docs/zh/data_types/array.md @@ -50,7 +50,7 @@ SELECT ## 使用数据类型 -ClickHouse会自动检测数组元素,并根据元素计算出存储这些元素最小的数据类型。如果在元素中存在[NULL](../query_language/syntax.md#null-literal)或存在[Nullable](nullable.md#data_type-nullable)类型元素,那么数组的元素类型将会变成[Nullable](nullable.md#data_type-nullable)。 +ClickHouse会自动检测数组元素,并根据元素计算出存储这些元素最小的数据类型。如果在元素中存在[NULL](../query_language/syntax.md#null-literal)或存在[Nullable](nullable.md#data_type-nullable)类型元素,那么数组的元素类型将会变成[Nullable](nullable.md)。 如果 ClickHouse 无法确定数据类型,它将产生异常。当尝试同时创建一个包含字符串和数字的数组时会发生这种情况 (`SELECT array(1, 'a')`)。 diff --git a/docs/zh/data_types/enum.md b/docs/zh/data_types/enum.md index 5a4347aeb9a..dd469b04eb5 100644 --- a/docs/zh/data_types/enum.md +++ b/docs/zh/data_types/enum.md @@ -77,9 +77,9 @@ SELECT toTypeName(CAST('a', 'Enum8(\'a\' = 1, \'b\' = 2)')) `Enum8` 类型的每个值范围是 `-128 ... 127`,`Enum16` 类型的每个值范围是 `-32768 ... 32767`。所有的字符串或者数字都必须是不一样的。允许存在空字符串。如果某个 Enum 类型被指定了(在表定义的时候),数字可以是任意顺序。然而,顺序并不重要。 -`Enum` 中的字符串和数值都不能是 [NULL](../query_language/syntax.md#null-literal)。 +`Enum` 中的字符串和数值都不能是 [NULL](../query_language/syntax.md)。 -`Enum` 包含在 [Nullable](nullable.md#data_type-nullable) 类型中。因此,如果您使用此查询创建一个表 +`Enum` 包含在 [Nullable](nullable.md) 类型中。因此,如果您使用此查询创建一个表 ``` CREATE TABLE t_enum_nullable diff --git a/docs/zh/data_types/float.md b/docs/zh/data_types/float.md index f66cb698365..7c71fc5e260 100644 --- a/docs/zh/data_types/float.md +++ b/docs/zh/data_types/float.md @@ -69,4 +69,4 @@ SELECT 0 / 0 └──────────────┘ ``` -可以在[ORDER BY 子句](../query_language/select.md#query_language-queries-order_by) 查看更多关于 ` NaN` 排序的规则。 +可以在[ORDER BY 子句](../query_language/select.md) 查看更多关于 ` NaN` 排序的规则。 diff --git a/docs/zh/data_types/nullable.md b/docs/zh/data_types/nullable.md index 95db5ead679..53f6e7e9f8b 100644 --- a/docs/zh/data_types/nullable.md +++ b/docs/zh/data_types/nullable.md @@ -2,9 +2,9 @@ # Nullable(TypeName) -允许用特殊标记 ([NULL](../query_language/syntax.md#null-literal)) 表示"缺失值",可以与 `TypeName` 的正常值存放一起。例如,`Nullable(Int8)` 类型的列可以存储 `Int8` 类型值,而没有值的行将存储 `NULL`。 +允许用特殊标记 ([NULL](../query_language/syntax.md)) 表示"缺失值",可以与 `TypeName` 的正常值存放一起。例如,`Nullable(Int8)` 类型的列可以存储 `Int8` 类型值,而没有值的行将存储 `NULL`。 -对于 `TypeName`,不能使用复合数据类型 [Array](array.md#data_type is array) 和 [Tuple](tuple.md#data_type-tuple)。复合数据类型可以包含 `Nullable` 类型值,例如`Array(Nullable(Int8))`。 +对于 `TypeName`,不能使用复合数据类型 [Array](array.md#data_type is array) 和 [Tuple](tuple.md)。复合数据类型可以包含 `Nullable` 类型值,例如`Array(Nullable(Int8))`。 `Nullable` 类型字段不能包含在表索引中。 diff --git a/docs/zh/data_types/special_data_types/nothing.md b/docs/zh/data_types/special_data_types/nothing.md index 5f282df761e..8e0b259bae4 100644 --- a/docs/zh/data_types/special_data_types/nothing.md +++ b/docs/zh/data_types/special_data_types/nothing.md @@ -4,7 +4,7 @@ 此数据类型的唯一目的是表示不是期望值的情况。 所以不能创建一个 `Nothing` 类型的值。 -例如,文本 [NULL](../../query_language/syntax.md#null-literal) 的类型为 `Nullable(Nothing)`。详情请见 [Nullable](../../data_types/nullable.md#data_type-nullable)。 +例如,文本 [NULL](../../query_language/syntax.md#null-literal) 的类型为 `Nullable(Nothing)`。详情请见 [Nullable](../../data_types/nullable.md)。 `Nothing` 类型也可以用来表示空数组: diff --git a/docs/zh/data_types/tuple.md b/docs/zh/data_types/tuple.md index 40f2a5bdd73..d1c92c7eae8 100644 --- a/docs/zh/data_types/tuple.md +++ b/docs/zh/data_types/tuple.md @@ -4,7 +4,7 @@ 元组,其中每个元素都有单独的 [类型](index.md#data_types)。 -不能在表中存储元组(除了内存表)。它们可以用于临时列分组。在查询中,IN 表达式和带特定参数的 lambda 函数可以来对临时列进行分组。更多信息,请参阅 [IN 操作符](../query_language/select.md#query_language-in_operators) and [Higher order functions](../query_language/functions/higher_order_functions.md#higher_order_functions)。 +不能在表中存储元组(除了内存表)。它们可以用于临时列分组。在查询中,IN 表达式和带特定参数的 lambda 函数可以来对临时列进行分组。更多信息,请参阅 [IN 操作符](../query_language/select.md) and [Higher order functions](../query_language/functions/higher_order_functions.md#higher_order_functions)。 元组可以是查询的结果。在这种情况下,对于JSON以外的文本格式,括号中的值是逗号分隔的。在JSON格式中,元组作为数组输出(在方括号中)。 @@ -34,7 +34,7 @@ SELECT ## 元组中的数据类型 -在动态创建元组时,ClickHouse 会自动为元组的每一个参数赋予最小可表达的类型。如果参数为 [NULL](../query_language/syntax.md#null-literal),那这个元组对应元素是 [Nullable](nullable.md#data_type-nullable)。 +在动态创建元组时,ClickHouse 会自动为元组的每一个参数赋予最小可表达的类型。如果参数为 [NULL](../query_language/syntax.md#null-literal),那这个元组对应元素是 [Nullable](nullable.md)。 自动数据类型检测示例: diff --git a/docs/zh/images/column_oriented.gif b/docs/zh/images/column_oriented.gif index 15f4b12e697ac40c60bf77f964645316410da946..5a0e5b8e15ef0314540506256cacd898a1d3a71e 100644 GIT binary patch delta 83 zcmV-Z0IdJ5;{x@&0m;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7y diff --git a/docs/zh/interfaces/formats.md b/docs/zh/interfaces/formats.md index fdfb2ccb0e7..c0a0dea6e81 100644 --- a/docs/zh/interfaces/formats.md +++ b/docs/zh/interfaces/formats.md @@ -95,7 +95,7 @@ world 数组写在方括号内的逗号分隔值列表中。 通常情况下,数组中的数字项目会被拼凑,但日期,带时间的日期以及字符串将使用与上面相同的转义规则用单引号引起来。 -[NULL](../query_language/syntax.md#null-literal) 将输出为 `\N`。 +[NULL](../query_language/syntax.md) 将输出为 `\N`。 @@ -141,7 +141,7 @@ SearchPhrase=curtain designs count()=1064 SearchPhrase=baku count()=1000 ``` -[NULL](../query_language/syntax.md#null-literal) 输出为 `\N`。 +[NULL](../query_language/syntax.md) 输出为 `\N`。 ``` sql SELECT * FROM t_null FORMAT TSKV @@ -267,7 +267,7 @@ JSON 与 JavaScript 兼容。为了确保这一点,一些字符被另外转义 该格式仅适用于输出查询结果,但不适用于解析输入(将数据插入到表中)。 -ClickHouse 支持 [NULL](../query_language/syntax.md#null-literal), 在 JSON 格式中以 `null` 输出来表示. +ClickHouse 支持 [NULL](../query_language/syntax.md), 在 JSON 格式中以 `null` 输出来表示. 参考 JSONEachRow 格式。 @@ -361,7 +361,7 @@ ClickHouse 支持 [NULL](../query_language/syntax.md#null-literal), 在 JSON 格 它会绘制一个完整的表格,每行数据在终端中占用两行。 每一个结果块都会以单独的表格输出。这是很有必要的,以便结果块不用缓冲结果输出(缓冲在可以预见结果集宽度的时候是很有必要的)。 -[NULL](../query_language/syntax.md#null-literal) 输出为 `ᴺᵁᴸᴸ`。 +[NULL](../query_language/syntax.md) 输出为 `ᴺᵁᴸᴸ`。 ``` sql SELECT * FROM t_null @@ -456,11 +456,11 @@ FixedString 被简单地表示为一个字节序列。 数组表示为 varint 长度(无符号[LEB128](https://en.wikipedia.org/wiki/LEB128)),后跟有序的数组元素。 -对于 [NULL](../query_language/syntax.md#null-literal) 的支持, 一个为 1 或 0 的字节会加在每个 [Nullable](../data_types/nullable.md#data_type-nullable) 值前面。如果为 1, 那么该值就是 `NULL`。 如果为 0,则不为 `NULL`。 +对于 [NULL](../query_language/syntax.md#null-literal) 的支持, 一个为 1 或 0 的字节会加在每个 [Nullable](../data_types/nullable.md) 值前面。如果为 1, 那么该值就是 `NULL`。 如果为 0,则不为 `NULL`。 ## Values -在括号中打印每一行。行由逗号分隔。最后一行之后没有逗号。括号内的值也用逗号分隔。数字以十进制格式输出,不含引号。 数组以方括号输出。带有时间的字符串,日期和时间用引号包围输出。转义字符的解析规则与 [TabSeparated](#tabseparated) 格式类似。 在格式化过程中,不插入额外的空格,但在解析过程中,空格是被允许并跳过的(除了数组值之外的空格,这是不允许的)。[NULL](../query_language/syntax.md#null-literal) 为 `NULL`。 +在括号中打印每一行。行由逗号分隔。最后一行之后没有逗号。括号内的值也用逗号分隔。数字以十进制格式输出,不含引号。 数组以方括号输出。带有时间的字符串,日期和时间用引号包围输出。转义字符的解析规则与 [TabSeparated](#tabseparated) 格式类似。 在格式化过程中,不插入额外的空格,但在解析过程中,空格是被允许并跳过的(除了数组值之外的空格,这是不允许的)。[NULL](../query_language/syntax.md) 为 `NULL`。 以 Values 格式传递数据时需要转义的最小字符集是:单引号和反斜线。 @@ -472,7 +472,7 @@ FixedString 被简单地表示为一个字节序列。 使用指定的列名在单独的行上打印每个值。如果每行都包含大量列,则此格式便于打印一行或几行。 -[NULL](../query_language/syntax.md#null-literal) 输出为 `ᴺᵁᴸᴸ`。 +[NULL](../query_language/syntax.md) 输出为 `ᴺᵁᴸᴸ`。 示例: @@ -618,7 +618,7 @@ struct Message { } ``` -格式文件存储的目录可以在服务配置中的[ format_schema_path ](../operations/server_settings/settings.md#server_settings-format_schema_path) 指定。 +格式文件存储的目录可以在服务配置中的[ format_schema_path ](../operations/server_settings/settings.md) 指定。 Cap'n Proto 反序列化是很高效的,通常不会增加系统的负载。 diff --git a/docs/zh/interfaces/http.md b/docs/zh/interfaces/http.md index 8b150d059a9..cbf2f868ce1 100644 --- a/docs/zh/interfaces/http.md +++ b/docs/zh/interfaces/http.md @@ -192,11 +192,11 @@ $ echo 'SELECT number FROM system.numbers LIMIT 10' | curl 'http://localhost:812 相比起 TCP 原生接口,HTTP 接口不支持会话和会话设置的概念,不允许中止查询(准确地说,只在少数情况下允许),不显示查询处理的进展。执行解析和数据格式化都是在服务端处理,网络上会比 TCP 原生接口更低效。 -可选的 `query_id` 参数可能当做 query ID 传入(或者任何字符串)。更多信息,参见 "[设置 replace_running_query](../operations/settings/settings.md#replace-running-query)" 部分。 +可选的 `query_id` 参数可能当做 query ID 传入(或者任何字符串)。更多信息,参见 "[设置 replace_running_query](../operations/settings/settings.md)" 部分。 可选的 `quota_key` 参数可能当做 quota key 传入(或者任何字符串)。更多信息,参见 "[配额](../operations/quotas.md#quotas)" 部分。 -HTTP 接口允许传入额外的数据(外部临时表)来查询。更多信息,参见 "[外部数据查询处理](../operations/table_engines/external_data.md#external-data)" 部分。 +HTTP 接口允许传入额外的数据(外部临时表)来查询。更多信息,参见 "[外部数据查询处理](../operations/table_engines/external_data.md)" 部分。 ## 响应缓冲 diff --git a/docs/zh/introduction/distinctive_features.md b/docs/zh/introduction/distinctive_features.md index dffd855048d..6a9557a301c 100644 --- a/docs/zh/introduction/distinctive_features.md +++ b/docs/zh/introduction/distinctive_features.md @@ -59,6 +59,6 @@ ClickHouse提供各种各样在允许牺牲数据精度的情况下对查询进 ClickHouse使用异步的多主复制技术。当数据被写入任何一个可用副本后,系统会在后台将数据分发给其他副本,以保证系统在不同副本上保持相同的数据。在大多数情况下ClickHouse能在故障后自动恢复,在一些复杂的情况下需要少量的手动恢复。 -更多信息,参见[数据复制](../operations/table_engines/replication.md#table_engines-replication)。 +更多信息,参见[数据复制](../operations/table_engines/replication.md)。 [来源文章](https://clickhouse.yandex/docs/en/introduction/distinctive_features/) diff --git a/docs/zh/introduction/performance.md b/docs/zh/introduction/performance.md index 1cd9f9f0692..06bcbd158b5 100644 --- a/docs/zh/introduction/performance.md +++ b/docs/zh/introduction/performance.md @@ -2,7 +2,7 @@ 根据Yandex的内部测试结果,ClickHouse表现出了比同类可比较产品更优的性能。你可以在[这里](https://clickhouse.yandex/benchmark.html)查看具体的测试结果。 -许多其他的测试也证实这一点。你可以使用互联网搜索到它们,或者你也可以从[我们收集的部分相关连接](https://clickhouse.yandex/#independent-bookmarks)中查看。 +许多其他的测试也证实这一点。你可以使用互联网搜索到它们,或者你也可以从[我们收集的部分相关连接](https://clickhouse.yandex/)中查看。 ## 单个大查询的吞吐量 diff --git a/docs/zh/operations/access_rights.md b/docs/zh/operations/access_rights.md index 451be2c7322..22c3b3e7714 100644 --- a/docs/zh/operations/access_rights.md +++ b/docs/zh/operations/access_rights.md @@ -61,7 +61,7 @@ Users are recorded in the `users` section. Here is a fragment of the `users.xml` You can see a declaration from two users: `default`and`web`. We added the `web` user separately. -The `default` user is chosen in cases when the username is not passed. The `default` user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the `user` and `password` (see the section on the [Distributed](../operations/table_engines/distributed.md#table_engines-distributed) engine). +The `default` user is chosen in cases when the username is not passed. The `default` user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the `user` and `password` (see the section on the [Distributed](../operations/table_engines/distributed.md) engine). The user that is used for exchanging information between servers combined in a cluster must not have substantial restrictions or quotas – otherwise, distributed queries will fail. @@ -87,8 +87,7 @@ The config includes comments explaining how to open access from everywhere. For use in production, only specify `ip` elements (IP addresses and their masks), since using `host` and `hoost_regexp` might cause extra latency. -Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md#settings_profiles)"). You can specify the default profile, `default'`. The profile can have any name. You can specify the same profile for different users. The most important thing you can write in the settings profile is `readonly=1`, which ensures read-only access. - +Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md Then specify the quota to be used (see the section "[Quotas](quotas.md#quotas)"). You can specify the default quota: `default`. It is set in the config by default to only count resource usage, without restricting it. The quota can have any name. You can specify the same quota for different users – in this case, resource usage is calculated for each user individually. In the optional `` section, you can also specify a list of databases that the user can access. By default, all databases are available to the user. You can specify the `default` database. In this case, the user will receive access to the database by default. diff --git a/docs/zh/operations/configuration_files.md b/docs/zh/operations/configuration_files.md index a7cdfb124ee..e858ae25180 100644 --- a/docs/zh/operations/configuration_files.md +++ b/docs/zh/operations/configuration_files.md @@ -14,7 +14,7 @@ If `replace` is specified, it replaces the entire element with the specified one If `remove` is specified, it deletes the element. -The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros]() server_settings/settings.md#server_settings-macros)). +The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros]() server_settings/settings.md)). Substitutions can also be performed from ZooKeeper. To do this, specify the attribute `from_zk = "/path/to/node"`. The element value is replaced with the contents of the node at `/path/to/node` in ZooKeeper. You can also put an entire XML subtree on the ZooKeeper node and it will be fully inserted into the source element. diff --git a/docs/zh/operations/server_settings/settings.md b/docs/zh/operations/server_settings/settings.md index 8e10969ed6b..cbaef77b890 100644 --- a/docs/zh/operations/server_settings/settings.md +++ b/docs/zh/operations/server_settings/settings.md @@ -78,7 +78,7 @@ To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc. Default settings profile. -Settings profiles are located in the file specified in the parameter [user_config](#server_settings-users_config). +Settings profiles are located in the file specified in the parameter [user_config](). **Example** @@ -97,7 +97,7 @@ Path: - Specify the absolute path or the path relative to the server config file. - The path can contain wildcards \* and ?. -See also "[External dictionaries](../../query_language/dicts/external_dicts.md#dicts-external_dicts)". +See also "[External dictionaries](../../query_language/dicts/external_dicts.md)". **Example** @@ -176,7 +176,7 @@ You can configure multiple `` clauses. For instance, you can use this Settings for thinning data for Graphite. -For more details, see [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md#table_engines-graphitemergetree). +For more details, see [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md). **Example** @@ -206,7 +206,7 @@ For more details, see [GraphiteMergeTree](../../operations/table_engines/graphit The port for connecting to the server over HTTP(s). -If `https_port` is specified, [openSSL](#server_settings-openSSL) must be configured. +If `https_port` is specified, [openSSL]() must be configured. If `http_port` is specified, the openSSL configuration is ignored even if it is set. @@ -357,7 +357,7 @@ Parameter substitutions for replicated tables. Can be omitted if replicated tables are not used. -For more information, see the section "[Creating replicated tables](../../operations/table_engines/replication.md#table_engines-replication-creation_of_rep_tables)". +For more information, see the section "[Creating replicated tables](../../operations/table_engines/replication.md)". **Example** @@ -369,7 +369,7 @@ For more information, see the section "[Creating replicated tables](../../operat ## mark_cache_size -Approximate size (in bytes) of the cache of "marks" used by [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Approximate size (in bytes) of the cache of "marks" used by [MergeTree](../../operations/table_engines/mergetree.md). The cache is shared for the server and memory is allocated as needed. The cache size must be at least 5368709120. @@ -425,7 +425,7 @@ We recommend using this option in Mac OS X, since the `getrlimit()` function ret Restriction on deleting tables. -If the size of a [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a DROP query. +If the size of a [MergeTree](../../operations/table_engines/mergetree.md) table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a DROP query. If you still need to delete the table without restarting the ClickHouse server, create the `/flags/force_drop_table` file and run the DROP query. @@ -443,7 +443,7 @@ The value 0 means that you can delete all tables without any restrictions. ## merge_tree -Fine tuning for tables in the [ MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Fine tuning for tables in the [ MergeTree](../../operations/table_engines/mergetree.md). For more information, see the MergeTreeSettings.h header file. @@ -520,7 +520,7 @@ Keys for server/client settings: ## part_log -Logging events that are associated with [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process. +Logging events that are associated with [MergeTree](../../operations/table_engines/mergetree.md). For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process. Queries are logged in the ClickHouse table, not in a separate file. @@ -540,7 +540,7 @@ Use the following parameters to configure logging: - database – Name of the database. - table – Name of the table. -- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key). +- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md). - flush_interval_milliseconds – Interval for flushing data from memory to the disk. **Example** @@ -573,7 +573,7 @@ The path to the directory containing data. ## query_log -Setting for logging queries received with the [log_queries=1](../settings/settings.md#settings_settings-log_queries) setting. +Setting for logging queries received with the [log_queries=1](../settings/settings.md) setting. Queries are logged in the ClickHouse table, not in a separate file. @@ -581,7 +581,7 @@ Use the following parameters to configure logging: - database – Name of the database. - table – Name of the table. -- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key). +- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md). - flush_interval_milliseconds – Interval for flushing data from memory to the disk. If the table doesn't exist, ClickHouse will create it. If the structure of the query log changed when the ClickHouse server was updated, the table with the old structure is renamed, and a new table is created automatically. @@ -603,7 +603,7 @@ If the table doesn't exist, ClickHouse will create it. If the structure of the q Configuration of clusters used by the Distributed table engine. -For more information, see the section "[Table engines/Distributed](../../operations/table_engines/distributed.md#table_engines-distributed)". +For more information, see the section "[Table engines/Distributed](../../operations/table_engines/distributed.md)". **Example** @@ -660,9 +660,9 @@ Path to temporary data for processing large queries. ## uncompressed_cache_size -Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). +Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree](../../operations/table_engines/mergetree.md). -There is one shared cache for the server. Memory is allocated on demand. The cache is used if the option [use_uncompressed_cache](../settings/settings.md#settings-use_uncompressed_cache) is enabled. +There is one shared cache for the server. Memory is allocated on demand. The cache is used if the option [use_uncompressed_cache](../settings/settings.md) is enabled. The uncompressed cache is advantageous for very short queries in individual cases. @@ -674,7 +674,7 @@ The uncompressed cache is advantageous for very short queries in individual case ## user_files_path -The directory with user files. Used in the table function [file()](../../query_language/table_functions/file.md#table_functions-file). +The directory with user files. Used in the table function [file()](../../query_language/table_functions/file.md). **Example** @@ -709,7 +709,7 @@ ClickHouse uses ZooKeeper for storing replica metadata when using replicated tab This parameter can be omitted if replicated tables are not used. -For more information, see the section "[Replication](../../operations/table_engines/replication.md#table_engines-replication)". +For more information, see the section "[Replication](../../operations/table_engines/replication.md)". **Example** diff --git a/docs/zh/operations/settings/settings.md b/docs/zh/operations/settings/settings.md index 8afea8e5d35..5976a90ef81 100644 --- a/docs/zh/operations/settings/settings.md +++ b/docs/zh/operations/settings/settings.md @@ -4,7 +4,7 @@ ## distributed_product_mode -Changes the behavior of [distributed subqueries](../../query_language/select.md#queries-distributed-subrequests). +Changes the behavior of [distributed subqueries](../../query_language/select.md). ClickHouse applies this setting when the query contains the product of distributed tables, i.e. when the query for a distributed table contains a non-GLOBAL subquery for the distributed table. @@ -13,7 +13,7 @@ Restrictions: - Only applied for IN and JOIN subqueries. - Only if the FROM section uses a distributed table containing more than one shard. - If the subquery concerns a distributed table containing more than one shard, -- Not used for a table-valued [remote](../../query_language/table_functions/remote.md#table_functions-remote) function. +- Not used for a table-valued [remote](../../query_language/table_functions/remote.md) function. The possible values ​​are: @@ -26,7 +26,7 @@ The possible values ​​are: ## fallback_to_stale_replicas_for_distributed_queries -Forces a query to an out-of-date replica if updated data is not available. See "[Replication](../../operations/table_engines/replication.md#table_engines-replication)". +Forces a query to an out-of-date replica if updated data is not available. See "[Replication](../../operations/table_engines/replication.md)". ClickHouse selects the most relevant from the outdated replicas of the table. @@ -42,7 +42,7 @@ Disables query execution if the index can't be used by date. Works with tables in the MergeTree family. -If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". +If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". @@ -52,7 +52,7 @@ Disables query execution if indexing by the primary key is not possible. Works with tables in the MergeTree family. -If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". +If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". @@ -107,7 +107,7 @@ Disabled by default (set to 0). It only works when reading from MergeTree engine Setting up query logging. -Queries sent to ClickHouse with this setup are logged according to the rules in the [query_log](../server_settings/settings.md#server_settings-query_log) server configuration parameter. +Queries sent to ClickHouse with this setup are logged according to the rules in the [query_log](../server_settings/settings.md) server configuration parameter. **Example**: @@ -131,7 +131,7 @@ This is slightly more than `max_block_size`. The reason for this is because cert ## max_replica_delay_for_distributed_queries -Disables lagging replicas for distributed queries. See "[Replication](../../operations/table_engines/replication.md#table_engines-replication)". +Disables lagging replicas for distributed queries. See "[Replication](../../operations/table_engines/replication.md)". Sets the time in seconds. If a replica lags more than the set value, this replica is not used. @@ -164,7 +164,7 @@ Don't confuse blocks for compression (a chunk of memory consisting of bytes) and ## min_compress_block_size -For [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)" tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least 'min_compress_block_size'. By default, 65,536. +For [MergeTree](../../operations/table_engines/mergetree.md)" tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least 'min_compress_block_size'. By default, 65,536. The actual size of the block, if the uncompressed data is less than 'max_compress_block_size', is no less than this value and no less than the volume of data for one mark. @@ -265,7 +265,7 @@ This parameter is useful when you are using formats that require a schema defini ## stream_flush_interval_ms -Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size](#settings-settings-max_insert_block_size) rows. +Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size]() rows. The default value is 7500. @@ -355,9 +355,9 @@ The character interpreted as a delimiter in the CSV data. By default, the delimi ## join_use_nulls -Affects the behavior of [JOIN](../../query_language/select.md#query_language-join). +Affects the behavior of [JOIN](../../query_language/select.md). -With `join_use_nulls=1,` `JOIN` behaves like in standard SQL, i.e. if empty cells appear when merging, the type of the corresponding field is converted to [Nullable](../../data_types/nullable.md#data_type-nullable), and empty cells are filled with [NULL](../../query_language/syntax.md#null-literal). +With `join_use_nulls=1,` `JOIN` behaves like in standard SQL, i.e. if empty cells appear when merging, the type of the corresponding field is converted to [Nullable](../../data_types/nullable.md#data_type-nullable), and empty cells are filled with [NULL](../../query_language/syntax.md). @@ -376,7 +376,7 @@ The default value is 0. All the replicas in the quorum are consistent, i.e., they contain data from all previous `INSERT` queries. The `INSERT` sequence is linearized. -When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency](#setting-select_sequential_consistency) option. +When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency]() option. **ClickHouse generates an exception** @@ -385,8 +385,8 @@ When reading the data written from the `insert_quorum`, you can use the[select_s **See also the following parameters:** -- [insert_quorum_timeout](#setting-insert_quorum_timeout) -- [select_sequential_consistency](#setting-select_sequential_consistency) +- [insert_quorum_timeout]() +- [select_sequential_consistency]() @@ -398,8 +398,8 @@ By default, 60 seconds. **See also the following parameters:** -- [insert_quorum](#setting-insert_quorum) -- [select_sequential_consistency](#setting-select_sequential_consistency) +- [insert_quorum]() +- [select_sequential_consistency]() @@ -414,8 +414,8 @@ When sequential consistency is enabled, ClickHouse allows the client to execute See also the following parameters: -- [insert_quorum](#setting-insert_quorum) -- [insert_quorum_timeout](#setting-insert_quorum_timeout) +- [insert_quorum]() +- [insert_quorum_timeout]() [Original article](https://clickhouse.yandex/docs/en/operations/settings/settings/) diff --git a/docs/zh/operations/system_tables.md b/docs/zh/operations/system_tables.md index a67fec3f9c5..21e4cd37eb8 100644 --- a/docs/zh/operations/system_tables.md +++ b/docs/zh/operations/system_tables.md @@ -128,7 +128,7 @@ This is similar to the DUAL table found in other DBMSs. ## system.parts -Contains information about parts of [MergeTree](table_engines/mergetree.md#table_engines-mergetree) tables. +Contains information about parts of [MergeTree](table_engines/mergetree.md) tables. Each row describes one part of the data. diff --git a/docs/zh/operations/table_engines/aggregatingmergetree.md b/docs/zh/operations/table_engines/aggregatingmergetree.md index 4ebb707a980..7f123200dca 100644 --- a/docs/zh/operations/table_engines/aggregatingmergetree.md +++ b/docs/zh/operations/table_engines/aggregatingmergetree.md @@ -2,11 +2,11 @@ # AggregatingMergeTree -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree), altering the logic for data parts merging. ClickHouse replaces all rows with the same primary key with a single row (within a one data part) that stores a combination of states of aggregate functions. +The engine inherits from [MergeTree](mergetree.md), altering the logic for data parts merging. ClickHouse replaces all rows with the same primary key with a single row (within a one data part) that stores a combination of states of aggregate functions. You can use `AggregatingMergeTree` tables for incremental data aggregation, including for aggregated materialized views. -The engine processes all columns with [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) type. +The engine processes all columns with [AggregateFunction](../../data_types/nested_data_structures/aggregatefunction.md) type. It is appropriate to use `AggregatingMergeTree` if it reduces the number of rows by orders. @@ -25,11 +25,11 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **Query clauses** -When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table @@ -50,8 +50,7 @@ All of the parameters have the same meaning as in `MergeTree`. ## SELECT and INSERT -To insert data, use [INSERT SELECT](../../query_language/insert_into.md#queries-insert-select) query with aggregate `-State`- functions. - +To insert data, use [INSERT SELECT](../../query_language/insert_into.md When selecting data from `AggregatingMergeTree` table, use `GROUP BY` clause and the same aggregate functions as when inserting data, but using `-Merge` suffix. In the results of `SELECT` query the values of `AggregateFunction` type have implementation-specific binary representation for all of the ClickHouse output formats. If dump data into, for example, `TabSeparated` format with `SELECT` query then this dump can be loaded back using `INSERT` query. diff --git a/docs/zh/operations/table_engines/collapsingmergetree.md b/docs/zh/operations/table_engines/collapsingmergetree.md index 45106cb25e8..26b6f96abdc 100644 --- a/docs/zh/operations/table_engines/collapsingmergetree.md +++ b/docs/zh/operations/table_engines/collapsingmergetree.md @@ -2,9 +2,9 @@ # CollapsingMergeTree -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree) and adds the logic of rows collapsing to data parts merge algorithm. +The engine inherits from [MergeTree](mergetree.md) and adds the logic of rows collapsing to data parts merge algorithm. -`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing](#collapsingmergetree-collapsing) section of the document. +`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing]() section of the document. The engine may significantly reduce the volume of storage and increase efficiency of `SELECT` query as a consequence. @@ -23,7 +23,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **CollapsingMergeTree Parameters** @@ -33,7 +33,7 @@ For a description of request parameters, see [request description](../../query_l **Query clauses** -When creating a `CollapsingMergeTree` table, the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `CollapsingMergeTree` table, the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table diff --git a/docs/zh/operations/table_engines/file.md b/docs/zh/operations/table_engines/file.md index ed49a693630..816b8d94cd6 100644 --- a/docs/zh/operations/table_engines/file.md +++ b/docs/zh/operations/table_engines/file.md @@ -18,11 +18,11 @@ File(Format) `Format` should be supported for either `INSERT` and `SELECT`. For the full list of supported formats see [Formats](../../interfaces/formats.md#formats). -ClickHouse does not allow to specify filesystem path for`File`. It will use folder defined by [path](../server_settings/settings.md#server_settings-path) setting in server configuration. +ClickHouse does not allow to specify filesystem path for`File`. It will use folder defined by [path](../server_settings/settings.md) setting in server configuration. When creating table using `File(Format)` it creates empty subdirectory in that folder. When data is written to that table, it's put into `data.Format` file in that subdirectory. -You may manually create this subfolder and file in server filesystem and then [ATTACH](../../query_language/misc.md#queries-attach) it to table information with matching name, so you can query data from that file. +You may manually create this subfolder and file in server filesystem and then [ATTACH](../../query_language/misc.md) it to table information with matching name, so you can query data from that file. !!! warning Be careful with this funcionality, because ClickHouse does not keep track of external changes to such files. The result of simultaneous writes via ClickHouse and outside of ClickHouse is undefined. @@ -60,8 +60,7 @@ SELECT * FROM file_engine_table ## Usage in Clickhouse-local -In [clickhouse-local](../utils/clickhouse-local.md#utils-clickhouse-local) File engine accepts file path in addition to `Format`. Default input/output streams can be specified using numeric or human-readable names like `0` or `stdin`, `1` or `stdout`. - +In [clickhouse-local](../utils/clickhouse-local.md **Example:** ```bash diff --git a/docs/zh/operations/table_engines/graphitemergetree.md b/docs/zh/operations/table_engines/graphitemergetree.md index 0aad07a13c3..843185ff83d 100644 --- a/docs/zh/operations/table_engines/graphitemergetree.md +++ b/docs/zh/operations/table_engines/graphitemergetree.md @@ -6,7 +6,7 @@ This engine is designed for rollup (thinning and aggregating/averaging) [Graphit You can use any ClickHouse table engine to store the Graphite data if you don't need rollup, but if you need a rollup use `GraphiteMergeTree`. The engine reduces the volume of storage and increases the efficiency of queries from Graphite. -The engine inherits properties from [MergeTree](mergetree.md#table_engines-mergetree). +The engine inherits properties from [MergeTree](mergetree.md). ## Creating a Table @@ -25,7 +25,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). A table for the Graphite date should have the following columns: @@ -44,7 +44,7 @@ The names of these columns should be set in the rollup configuration. **Query clauses** -When creating a `GraphiteMergeTree` table, the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `GraphiteMergeTree` table, the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table @@ -70,7 +70,7 @@ All of the parameters excepting `config_section` have the same meaning as in `Me ## Rollup configuration -The settings for rollup are defined by the [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) parameter in the server configuration. The name of the parameter could be any. You can create several configurations and use them for different tables. +The settings for rollup are defined by the [graphite_rollup](../server_settings/settings.md) parameter in the server configuration. The name of the parameter could be any. You can create several configurations and use them for different tables. Rollup configuration structure: diff --git a/docs/zh/operations/table_engines/kafka.md b/docs/zh/operations/table_engines/kafka.md index db86553676f..fc341a041ff 100644 --- a/docs/zh/operations/table_engines/kafka.md +++ b/docs/zh/operations/table_engines/kafka.md @@ -105,7 +105,7 @@ Kafka SETTINGS SELECT level, sum(total) FROM daily GROUP BY level; ``` -为了提高性能,接受的消息被分组为 [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size) 大小的块。如果未在 [stream_flush_interval_ms](../settings/settings.md#settings-settings_stream_flush_interval_ms) 毫秒内形成块,则不关心块的完整性,都会将数据刷新到表中。 +为了提高性能,接受的消息被分组为 [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size) 大小的块。如果未在 [stream_flush_interval_ms](../settings/settings.md) 毫秒内形成块,则不关心块的完整性,都会将数据刷新到表中。 停止接收主题数据或更改转换逻辑,请 detach 物化视图: diff --git a/docs/zh/operations/table_engines/materializedview.md b/docs/zh/operations/table_engines/materializedview.md index c13a1ac8710..1e0a1615874 100644 --- a/docs/zh/operations/table_engines/materializedview.md +++ b/docs/zh/operations/table_engines/materializedview.md @@ -1,6 +1,6 @@ # MaterializedView -Used for implementing materialized views (for more information, see [CREATE TABLE](../../query_language/create.md#query_language-queries-create_table)). For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine. +Used for implementing materialized views (for more information, see [CREATE TABLE](../../query_language/create.md)). For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine. [Original article](https://clickhouse.yandex/docs/en/operations/table_engines/materializedview/) diff --git a/docs/zh/operations/table_engines/mergetree.md b/docs/zh/operations/table_engines/mergetree.md index 7b4ecd51fe7..e526923dc18 100644 --- a/docs/zh/operations/table_engines/mergetree.md +++ b/docs/zh/operations/table_engines/mergetree.md @@ -12,20 +12,20 @@ Main features: This allows you to create a small sparse index that helps find data faster. -- This allows you to use partitions if the [partitioning key](custom_partitioning_key.md#table_engines-custom_partitioning_key) is specified. +- This allows you to use partitions if the [partitioning key](custom_partitioning_key.md) is specified. ClickHouse supports certain operations with partitions that are more effective than general operations on the same data with the same result. ClickHouse also automatically cuts off the partition data where the partitioning key is specified in the query. This also increases the query performance. - Data replication support. - The family of `ReplicatedMergeTree` tables is used for this. For more information, see the [Data replication](replication.md#table_engines-replication) section. + The family of `ReplicatedMergeTree` tables is used for this. For more information, see the [Data replication](replication.md) section. - Data sampling support. If necessary, you can set the data sampling method in the table. !!! info - The [Merge](merge.md#table_engine-merge) engine does not belong to the `*MergeTree` family. + The [Merge](merge.md) engine does not belong to the `*MergeTree` family. @@ -44,7 +44,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **Query clauses** @@ -55,9 +55,9 @@ For a description of request parameters, see [request description](../../query_l A tuple of columns or arbitrary expressions. Example: `ORDER BY (CounterID, EventDate)`. If a sampling expression is used, the primary key must contain it. Example: `ORDER BY (CounerID, EventDate, intHash32(UserID))`. -- `PARTITION BY` — The [partitioning key](custom_partitioning_key.md#table_engines-custom_partitioning_key). +- `PARTITION BY` — The [partitioning key](custom_partitioning_key.md). - For partitioning by month, use the `toYYYYMM(date_column)` expression, where `date_column` is a column with a date of the type [Date](../../data_types/date.md#data_type-date). The partition names here have the `"YYYYMM"` format. + For partitioning by month, use the `toYYYYMM(date_column)` expression, where `date_column` is a column with a date of the type [Date](../../data_types/date.md). The partition names here have the `"YYYYMM"` format. - `SAMPLE BY` — An expression for sampling. Example: `intHash32(UserID))`. @@ -72,7 +72,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa In the example, we set partitioning by month. -We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md#select-section-sample) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. +We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. `index_granularity` could be omitted because 8192 is the default value. @@ -92,10 +92,9 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] **MergeTree() parameters** -- `date-column` — The name of a column of the type [Date](../../data_types/date.md#data_type-date). ClickHouse automatically creates partitions by month on the basis of this column. The partition names are in the `"YYYYMM"` format. +- `date-column` — The name of a column of the type [Date](../../data_types/date.md). ClickHouse automatically creates partitions by month on the basis of this column. The partition names are in the `"YYYYMM"` format. - `sampling_expression` — an expression for sampling. -- `(primary, key)` — primary key. Type — [Tuple()](../../data_types/tuple.md#data_type-tuple). It may consist of arbitrary expressions, but it typically is a tuple of columns. It must include an expression for sampling if it is set. It must not include a column with a `date-column` date. -- `index_granularity` — The granularity of an index. The number of data rows between the "marks" of an index. The value 8192 is appropriate for most tasks. +- `(primary, key)` — primary key. Type — [Tuple()](../../data_types/tuple.md- `index_granularity` — The granularity of an index. The number of data rows between the "marks" of an index. The value 8192 is appropriate for most tasks. **Example** @@ -159,7 +158,7 @@ The number of columns in the primary key is not explicitly limited. Depending on ClickHouse sorts data by primary key, so the higher the consistency, the better the compression. -- Provide additional logic when data parts merging in the [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) and [SummingMergeTree](summingmergetree.md#table_engine-summingmergetree) engines. +- Provide additional logic when data parts merging in the [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) and [SummingMergeTree](summingmergetree.md) engines. You may need many fields in the primary key even if they are not necessary for the previous steps. @@ -195,7 +194,7 @@ In the example below, the index can't be used. SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%' ``` -To check whether ClickHouse can use the index when running a query, use the settings [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) and [force_primary_key](../settings/settings.md#settings-settings-force_primary_key). +To check whether ClickHouse can use the index when running a query, use the settings [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) and [force_primary_key](../settings/settings.md). The key for partitioning by month allows reading only those data blocks which contain dates from the proper range. In this case, the data block may contain data for many dates (up to an entire month). Within a block, data is sorted by primary key, which might not contain the date as the first column. Because of this, using a query with only a date condition that does not specify the primary key prefix will cause more data to be read than for a single date. diff --git a/docs/zh/operations/table_engines/mysql.md b/docs/zh/operations/table_engines/mysql.md index 8baceafc64c..a7815f691e2 100644 --- a/docs/zh/operations/table_engines/mysql.md +++ b/docs/zh/operations/table_engines/mysql.md @@ -22,6 +22,6 @@ MySQL('host:port', 'database', 'table', 'user', 'password'[, replace_query, 'on_ 其余条件以及 `LIMIT` 采样约束语句仅在对MySQL的查询完成后才在ClickHouse中执行。 -`MySQL` 引擎不支持 [Nullable](../../data_types/nullable.md#data_type-nullable) 数据类型,因此,当从MySQL表中读取数据时,`NULL` 将转换为指定列类型的默认值(通常为0或空字符串)。 +`MySQL` 引擎不支持 [Nullable](../../data_types/nullable.md) 数据类型,因此,当从MySQL表中读取数据时,`NULL` 将转换为指定列类型的默认值(通常为0或空字符串)。 [Original article](https://clickhouse.yandex/docs/zh/operations/table_engines/mysql/) diff --git a/docs/zh/operations/table_engines/replacingmergetree.md b/docs/zh/operations/table_engines/replacingmergetree.md index 7a4f3ab7443..2d0e179ac30 100644 --- a/docs/zh/operations/table_engines/replacingmergetree.md +++ b/docs/zh/operations/table_engines/replacingmergetree.md @@ -1,6 +1,6 @@ # ReplacingMergeTree -The engine differs from [MergeTree](mergetree.md#table_engines-mergetree) in that it removes duplicate entries with the same primary key value. +The engine differs from [MergeTree](mergetree.md) in that it removes duplicate entries with the same primary key value. Data deduplication occurs only during a merge. Merging occurs in the background at an unknown time, so you can't plan for it. Some of the data may remain unprocessed. Although you can run an unscheduled merge using the `OPTIMIZE` query, don't count on using it, because the `OPTIMIZE` query will read and write a large amount of data. @@ -21,7 +21,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **ReplacingMergeTree Parameters** @@ -33,7 +33,7 @@ For a description of request parameters, see [request description](../../query_l **Query clauses** -When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `ReplacingMergeTree` table the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table diff --git a/docs/zh/operations/table_engines/replication.md b/docs/zh/operations/table_engines/replication.md index 01245edf744..f0f7a5456c5 100644 --- a/docs/zh/operations/table_engines/replication.md +++ b/docs/zh/operations/table_engines/replication.md @@ -48,7 +48,7 @@ You can specify any existing ZooKeeper cluster and the system will use a directo If ZooKeeper isn't set in the config file, you can't create replicated tables, and any existing replicated tables will be read-only. -ZooKeeper is not used in `SELECT` queries because replication does not affect the performance of `SELECT` and queries run just as fast as they do for non-replicated tables. When querying distributed replicated tables, ClickHouse behavior is controlled by the settings [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) and [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries). +ZooKeeper is not used in `SELECT` queries because replication does not affect the performance of `SELECT` and queries run just as fast as they do for non-replicated tables. When querying distributed replicated tables, ClickHouse behavior is controlled by the settings [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) and [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md). For each `INSERT` query, approximately ten entries are added to ZooKeeper through several transactions. (To be more precise, this is for each inserted block of data; an INSERT query contains one block or one block per `max_insert_block_size = 1048576` rows.) This leads to slightly longer latencies for `INSERT` compared to non-replicated tables. But if you follow the recommendations to insert data in batches of no more than one `INSERT` per second, it doesn't create any problems. The entire ClickHouse cluster used for coordinating one ZooKeeper cluster has a total of several hundred `INSERTs` per second. The throughput on data inserts (the number of rows per second) is just as high as for non-replicated data. @@ -60,7 +60,7 @@ By default, an INSERT query waits for confirmation of writing the data from only Each block of data is written atomically. The INSERT query is divided into blocks up to `max_insert_block_size = 1048576` rows. In other words, if the `INSERT` query has less than 1048576 rows, it is made atomically. -Data blocks are deduplicated. For multiple writes of the same data block (data blocks of the same size containing the same rows in the same order), the block is only written once. The reason for this is in case of network failures when the client application doesn't know if the data was written to the DB, so the `INSERT` query can simply be repeated. It doesn't matter which replica INSERTs were sent to with identical data. `INSERTs` are idempotent. Deduplication parameters are controlled by [merge_tree](../server_settings/settings.md#server_settings-merge_tree) server settings. +Data blocks are deduplicated. For multiple writes of the same data block (data blocks of the same size containing the same rows in the same order), the block is only written once. The reason for this is in case of network failures when the client application doesn't know if the data was written to the DB, so the `INSERT` query can simply be repeated. It doesn't matter which replica INSERTs were sent to with identical data. `INSERTs` are idempotent. Deduplication parameters are controlled by [merge_tree](../server_settings/settings.md) server settings. During replication, only the source data to insert is transferred over the network. Further data transformation (merging) is coordinated and performed on all the replicas in the same way. This minimizes network usage, which means that replication works well when replicas reside in different datacenters. (Note that duplicating data in different datacenters is the main goal of replication.) @@ -170,7 +170,7 @@ If all data and metadata disappeared from one of the servers, follow these steps Then start the server (restart, if it is already running). Data will be downloaded from replicas. -An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicatable tables](#table_engines-replication-creation_of_rep_tables)". +An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicatable tables]()". There is no restriction on network bandwidth during recovery. Keep this in mind if you are restoring many replicas at once. diff --git a/docs/zh/operations/table_engines/summingmergetree.md b/docs/zh/operations/table_engines/summingmergetree.md index a2d89bfa4c8..ce04a26950b 100644 --- a/docs/zh/operations/table_engines/summingmergetree.md +++ b/docs/zh/operations/table_engines/summingmergetree.md @@ -2,7 +2,7 @@ # SummingMergeTree -The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree). The difference is that when merging data parts for `SummingMergeTree` tables ClickHouse replaces all the rows with the same primary key with one row which contains summarized values for the columns with the numeric data type. If the primary key is composed in a way that a single key value corresponds to large number of rows, this significantly reduces storage volume and speeds up data selection. +The engine inherits from [MergeTree](mergetree.md). The difference is that when merging data parts for `SummingMergeTree` tables ClickHouse replaces all the rows with the same primary key with one row which contains summarized values for the columns with the numeric data type. If the primary key is composed in a way that a single key value corresponds to large number of rows, this significantly reduces storage volume and speeds up data selection. We recommend to use the engine together with `MergeTree`. Store complete data in `MergeTree` table, and use `SummingMergeTree` for aggregated data storing, for example, when preparing reports. Such an approach will prevent you from losing valuable data due to an incorrectly composed primary key. @@ -21,7 +21,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md#query_language-queries-create_table). +For a description of request parameters, see [request description](../../query_language/create.md). **Parameters of SummingMergeTree** @@ -32,7 +32,7 @@ The columns must be of a numeric type and must not be in the primary key. **Query clauses** -When creating a `SummingMergeTree` table the same [clauses](mergetree.md#table_engines-mergetree-configuring) are required, as when creating a `MergeTree` table. +When creating a `SummingMergeTree` table the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table.
    Deprecated Method for Creating a Table @@ -73,7 +73,7 @@ Insert data to it: :) INSERT INTO summtt Values(1,1),(1,2),(2,1) ``` -ClickHouse may sum all the rows not completely ([see below](#summary-data-processing)), so we use an aggregate function `sum` and `GROUP BY` clause in the query. +ClickHouse may sum all the rows not completely ([see below]()), so we use an aggregate function `sum` and `GROUP BY` clause in the query. ```sql SELECT key, sum(value) FROM summtt GROUP BY key @@ -92,7 +92,7 @@ SELECT key, sum(value) FROM summtt GROUP BY key When data are inserted into a table, they are saved as-is. Clickhouse merges the inserted parts of data periodically and this is when rows with the same primary key are summed and replaced with one for each resulting part of data. -ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md#agg_function-sum) and `GROUP BY` clause should be used in a query as described in the example above. +ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md) and `GROUP BY` clause should be used in a query as described in the example above. ### Common rules for summation @@ -106,7 +106,7 @@ The values are not summarized for columns in the primary key. ### The Summation in the AggregateFunction Columns -For columns of [AggregateFunction type](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) ClickHouse behaves as [AggregatingMergeTree](aggregatingmergetree.md#table_engine-aggregatingmergetree) engine aggregating according to the function. +For columns of [AggregateFunction type](../../data_types/nested_data_structures/aggregatefunction.md#data_type-aggregatefunction) ClickHouse behaves as [AggregatingMergeTree](aggregatingmergetree.md) engine aggregating according to the function. ### Nested Structures @@ -128,7 +128,7 @@ Examples: [(1, 100), (2, 150)] + [(1, -100)] -> [(2, 150)] ``` -When requesting data, use the [sumMap(key, value)](../../query_language/agg_functions/reference.md#agg_function-summary) function for aggregation of `Map`. +When requesting data, use the [sumMap(key, value)](../../query_language/agg_functions/reference.md) function for aggregation of `Map`. For nested data structure, you do not need to specify its columns in the tuple of columns for summation. diff --git a/docs/zh/operations/utils/index.md b/docs/zh/operations/utils/index.md index 6406b486cc8..ca0f0954150 100644 --- a/docs/zh/operations/utils/index.md +++ b/docs/zh/operations/utils/index.md @@ -1,7 +1,7 @@ # ClickHouse Utility -* [clickhouse-local](clickhouse-local.md#utils-clickhouse-local) — Allows running SQL queries on data without stopping the ClickHouse server, similar to how `awk` does this. -* [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) — Copies (and reshards) data from one cluster to another cluster. +* [clickhouse-local](clickhouse-local.md) — Allows running SQL queries on data without stopping the ClickHouse server, similar to how `awk` does this. +* [clickhouse-copier](clickhouse-copier.md) — Copies (and reshards) data from one cluster to another cluster. [Original article](https://clickhouse.yandex/docs/en/operations/utils/) diff --git a/docs/zh/query_language/insert_into.md b/docs/zh/query_language/insert_into.md index 992e720fe24..9ef32c6a6c5 100644 --- a/docs/zh/query_language/insert_into.md +++ b/docs/zh/query_language/insert_into.md @@ -15,7 +15,7 @@ INSERT INTO [db.]table [(c1, c2, c3)] VALUES (v11, v12, v13), (v21, v22, v23), . - 如果存在`DEFAULT`表达式,根据`DEFAULT`表达式计算被填充的值。 - 如果没有定义`DEFAULT`表达式,则填充零或空字符串。 -如果[strict_insert_defaults=1](../operations/settings/settings.md#settings-strict_insert_defaults),你必须在查询中列出所有没有定义`DEFAULT`表达式的列。 +如果[strict_insert_defaults=1](../operations/settings/settings.md),你必须在查询中列出所有没有定义`DEFAULT`表达式的列。 数据可以以ClickHouse支持的任何[输入输出格式](../interfaces/formats.md#formats)传递给INSERT。格式的名称必须显示的指定在查询中: diff --git a/docs/zh/query_language/select.md b/docs/zh/query_language/select.md index ae67b48d3d9..06fb53bb8fa 100644 --- a/docs/zh/query_language/select.md +++ b/docs/zh/query_language/select.md @@ -341,7 +341,7 @@ ARRAY JOIN nest AS n, arrayEnumerate(`nest.x`) AS num JOIN子句用于连接数据,作用与[SQL JOIN](https://en.wikipedia.org/wiki/Join_(SQL))的定义相同。 !!! info "注意" - 与[ARRAY JOIN](#select-array-join)没有关系. + 与[ARRAY JOIN]()没有关系. ``` sql @@ -351,8 +351,7 @@ FROM (ON )|(USING ) ... ``` -可以使用具体的表名来代替``与``。但这与使用`SELECT * FROM table`子查询的方式相同。除非你的表是[Join](../operations/table_engines/join.md#table-engine-join)引擎 - 对JOIN进行了预处理。 - +可以使用具体的表名来代替``与``。但这与使用`SELECT * FROM table`子查询的方式相同。除非你的表是[Join](../operations/table_engines/join.md **支持的`JOIN`类型** - `INNER JOIN` @@ -368,7 +367,7 @@ FROM 在使用`ALL`修饰符对JOIN进行修饰时,如果右表中存在多个与左表关联的数据,那么系统则将右表中所有可以与左表关联的数据全部返回在结果中。这与SQL标准的JOIN行为相同。 在使用`ANY`修饰符对JOIN进行修饰时,如果右表中存在多个与左表关联的数据,那么系统仅返回第一个与左表匹配的结果。如果左表与右表一一对应,不存在多余的行时,`ANY`与`ALL`的结果相同。 -你可以在会话中通过设置[join_default_strictness](../operations/settings/settings.md#session-setting-join_default_strictness)来指定默认的JOIN修饰符。 +你可以在会话中通过设置[join_default_strictness](../operations/settings/settings.md)来指定默认的JOIN修饰符。 **`GLOBAL` distribution** @@ -376,7 +375,7 @@ FROM 当使用`GLOBAL ... JOIN`,首先会在请求服务器上计算右表并以临时表的方式将其发送到所有服务器。这时每台服务器将直接使用它进行计算。 -使用`GLOBAL`时需要小心。更多信息,参阅[Distributed subqueries](#queries-distributed-subqueries)部分。 +使用`GLOBAL`时需要小心。更多信息,参阅[Distributed subqueries]()部分。 **使用建议** @@ -438,13 +437,13 @@ LIMIT 10 在一些场景下,使用`IN`代替`JOIN`将会得到更高的效率。在各种类型的JOIN中,最高效的是`ANY LEFT JOIN`,然后是`ANY INNER JOIN`,效率最差的是`ALL LEFT JOIN`以及`ALL INNER JOIN`。 -如果你需要使用`JOIN`来关联一些纬度表(包含纬度属性的一些相对比较小的表,例如广告活动的名称),那么`JOIN`可能不是好的选择,因为语法负责,并且每次查询都将重新访问这些表。对于这种情况,您应该使用“外部字典”的功能来替换`JOIN`。更多信息,参见[外部字典](dicts/external_dicts.md#dicts-external_dicts)部分。 +如果你需要使用`JOIN`来关联一些纬度表(包含纬度属性的一些相对比较小的表,例如广告活动的名称),那么`JOIN`可能不是好的选择,因为语法负责,并且每次查询都将重新访问这些表。对于这种情况,您应该使用“外部字典”的功能来替换`JOIN`。更多信息,参见[外部字典](dicts/external_dicts.md)部分。 #### Null的处理 -JOIN的行为受[join_use_nulls](../operations/settings/settings.md#settings-join_use_nulls)的影响。当`join_use_nulls=1`时,`JOIN`的工作与SQL标准相同。 +JOIN的行为受[join_use_nulls](../operations/settings/settings.md)的影响。当`join_use_nulls=1`时,`JOIN`的工作与SQL标准相同。 -如果JOIN的key是[Nullable](../data_types/nullable.md#data_types-nullable)类型的字段,则其中至少一个存在[NULL](syntax.md#null-literal)值的key不会被关联。 +如果JOIN的key是[Nullable](../data_types/nullable.md#data_types-nullable)类型的字段,则其中至少一个存在[NULL](syntax.md)值的key不会被关联。 @@ -516,7 +515,7 @@ GROUP BY子句会为遇到的每一个不同的key计算一组聚合函数的值 #### NULL 处理 -对于GROUP BY子句,ClickHouse将[NULL](syntax.md#null-literal)解释为一个值,并且支持`NULL=NULL`。 +对于GROUP BY子句,ClickHouse将[NULL](syntax.md)解释为一个值,并且支持`NULL=NULL`。 下面这个例子将说明这将意味着什么。 @@ -699,7 +698,7 @@ WHERE于HAVING不同之处在于WHERE在聚合前(GROUP BY)执行,HAVING在聚 在SELECT表达式中存在Array类型的列时,不能使用DISTINCT。 -`DISTINCT`可以与[NULL](syntax.md#null-literal)一起工作,就好像`NULL`仅是一个特殊的值一样,并且`NULL=NULL`。换而言之,在`DISTINCT`的结果中,与`NULL`不同的组合仅能出现一次。 +`DISTINCT`可以与[NULL](syntax.md)一起工作,就好像`NULL`仅是一个特殊的值一样,并且`NULL=NULL`。换而言之,在`DISTINCT`的结果中,与`NULL`不同的组合仅能出现一次。 ### LIMIT 子句 @@ -821,7 +820,7 @@ IN子句中的子查询仅在单个服务器上运行一次。不能够是相关 #### NULL 处理 -在处理中,IN操作符总是假定[NULL](syntax.md#null-literal)值的操作结果总是等于`0`,而不管`NULL`位于左侧还是右侧。`NULL`值不应该包含在任何数据集中,它们彼此不能够对应,并且不能够比较。 +在处理中,IN操作符总是假定[NULL](syntax.md)值的操作结果总是等于`0`,而不管`NULL`位于左侧还是右侧。`NULL`值不应该包含在任何数据集中,它们彼此不能够对应,并且不能够比较。 下面的示例中有一个`t_null`表: @@ -859,7 +858,7 @@ FROM t_null 对于带有子查询的(类似与JOINs)IN中,有两种选择:普通的`IN`/`JOIN`与`GLOBAL IN` / `GLOBAL JOIN`。它们对于分布式查询的处理运行方式是不同的。 !!! 注意 - 请记住,下面描述的算法可能因为根据[settings](../operations/settings/settings.md#settings-distributed_product_mode)配置的不同而不同。 + 请记住,下面描述的算法可能因为根据[settings](../operations/settings/settings.md)配置的不同而不同。 当使用普通的IN时,查询总是被发送到远程的服务器,并且在每个服务器中运行“IN”或“JOIN”子句中的子查询。 From ddcbbc7d516ed1684a4b37ceedf1774a03ea4139 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 16:47:59 +0300 Subject: [PATCH 114/297] Remove anchors that nobody links to --- docs/en/data_types/decimal.md | 1 - docs/en/data_types/enum.md | 1 - docs/en/data_types/int_uint.md | 1 - .../data_types/special_data_types/nothing.md | 1 - docs/en/data_types/string.md | 1 - docs/en/data_types/tuple.md | 1 - .../example_datasets/ontime.md | 1 - .../en/operations/server_settings/settings.md | 34 ------------------- docs/en/operations/settings/settings.md | 13 ------- .../operations/settings/settings_profiles.md | 1 - docs/en/operations/system_tables.md | 3 -- .../table_engines/aggregatingmergetree.md | 1 - .../table_engines/collapsingmergetree.md | 1 - .../table_engines/custom_partitioning_key.md | 1 - .../en/operations/table_engines/dictionary.md | 1 - .../operations/table_engines/distributed.md | 1 - .../operations/table_engines/external_data.md | 1 - .../table_engines/graphitemergetree.md | 1 - docs/en/operations/table_engines/join.md | 1 - docs/en/operations/table_engines/mergetree.md | 2 -- docs/en/operations/table_engines/mysql.md | 1 - docs/en/operations/table_engines/null.md | 1 - .../operations/table_engines/replication.md | 2 -- .../table_engines/summingmergetree.md | 2 -- .../versionedcollapsingmergetree.md | 2 -- docs/en/operations/utils/clickhouse-copier.md | 1 - docs/en/operations/utils/clickhouse-local.md | 1 - .../query_language/agg_functions/reference.md | 4 --- docs/en/query_language/alter.md | 2 -- docs/en/query_language/create.md | 1 - .../dicts/external_dicts_dict_layout.md | 6 ---- .../dicts/external_dicts_dict_lifetime.md | 1 - .../dicts/external_dicts_dict_structure.md | 3 -- .../functions/other_functions.md | 1 - .../functions/type_conversion_functions.md | 2 -- docs/en/query_language/insert_into.md | 2 -- docs/en/query_language/operators.md | 1 - docs/en/query_language/select.md | 7 ---- docs/en/query_language/syntax.md | 1 - .../en/query_language/table_functions/file.md | 1 - .../en/query_language/table_functions/jdbc.md | 1 - .../query_language/table_functions/remote.md | 1 - docs/en/query_language/table_functions/url.md | 1 - .../example_datasets/ontime.md | 1 - docs/ru/data_types/decimal.md | 1 - docs/ru/data_types/enum.md | 1 - docs/ru/data_types/int_uint.md | 1 - .../data_types/special_data_types/nothing.md | 1 - docs/ru/data_types/string.md | 1 - docs/ru/data_types/tuple.md | 1 - .../example_datasets/ontime.md | 1 - .../ru/operations/server_settings/settings.md | 34 ------------------- docs/ru/operations/settings/settings.md | 12 ------- .../operations/settings/settings_profiles.md | 1 - docs/ru/operations/system_tables.md | 3 -- .../table_engines/aggregatingmergetree.md | 1 - .../table_engines/custom_partitioning_key.md | 1 - .../ru/operations/table_engines/dictionary.md | 1 - .../operations/table_engines/distributed.md | 1 - .../table_engines/graphitemergetree.md | 1 - docs/ru/operations/table_engines/merge.md | 1 - docs/ru/operations/table_engines/mergetree.md | 2 -- docs/ru/operations/table_engines/mysql.md | 1 - .../operations/table_engines/replication.md | 2 -- .../table_engines/summingmergetree.md | 2 -- docs/ru/operations/utils/clickhouse-copier.md | 1 - docs/ru/operations/utils/clickhouse-local.md | 1 - .../query_language/agg_functions/reference.md | 4 --- docs/ru/query_language/alter.md | 2 -- docs/ru/query_language/create.md | 1 - .../dicts/external_dicts_dict_layout.md | 6 ---- .../dicts/external_dicts_dict_lifetime.md | 1 - .../dicts/external_dicts_dict_sources.md | 8 ----- .../dicts/external_dicts_dict_structure.md | 3 -- .../functions/other_functions.md | 1 - .../functions/type_conversion_functions.md | 1 - docs/ru/query_language/insert_into.md | 1 - docs/ru/query_language/misc.md | 1 - docs/ru/query_language/operators.md | 1 - docs/ru/query_language/select.md | 8 ----- .../ru/query_language/table_functions/file.md | 1 - .../ru/query_language/table_functions/jdbc.md | 1 - .../query_language/table_functions/remote.md | 1 - docs/ru/query_language/table_functions/url.md | 1 - docs/zh/data_types/decimal.md | 1 - docs/zh/data_types/enum.md | 1 - docs/zh/data_types/int_uint.md | 1 - .../data_types/special_data_types/nothing.md | 1 - docs/zh/data_types/string.md | 1 - docs/zh/data_types/tuple.md | 1 - .../example_datasets/ontime.md | 1 - .../zh/operations/server_settings/settings.md | 34 ------------------- docs/zh/operations/settings/settings.md | 12 ------- .../operations/settings/settings_profiles.md | 1 - docs/zh/operations/system_tables.md | 3 -- .../table_engines/aggregatingmergetree.md | 1 - .../table_engines/collapsingmergetree.md | 1 - .../table_engines/custom_partitioning_key.md | 1 - .../zh/operations/table_engines/dictionary.md | 1 - .../operations/table_engines/distributed.md | 1 - .../table_engines/graphitemergetree.md | 1 - docs/zh/operations/table_engines/mergetree.md | 1 - .../operations/table_engines/replication.md | 2 -- .../table_engines/summingmergetree.md | 2 -- docs/zh/operations/utils/clickhouse-copier.md | 1 - docs/zh/operations/utils/clickhouse-local.md | 1 - docs/zh/query_language/create.md | 1 - docs/zh/query_language/insert_into.md | 2 -- docs/zh/query_language/select.md | 7 ---- 109 files changed, 308 deletions(-) diff --git a/docs/en/data_types/decimal.md b/docs/en/data_types/decimal.md index cd7273c0441..136297f8d48 100644 --- a/docs/en/data_types/decimal.md +++ b/docs/en/data_types/decimal.md @@ -1,4 +1,3 @@ - # Decimal(P, S), Decimal32(S), Decimal64(S), Decimal128(S) diff --git a/docs/en/data_types/enum.md b/docs/en/data_types/enum.md index bd5168016d3..5ba82e71ec5 100644 --- a/docs/en/data_types/enum.md +++ b/docs/en/data_types/enum.md @@ -1,4 +1,3 @@ - # Enum8, Enum16 diff --git a/docs/en/data_types/int_uint.md b/docs/en/data_types/int_uint.md index 75a0d7bbde9..69528b36278 100644 --- a/docs/en/data_types/int_uint.md +++ b/docs/en/data_types/int_uint.md @@ -1,4 +1,3 @@ - # UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64 diff --git a/docs/en/data_types/special_data_types/nothing.md b/docs/en/data_types/special_data_types/nothing.md index 79384766295..2ccf7a7c72a 100644 --- a/docs/en/data_types/special_data_types/nothing.md +++ b/docs/en/data_types/special_data_types/nothing.md @@ -1,4 +1,3 @@ - # Nothing diff --git a/docs/en/data_types/string.md b/docs/en/data_types/string.md index 5e2fe8e1807..1d5b0a7e86c 100644 --- a/docs/en/data_types/string.md +++ b/docs/en/data_types/string.md @@ -1,4 +1,3 @@ - # String diff --git a/docs/en/data_types/tuple.md b/docs/en/data_types/tuple.md index 1f9cf3ec86f..789443aabed 100644 --- a/docs/en/data_types/tuple.md +++ b/docs/en/data_types/tuple.md @@ -1,4 +1,3 @@ - # Tuple(T1, T2, ...) diff --git a/docs/en/getting_started/example_datasets/ontime.md b/docs/en/getting_started/example_datasets/ontime.md index f319325d687..bd77e838e90 100644 --- a/docs/en/getting_started/example_datasets/ontime.md +++ b/docs/en/getting_started/example_datasets/ontime.md @@ -1,4 +1,3 @@ - # OnTime diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index e7c6ba88876..ba050176a35 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -1,6 +1,5 @@ # Server settings - ## builtin_dictionaries_reload_interval @@ -16,7 +15,6 @@ Default value: 3600. 3600 ``` - ## compression @@ -58,7 +56,6 @@ ClickHouse checks `min_part_size` and `min_part_size_ratio` and processes the ``` - ## default_database @@ -72,7 +69,6 @@ To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc. default ``` - ## default_profile @@ -86,7 +82,6 @@ Settings profiles are located in the file specified in the parameter [user_confi default ``` - ## dictionaries_config @@ -105,7 +100,6 @@ See also "[External dictionaries](../../query_language/dicts/external_dicts.md)" *_dictionary.xml ``` - ## dictionaries_lazy_load @@ -123,7 +117,6 @@ The default is `true`. true ``` - ## format_schema_path @@ -136,7 +129,6 @@ The path to the directory with the schemes for the input data, such as schemas f format_schemas/ ``` - ## graphite @@ -170,7 +162,6 @@ You can configure multiple `` clauses. For instance, you can use this ``` - ## graphite_rollup @@ -200,7 +191,6 @@ For more details, see [GraphiteMergeTree](../../operations/table_engines/graphit ``` - ## http_port/https_port @@ -216,7 +206,6 @@ If `http_port` is specified, the openSSL configuration is ignored even if it is 0000 ``` - ## http_server_default_response @@ -246,7 +235,6 @@ For more information, see the section "[Configuration files](../configuration_fi /etc/metrica.xml ``` - ## interserver_http_port @@ -258,7 +246,6 @@ Port for exchanging data between ClickHouse servers. 9009 ``` - ## interserver_http_host @@ -274,7 +261,6 @@ Useful for breaking away from a specific network interface. example.yandex.ru ``` - ## keep_alive_timeout @@ -286,7 +272,6 @@ The number of seconds that ClickHouse waits for incoming requests before closing 10 ``` - ## listen_host @@ -299,7 +284,6 @@ Examples: 127.0.0.1 ``` - ## logger @@ -349,7 +333,6 @@ in uppercase letters with the "LOG_" prefix: (``LOG_USER``, ``LOG_DAEMON``, ``LO Default value: ``LOG_USER`` if ``address`` is specified, ``LOG_DAEMON otherwise.`` - format – Message format. Possible values: ``bsd`` and ``syslog.`` - ## macros @@ -365,7 +348,6 @@ For more information, see the section "[Creating replicated tables](../../operat ``` - ## mark_cache_size @@ -379,7 +361,6 @@ The cache is shared for the server and memory is allocated as needed. The cache 5368709120 ``` - ## max_concurrent_queries @@ -391,7 +372,6 @@ The maximum number of simultaneously processed requests. 100 ``` - ## max_connections @@ -403,7 +383,6 @@ The maximum number of inbound connections. 4096 ``` - ## max_open_files @@ -419,7 +398,6 @@ We recommend using this option in Mac OS X, since the `getrlimit()` function ret 262144 ``` - ## max_table_size_to_drop @@ -439,7 +417,6 @@ The value 0 means that you can delete all tables without any restrictions. 0 ``` - ## merge_tree @@ -455,7 +432,6 @@ For more information, see the MergeTreeSettings.h header file. ``` - ## openSSL @@ -516,7 +492,6 @@ Keys for server/client settings: ``` - ## part_log @@ -555,7 +530,6 @@ Use the following parameters to configure logging: ``` - ## path @@ -570,7 +544,6 @@ The path to the directory containing data. /var/lib/clickhouse/ ``` - ## query_log @@ -598,7 +571,6 @@ If the table doesn't exist, ClickHouse will create it. If the structure of the q ``` - ## remote_servers @@ -614,7 +586,6 @@ For more information, see the section "[Table engines/Distributed](../../operati For the value of the `incl` attribute, see the section "[Configuration files](../configuration_files.md#configuration_files)". - ## timezone @@ -630,7 +601,6 @@ The time zone is necessary for conversions between String and DateTime formats w Europe/Moscow ``` - ## tcp_port @@ -642,7 +612,6 @@ Port for communicating with clients over the TCP protocol. 9000 ``` - ## tmp_path @@ -657,7 +626,6 @@ Path to temporary data for processing large queries. /var/lib/clickhouse/tmp/ ``` - ## uncompressed_cache_size @@ -683,7 +651,6 @@ The directory with user files. Used in the table function [file()](../../query_ /var/lib/clickhouse/user_files/ ``` - ## users_config @@ -700,7 +667,6 @@ Path to the file that contains: users.xml ``` - ## zookeeper diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index e23b83f2386..01fdbea7db4 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -1,6 +1,5 @@ # Settings - ## distributed_product_mode @@ -22,7 +21,6 @@ The possible values ​​are: - `global` — Replaces the `IN` / `JOIN` query with `GLOBAL IN` / `GLOBAL JOIN.` - `allow` — Allows the use of these types of subqueries. - ## fallback_to_stale_replicas_for_distributed_queries @@ -44,7 +42,6 @@ Works with tables in the MergeTree family. If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". - ## force_primary_key @@ -54,7 +51,6 @@ Works with tables in the MergeTree family. If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". - ## fsync_metadata @@ -87,7 +83,6 @@ If an error occurred while reading rows but the error counter is still less than If `input_format_allow_errors_ratio` is exceeded, ClickHouse throws an exception. - ## join_default_strictness @@ -117,7 +112,6 @@ Used for the same purpose as `max_block_size`, but it sets the recommended block However, the block size cannot be more than `max_block_size` rows. Disabled by default (set to 0). It only works when reading from MergeTree engines. - ## log_queries @@ -253,7 +247,6 @@ By default, 3. Whether to count extreme values (the minimums and maximums in columns of a query result). Accepts 0 or 1. By default, 0 (disabled). For more information, see the section "Extreme values". - ## use_uncompressed_cache @@ -277,7 +270,6 @@ Yandex.Metrica uses this parameter set to 1 for implementing suggestions for seg This parameter is useful when you are using formats that require a schema definition, such as [Cap'n Proto](https://capnproto.org/). The value depends on the format. - ## stream_flush_interval_ms @@ -287,7 +279,6 @@ The default value is 7500. The smaller the value, the more often data is flushed into the table. Setting the value too low leads to poor performance. - ## load_balancing @@ -367,7 +358,6 @@ If the value is true, integers appear in quotes when using JSON\* Int64 and UInt The character interpreted as a delimiter in the CSV data. By default, the delimiter is `,`. - ## join_use_nulls @@ -375,7 +365,6 @@ Affects the behavior of [JOIN](../../query_language/select.md). With `join_use_nulls=1,` `JOIN` behaves like in standard SQL, i.e. if empty cells appear when merging, the type of the corresponding field is converted to [Nullable](../../data_types/nullable.md#data_type-nullable), and empty cells are filled with [NULL](../../query_language/syntax.md). - ## insert_quorum @@ -404,7 +393,6 @@ When reading the data written from the `insert_quorum`, you can use the[select_s - [insert_quorum_timeout]() - [select_sequential_consistency]() - ## insert_quorum_timeout @@ -417,7 +405,6 @@ By default, 60 seconds. - [insert_quorum]() - [select_sequential_consistency]() - ## select_sequential_consistency diff --git a/docs/en/operations/settings/settings_profiles.md b/docs/en/operations/settings/settings_profiles.md index 338800fbee2..3953ada8a83 100644 --- a/docs/en/operations/settings/settings_profiles.md +++ b/docs/en/operations/settings/settings_profiles.md @@ -1,4 +1,3 @@ - # Settings profiles diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 21e4cd37eb8..b41f7f02b95 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -5,7 +5,6 @@ You can't delete a system table (but you can perform DETACH). System tables don't have files with data on the disk or files with metadata. The server creates all the system tables when it starts. System tables are read-only. They are located in the 'system' database. - ## system.asynchronous_metrics @@ -70,7 +69,6 @@ Columns: - `source String` — Text describing the data source for the dictionary. Note that the amount of memory used by the dictionary is not proportional to the number of items stored in it. So for flat and cached dictionaries, all the memory cells are pre-assigned, regardless of how full the dictionary actually is. - ## system.events @@ -105,7 +103,6 @@ Columns: - `rows_read UInt64` — Number of rows read. - `bytes_written_uncompressed UInt64` — Number of bytes written, uncompressed. - `rows_written UInt64` — Number of lines rows written. - ## system.metrics diff --git a/docs/en/operations/table_engines/aggregatingmergetree.md b/docs/en/operations/table_engines/aggregatingmergetree.md index f8d5c372d7d..df84492c027 100644 --- a/docs/en/operations/table_engines/aggregatingmergetree.md +++ b/docs/en/operations/table_engines/aggregatingmergetree.md @@ -1,4 +1,3 @@ - # AggregatingMergeTree diff --git a/docs/en/operations/table_engines/collapsingmergetree.md b/docs/en/operations/table_engines/collapsingmergetree.md index db41150159d..f74b7986ed6 100644 --- a/docs/en/operations/table_engines/collapsingmergetree.md +++ b/docs/en/operations/table_engines/collapsingmergetree.md @@ -56,7 +56,6 @@ All of the parameters excepting `sign` have the same meaning as in `MergeTree`. Column Data Type — `Int8`.
    - ## Collapsing diff --git a/docs/en/operations/table_engines/custom_partitioning_key.md b/docs/en/operations/table_engines/custom_partitioning_key.md index 5bf686ea872..a674bc5533f 100644 --- a/docs/en/operations/table_engines/custom_partitioning_key.md +++ b/docs/en/operations/table_engines/custom_partitioning_key.md @@ -1,4 +1,3 @@ - # Custom Partitioning Key diff --git a/docs/en/operations/table_engines/dictionary.md b/docs/en/operations/table_engines/dictionary.md index 00caba03ac0..4ed0199297e 100644 --- a/docs/en/operations/table_engines/dictionary.md +++ b/docs/en/operations/table_engines/dictionary.md @@ -1,4 +1,3 @@ - # Dictionary diff --git a/docs/en/operations/table_engines/distributed.md b/docs/en/operations/table_engines/distributed.md index 6bd60c1591d..39f99d30a3f 100644 --- a/docs/en/operations/table_engines/distributed.md +++ b/docs/en/operations/table_engines/distributed.md @@ -1,4 +1,3 @@ - # Distributed diff --git a/docs/en/operations/table_engines/external_data.md b/docs/en/operations/table_engines/external_data.md index ea27c9f0e1c..315bcb386a8 100644 --- a/docs/en/operations/table_engines/external_data.md +++ b/docs/en/operations/table_engines/external_data.md @@ -1,4 +1,3 @@ - # External Data for Query Processing diff --git a/docs/en/operations/table_engines/graphitemergetree.md b/docs/en/operations/table_engines/graphitemergetree.md index 843185ff83d..fa15ab4daaf 100644 --- a/docs/en/operations/table_engines/graphitemergetree.md +++ b/docs/en/operations/table_engines/graphitemergetree.md @@ -1,4 +1,3 @@ - # GraphiteMergeTree diff --git a/docs/en/operations/table_engines/join.md b/docs/en/operations/table_engines/join.md index 217e499305f..3fc5ef8ac53 100644 --- a/docs/en/operations/table_engines/join.md +++ b/docs/en/operations/table_engines/join.md @@ -1,4 +1,3 @@ - # Join diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index 9422b2028b2..f8b2a00cf83 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -27,7 +27,6 @@ Main features: !!! info The [Merge](merge.md) engine does not belong to the `*MergeTree` family. - ## Creating a Table @@ -172,7 +171,6 @@ The number of columns in the primary key is not explicitly limited. Depending on A long primary key will negatively affect the insert performance and memory consumption, but extra columns in the primary key do not affect ClickHouse performance during `SELECT` queries. - ### Choosing the Primary Key that differs from the Sorting Key diff --git a/docs/en/operations/table_engines/mysql.md b/docs/en/operations/table_engines/mysql.md index 5f3122faf00..6c17b882321 100644 --- a/docs/en/operations/table_engines/mysql.md +++ b/docs/en/operations/table_engines/mysql.md @@ -1,4 +1,3 @@ - # MySQL diff --git a/docs/en/operations/table_engines/null.md b/docs/en/operations/table_engines/null.md index 68a2abdac81..a236de2f180 100644 --- a/docs/en/operations/table_engines/null.md +++ b/docs/en/operations/table_engines/null.md @@ -1,4 +1,3 @@ - # Null diff --git a/docs/en/operations/table_engines/replication.md b/docs/en/operations/table_engines/replication.md index 09392bb3740..51c99ed7ab0 100644 --- a/docs/en/operations/table_engines/replication.md +++ b/docs/en/operations/table_engines/replication.md @@ -69,7 +69,6 @@ You can have any number of replicas of the same data. Yandex.Metrica uses double The system monitors data synchronicity on replicas and is able to recover after a failure. Failover is automatic (for small differences in data) or semi-automatic (when data differs too much, which may indicate a configuration error). - ## Creating Replicated Tables @@ -177,7 +176,6 @@ An alternative recovery option is to delete information about the lost replica f There is no restriction on network bandwidth during recovery. Keep this in mind if you are restoring many replicas at once. - ## Converting from MergeTree to ReplicatedMergeTree diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index c74cee277ce..ed1cb2b359e 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -1,4 +1,3 @@ - # SummingMergeTree @@ -86,7 +85,6 @@ SELECT key, sum(value) FROM summtt GROUP BY key └─────┴────────────┘ ``` - ## Data Processing diff --git a/docs/en/operations/table_engines/versionedcollapsingmergetree.md b/docs/en/operations/table_engines/versionedcollapsingmergetree.md index 330e2bd4fe7..fc5b5559bc4 100644 --- a/docs/en/operations/table_engines/versionedcollapsingmergetree.md +++ b/docs/en/operations/table_engines/versionedcollapsingmergetree.md @@ -1,4 +1,3 @@ - # VersionedCollapsingMergeTree @@ -71,7 +70,6 @@ All of the parameters excepting `sign` and `version` have the same meaning as in Column data type should be `UInt*`.
    - ## Collapsing diff --git a/docs/en/operations/utils/clickhouse-copier.md b/docs/en/operations/utils/clickhouse-copier.md index 361834a681d..bb2666a05cc 100644 --- a/docs/en/operations/utils/clickhouse-copier.md +++ b/docs/en/operations/utils/clickhouse-copier.md @@ -1,4 +1,3 @@ - # clickhouse-copier diff --git a/docs/en/operations/utils/clickhouse-local.md b/docs/en/operations/utils/clickhouse-local.md index 4b20473cb42..89c719531c1 100644 --- a/docs/en/operations/utils/clickhouse-local.md +++ b/docs/en/operations/utils/clickhouse-local.md @@ -1,4 +1,3 @@ - # clickhouse-local diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md index ace9f5769b3..6b214e71acc 100644 --- a/docs/en/query_language/agg_functions/reference.md +++ b/docs/en/query_language/agg_functions/reference.md @@ -1,4 +1,3 @@ - # Function reference @@ -213,7 +212,6 @@ SELECT argMin(user, salary) FROM salary Calculates the 'arg' value for a maximum 'val' value. If there are several different values of 'arg' for maximum values of 'val', the first of these values encountered is output. - ## sum(x) @@ -226,7 +224,6 @@ Computes the sum of the numbers, using the same data type for the result as for Only works for numbers. - ## sumMap(key, value) @@ -322,7 +319,6 @@ For example, `groupArray (1) (x)` is equivalent to `[any (x)]`. In some cases, you can still rely on the order of execution. This applies to cases when `SELECT` comes from a subquery that uses `ORDER BY`. - ## groupArrayInsertAt(x) diff --git a/docs/en/query_language/alter.md b/docs/en/query_language/alter.md index 59c88b169a4..9457fafc71d 100644 --- a/docs/en/query_language/alter.md +++ b/docs/en/query_language/alter.md @@ -66,7 +66,6 @@ For tables that don't store data themselves (such as `Merge` and `Distributed`), The `ALTER` query for changing columns is replicated. The instructions are saved in ZooKeeper, then each replica applies them. All `ALTER` queries are run in the same order. The query waits for the appropriate actions to be completed on the other replicas. However, a query to change columns in a replicated table can be interrupted, and all actions will be performed asynchronously. - ### Manipulations With Key Expressions @@ -85,7 +84,6 @@ The command is lightweight in a sense that it only changes metadata. To keep the rows are ordered by the sorting key expression you cannot add expressions containing existing columns to the sorting key (only columns added by the `ADD COLUMN` command in the same `ALTER` query). - ### Manipulations With Partitions and Parts diff --git a/docs/en/query_language/create.md b/docs/en/query_language/create.md index 70829b72eeb..9cf783154f9 100644 --- a/docs/en/query_language/create.md +++ b/docs/en/query_language/create.md @@ -9,7 +9,6 @@ CREATE DATABASE [IF NOT EXISTS] db_name `A database` is just a directory for tables. If `IF NOT EXISTS` is included, the query won't return an error if the database already exists. - ## CREATE TABLE diff --git a/docs/en/query_language/dicts/external_dicts_dict_layout.md b/docs/en/query_language/dicts/external_dicts_dict_layout.md index 150f129ce94..23be493dfd7 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/en/query_language/dicts/external_dicts_dict_layout.md @@ -36,7 +36,6 @@ The configuration looks like this: ``` - ## Ways to Store Dictionaries in Memory @@ -84,7 +83,6 @@ Configuration example: ``` - ### complex_key_hashed @@ -98,7 +96,6 @@ Configuration example: ``` - ### range_hashed @@ -185,7 +182,6 @@ Configuration example: ``` - ### cache @@ -221,13 +217,11 @@ Set a large enough cache size. You need to experiment to select the number of ce !!! warning Do not use ClickHouse as a source, because it is slow to process queries with random reads. - ### complex_key_cache This type of storage is for use with composite [keys](external_dicts_dict_structure.md). Similar to `cache`. - ### ip_trie diff --git a/docs/en/query_language/dicts/external_dicts_dict_lifetime.md b/docs/en/query_language/dicts/external_dicts_dict_lifetime.md index b8df6bebedc..4ab8ba4ea20 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_lifetime.md +++ b/docs/en/query_language/dicts/external_dicts_dict_lifetime.md @@ -1,4 +1,3 @@ - # Dictionary Updates diff --git a/docs/en/query_language/dicts/external_dicts_dict_structure.md b/docs/en/query_language/dicts/external_dicts_dict_structure.md index eb8f46dba66..3a3c2661263 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_structure.md +++ b/docs/en/query_language/dicts/external_dicts_dict_structure.md @@ -1,4 +1,3 @@ - # Dictionary Key and Fields @@ -28,7 +27,6 @@ Columns are described in the structure: - `` - [key column](external_dicts_dict_structure.md). - `` - [data column](external_dicts_dict_structure.md). There can be a large number of columns. - ## Key @@ -85,7 +83,6 @@ The key structure is set in the element ``. Key fields are specified in the For a query to the `dictGet*` function, a tuple is passed as the key. Example: `dictGetString('dict_name', 'attr_name', tuple('string for field1', num_for_field2))`. - ## Attributes diff --git a/docs/en/query_language/functions/other_functions.md b/docs/en/query_language/functions/other_functions.md index 674fd97ae08..85cd1dfe5c5 100644 --- a/docs/en/query_language/functions/other_functions.md +++ b/docs/en/query_language/functions/other_functions.md @@ -122,7 +122,6 @@ ORDER BY h ASC └────┴────────┴────────────────────┘ ``` - ## transform diff --git a/docs/en/query_language/functions/type_conversion_functions.md b/docs/en/query_language/functions/type_conversion_functions.md index 9eff4491bc6..a1a175db845 100644 --- a/docs/en/query_language/functions/type_conversion_functions.md +++ b/docs/en/query_language/functions/type_conversion_functions.md @@ -1,4 +1,3 @@ - # Type conversion functions @@ -100,7 +99,6 @@ These functions accept a string and interpret the bytes placed at the beginning This function accepts a number or date or date with time, and returns a string containing bytes representing the corresponding value in host order (little endian). Null bytes are dropped from the end. For example, a UInt32 type value of 255 is a string that is one byte long. - ## CAST(x, t) diff --git a/docs/en/query_language/insert_into.md b/docs/en/query_language/insert_into.md index 9b1edab2ac8..fc9421d3479 100644 --- a/docs/en/query_language/insert_into.md +++ b/docs/en/query_language/insert_into.md @@ -1,4 +1,3 @@ - ## INSERT @@ -41,7 +40,6 @@ INSERT INTO t FORMAT TabSeparated You can insert data separately from the query by using the command-line client or the HTTP interface. For more information, see the section "[Interfaces](../interfaces/index.md#interfaces)". - ### Inserting The Results of `SELECT` diff --git a/docs/en/query_language/operators.md b/docs/en/query_language/operators.md index cef9ec07f99..fbe4c3ace26 100644 --- a/docs/en/query_language/operators.md +++ b/docs/en/query_language/operators.md @@ -153,7 +153,6 @@ WHERE isNull(y) 1 rows in set. Elapsed: 0.002 sec. ``` - ### IS NOT NULL diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index 8eda93e5a4e..a168aca29e6 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -80,7 +80,6 @@ A sample with a relative coefficient is "consistent": if we look at all possible For example, a sample of user IDs takes rows with the same subset of all the possible user IDs from different tables. This allows using the sample in subqueries in the IN clause, as well as for manually correlating results of different queries with samples. - ### ARRAY JOIN Clause @@ -334,7 +333,6 @@ The query can only specify a single ARRAY JOIN clause. The corresponding conversion can be performed before the WHERE/PREWHERE clause (if its result is needed in this clause), or after completing WHERE/PREWHERE (to reduce the volume of calculations). - ### JOIN Clause @@ -447,7 +445,6 @@ The JOIN behavior is affected by the [join_use_nulls](../operations/settings/set If the JOIN keys are [Nullable](../data_types/nullable.md#data_types-nullable) fields, the rows where at least one of the keys has the value [NULL](syntax.md) are not joined. - ### WHERE Clause @@ -456,7 +453,6 @@ This expression will be used for filtering data before all other transformations If indexes are supported by the database table engine, the expression is evaluated on the ability to use indexes. - ### PREWHERE Clause @@ -615,7 +611,6 @@ Allows filtering the result received after GROUP BY, similar to the WHERE clause WHERE and HAVING differ in that WHERE is performed before aggregation (GROUP BY), while HAVING is performed after it. If aggregation is not performed, HAVING can't be used. - ### ORDER BY Clause @@ -751,7 +746,6 @@ If the FORMAT clause is omitted, the default format is used, which depends on bo When using the command-line client, data is passed to the client in an internal efficient format. The client independently interprets the FORMAT clause of the query and formats the data itself (thus relieving the network and the server from the load). - ### IN Operators @@ -850,7 +844,6 @@ FROM t_null └───────────────────────┘ ``` - #### Distributed Subqueries diff --git a/docs/en/query_language/syntax.md b/docs/en/query_language/syntax.md index cd8152664b4..56a05d26534 100644 --- a/docs/en/query_language/syntax.md +++ b/docs/en/query_language/syntax.md @@ -56,7 +56,6 @@ For example, 1 is parsed as UInt8, but 256 is parsed as UInt16. For more informa Examples: `1`, `18446744073709551615`, `0xDEADBEEF`, `01`, `0.1`, `1e100`, `-1e-100`, `inf`, `nan`. - ### String Literals diff --git a/docs/en/query_language/table_functions/file.md b/docs/en/query_language/table_functions/file.md index e7c7e5b8e89..22c22bf5b3c 100644 --- a/docs/en/query_language/table_functions/file.md +++ b/docs/en/query_language/table_functions/file.md @@ -1,4 +1,3 @@ - # file diff --git a/docs/en/query_language/table_functions/jdbc.md b/docs/en/query_language/table_functions/jdbc.md index 240e12551d8..3121d2e22c5 100644 --- a/docs/en/query_language/table_functions/jdbc.md +++ b/docs/en/query_language/table_functions/jdbc.md @@ -1,4 +1,3 @@ - # jdbc diff --git a/docs/en/query_language/table_functions/remote.md b/docs/en/query_language/table_functions/remote.md index 49ba0f83cc3..90e9085573f 100644 --- a/docs/en/query_language/table_functions/remote.md +++ b/docs/en/query_language/table_functions/remote.md @@ -1,4 +1,3 @@ - # remote diff --git a/docs/en/query_language/table_functions/url.md b/docs/en/query_language/table_functions/url.md index 4e012cff01f..662049aa0f9 100644 --- a/docs/en/query_language/table_functions/url.md +++ b/docs/en/query_language/table_functions/url.md @@ -1,4 +1,3 @@ - # url diff --git a/docs/fa/getting_started/example_datasets/ontime.md b/docs/fa/getting_started/example_datasets/ontime.md index 443e37ed9fe..71c09531a8d 100644 --- a/docs/fa/getting_started/example_datasets/ontime.md +++ b/docs/fa/getting_started/example_datasets/ontime.md @@ -1,4 +1,3 @@ -
    diff --git a/docs/ru/data_types/decimal.md b/docs/ru/data_types/decimal.md index e9fed3cc104..1dc2679213c 100644 --- a/docs/ru/data_types/decimal.md +++ b/docs/ru/data_types/decimal.md @@ -1,4 +1,3 @@ - # Decimal(P, S), Decimal32(S), Decimal64(S), Decimal128(S) diff --git a/docs/ru/data_types/enum.md b/docs/ru/data_types/enum.md index 9c7a2bb79fb..7ed0150e65f 100644 --- a/docs/ru/data_types/enum.md +++ b/docs/ru/data_types/enum.md @@ -1,4 +1,3 @@ - # Enum8, Enum16 diff --git a/docs/ru/data_types/int_uint.md b/docs/ru/data_types/int_uint.md index 562da33e730..630980d641a 100644 --- a/docs/ru/data_types/int_uint.md +++ b/docs/ru/data_types/int_uint.md @@ -1,4 +1,3 @@ - # UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64 diff --git a/docs/ru/data_types/special_data_types/nothing.md b/docs/ru/data_types/special_data_types/nothing.md index 296c2df9c91..19f879e2242 100644 --- a/docs/ru/data_types/special_data_types/nothing.md +++ b/docs/ru/data_types/special_data_types/nothing.md @@ -1,4 +1,3 @@ - # Nothing diff --git a/docs/ru/data_types/string.md b/docs/ru/data_types/string.md index 18d18eecb0e..2085bda8189 100644 --- a/docs/ru/data_types/string.md +++ b/docs/ru/data_types/string.md @@ -1,4 +1,3 @@ - # String diff --git a/docs/ru/data_types/tuple.md b/docs/ru/data_types/tuple.md index 6d81ba36531..1763967c052 100644 --- a/docs/ru/data_types/tuple.md +++ b/docs/ru/data_types/tuple.md @@ -1,4 +1,3 @@ - # Tuple(T1, T2, ...) diff --git a/docs/ru/getting_started/example_datasets/ontime.md b/docs/ru/getting_started/example_datasets/ontime.md index fa832c99847..d08d40d6692 100644 --- a/docs/ru/getting_started/example_datasets/ontime.md +++ b/docs/ru/getting_started/example_datasets/ontime.md @@ -1,4 +1,3 @@ - # OnTime diff --git a/docs/ru/operations/server_settings/settings.md b/docs/ru/operations/server_settings/settings.md index bb86a77385c..cd993062417 100644 --- a/docs/ru/operations/server_settings/settings.md +++ b/docs/ru/operations/server_settings/settings.md @@ -1,6 +1,5 @@ # Серверные настройки - ## builtin_dictionaries_reload_interval @@ -16,7 +15,6 @@ ClickHouse перезагружает встроенные словари с з 3600 ``` - ## compression @@ -58,7 +56,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## default_database @@ -72,7 +69,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat default ``` - ## default_profile @@ -86,7 +82,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat default ``` - ## dictionaries_config @@ -105,7 +100,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat *_dictionary.xml ``` - ## dictionaries_lazy_load @@ -123,7 +117,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat true ``` - ## format_schema_path @@ -137,7 +130,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## graphite @@ -171,7 +163,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## graphite_rollup @@ -201,7 +192,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## http_port/https_port @@ -217,7 +207,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 0000 ``` - ## http_server_default_response @@ -247,7 +236,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat /etc/metrica.xml ``` - ## interserver_http_port @@ -259,7 +247,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 9009 ``` - ## interserver_http_host @@ -275,7 +262,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat example.yandex.ru ``` - ## keep_alive_timeout @@ -287,7 +273,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 10 ``` - ## listen_host @@ -300,7 +285,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 127.0.0.1 ``` - ## logger @@ -349,7 +333,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat - format - формат сообщений. Возможные значения - ``bsd`` и ``syslog`` - ## macros @@ -365,7 +348,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## mark_cache_size @@ -379,7 +361,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 5368709120 ``` - ## max_concurrent_queries @@ -391,7 +372,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 100 ``` - ## max_connections @@ -403,7 +383,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 4096 ``` - ## max_open_files @@ -419,7 +398,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 262144 ``` - ## max_table_size_to_drop @@ -439,7 +417,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 0 ``` - ## merge_tree @@ -455,7 +432,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## openSSL @@ -516,7 +492,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## part_log @@ -556,7 +531,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## path @@ -571,7 +545,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat /var/lib/clickhouse/ ``` - ## query_log @@ -599,7 +572,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat ``` - ## remote_servers @@ -616,7 +588,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Значение атрибута `incl` смотрите в разделе "[Конфигурационные файлы](../configuration_files.md#configuration_files)". - ## timezone @@ -632,7 +603,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Europe/Moscow ``` - ## tcp_port @@ -644,7 +614,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat 9000 ``` - ## tmp_path @@ -659,7 +628,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat /var/lib/clickhouse/tmp/ ``` - ## uncompressed_cache_size @@ -685,7 +653,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat /var/lib/clickhouse/user_files/ ``` - ## users_config @@ -702,7 +669,6 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat users.xml ``` - ## zookeeper diff --git a/docs/ru/operations/settings/settings.md b/docs/ru/operations/settings/settings.md index fd2a480d53a..31d40ebc0c7 100644 --- a/docs/ru/operations/settings/settings.md +++ b/docs/ru/operations/settings/settings.md @@ -1,6 +1,5 @@ # Настройки - ## distributed_product_mode @@ -22,7 +21,6 @@ ClickHouse применяет настройку в тех случаях, ко - `global` - заменит запрос `IN` / `JOIN` на `GLOBAL IN` / `GLOBAL JOIN`; - `allow` - разрешает использование таких подзапросов. - ## fallback_to_stale_replicas_for_distributed_queries @@ -44,7 +42,6 @@ ClickHouse применяет настройку в тех случаях, ко При `force_index_by_date=1` ClickHouse проверяет, есть ли в запросе условие на ключ даты, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Например, условие `Date != '2000-01-01'` подходит даже в том случае, когда соответствует всем данным в таблице (т.е. для выполнения запроса требуется full scan). Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md)". - ## force_primary_key @@ -54,7 +51,6 @@ ClickHouse применяет настройку в тех случаях, ко При `force_primary_key=1` ClickHouse проверяет, есть ли в запросе условие на первичный ключ, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md)". - ## fsync_metadata @@ -101,7 +97,6 @@ ClickHouse применяет настройку в тех случаях, ко При этом размер блока не может быть более `max_block_size` строк. По умолчанию выключен (равен 0), работает только при чтении из MergeTree-движков. - ## log_queries @@ -235,7 +230,6 @@ ClickHouse применяет настройку в тех случаях, ко Считать ли экстремальные значения (минимумы и максимумы по столбцам результата запроса). Принимает 0 или 1. По умолчанию - 0 (выключено). Подробнее смотрите раздел "Экстремальные значения". - ## use_uncompressed_cache @@ -259,7 +253,6 @@ ClickHouse применяет настройку в тех случаях, ко Параметр применяется в том случае, когда используются форматы, требующие определения схемы, например [Cap'n Proto](https://capnproto.org/). Значение параметра зависит от формата. - ## stream_flush_interval_ms @@ -270,7 +263,6 @@ ClickHouse применяет настройку в тех случаях, ко Чем меньше значение, тем чаще данные сбрасываются в таблицу. Установка слишком низкого значения приводит к снижению производительности. - ## load_balancing @@ -347,7 +339,6 @@ ClickHouse применяет настройку в тех случаях, ко Символ, интерпретируемый как разделитель в данных формата CSV. По умолчанию — `,`. - ## join_use_nulls @@ -355,7 +346,6 @@ ClickHouse применяет настройку в тех случаях, ко При `join_use_nulls=1` `JOIN` ведёт себя как в стандартном SQL, т.е. если при слиянии возникают пустые ячейки, то тип соответствующего поля преобразуется к [Nullable](../../data_types/nullable.md#data_type-nullable), а пустые ячейки заполняются значениями [NULL](../../query_language/syntax.md). - ## insert_quorum @@ -384,7 +374,6 @@ ClickHouse применяет настройку в тех случаях, ко - [insert_quorum_timeout]() - [select_sequential_consistency]() - ## insert_quorum_timeout @@ -397,7 +386,6 @@ ClickHouse применяет настройку в тех случаях, ко - [insert_quorum]() - [select_sequential_consistency]() - ## select_sequential_consistency diff --git a/docs/ru/operations/settings/settings_profiles.md b/docs/ru/operations/settings/settings_profiles.md index 600b7c11730..212e577faaf 100644 --- a/docs/ru/operations/settings/settings_profiles.md +++ b/docs/ru/operations/settings/settings_profiles.md @@ -1,4 +1,3 @@ - # Профили настроек diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index a4a014d225f..bcc2139bdb9 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -5,7 +5,6 @@ Для системных таблиц нет файлов с данными на диске и файлов с метаданными. Сервер создаёт все системные таблицы при старте. В системные таблицы нельзя записывать данные - можно только читать. Системные таблицы расположены в базе данных system. - ## system.asynchronous_metrics @@ -69,7 +68,6 @@ default_expression String - выражение для значения по ум Заметим, что количество оперативной памяти, которое использует словарь, не является пропорциональным количеству элементов, хранящихся в словаре. Так, для flat и cached словарей, все ячейки памяти выделяются заранее, независимо от реальной заполненности словаря. - ## system.events @@ -102,7 +100,6 @@ default_expression String - выражение для значения по ум - `rows_read UInt64` — Количество прочитанных строк. - `bytes_written_uncompressed UInt64` — Количество записанных байт, несжатых. - `rows_written UInt64` — Количество записанных строк. - ## system.metrics ## system.numbers diff --git a/docs/ru/operations/table_engines/aggregatingmergetree.md b/docs/ru/operations/table_engines/aggregatingmergetree.md index 622bc3033ff..97ddee14714 100644 --- a/docs/ru/operations/table_engines/aggregatingmergetree.md +++ b/docs/ru/operations/table_engines/aggregatingmergetree.md @@ -1,4 +1,3 @@ - # AggregatingMergeTree diff --git a/docs/ru/operations/table_engines/custom_partitioning_key.md b/docs/ru/operations/table_engines/custom_partitioning_key.md index 6aa3cad3d0f..3dde806cad0 100644 --- a/docs/ru/operations/table_engines/custom_partitioning_key.md +++ b/docs/ru/operations/table_engines/custom_partitioning_key.md @@ -1,4 +1,3 @@ - # Произвольный ключ партиционирования diff --git a/docs/ru/operations/table_engines/dictionary.md b/docs/ru/operations/table_engines/dictionary.md index 6a79f442232..650ad9466a7 100644 --- a/docs/ru/operations/table_engines/dictionary.md +++ b/docs/ru/operations/table_engines/dictionary.md @@ -1,4 +1,3 @@ - # Dictionary diff --git a/docs/ru/operations/table_engines/distributed.md b/docs/ru/operations/table_engines/distributed.md index a483e6de8b5..be3dde014cf 100644 --- a/docs/ru/operations/table_engines/distributed.md +++ b/docs/ru/operations/table_engines/distributed.md @@ -1,4 +1,3 @@ - # Distributed diff --git a/docs/ru/operations/table_engines/graphitemergetree.md b/docs/ru/operations/table_engines/graphitemergetree.md index 60a407016da..9142a4023a6 100644 --- a/docs/ru/operations/table_engines/graphitemergetree.md +++ b/docs/ru/operations/table_engines/graphitemergetree.md @@ -1,4 +1,3 @@ - # GraphiteMergeTree diff --git a/docs/ru/operations/table_engines/merge.md b/docs/ru/operations/table_engines/merge.md index 1b4e4d6a984..28065e5d120 100644 --- a/docs/ru/operations/table_engines/merge.md +++ b/docs/ru/operations/table_engines/merge.md @@ -1,4 +1,3 @@ - # Merge diff --git a/docs/ru/operations/table_engines/mergetree.md b/docs/ru/operations/table_engines/mergetree.md index c73d66374ec..94143ce9d2a 100644 --- a/docs/ru/operations/table_engines/mergetree.md +++ b/docs/ru/operations/table_engines/mergetree.md @@ -25,7 +25,6 @@ При необходимости можно задать способ сэмплирования данных в таблице. - ## Создание таблицы @@ -171,7 +170,6 @@ ClickHouse не требует уникального первичного кл Длинный первичный ключ будет негативно влиять на производительность вставки и потребление памяти, однако на производительность ClickHouse при запросах `SELECT` лишние столбцы в первичном ключе не влияют. - ### Первичный ключ, отличный от ключа сортировки diff --git a/docs/ru/operations/table_engines/mysql.md b/docs/ru/operations/table_engines/mysql.md index 6b2a14f4edc..e0beb5af180 100644 --- a/docs/ru/operations/table_engines/mysql.md +++ b/docs/ru/operations/table_engines/mysql.md @@ -1,4 +1,3 @@ - # MySQL diff --git a/docs/ru/operations/table_engines/replication.md b/docs/ru/operations/table_engines/replication.md index 2994138df84..3e0b4a68be7 100644 --- a/docs/ru/operations/table_engines/replication.md +++ b/docs/ru/operations/table_engines/replication.md @@ -68,7 +68,6 @@ Система следит за синхронностью данных на репликах и умеет восстанавливаться после сбоя. Восстановление после сбоя автоматическое (в случае небольших различий в данных) или полуавтоматическое (когда данные отличаются слишком сильно, что может свидетельствовать об ошибке конфигурации). - ## Создание реплицируемых таблиц @@ -173,7 +172,6 @@ sudo -u clickhouse touch /var/lib/clickhouse/flags/force_restore_data Отсутствует ограничение на использование сетевой полосы при восстановлении. Имейте это ввиду, если восстанавливаете сразу много реплик. - ## Преобразование из MergeTree в ReplicatedMergeTree diff --git a/docs/ru/operations/table_engines/summingmergetree.md b/docs/ru/operations/table_engines/summingmergetree.md index 841060e303d..6d6014de395 100644 --- a/docs/ru/operations/table_engines/summingmergetree.md +++ b/docs/ru/operations/table_engines/summingmergetree.md @@ -1,4 +1,3 @@ - # SummingMergeTree @@ -85,7 +84,6 @@ SELECT key, sum(value) FROM summtt GROUP BY key └─────┴────────────┘ ``` - ## Обработка данных diff --git a/docs/ru/operations/utils/clickhouse-copier.md b/docs/ru/operations/utils/clickhouse-copier.md index d114c826dc6..1959a768def 100644 --- a/docs/ru/operations/utils/clickhouse-copier.md +++ b/docs/ru/operations/utils/clickhouse-copier.md @@ -1,4 +1,3 @@ - # clickhouse-copier diff --git a/docs/ru/operations/utils/clickhouse-local.md b/docs/ru/operations/utils/clickhouse-local.md index 4edbb3abb2b..b43eb3600f7 100644 --- a/docs/ru/operations/utils/clickhouse-local.md +++ b/docs/ru/operations/utils/clickhouse-local.md @@ -1,4 +1,3 @@ - # clickhouse-local diff --git a/docs/ru/query_language/agg_functions/reference.md b/docs/ru/query_language/agg_functions/reference.md index 449d2efd665..2b440de9f27 100644 --- a/docs/ru/query_language/agg_functions/reference.md +++ b/docs/ru/query_language/agg_functions/reference.md @@ -1,4 +1,3 @@ - # Справочник функций @@ -214,7 +213,6 @@ SELECT argMin(user, salary) FROM salary Вычисляет значение arg при максимальном значении val. Если есть несколько разных значений arg для максимальных значений val, то выдаётся первое попавшееся из таких значений. - ## sum(x) @@ -227,7 +225,6 @@ SELECT argMin(user, salary) FROM salary Работает только для чисел. - ## sumMap(key, value) @@ -323,7 +320,6 @@ GROUP BY timeslot В некоторых случаях, вы всё же можете рассчитывать на порядок выполнения запроса. Это — случаи, когда `SELECT` идёт из подзапроса, в котором используется `ORDER BY`. - ## groupArrayInsertAt(x) diff --git a/docs/ru/query_language/alter.md b/docs/ru/query_language/alter.md index e996e0342d8..9eaed2dae51 100644 --- a/docs/ru/query_language/alter.md +++ b/docs/ru/query_language/alter.md @@ -64,7 +64,6 @@ MODIFY COLUMN name [type] [default_expr] Запрос `ALTER` на изменение столбцов реплицируется. Соответствующие инструкции сохраняются в ZooKeeper, и затем каждая реплика их применяет. Все запросы `ALTER` выполняются в одном и том же порядке. Запрос ждёт выполнения соответствующих действий на всех репликах. Но при этом, запрос на изменение столбцов в реплицируемой таблице можно прервать, и все действия будут осуществлены асинхронно. - ### Манипуляции с ключевыми выражениями таблиц @@ -82,7 +81,6 @@ MODIFY ORDER BY new_expression сортировки, разрешено добавлять в ключ только новые столбцы (т.е. столбцы, добавляемые командой `ADD COLUMN` в том же запросе `ALTER`), у которых нет выражения по умолчанию. - ### Манипуляции с партициями и кусками diff --git a/docs/ru/query_language/create.md b/docs/ru/query_language/create.md index f1d8f8471de..a0027d3abc1 100644 --- a/docs/ru/query_language/create.md +++ b/docs/ru/query_language/create.md @@ -9,7 +9,6 @@ CREATE DATABASE [IF NOT EXISTS] db_name Если написано `IF NOT EXISTS`, то запрос не будет возвращать ошибку, если база данных уже существует. - ## CREATE TABLE Запрос `CREATE TABLE` может иметь несколько форм. diff --git a/docs/ru/query_language/dicts/external_dicts_dict_layout.md b/docs/ru/query_language/dicts/external_dicts_dict_layout.md index f7d50a757d0..93a3e29c5d3 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_layout.md @@ -36,7 +36,6 @@ ``` - ## Способы размещения словарей в памяти @@ -84,7 +83,6 @@ ``` - ### complex_key_hashed @@ -98,7 +96,6 @@ ``` - ### range_hashed @@ -183,7 +180,6 @@ ``` - ### cache @@ -220,13 +216,11 @@ !!! warning Не используйте в качестве источника ClickHouse, поскольку он медленно обрабатывает запросы со случайным чтением. - ### complex_key_cache Тип размещения предназначен для использования с составными [ключами](external_dicts_dict_structure.md). Аналогичен `cache`. - ### ip_trie diff --git a/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md b/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md index c3c89715338..f2774e63b0a 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_lifetime.md @@ -1,4 +1,3 @@ - # Обновление словарей diff --git a/docs/ru/query_language/dicts/external_dicts_dict_sources.md b/docs/ru/query_language/dicts/external_dicts_dict_sources.md index b11d1ef2832..76fd552f4d7 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_sources.md @@ -1,4 +1,3 @@ - # Источники внешних словарей @@ -34,7 +33,6 @@ - [ClickHouse]() - [MongoDB]() - ## Локальный файл @@ -54,7 +52,6 @@ - `path` - Абсолютный путь к файлу. - `format` - Формат файла. Поддерживаются все форматы, описанные в разделе "[Форматы](../../interfaces/formats.md#formats)". - ## Исполняемый файл @@ -76,7 +73,6 @@ - `command` - Абсолютный путь к исполняемому файлу или имя файла (если каталог программы прописан в `PATH`). - `format` - Формат файла. Поддерживаются все форматы, описанные в разделе "[Форматы](../../interfaces/formats.md#formats)". - ## HTTP(s) @@ -100,7 +96,6 @@ - `url` - URL источника. - `format` - Формат файла. Поддерживаются все форматы, описанные в разделе "[Форматы](../../interfaces/formats.md#formats)". - ## ODBC @@ -303,7 +298,6 @@ SELECT * FROM odbc('DSN=gregtest;Servername=some-server.com', 'test_db'); ## СУБД - ### MySQL @@ -365,7 +359,6 @@ MySQL можно подключить на локальном хосте чер ``` - ### ClickHouse @@ -396,7 +389,6 @@ MySQL можно подключить на локальном хосте чер - `where` - условие выбора. Может отсутствовать. - `invalidate_query` - запрос для проверки статуса словаря. Необязательный параметр. Читайте подробнее в разделе [Обновление словарей](external_dicts_dict_lifetime.md). - ### MongoDB diff --git a/docs/ru/query_language/dicts/external_dicts_dict_structure.md b/docs/ru/query_language/dicts/external_dicts_dict_structure.md index 22755baeefc..50a2469358b 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_structure.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_structure.md @@ -1,4 +1,3 @@ - # Ключ и поля словаря @@ -28,7 +27,6 @@ - `` - [ключевой столбец](external_dicts_dict_structure.md). - `` - [столбец данных](external_dicts_dict_structure.md). Столбцов может быть много. - ## Ключ @@ -85,7 +83,6 @@ ClickHouse поддерживает следующие виды ключей: При запросе в функции `dictGet*` в качестве ключа передаётся кортеж. Пример: `dictGetString('dict_name', 'attr_name', tuple('string for field1', num_for_field2))`. - ## Атрибуты diff --git a/docs/ru/query_language/functions/other_functions.md b/docs/ru/query_language/functions/other_functions.md index 038129bece4..eede1a97264 100644 --- a/docs/ru/query_language/functions/other_functions.md +++ b/docs/ru/query_language/functions/other_functions.md @@ -111,7 +111,6 @@ ORDER BY h ASC └────┴────────┴────────────────────┘ ``` - ## transform Преобразовать значение согласно явно указанному отображению одних элементов на другие. diff --git a/docs/ru/query_language/functions/type_conversion_functions.md b/docs/ru/query_language/functions/type_conversion_functions.md index 3fb464ca4f2..6e7fd6a552d 100644 --- a/docs/ru/query_language/functions/type_conversion_functions.md +++ b/docs/ru/query_language/functions/type_conversion_functions.md @@ -1,4 +1,3 @@ - # Функции преобразования типов diff --git a/docs/ru/query_language/insert_into.md b/docs/ru/query_language/insert_into.md index dc7a82e77e5..6799eb71b64 100644 --- a/docs/ru/query_language/insert_into.md +++ b/docs/ru/query_language/insert_into.md @@ -1,4 +1,3 @@ - ## INSERT diff --git a/docs/ru/query_language/misc.md b/docs/ru/query_language/misc.md index 5bfddb64b43..3c177fe44c9 100644 --- a/docs/ru/query_language/misc.md +++ b/docs/ru/query_language/misc.md @@ -1,6 +1,5 @@ - ## ATTACH Запрос полностью аналогичен запросу `CREATE`, но: diff --git a/docs/ru/query_language/operators.md b/docs/ru/query_language/operators.md index 3f1157f775c..b3e9da24a31 100644 --- a/docs/ru/query_language/operators.md +++ b/docs/ru/query_language/operators.md @@ -151,7 +151,6 @@ WHERE isNull(y) 1 rows in set. Elapsed: 0.002 sec. ``` - ### IS NOT NULL diff --git a/docs/ru/query_language/select.md b/docs/ru/query_language/select.md index 2a5d9820abc..ffb48a05599 100644 --- a/docs/ru/query_language/select.md +++ b/docs/ru/query_language/select.md @@ -26,7 +26,6 @@ SELECT [DISTINCT] expr_list Если в запросе отсутствуют секции `DISTINCT`, `GROUP BY`, `ORDER BY`, подзапросы в `IN` и `JOIN`, то запрос будет обработан полностью потоково, с использованием O(1) количества оперативки. Иначе запрос может съесть много оперативки, если не указаны подходящие ограничения `max_memory_usage`, `max_rows_to_group_by`, `max_rows_to_sort`, `max_rows_in_distinct`, `max_bytes_in_distinct`, `max_rows_in_set`, `max_bytes_in_set`, `max_rows_in_join`, `max_bytes_in_join`, `max_bytes_before_external_sort`, `max_bytes_before_external_group_by`. Подробнее смотрите в разделе "Настройки". Присутствует возможность использовать внешнюю сортировку (с сохранением временных данных на диск) и внешнюю агрегацию. `Merge join` в системе нет. - ### Секция FROM @@ -46,7 +45,6 @@ SELECT [DISTINCT] expr_list Модификатор FINAL может быть использован только при SELECT-е из таблицы типа CollapsingMergeTree. При указании FINAL, данные будут выбираться полностью "сколлапсированными". Стоит учитывать, что использование FINAL приводит к выбору кроме указанных в SELECT-е столбцов также столбцов, относящихся к первичному ключу. Также, запрос будет выполняться в один поток, и при выполнении запроса будет выполняться слияние данных. Это приводит к тому, что при использовании FINAL, запрос выполняется медленнее. В большинстве случаев, следует избегать использования FINAL. Подробнее смотрите раздел "Движок CollapsingMergeTree". - ### Секция SAMPLE @@ -337,7 +335,6 @@ ARRAY JOIN nest AS n, arrayEnumerate(`nest.x`) AS num Соответствующее преобразование может выполняться как до секции WHERE/PREWHERE (если его результат нужен в этой секции), так и после выполнения WHERE/PREWHERE (чтобы уменьшить объём вычислений). - ### Секция JOIN @@ -442,7 +439,6 @@ LIMIT 10 Если ключами JOIN выступают поля типа [Nullable](../data_types/nullable.md#data_types-nullable), то строки, где хотя бы один из ключей имеет значение [NULL](syntax.md), не соединяются. - ### Секция WHERE @@ -470,7 +466,6 @@ WHERE isNull(y) 1 rows in set. Elapsed: 0.002 sec. ``` - ### Секция PREWHERE @@ -631,7 +626,6 @@ LIMIT 100 WHERE и HAVING отличаются тем, что WHERE выполняется до агрегации (GROUP BY), а HAVING - после. Если агрегации не производится, то HAVING использовать нельзя. - ### Секция ORDER BY @@ -767,7 +761,6 @@ SELECT CounterID, 2 AS table, sum(Sign) AS c При использовании клиента командной строки данные на клиент передаются во внутреннем эффективном формате. При этом клиент самостоятельно интерпретирует секцию FORMAT запроса и форматирует данные на своей стороне (снимая нагрузку на сеть и сервер). - ### Операторы IN @@ -868,7 +861,6 @@ FROM t_null └───────────────────────┘ ``` - #### Распределённые подзапросы diff --git a/docs/ru/query_language/table_functions/file.md b/docs/ru/query_language/table_functions/file.md index f0fe3d4687b..816643de1ba 100644 --- a/docs/ru/query_language/table_functions/file.md +++ b/docs/ru/query_language/table_functions/file.md @@ -1,4 +1,3 @@ - # file diff --git a/docs/ru/query_language/table_functions/jdbc.md b/docs/ru/query_language/table_functions/jdbc.md index 77b1da780ab..4f6273489da 100644 --- a/docs/ru/query_language/table_functions/jdbc.md +++ b/docs/ru/query_language/table_functions/jdbc.md @@ -1,4 +1,3 @@ - # jdbc diff --git a/docs/ru/query_language/table_functions/remote.md b/docs/ru/query_language/table_functions/remote.md index 24380b31cc1..c3eeeed46e0 100644 --- a/docs/ru/query_language/table_functions/remote.md +++ b/docs/ru/query_language/table_functions/remote.md @@ -1,4 +1,3 @@ - # remote diff --git a/docs/ru/query_language/table_functions/url.md b/docs/ru/query_language/table_functions/url.md index fccaf1fe11e..65a66fce6bf 100644 --- a/docs/ru/query_language/table_functions/url.md +++ b/docs/ru/query_language/table_functions/url.md @@ -1,4 +1,3 @@ - # url diff --git a/docs/zh/data_types/decimal.md b/docs/zh/data_types/decimal.md index 373543c2c2e..8fc4db33981 100644 --- a/docs/zh/data_types/decimal.md +++ b/docs/zh/data_types/decimal.md @@ -1,4 +1,3 @@ - # Decimal(P, S), Decimal32(S), Decimal64(S), Decimal128(S) diff --git a/docs/zh/data_types/enum.md b/docs/zh/data_types/enum.md index dd469b04eb5..ca8488b4345 100644 --- a/docs/zh/data_types/enum.md +++ b/docs/zh/data_types/enum.md @@ -1,4 +1,3 @@ - # Enum8, Enum16 diff --git a/docs/zh/data_types/int_uint.md b/docs/zh/data_types/int_uint.md index a74d11cbc20..9d215b93ba7 100644 --- a/docs/zh/data_types/int_uint.md +++ b/docs/zh/data_types/int_uint.md @@ -1,4 +1,3 @@ - # UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64 diff --git a/docs/zh/data_types/special_data_types/nothing.md b/docs/zh/data_types/special_data_types/nothing.md index 8e0b259bae4..6d313d7e09b 100644 --- a/docs/zh/data_types/special_data_types/nothing.md +++ b/docs/zh/data_types/special_data_types/nothing.md @@ -1,4 +1,3 @@ - # Nothing diff --git a/docs/zh/data_types/string.md b/docs/zh/data_types/string.md index 5d7374eb56f..3aef96b8aa3 100644 --- a/docs/zh/data_types/string.md +++ b/docs/zh/data_types/string.md @@ -1,4 +1,3 @@ - # String diff --git a/docs/zh/data_types/tuple.md b/docs/zh/data_types/tuple.md index d1c92c7eae8..7e81736c82d 100644 --- a/docs/zh/data_types/tuple.md +++ b/docs/zh/data_types/tuple.md @@ -1,4 +1,3 @@ - # Tuple(T1, T2, ...) diff --git a/docs/zh/getting_started/example_datasets/ontime.md b/docs/zh/getting_started/example_datasets/ontime.md index 37f673e2559..49d48fb1660 100644 --- a/docs/zh/getting_started/example_datasets/ontime.md +++ b/docs/zh/getting_started/example_datasets/ontime.md @@ -1,4 +1,3 @@ - # 航班飞行数据 diff --git a/docs/zh/operations/server_settings/settings.md b/docs/zh/operations/server_settings/settings.md index cbaef77b890..72b0bd860c4 100644 --- a/docs/zh/operations/server_settings/settings.md +++ b/docs/zh/operations/server_settings/settings.md @@ -1,6 +1,5 @@ # Server settings - ## builtin_dictionaries_reload_interval @@ -16,7 +15,6 @@ Default value: 3600. 3600 ``` - ## compression @@ -58,7 +56,6 @@ ClickHouse checks `min_part_size` and `min_part_size_ratio` and processes the ``` - ## default_database @@ -72,7 +69,6 @@ To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc. default ``` - ## default_profile @@ -86,7 +82,6 @@ Settings profiles are located in the file specified in the parameter [user_confi default ``` - ## dictionaries_config @@ -105,7 +100,6 @@ See also "[External dictionaries](../../query_language/dicts/external_dicts.md)" *_dictionary.xml ``` - ## dictionaries_lazy_load @@ -123,7 +117,6 @@ The default is `true`. true ``` - ## format_schema_path @@ -136,7 +129,6 @@ The path to the directory with the schemes for the input data, such as schemas f format_schemas/ ``` - ## graphite @@ -170,7 +162,6 @@ You can configure multiple `` clauses. For instance, you can use this ``` - ## graphite_rollup @@ -200,7 +191,6 @@ For more details, see [GraphiteMergeTree](../../operations/table_engines/graphit ``` - ## http_port/https_port @@ -216,7 +206,6 @@ If `http_port` is specified, the openSSL configuration is ignored even if it is 0000 ``` - ## http_server_default_response @@ -246,7 +235,6 @@ For more information, see the section "[Configuration files](../configuration_fi /etc/metrica.xml ``` - ## interserver_http_port @@ -258,7 +246,6 @@ Port for exchanging data between ClickHouse servers. 9009 ``` - ## interserver_http_host @@ -274,7 +261,6 @@ Useful for breaking away from a specific network interface. example.yandex.ru ``` - ## keep_alive_timeout @@ -286,7 +272,6 @@ The number of seconds that ClickHouse waits for incoming requests before closing 10 ``` - ## listen_host @@ -299,7 +284,6 @@ Examples: 127.0.0.1 ``` - ## logger @@ -349,7 +333,6 @@ in uppercase letters with the "LOG_" prefix: (``LOG_USER``, ``LOG_DAEMON``, ``LO Default value: ``LOG_USER`` if ``address`` is specified, ``LOG_DAEMON otherwise.`` - format – Message format. Possible values: ``bsd`` and ``syslog.`` - ## macros @@ -365,7 +348,6 @@ For more information, see the section "[Creating replicated tables](../../operat ``` - ## mark_cache_size @@ -379,7 +361,6 @@ The cache is shared for the server and memory is allocated as needed. The cache 5368709120 ``` - ## max_concurrent_queries @@ -391,7 +372,6 @@ The maximum number of simultaneously processed requests. 100 ``` - ## max_connections @@ -403,7 +383,6 @@ The maximum number of inbound connections. 4096 ``` - ## max_open_files @@ -419,7 +398,6 @@ We recommend using this option in Mac OS X, since the `getrlimit()` function ret 262144 ``` - ## max_table_size_to_drop @@ -439,7 +417,6 @@ The value 0 means that you can delete all tables without any restrictions. 0 ``` - ## merge_tree @@ -455,7 +432,6 @@ For more information, see the MergeTreeSettings.h header file. ``` - ## openSSL @@ -516,7 +492,6 @@ Keys for server/client settings: ``` - ## part_log @@ -554,7 +529,6 @@ Use the following parameters to configure logging: ``` - ## path @@ -569,7 +543,6 @@ The path to the directory containing data. /var/lib/clickhouse/ ``` - ## query_log @@ -597,7 +570,6 @@ If the table doesn't exist, ClickHouse will create it. If the structure of the q ``` - ## remote_servers @@ -613,7 +585,6 @@ For more information, see the section "[Table engines/Distributed](../../operati For the value of the `incl` attribute, see the section "[Configuration files](../configuration_files.md#configuration_files)". - ## timezone @@ -629,7 +600,6 @@ The time zone is necessary for conversions between String and DateTime formats w Europe/Moscow ``` - ## tcp_port @@ -641,7 +611,6 @@ Port for communicating with clients over the TCP protocol. 9000 ``` - ## tmp_path @@ -656,7 +625,6 @@ Path to temporary data for processing large queries. /var/lib/clickhouse/tmp/ ``` - ## uncompressed_cache_size @@ -682,7 +650,6 @@ The directory with user files. Used in the table function [file()](../../query_ /var/lib/clickhouse/user_files/ ``` - ## users_config @@ -699,7 +666,6 @@ Path to the file that contains: users.xml ``` - ## zookeeper diff --git a/docs/zh/operations/settings/settings.md b/docs/zh/operations/settings/settings.md index 5976a90ef81..e3170246054 100644 --- a/docs/zh/operations/settings/settings.md +++ b/docs/zh/operations/settings/settings.md @@ -1,6 +1,5 @@ # Settings - ## distributed_product_mode @@ -22,7 +21,6 @@ The possible values ​​are: - `global` — Replaces the `IN` / `JOIN` query with `GLOBAL IN` / `GLOBAL JOIN.` - `allow` — Allows the use of these types of subqueries. - ## fallback_to_stale_replicas_for_distributed_queries @@ -44,7 +42,6 @@ Works with tables in the MergeTree family. If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". - ## force_primary_key @@ -54,7 +51,6 @@ Works with tables in the MergeTree family. If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md)". - ## fsync_metadata @@ -101,7 +97,6 @@ Used for the same purpose as `max_block_size`, but it sets the recommended block However, the block size cannot be more than `max_block_size` rows. Disabled by default (set to 0). It only works when reading from MergeTree engines. - ## log_queries @@ -237,7 +232,6 @@ By default, 3. Whether to count extreme values (the minimums and maximums in columns of a query result). Accepts 0 or 1. By default, 0 (disabled). For more information, see the section "Extreme values". - ## use_uncompressed_cache @@ -261,7 +255,6 @@ Yandex.Metrica uses this parameter set to 1 for implementing suggestions for seg This parameter is useful when you are using formats that require a schema definition, such as [Cap'n Proto](https://capnproto.org/). The value depends on the format. - ## stream_flush_interval_ms @@ -271,7 +264,6 @@ The default value is 7500. The smaller the value, the more often data is flushed into the table. Setting the value too low leads to poor performance. - ## load_balancing @@ -351,7 +343,6 @@ If the value is true, integers appear in quotes when using JSON\* Int64 and UInt The character interpreted as a delimiter in the CSV data. By default, the delimiter is `,`. - ## join_use_nulls @@ -359,7 +350,6 @@ Affects the behavior of [JOIN](../../query_language/select.md). With `join_use_nulls=1,` `JOIN` behaves like in standard SQL, i.e. if empty cells appear when merging, the type of the corresponding field is converted to [Nullable](../../data_types/nullable.md#data_type-nullable), and empty cells are filled with [NULL](../../query_language/syntax.md). - ## insert_quorum @@ -388,7 +378,6 @@ When reading the data written from the `insert_quorum`, you can use the[select_s - [insert_quorum_timeout]() - [select_sequential_consistency]() - ## insert_quorum_timeout @@ -401,7 +390,6 @@ By default, 60 seconds. - [insert_quorum]() - [select_sequential_consistency]() - ## select_sequential_consistency diff --git a/docs/zh/operations/settings/settings_profiles.md b/docs/zh/operations/settings/settings_profiles.md index 338800fbee2..3953ada8a83 100644 --- a/docs/zh/operations/settings/settings_profiles.md +++ b/docs/zh/operations/settings/settings_profiles.md @@ -1,4 +1,3 @@ - # Settings profiles diff --git a/docs/zh/operations/system_tables.md b/docs/zh/operations/system_tables.md index 21e4cd37eb8..b41f7f02b95 100644 --- a/docs/zh/operations/system_tables.md +++ b/docs/zh/operations/system_tables.md @@ -5,7 +5,6 @@ You can't delete a system table (but you can perform DETACH). System tables don't have files with data on the disk or files with metadata. The server creates all the system tables when it starts. System tables are read-only. They are located in the 'system' database. - ## system.asynchronous_metrics @@ -70,7 +69,6 @@ Columns: - `source String` — Text describing the data source for the dictionary. Note that the amount of memory used by the dictionary is not proportional to the number of items stored in it. So for flat and cached dictionaries, all the memory cells are pre-assigned, regardless of how full the dictionary actually is. - ## system.events @@ -105,7 +103,6 @@ Columns: - `rows_read UInt64` — Number of rows read. - `bytes_written_uncompressed UInt64` — Number of bytes written, uncompressed. - `rows_written UInt64` — Number of lines rows written. - ## system.metrics diff --git a/docs/zh/operations/table_engines/aggregatingmergetree.md b/docs/zh/operations/table_engines/aggregatingmergetree.md index 7f123200dca..5b571f63a65 100644 --- a/docs/zh/operations/table_engines/aggregatingmergetree.md +++ b/docs/zh/operations/table_engines/aggregatingmergetree.md @@ -1,4 +1,3 @@ - # AggregatingMergeTree diff --git a/docs/zh/operations/table_engines/collapsingmergetree.md b/docs/zh/operations/table_engines/collapsingmergetree.md index 26b6f96abdc..c6140514693 100644 --- a/docs/zh/operations/table_engines/collapsingmergetree.md +++ b/docs/zh/operations/table_engines/collapsingmergetree.md @@ -56,7 +56,6 @@ All of the parameters excepting `sign` have the same meaning as in `MergeTree`. Column Data Type — `Int8`.
    - ## Collapsing diff --git a/docs/zh/operations/table_engines/custom_partitioning_key.md b/docs/zh/operations/table_engines/custom_partitioning_key.md index 55940db8ca9..98df0bfc1c8 100644 --- a/docs/zh/operations/table_engines/custom_partitioning_key.md +++ b/docs/zh/operations/table_engines/custom_partitioning_key.md @@ -1,4 +1,3 @@ - # Custom Partitioning Key diff --git a/docs/zh/operations/table_engines/dictionary.md b/docs/zh/operations/table_engines/dictionary.md index eed7f7afaf4..fa2d6cbc7ce 100644 --- a/docs/zh/operations/table_engines/dictionary.md +++ b/docs/zh/operations/table_engines/dictionary.md @@ -1,4 +1,3 @@ - # Dictionary diff --git a/docs/zh/operations/table_engines/distributed.md b/docs/zh/operations/table_engines/distributed.md index 6bd60c1591d..39f99d30a3f 100644 --- a/docs/zh/operations/table_engines/distributed.md +++ b/docs/zh/operations/table_engines/distributed.md @@ -1,4 +1,3 @@ - # Distributed diff --git a/docs/zh/operations/table_engines/graphitemergetree.md b/docs/zh/operations/table_engines/graphitemergetree.md index 843185ff83d..fa15ab4daaf 100644 --- a/docs/zh/operations/table_engines/graphitemergetree.md +++ b/docs/zh/operations/table_engines/graphitemergetree.md @@ -1,4 +1,3 @@ - # GraphiteMergeTree diff --git a/docs/zh/operations/table_engines/mergetree.md b/docs/zh/operations/table_engines/mergetree.md index e526923dc18..12ed0cc094f 100644 --- a/docs/zh/operations/table_engines/mergetree.md +++ b/docs/zh/operations/table_engines/mergetree.md @@ -27,7 +27,6 @@ Main features: !!! info The [Merge](merge.md) engine does not belong to the `*MergeTree` family. - ## Creating a Table diff --git a/docs/zh/operations/table_engines/replication.md b/docs/zh/operations/table_engines/replication.md index f0f7a5456c5..ad344f5c4ba 100644 --- a/docs/zh/operations/table_engines/replication.md +++ b/docs/zh/operations/table_engines/replication.md @@ -68,7 +68,6 @@ You can have any number of replicas of the same data. Yandex.Metrica uses double The system monitors data synchronicity on replicas and is able to recover after a failure. Failover is automatic (for small differences in data) or semi-automatic (when data differs too much, which may indicate a configuration error). - ## Creating Replicated Tables @@ -174,7 +173,6 @@ An alternative recovery option is to delete information about the lost replica f There is no restriction on network bandwidth during recovery. Keep this in mind if you are restoring many replicas at once. - ## Converting from MergeTree to ReplicatedMergeTree diff --git a/docs/zh/operations/table_engines/summingmergetree.md b/docs/zh/operations/table_engines/summingmergetree.md index ce04a26950b..2cad58f27cc 100644 --- a/docs/zh/operations/table_engines/summingmergetree.md +++ b/docs/zh/operations/table_engines/summingmergetree.md @@ -1,4 +1,3 @@ - # SummingMergeTree @@ -86,7 +85,6 @@ SELECT key, sum(value) FROM summtt GROUP BY key └─────┴────────────┘ ``` - ## Data Processing diff --git a/docs/zh/operations/utils/clickhouse-copier.md b/docs/zh/operations/utils/clickhouse-copier.md index 361834a681d..bb2666a05cc 100644 --- a/docs/zh/operations/utils/clickhouse-copier.md +++ b/docs/zh/operations/utils/clickhouse-copier.md @@ -1,4 +1,3 @@ - # clickhouse-copier diff --git a/docs/zh/operations/utils/clickhouse-local.md b/docs/zh/operations/utils/clickhouse-local.md index 4b20473cb42..89c719531c1 100644 --- a/docs/zh/operations/utils/clickhouse-local.md +++ b/docs/zh/operations/utils/clickhouse-local.md @@ -1,4 +1,3 @@ - # clickhouse-local diff --git a/docs/zh/query_language/create.md b/docs/zh/query_language/create.md index f86270eb7cb..1cc5fe0febc 100644 --- a/docs/zh/query_language/create.md +++ b/docs/zh/query_language/create.md @@ -9,7 +9,6 @@ CREATE DATABASE [IF NOT EXISTS] db_name 数据库其实只是用于存放表的一个目录。 如果查询中存在`IF NOT EXISTS`,则当数据库已经存在时,该查询不会返回任何错误。 - ## CREATE TABLE diff --git a/docs/zh/query_language/insert_into.md b/docs/zh/query_language/insert_into.md index 9ef32c6a6c5..58af549fc35 100644 --- a/docs/zh/query_language/insert_into.md +++ b/docs/zh/query_language/insert_into.md @@ -1,4 +1,3 @@ - ## INSERT @@ -41,7 +40,6 @@ INSERT INTO t FORMAT TabSeparated 在使用命令行客户端或HTTP客户端时,你可以将具体的查询语句与数据分开发送。更多具体信息,请参考“[客户端](../interfaces/index.md#interfaces)”部分。 - ### 使用`SELECT`的结果写入 diff --git a/docs/zh/query_language/select.md b/docs/zh/query_language/select.md index 06fb53bb8fa..b58f6886b35 100644 --- a/docs/zh/query_language/select.md +++ b/docs/zh/query_language/select.md @@ -80,7 +80,6 @@ ORDER BY PageViews DESC LIMIT 1000 例如,我们可以使用采样的方式获取到与不进行采样相同的用户ID的列表。这将表明,你可以在IN子查询中使用采样,或者使用采样的结果与其他查询进行关联。 - ### ARRAY JOIN 子句 @@ -334,7 +333,6 @@ ARRAY JOIN nest AS n, arrayEnumerate(`nest.x`) AS num 如果在WHERE/PREWHERE子句中使用了ARRAY JOIN子句的结果,它将优先于WHERE/PREWHERE子句执行,否则它将在WHERE/PRWHERE子句之后执行,以便减少计算。 - ### JOIN 子句 @@ -445,7 +443,6 @@ JOIN的行为受[join_use_nulls](../operations/settings/settings.md)的影响。 如果JOIN的key是[Nullable](../data_types/nullable.md#data_types-nullable)类型的字段,则其中至少一个存在[NULL](syntax.md)值的key不会被关联。 - ### WHERE 子句 @@ -454,7 +451,6 @@ JOIN的行为受[join_use_nulls](../operations/settings/settings.md)的影响。 如果在支持索引的数据库表引擎中,这个表达式将被评估是否使用索引。 - ### PREWHERE 子句 @@ -615,7 +611,6 @@ HAVING子句可以用来过滤GROUP BY之后的数据,类似于WHERE子句。 WHERE于HAVING不同之处在于WHERE在聚合前(GROUP BY)执行,HAVING在聚合后执行。 如果不存在聚合,则不能使用HAVING。 - ### ORDER BY 子句 @@ -751,7 +746,6 @@ UNION ALL中的查询可以同时运行,它们的结果将被混合到一起 当使用命令行客户端时,数据以内部高效的格式在服务器和客户端之间进行传递。客户端将单独的解析FORMAT子句,以帮助数据格式的转换(这将减轻网络和服务器的负载)。 - ### IN 运算符 @@ -851,7 +845,6 @@ FROM t_null └───────────────────────┘ ``` - #### 分布式子查询 From 5b0b704c7272299c4a49585cfd391e868e9cb5c3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 17:15:20 +0300 Subject: [PATCH 115/297] build fixes --- docs/en/operations/access_rights.md | 2 +- docs/ru/operations/access_rights.md | 2 +- docs/zh/operations/access_rights.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/operations/access_rights.md b/docs/en/operations/access_rights.md index 22c3b3e7714..92c040283ec 100644 --- a/docs/en/operations/access_rights.md +++ b/docs/en/operations/access_rights.md @@ -87,7 +87,7 @@ The config includes comments explaining how to open access from everywhere. For use in production, only specify `ip` elements (IP addresses and their masks), since using `host` and `hoost_regexp` might cause extra latency. -Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md +Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md)". You can specify the default profile, `default'`. The profile can have any name. You can specify the same profile for different users. The most important thing you can write in the settings profile is `readonly=1`, which ensures read-only access. Then specify the quota to be used (see the section "[Quotas](quotas.md#quotas)"). You can specify the default quota: `default`. It is set in the config by default to only count resource usage, without restricting it. The quota can have any name. You can specify the same quota for different users – in this case, resource usage is calculated for each user individually. In the optional `` section, you can also specify a list of databases that the user can access. By default, all databases are available to the user. You can specify the `default` database. In this case, the user will receive access to the database by default. diff --git a/docs/ru/operations/access_rights.md b/docs/ru/operations/access_rights.md index 602b36e86f6..9c347126084 100644 --- a/docs/ru/operations/access_rights.md +++ b/docs/ru/operations/access_rights.md @@ -87,7 +87,7 @@ Для продакшен использования, указывайте только элементы вида `ip` (IP-адреса и их маски), так как использование `host` и `host_regexp` может вызывать лишние задержки. -Далее указывается используемый профиль настроек пользователя (смотрите раздел "[Профили настроек](settings/settings_profiles.md +Далее указывается используемый профиль настроек пользователя (смотрите раздел "[Профили настроек](settings/settings_profiles.md)"). Вы можете указать профиль по умолчанию - `default`. Профиль может называться как угодно; один и тот же профиль может быть указан для разных пользователей. Наиболее важная вещь, которую вы можете прописать в профиле настроек `readonly=1`, что обеспечивает доступ только на чтение. Затем указывается используемая квота (смотрите раздел "[Квоты](quotas.md#quotas)"). Вы можете указать квоту по умолчанию — `default`. Она настроена в конфиге по умолчанию так, что только считает использование ресурсов, но никак их не ограничивает. Квота может называться как угодно. Одна и та же квота может быть указана для разных пользователей, в этом случае подсчёт использования ресурсов делается для каждого пользователя по отдельности. Также, в необязательном разделе `` можно указать перечень баз, к которым у пользователя будет доступ. По умолчанию пользователю доступны все базы. Можно указать базу данных `default`, в этом случае пользователь получит доступ к базе данных по умолчанию. diff --git a/docs/zh/operations/access_rights.md b/docs/zh/operations/access_rights.md index 22c3b3e7714..f68cfd5078a 100644 --- a/docs/zh/operations/access_rights.md +++ b/docs/zh/operations/access_rights.md @@ -87,7 +87,7 @@ The config includes comments explaining how to open access from everywhere. For use in production, only specify `ip` elements (IP addresses and their masks), since using `host` and `hoost_regexp` might cause extra latency. -Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md +Next the user settings profile is specified (see the section "[Settings profiles](settings/settings_profiles.md)"). You can specify the default profile, `default'`. The profile can have any name. You can specify the same profile for different users. The most important thing you can write in the settings profile is `readonly=1`, which ensures read-only access. Then specify the quota to be used (see the section "[Quotas](quotas.md#quotas)"). You can specify the default quota: `default`. It is set in the config by default to only count resource usage, without restricting it. The quota can have any name. You can specify the same quota for different users – in this case, resource usage is calculated for each user individually. In the optional `` section, you can also specify a list of databases that the user can access. By default, all databases are available to the user. You can specify the `default` database. In this case, the user will receive access to the database by default. From dca7d47b274a17cedd66033b0243dff0f165dee6 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 17:24:49 +0300 Subject: [PATCH 116/297] fix few links --- docs/en/introduction/performance.md | 2 +- docs/fa/introduction/performance.md | 2 +- docs/zh/introduction/performance.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/introduction/performance.md b/docs/en/introduction/performance.md index 14c0404b289..d2d67ce6cf9 100644 --- a/docs/en/introduction/performance.md +++ b/docs/en/introduction/performance.md @@ -2,7 +2,7 @@ According to internal testing results at Yandex, ClickHouse shows the best performance (both the highest throughput for long queries and the lowest latency on short queries) for comparable operating scenarios among systems of its class that were available for testing. You can view the test results on a [separate page](https://clickhouse.yandex/benchmark.html). -This has also been confirmed by numerous independent benchmarks. They are not difficult to find using an internet search, or you can see [our small collection of related links](https://clickhouse.yandex/). +This has also been confirmed by numerous independent benchmarks. They are not difficult to find using an internet search, or you can see [our small collection of related links](https://clickhouse.yandex/#independent-benchmarks). ## Throughput for a Single Large Query diff --git a/docs/fa/introduction/performance.md b/docs/fa/introduction/performance.md index 517bb340198..2fb2a9dc036 100644 --- a/docs/fa/introduction/performance.md +++ b/docs/fa/introduction/performance.md @@ -4,7 +4,7 @@ با توجه به نتایج تست های Yandex، ClickHouse بهترین عملکرد را برای سناریوهای عملیاتی قابل مقایسه با دیگر سیستم های در کلاس خود را از خود نشان داد. این تست ها شامل بالاترین توان عملیاتی برای query های طولانی، و کمترین latency برای query های کوتاه بود. نتایج این تست های در [صفحه ی جدا](https://clickhouse.yandex/benchmark.html) موجود است. -benchmark های زیادی وجود دارند که این نتایج را تایید می کنند. میتوانید این نتایج را جستجو کنید و یا [این لینک های benchmark](https://clickhouse.yandex/). مستقل را ببینید. +benchmark های زیادی وجود دارند که این نتایج را تایید می کنند. میتوانید این نتایج را جستجو کنید و یا [این لینک های benchmark](https://clickhouse.yandex/#independent-benchmarks). مستقل را ببینید. ## توان عملیاتی برای یک query بزرگ diff --git a/docs/zh/introduction/performance.md b/docs/zh/introduction/performance.md index 06bcbd158b5..f06e6892187 100644 --- a/docs/zh/introduction/performance.md +++ b/docs/zh/introduction/performance.md @@ -2,7 +2,7 @@ 根据Yandex的内部测试结果,ClickHouse表现出了比同类可比较产品更优的性能。你可以在[这里](https://clickhouse.yandex/benchmark.html)查看具体的测试结果。 -许多其他的测试也证实这一点。你可以使用互联网搜索到它们,或者你也可以从[我们收集的部分相关连接](https://clickhouse.yandex/)中查看。 +许多其他的测试也证实这一点。你可以使用互联网搜索到它们,或者你也可以从[我们收集的部分相关连接](https://clickhouse.yandex/#independent-benchmarks)中查看。 ## 单个大查询的吞吐量 From 291948f0bafdb51d66373949a5ed7a11a2c5a439 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 18:51:41 +0300 Subject: [PATCH 117/297] restore css --- .../assets/stylesheets/application.2a88008a.css | 3 ++- .../assets/stylesheets/application.ac64251e.css | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css index b1bf3aa9583..8a33734833a 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.2a88008a.css @@ -1 +1,2 @@ -html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;border:0;outline-style:none;background:transparent;font-size:inherit}input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}[dir=rtl] .md-icon--arrow-back:before{content:"\E5C8"}[dir=rtl] .md-icon--arrow-forward:before{content:"\E5C4"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%;direction:ltr}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.3rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.07812em;margin-left:0}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}[dir=rtl] .md-typeset blockquote{padding-right:1.2rem;padding-left:0;border-right:.4rem solid rgba(0,0,0,.26);border-left:initial}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em;margin-left:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em;margin-left:0}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}[dir=rtl] .md-typeset ol li ol,[dir=rtl] .md-typeset ol li ul,[dir=rtl] .md-typeset ul li ol,[dir=rtl] .md-typeset ul li ul{margin-right:.625em;margin-left:0}.md-typeset dd{margin:1em 0 1em 1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em;margin-left:0}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) td:not([align]),[dir=rtl] .md-typeset table:not([class]) th:not([align]){text-align:right}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.07);content:"\E14D"}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{color:rgba(0,0,0,.54)}.md-clipboard:focus:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.no-js .md-header{-webkit-transition:none;transition:none}.md-header[data-md-state=shadow]{-webkit-transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s,-webkit-box-shadow .25s;-webkit-box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2);box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2)}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem)}.no-js .md-header-nav__topic{position:static}.no-js .md-header-nav__topic+.md-header-nav__topic{display:none}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem)}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}[dir=rtl] .md-footer-nav__link--prev{float:right}.md-footer-nav__link--next{width:75%;float:right;text-align:right}[dir=rtl] .md-footer-nav__link--next{float:left;text-align:left}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}[dir=rtl] .md-nav__title:before{content:"\E5C8"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-right:1.2rem;padding-left:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.4rem 0 7.2rem;text-overflow:ellipsis;z-index:2}[dir=rtl] .md-search__input{padding:0 7.2rem 0 4.4rem}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}[dir=rtl] .md-search__icon[for=search]{right:1rem;left:auto}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[dir=rtl] .md-search__icon[type=reset]{right:auto;left:1rem}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}[dir=rtl] .md-search-result__article--document:before{right:0;left:auto}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}[dir=rtl] .md-source{padding-right:0;padding-left:1.2rem}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}[dir=rtl] .md-source__icon svg{margin-right:1.2rem;margin-left:0}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-4.4rem;margin-left:0;padding-right:4rem;padding-left:0}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[dir=rtl] .md-source__fact{float:right}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:0 1.2rem;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem;overflow:auto}[dir=rtl] .md-typeset .admonition,[dir=rtl] .md-typeset details{border-right:.4rem solid #448aff;border-left:none}html .md-typeset .admonition>:last-child,html .md-typeset details>:last-child{margin-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:0 -1.2rem;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}[dir=rtl] .md-typeset .admonition>.admonition-title,[dir=rtl] .md-typeset .admonition>summary,[dir=rtl] .md-typeset details>.admonition-title,[dir=rtl] .md-typeset details>summary{padding:.8rem 4rem .8rem 1.2rem}.md-typeset .admonition>.admonition-title:last-child,.md-typeset .admonition>summary:last-child,.md-typeset details>.admonition-title:last-child,.md-typeset details>summary:last-child{margin-bottom:0}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}[dir=rtl] .md-typeset .admonition>.admonition-title:before,[dir=rtl] .md-typeset .admonition>summary:before,[dir=rtl] .md-typeset details>.admonition-title:before,[dir=rtl] .md-typeset details>summary:before{right:1.2rem;left:auto}.md-typeset .admonition.abstract,.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.abstract,.md-typeset details.summary,.md-typeset details.tldr{border-left-color:#00b0ff}[dir=rtl] .md-typeset .admonition.abstract,[dir=rtl] .md-typeset .admonition.summary,[dir=rtl] .md-typeset .admonition.tldr,[dir=rtl] .md-typeset details.abstract,[dir=rtl] .md-typeset details.summary,[dir=rtl] .md-typeset details.tldr{border-right-color:#00b0ff}.md-typeset .admonition.abstract>.admonition-title,.md-typeset .admonition.abstract>summary,.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.abstract>.admonition-title,.md-typeset details.abstract>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom-color:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.abstract>.admonition-title:before,.md-typeset .admonition.abstract>summary:before,.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.abstract>.admonition-title:before,.md-typeset details.abstract>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left-color:#00b8d4}[dir=rtl] .md-typeset .admonition.info,[dir=rtl] .md-typeset .admonition.todo,[dir=rtl] .md-typeset details.info,[dir=rtl] .md-typeset details.todo{border-right-color:#00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom-color:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left-color:#00bfa5}[dir=rtl] .md-typeset .admonition.hint,[dir=rtl] .md-typeset .admonition.important,[dir=rtl] .md-typeset .admonition.tip,[dir=rtl] .md-typeset details.hint,[dir=rtl] .md-typeset details.important,[dir=rtl] .md-typeset details.tip{border-right-color:#00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom-color:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left-color:#00c853}[dir=rtl] .md-typeset .admonition.check,[dir=rtl] .md-typeset .admonition.done,[dir=rtl] .md-typeset .admonition.success,[dir=rtl] .md-typeset details.check,[dir=rtl] .md-typeset details.done,[dir=rtl] .md-typeset details.success{border-right-color:#00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom-color:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left-color:#64dd17}[dir=rtl] .md-typeset .admonition.faq,[dir=rtl] .md-typeset .admonition.help,[dir=rtl] .md-typeset .admonition.question,[dir=rtl] .md-typeset details.faq,[dir=rtl] .md-typeset details.help,[dir=rtl] .md-typeset details.question{border-right-color:#64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom-color:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left-color:#ff9100}[dir=rtl] .md-typeset .admonition.attention,[dir=rtl] .md-typeset .admonition.caution,[dir=rtl] .md-typeset .admonition.warning,[dir=rtl] .md-typeset details.attention,[dir=rtl] .md-typeset details.caution,[dir=rtl] .md-typeset details.warning{border-right-color:#ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom-color:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left-color:#ff5252}[dir=rtl] .md-typeset .admonition.fail,[dir=rtl] .md-typeset .admonition.failure,[dir=rtl] .md-typeset .admonition.missing,[dir=rtl] .md-typeset details.fail,[dir=rtl] .md-typeset details.failure,[dir=rtl] .md-typeset details.missing{border-right-color:#ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom-color:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left-color:#ff1744}[dir=rtl] .md-typeset .admonition.danger,[dir=rtl] .md-typeset .admonition.error,[dir=rtl] .md-typeset details.danger,[dir=rtl] .md-typeset details.error{border-right-color:#ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom-color:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left-color:#f50057}[dir=rtl] .md-typeset .admonition.bug,[dir=rtl] .md-typeset details.bug{border-right-color:#f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom-color:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.example,.md-typeset details.example{border-left-color:#651fff}[dir=rtl] .md-typeset .admonition.example,[dir=rtl] .md-typeset details.example{border-right-color:#651fff}.md-typeset .admonition.example>.admonition-title,.md-typeset .admonition.example>summary,.md-typeset details.example>.admonition-title,.md-typeset details.example>summary{border-bottom-color:.1rem solid rgba(101,31,255,.1);background-color:rgba(101,31,255,.1)}.md-typeset .admonition.example>.admonition-title:before,.md-typeset .admonition.example>summary:before,.md-typeset details.example>.admonition-title:before,.md-typeset details.example>summary:before{color:#651fff;content:"\E242"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left-color:#9e9e9e}[dir=rtl] .md-typeset .admonition.cite,[dir=rtl] .md-typeset .admonition.quote,[dir=rtl] .md-typeset details.cite,[dir=rtl] .md-typeset details.quote{border-right-color:#9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom-color:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}[dir=rtl] .md-typeset .footnote-backref{-webkit-transform:translateX(-.5rem);transform:translateX(-.5rem)}.md-typeset .footnote-backref:before{display:inline-block;font-size:1.6rem;content:"\E31B"}[dir=rtl] .md-typeset .footnote-backref:before{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}[dir=rtl] .md-typeset .headerlink{margin-right:1rem;margin-left:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}[dir=rtl] .md-typeset details summary{padding-left:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}[dir=rtl] .md-typeset summary:after{right:auto;left:1.2rem}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em;left:auto}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}[dir=rtl] .md-typeset .task-list-control .task-list-indicator:before{right:-1.25em;left:auto}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}html [dir=rtl] .md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[dir=rtl] .md-search__overlay{right:.4rem;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}[dir=rtl] [data-md-toggle=search]:checked~.md-header .md-search__inner{right:0;left:auto}html [dir=rtl] .md-search__inner{right:100%;left:auto;-webkit-transform:translateX(-5%);transform:translateX(-5%)}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}[dir=rtl] .md-search__icon[for=search][for=search]:before{content:"\E5C8"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}html [dir=rtl] .md-nav--primary .md-nav__title--site .md-nav__button,html [dir=rtl] .md-nav--primary .md-nav__title:before{right:.4rem;left:auto}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}[dir=rtl] .md-nav--primary .md-nav__item{padding:0}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E314"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}[dir=rtl] .md-nav--primary .md-nav__link:after{right:auto;left:1.2rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:2.8rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:4rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:5.2rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:6.4rem;padding-left:0}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}[dir=rtl] .md-nav__toggle~.md-nav{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}[dir=rtl] .md-sidebar--primary{right:-24.2rem;left:auto}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-transform:translateX(-24.2rem);transform:translateX(-24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}[dir=rtl] .md-content{margin-right:0;margin-left:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}[dir=rtl] .md-header-nav__source{margin-right:2.8rem;margin-left:0;padding-right:0;padding-left:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[dir=rtl] .md-search__overlay{right:0;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}[dir=rtl] .md-search__inner{float:left}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}[dir=rtl] .md-search__input{padding-right:4.4rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uMmE4ODAwOGEuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ \ No newline at end of file +html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;border:0;outline-style:none;background:transparent;font-size:inherit}input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}[dir=rtl] .md-icon--arrow-back:before{content:"\E5C8"}[dir=rtl] .md-icon--arrow-forward:before{content:"\E5C4"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%;direction:ltr}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.3rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.07812em;margin-left:0}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}[dir=rtl] .md-typeset blockquote{padding-right:1.2rem;padding-left:0;border-right:.4rem solid rgba(0,0,0,.26);border-left:initial}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em;margin-left:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em;margin-left:0}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}[dir=rtl] .md-typeset ol li ol,[dir=rtl] .md-typeset ol li ul,[dir=rtl] .md-typeset ul li ol,[dir=rtl] .md-typeset ul li ul{margin-right:.625em;margin-left:0}.md-typeset dd{margin:1em 0 1em 1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em;margin-left:0}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) td:not([align]),[dir=rtl] .md-typeset table:not([class]) th:not([align]){text-align:right}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.07);content:"\E14D"}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{color:rgba(0,0,0,.54)}.md-clipboard:focus:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.no-js .md-header{-webkit-transition:none;transition:none}.md-header[data-md-state=shadow]{-webkit-transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,-webkit-box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s,-webkit-box-shadow .25s;-webkit-box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2);box-shadow:0 0 .4rem rgba(0,0,0,.1),0 .4rem .8rem rgba(0,0,0,.2)}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem)}.no-js .md-header-nav__topic{position:static}.no-js .md-header-nav__topic+.md-header-nav__topic{display:none}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem)}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}[dir=rtl] .md-footer-nav__link--prev{float:right}.md-footer-nav__link--next{width:75%;float:right;text-align:right}[dir=rtl] .md-footer-nav__link--next{float:left;text-align:left}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}[dir=rtl] .md-nav__title:before{content:"\E5C8"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-right:1.2rem;padding-left:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.4rem 0 7.2rem;text-overflow:ellipsis;z-index:2}[dir=rtl] .md-search__input{padding:0 7.2rem 0 4.4rem}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}[dir=rtl] .md-search__icon[for=search]{right:1rem;left:auto}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[dir=rtl] .md-search__icon[type=reset]{right:auto;left:1rem}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}[dir=rtl] .md-search-result__article--document:before{right:0;left:auto}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}[dir=rtl] .md-source{padding-right:0;padding-left:1.2rem}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}[dir=rtl] .md-source__icon svg{margin-right:1.2rem;margin-left:0}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-4.4rem;margin-left:0;padding-right:4rem;padding-left:0}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[dir=rtl] .md-source__fact{float:right}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:0 1.2rem;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem;overflow:auto}[dir=rtl] .md-typeset .admonition,[dir=rtl] .md-typeset details{border-right:.4rem solid #448aff;border-left:none}html .md-typeset .admonition>:last-child,html .md-typeset details>:last-child{margin-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:0 -1.2rem;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}[dir=rtl] .md-typeset .admonition>.admonition-title,[dir=rtl] .md-typeset .admonition>summary,[dir=rtl] .md-typeset details>.admonition-title,[dir=rtl] .md-typeset details>summary{padding:.8rem 4rem .8rem 1.2rem}.md-typeset .admonition>.admonition-title:last-child,.md-typeset .admonition>summary:last-child,.md-typeset details>.admonition-title:last-child,.md-typeset details>summary:last-child{margin-bottom:0}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}[dir=rtl] .md-typeset .admonition>.admonition-title:before,[dir=rtl] .md-typeset .admonition>summary:before,[dir=rtl] .md-typeset details>.admonition-title:before,[dir=rtl] .md-typeset details>summary:before{right:1.2rem;left:auto}.md-typeset .admonition.abstract,.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.abstract,.md-typeset details.summary,.md-typeset details.tldr{border-left-color:#00b0ff}[dir=rtl] .md-typeset .admonition.abstract,[dir=rtl] .md-typeset .admonition.summary,[dir=rtl] .md-typeset .admonition.tldr,[dir=rtl] .md-typeset details.abstract,[dir=rtl] .md-typeset details.summary,[dir=rtl] .md-typeset details.tldr{border-right-color:#00b0ff}.md-typeset .admonition.abstract>.admonition-title,.md-typeset .admonition.abstract>summary,.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.abstract>.admonition-title,.md-typeset details.abstract>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom-color:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.abstract>.admonition-title:before,.md-typeset .admonition.abstract>summary:before,.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.abstract>.admonition-title:before,.md-typeset details.abstract>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left-color:#00b8d4}[dir=rtl] .md-typeset .admonition.info,[dir=rtl] .md-typeset .admonition.todo,[dir=rtl] .md-typeset details.info,[dir=rtl] .md-typeset details.todo{border-right-color:#00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom-color:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left-color:#00bfa5}[dir=rtl] .md-typeset .admonition.hint,[dir=rtl] .md-typeset .admonition.important,[dir=rtl] .md-typeset .admonition.tip,[dir=rtl] .md-typeset details.hint,[dir=rtl] .md-typeset details.important,[dir=rtl] .md-typeset details.tip{border-right-color:#00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom-color:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left-color:#00c853}[dir=rtl] .md-typeset .admonition.check,[dir=rtl] .md-typeset .admonition.done,[dir=rtl] .md-typeset .admonition.success,[dir=rtl] .md-typeset details.check,[dir=rtl] .md-typeset details.done,[dir=rtl] .md-typeset details.success{border-right-color:#00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom-color:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left-color:#64dd17}[dir=rtl] .md-typeset .admonition.faq,[dir=rtl] .md-typeset .admonition.help,[dir=rtl] .md-typeset .admonition.question,[dir=rtl] .md-typeset details.faq,[dir=rtl] .md-typeset details.help,[dir=rtl] .md-typeset details.question{border-right-color:#64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom-color:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left-color:#ff9100}[dir=rtl] .md-typeset .admonition.attention,[dir=rtl] .md-typeset .admonition.caution,[dir=rtl] .md-typeset .admonition.warning,[dir=rtl] .md-typeset details.attention,[dir=rtl] .md-typeset details.caution,[dir=rtl] .md-typeset details.warning{border-right-color:#ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom-color:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left-color:#ff5252}[dir=rtl] .md-typeset .admonition.fail,[dir=rtl] .md-typeset .admonition.failure,[dir=rtl] .md-typeset .admonition.missing,[dir=rtl] .md-typeset details.fail,[dir=rtl] .md-typeset details.failure,[dir=rtl] .md-typeset details.missing{border-right-color:#ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom-color:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left-color:#ff1744}[dir=rtl] .md-typeset .admonition.danger,[dir=rtl] .md-typeset .admonition.error,[dir=rtl] .md-typeset details.danger,[dir=rtl] .md-typeset details.error{border-right-color:#ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom-color:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left-color:#f50057}[dir=rtl] .md-typeset .admonition.bug,[dir=rtl] .md-typeset details.bug{border-right-color:#f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom-color:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.example,.md-typeset details.example{border-left-color:#651fff}[dir=rtl] .md-typeset .admonition.example,[dir=rtl] .md-typeset details.example{border-right-color:#651fff}.md-typeset .admonition.example>.admonition-title,.md-typeset .admonition.example>summary,.md-typeset details.example>.admonition-title,.md-typeset details.example>summary{border-bottom-color:.1rem solid rgba(101,31,255,.1);background-color:rgba(101,31,255,.1)}.md-typeset .admonition.example>.admonition-title:before,.md-typeset .admonition.example>summary:before,.md-typeset details.example>.admonition-title:before,.md-typeset details.example>summary:before{color:#651fff;content:"\E242"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left-color:#9e9e9e}[dir=rtl] .md-typeset .admonition.cite,[dir=rtl] .md-typeset .admonition.quote,[dir=rtl] .md-typeset details.cite,[dir=rtl] .md-typeset details.quote{border-right-color:#9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom-color:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.4rem;height:.4rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}[dir=rtl] .md-typeset .footnote-backref{-webkit-transform:translateX(-.5rem);transform:translateX(-.5rem)}.md-typeset .footnote-backref:before{display:inline-block;font-size:1.6rem;content:"\E31B"}[dir=rtl] .md-typeset .footnote-backref:before{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}[dir=rtl] .md-typeset .headerlink{margin-right:1rem;margin-left:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}[dir=rtl] .md-typeset details summary{padding-left:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}[dir=rtl] .md-typeset summary:after{right:auto;left:1.2rem}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em;left:auto}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}[dir=rtl] .md-typeset .task-list-control .task-list-indicator:before{right:-1.25em;left:auto}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}html [dir=rtl] .md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[dir=rtl] .md-search__overlay{right:.4rem;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}[dir=rtl] [data-md-toggle=search]:checked~.md-header .md-search__inner{right:0;left:auto}html [dir=rtl] .md-search__inner{right:100%;left:auto;-webkit-transform:translateX(-5%);transform:translateX(-5%)}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}[dir=rtl] .md-search__icon[for=search][for=search]:before{content:"\E5C8"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}html [dir=rtl] .md-nav--primary .md-nav__title--site .md-nav__button,html [dir=rtl] .md-nav--primary .md-nav__title:before{right:.4rem;left:auto}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}[dir=rtl] .md-nav--primary .md-nav__item{padding:0}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:1.6rem;padding-left:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E314"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}[dir=rtl] .md-nav--primary .md-nav__link:after{right:auto;left:1.2rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:2.8rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:4rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:5.2rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:6.4rem;padding-left:0}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}[dir=rtl] .md-nav__toggle~.md-nav{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}[dir=rtl] .md-sidebar--primary{right:-24.2rem;left:auto}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-transform:translateX(-24.2rem);transform:translateX(-24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}[dir=rtl] .md-content{margin-right:0;margin-left:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}[dir=rtl] .md-header-nav__source{margin-right:2.8rem;margin-left:0;padding-right:0;padding-left:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[dir=rtl] .md-search__overlay{right:0;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}[dir=rtl] .md-search__inner{float:left}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}[dir=rtl] .md-search__input{padding-right:4.4rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.4rem;height:.4rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-search-result__meta{padding-left:4.4rem}[dir=rtl] .md-search-result__meta{padding-right:4.4rem;padding-left:0}.md-search-result__article{padding-left:4.4rem}[dir=rtl] .md-search-result__article{padding-right:4.4rem;padding-left:1.6rem}.md-sidebar--secondary{display:block;margin-left:100%;-webkit-transform:translate(-100%);transform:translate(-100%)}[dir=rtl] .md-sidebar--secondary{margin-right:100%;margin-left:0;-webkit-transform:translate(100%);transform:translate(100%)}}@media only screen and (min-width:76.25em){.md-content{margin-left:24.2rem}[dir=rtl] .md-content{margin-right:24.2rem}.md-content__inner{margin-right:2.4rem;margin-left:2.4rem}.md-header-nav__button.md-icon--menu{display:none}.md-nav[data-md-state=animate]{-webkit-transition:max-height .25s cubic-bezier(.86,0,.07,1);transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav__toggle~.md-nav{max-height:0;overflow:hidden}.no-js .md-nav__toggle~.md-nav{display:none}.md-nav[data-md-state=expand],.md-nav__toggle:checked~.md-nav{max-height:100%}.no-js .md-nav[data-md-state=expand],.no-js .md-nav__toggle:checked~.md-nav{display:block}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--nested>.md-nav__link:after{display:inline-block;-webkit-transform-origin:.45em .45em;transform-origin:.45em .45em;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;vertical-align:-.125em}.js .md-nav__item--nested>.md-nav__link:after{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link:after{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:68.8rem}.md-sidebar--secondary{margin-left:122rem}[dir=rtl] .md-sidebar--secondary{margin-right:122rem;margin-left:0}.md-tabs~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{font-size:0;visibility:hidden}.md-tabs--active~.md-main .md-nav--primary .md-nav__title{display:block;padding:0}.md-tabs--active~.md-main .md-nav--primary .md-nav__title--site{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item{font-size:0;visibility:hidden}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{display:none;font-size:1.4rem;overflow:auto;visibility:visible}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--active{display:block}.md-tabs--active~.md-main .md-nav[data-md-level="1"]{max-height:none;overflow:visible}.md-tabs--active~.md-main .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:0}.md-tabs--active~.md-main .md-nav[data-md-level="1"] .md-nav .md-nav__title{display:none}}@media only screen and (min-width:45em){.md-footer-nav__link{width:50%}.md-footer-copyright{max-width:75%;float:left}[dir=rtl] .md-footer-copyright{float:right}.md-footer-social{padding:1.2rem 0;float:right}[dir=rtl] .md-footer-social{float:left}}@media only screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(45);transform:scale(45)}}@media only screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(60);transform:scale(60)}}@media only screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(75);transform:scale(75)}}@media only screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:46.8rem}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}} +/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uMmE4ODAwOGEuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ \ No newline at end of file diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css index 340f840b26c..a40cca4969c 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/application.ac64251e.css @@ -1 +1,2 @@ -html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}a:active,a:hover{outline-width:0}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;background:transparent;font-size:inherit}button,input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.2rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}.md-typeset dd{margin:1em 0 1em 1.875em}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.54);content:"\E14D";opacity:.25}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{opacity:1}.md-clipboard:active:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.no-js .md-header-nav__topic{position:static}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}.md-footer-nav__link--next{width:75%;float:right;text-align:right}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.8rem 0 7.2rem;text-overflow:ellipsis;z-index:2}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:1.2rem 1.2rem 0;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem}.md-typeset .admonition :first-child,.md-typeset details :first-child{margin-top:0}html .md-typeset .admonition :last-child,html .md-typeset details :last-child{margin-bottom:0;padding-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:-1.2rem -1.2rem 0;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}html .md-typeset .admonition>.admonition-title,html .md-typeset .admonition>summary,html .md-typeset details>.admonition-title,html .md-typeset details>summary{padding-bottom:.8rem}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.summary,.md-typeset details.tldr{border-left:.4rem solid #00b0ff}.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left:.4rem solid #00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left:.4rem solid #00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left:.4rem solid #00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left:.4rem solid #64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left:.4rem solid #ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left:.4rem solid #ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left:.4rem solid #ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left:.4rem solid #f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left:.4rem solid #9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}.md-typeset .footnote-backref:before{font-size:1.6rem;content:"\E31B"}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uYWM2NDI1MWUuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ +html{-webkit-box-sizing:border-box;box-sizing:border-box}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;-webkit-box-sizing:content-box;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}a:active,a:hover{outline-width:0}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:collapse;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{padding:0;background:transparent;font-size:inherit}button,input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;speak:none;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.4rem;padding:.8rem;font-size:2.4rem;cursor:pointer}.md-icon--arrow-back:before{content:"\E5C4"}.md-icon--arrow-forward:before{content:"\E5C8"}.md-icon--menu:before{content:"\E5D2"}.md-icon--search:before{content:"\E8B6"}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);-webkit-font-feature-settings:"kern";font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:1.6rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 4rem;color:rgba(0,0,0,.54);font-size:3.125rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:4rem 0 1.6rem;font-size:2.5rem;line-height:1.4}.md-typeset h3{margin:3.2rem 0 1.6rem;font-size:2rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:1.6rem}.md-typeset h4{font-size:1.6rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:1.6rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.1rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,93%,.5);color:#37474f;font-size:85%}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.2rem;-webkit-box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);box-shadow:.29412em 0 0 hsla(0,0%,93%,.5),-.29412em 0 0 hsla(0,0%,93%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:none;background-color:inherit;color:inherit;-webkit-box-shadow:none;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.2rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;font-size:inherit;-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:none;box-decoration-break:none;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border:.1rem solid #c9c9c9;border-radius:.2rem;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;-webkit-box-shadow:0 .1rem 0 #b0b0b0;box-shadow:0 .1rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;background-color:rgba(255,235,59,.5);-webkit-box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.1rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}.md-typeset blockquote{padding-left:1.2rem;border-left:.4rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}.md-typeset dd{margin:1em 0 1em 1.875em}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.2rem;font-size:1.28rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}.md-typeset table:not([class]) th{min-width:10rem;padding:1.2rem 1.6rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:1.2rem 1.6rem;border-top:.1rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -1.6rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 1.6rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:62.5%;overflow-x:hidden}body,html{height:100%}body{position:relative}hr{display:block;height:.1rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:122rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:4.8rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:3rem;padding-bottom:.1rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@page{margin:25mm}.md-clipboard{position:absolute;top:.6rem;right:.6rem;width:2.8rem;height:2.8rem;border-radius:.2rem;font-size:1.6rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.54);content:"\E14D";opacity:.25}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{opacity:1}.md-clipboard:active:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:3.4rem;padding:.6rem 1rem;-webkit-transform:translateX(.8rem);transform:translateX(.8rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.2rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:1.28rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.4rem;width:0;margin-top:-.4rem;border-width:.4rem 0 .4rem .4rem;border-style:solid;border-color:transparent rgba(0,0,0,.54);content:""}.md-content__inner{margin:0 1.6rem 2.4rem;padding-top:1.2rem}.md-content__inner:before{display:block;height:.8rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.8rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:4.8rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-header,.no-js .md-header{-webkit-box-shadow:none;box-shadow:none}.md-header-nav{padding:0 .4rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(2.5rem);transform:translateX(2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.no-js .md-header-nav__topic{position:static}.md-header-nav__title{padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-2.5rem);transform:translateX(-2.5rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:2rem;overflow:hidden}.md-hero__inner{margin-top:2rem;padding:1.6rem 1.6rem .8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(1.25rem);transform:translateY(1.25rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:2.4rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.4rem;overflow:auto}.md-footer-nav__link{padding-top:2.8rem;padding-bottom:.8rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}.md-footer-nav__link--next{width:75%;float:right;text-align:right}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 2rem;font-size:1.8rem;line-height:4.8rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-2rem;padding:0 2rem;color:hsla(0,0%,100%,.7);font-size:1.5rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.4rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 1.2rem;padding:.8rem 0;color:hsla(0,0%,100%,.3);font-size:1.28rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .8rem;padding:.4rem 0 1.2rem}.md-footer-social__link{display:inline-block;width:3.2rem;height:3.2rem;font-size:1.6rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:1.4rem;line-height:1.3}.md-nav--secondary .md-nav__link--active{color:#3f51b5}.md-nav__title{display:block;padding:0 1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 1.2rem}.md-nav__item:last-child{padding-bottom:1.2rem}.md-nav__item .md-nav__item{padding-right:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=toc],html .md-nav__link[for=toc]+.md-nav__link:after,html .md-nav__link[for=toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 4.8rem 0 7.2rem;text-overflow:ellipsis;z-index:2}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:2.4rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=search]{top:.6rem;left:1rem}.md-search__icon[for=search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.6rem;right:1rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .2rem .2rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 1.6rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:1.28rem;line-height:3.6rem}.md-search-result__list{margin:0;padding:0;border-top:.1rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{-webkit-box-shadow:0 -.1rem 0 rgba(0,0,0,.07);box-shadow:0 -.1rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:1.2rem}.md-search-result__article{position:relative;padding:0 1.6rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}.md-search-result__article--document .md-search-result__title{margin:1.1rem 0;font-size:1.6rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:1.28rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:3.3rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:1.28rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:24.2rem;padding:2.4rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:4.8rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .4rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@keyframes md-source__facts--done{0%{height:0}to{height:1.3rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:1.2rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:1.3rem;line-height:1.2;white-space:nowrap}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:4.8rem;content:"";vertical-align:middle}.md-source__icon{width:4.8rem}.md-source__icon svg{width:2.4rem;height:2.4rem;margin-top:1.2rem;margin-left:1.2rem}.md-source__icon+.md-source__repository{margin-left:-4.4rem;padding-left:4rem}.md-source__repository{display:inline-block;max-width:100%;margin-left:1.2rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:1.1rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .2rem;content:"\B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.5rem;border-radius:.2rem;background-color:rgba(0,0,0,.07);font-size:1.28rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.5rem;padding:.5rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:1.6rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{-webkit-box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0;margin-left:.4rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:4.8rem;padding-right:1.2rem;padding-left:1.2rem}.md-tabs__link{display:block;margin-top:1.6rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:1.4rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:1.2rem 1.2rem 0;border-left:.4rem solid #448aff;border-radius:.2rem;font-size:1.28rem}.md-typeset .admonition :first-child,.md-typeset details :first-child{margin-top:0}html .md-typeset .admonition :last-child,html .md-typeset details :last-child{margin-bottom:0;padding-bottom:1.2rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:-1.2rem -1.2rem 0;padding:.8rem 1.2rem .8rem 4rem;border-bottom:.1rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}html .md-typeset .admonition>.admonition-title,html .md-typeset .admonition>summary,html .md-typeset details>.admonition-title,html .md-typeset details>summary{padding-bottom:.8rem}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:1.2rem;color:#448aff;font-size:2rem;content:"\E3C9"}.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.summary,.md-typeset details.tldr{border-left:.4rem solid #00b0ff}.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom:.1rem solid rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:"\E8D2"}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left:.4rem solid #00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom:.1rem solid rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:"\E88E"}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left:.4rem solid #00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom:.1rem solid rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:"\E80E"}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left:.4rem solid #00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom:.1rem solid rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:"\E876"}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left:.4rem solid #64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom:.1rem solid rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:"\E887"}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left:.4rem solid #ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom:.1rem solid rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:"\E002"}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left:.4rem solid #ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom:.1rem solid rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:"\E14C"}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left:.4rem solid #ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom:.1rem solid rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:"\E3E7"}.md-typeset .admonition.bug,.md-typeset details.bug{border-left:.4rem solid #f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom:.1rem solid rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:"\E868"}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left:.4rem solid #9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom:.1rem solid hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:"\E244"}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -1.2rem;padding:0 1.2rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilite,.md-typeset .highlight{position:relative;margin:1em 0;padding:0;border-radius:.2rem;background-color:hsla(0,0%,93%,.5);color:#37474f;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset .codehilite code,.md-typeset .codehilite pre,.md-typeset .highlight code,.md-typeset .highlight pre{display:block;margin:0;padding:1.05rem 1.2rem;background-color:transparent;overflow:auto;vertical-align:top}.md-typeset .codehilite code::-webkit-scrollbar,.md-typeset .codehilite pre::-webkit-scrollbar,.md-typeset .highlight code::-webkit-scrollbar,.md-typeset .highlight pre::-webkit-scrollbar{width:.6rem;height:.6rem}.md-typeset .codehilite code::-webkit-scrollbar-thumb,.md-typeset .codehilite pre::-webkit-scrollbar-thumb,.md-typeset .highlight code::-webkit-scrollbar-thumb,.md-typeset .highlight pre::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset .codehilite code::-webkit-scrollbar-thumb:hover,.md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,.md-typeset .highlight code::-webkit-scrollbar-thumb:hover,.md-typeset .highlight pre::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset pre.codehilite,.md-typeset pre.highlight{overflow:visible}.md-typeset pre.codehilite code,.md-typeset pre.highlight code{display:block;padding:1.05rem 1.2rem;overflow:auto}.md-typeset .codehilitetable{display:block;margin:1em 0;border-radius:.2em;font-size:1.6rem;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td{display:block;padding:0}.md-typeset .codehilitetable tr{display:-webkit-box;display:-ms-flexbox;display:flex}.md-typeset .codehilitetable .codehilite,.md-typeset .codehilitetable .highlight,.md-typeset .codehilitetable .linenodiv{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv{padding:1.05rem 1.2rem}.md-typeset .codehilitetable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre{margin:0;padding:0;background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable{-webkit-box-shadow:none;box-shadow:none}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-7.6rem;padding-top:7.6rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-7rem;padding-top:7rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:1.28rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.1rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.5rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.5rem);transform:translateX(.5rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}.md-typeset .footnote-backref:before{font-size:1.6rem;content:"\E31B"}.md-typeset .headerlink{display:inline-block;margin-left:1rem;-webkit-transform:translateY(.5rem);transform:translateY(.5rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id] .headerlink{display:none}.md-typeset h2[id]:before{display:block;margin-top:-.8rem;padding-top:.8rem;content:""}.md-typeset h2[id]:target:before{margin-top:-6.8rem;padding-top:6.8rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h3[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-.9rem;padding-top:.9rem;content:""}.md-typeset h4[id]:target:before{margin-top:-6.9rem;padding-top:6.9rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h5[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-1.1rem;padding-top:1.1rem;content:""}.md-typeset h6[id]:target:before{margin-top:-7.1rem;padding-top:7.1rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.2rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;-webkit-box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;-webkit-box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,93%,.5);color:#37474f;-webkit-box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5);box-shadow:.25em 0 0 hsla(0,0%,93%,.5),-.25em 0 0 hsla(0,0%,93%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:1.6rem;padding-left:1.6rem;-webkit-box-shadow:none;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:4rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.8rem;right:1.2rem;color:rgba(0,0,0,.26);font-size:2rem;content:"\E313"}.md-typeset .emojione{width:2rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{-webkit-box-shadow:none;box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset pre{margin:1em -1.6rem;border-radius:0}.md-typeset pre>code{padding:1.05rem 1.6rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -1.6rem;padding:0 1.6rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilite code,.md-typeset>.codehilite pre,.md-typeset>.highlight code,.md-typeset>.highlight pre{padding:1.05rem 1.6rem}.md-typeset>.codehilitetable{margin:1em -1.6rem;border-radius:0}.md-typeset>.codehilitetable .codehilite>code,.md-typeset>.codehilitetable .codehilite>pre,.md-typeset>.codehilitetable .highlight>code,.md-typeset>.codehilitetable .highlight>pre,.md-typeset>.codehilitetable .linenodiv{padding:1rem 1.6rem}.md-typeset>p>.MJXc-display{margin:.75em -1.6rem;padding:.25em 1.6rem}}@media only screen and (min-width:100em){html{font-size:68.75%}}@media only screen and (min-width:125em){html{font-size:75%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=toc]{display:block;padding-right:4.8rem}html .md-nav__link[for=toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=toc]+.md-nav__link{display:none}html .md-nav__link[for=toc]~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-nav__source{display:block;padding:0 .4rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.4rem;left:.4rem;width:3.6rem;height:3.6rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:2rem;background-color:#fff;overflow:hidden;pointer-events:none}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}.md-search__input{width:100%;height:4.8rem;font-size:1.8rem}.md-search__icon[for=search]{top:1.2rem;left:1.6rem}.md-search__icon[for=search][for=search]:before{content:"\E5C4"}.md-search__icon[type=reset]{top:1.2rem;right:1.6rem}.md-search__output{top:4.8rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:4.8rem;margin-bottom:2.4rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:1.6rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:11.2rem;padding:6rem 1.6rem .4rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:4.8rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.4rem;left:.4rem;width:4rem;height:4rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;-webkit-box-shadow:0 .1rem 0 rgba(0,0,0,.07) inset;box-shadow:inset 0 .1rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.4rem;left:.4rem;width:6.4rem;height:6.4rem;font-size:4.8rem}html .md-nav--primary .md-nav__title--site:before{display:none}.md-nav--primary .md-nav__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.1rem solid rgba(0,0,0,.07)}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:4.8rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:1.2rem 1.6rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:1.2rem;margin-top:-1.2rem;color:inherit;font-size:2.4rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:2.8rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:4rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:5.2rem}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:6.4rem}.md-nav__toggle~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:-ms-flexbox;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-24.2rem;width:24.2rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1),-webkit-box-shadow .25s;background-color:#fff;z-index:3}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(24.2rem);transform:translateX(24.2rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:24.2rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:23rem;max-width:23rem;margin-left:2.8rem;padding-right:1.2rem}.md-search{padding:.4rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:23rem;padding:.2rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}.md-search__form,.md-search__input{border-radius:.2rem}.md-search__input{width:100%;height:3.6rem;padding-left:4.4rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:1.6rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder,.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.2rem .2rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:none}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder,[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:3.8rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{-webkit-box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.6rem;height:.6rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-search-result__article,.md-search-result__meta{padding-left:4.4rem}.md-sidebar--secondary{display:block;margin-left:100%;-webkit-transform:translate(-100%);transform:translate(-100%)}}@media only screen and (min-width:76.25em){.md-content{margin-left:24.2rem}.md-content__inner{margin-right:2.4rem;margin-left:2.4rem}.md-header-nav__button.md-icon--menu{display:none}.md-nav[data-md-state=animate]{-webkit-transition:max-height .25s cubic-bezier(.86,0,.07,1);transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav__toggle~.md-nav{max-height:0;overflow:hidden}.md-nav[data-md-state=expand],.md-nav__toggle:checked~.md-nav{max-height:100%}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--nested>.md-nav__link:after{display:inline-block;-webkit-transform-origin:.45em .45em;transform-origin:.45em .45em;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;vertical-align:-.125em}.js .md-nav__item--nested>.md-nav__link:after{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link:after{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:68.8rem}.md-sidebar--secondary{margin-left:122rem}.md-tabs~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{font-size:0}.md-tabs--active~.md-main .md-nav--primary .md-nav__title--site{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item{font-size:0}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{display:none;font-size:1.4rem;overflow:auto}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link{margin-top:0;font-weight:700;pointer-events:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link:after{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--active{display:block}.md-tabs--active~.md-main .md-nav[data-md-level="1"]{max-height:none}.md-tabs--active~.md-main .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:0}}@media only screen and (min-width:45em){.md-footer-nav__link{width:50%}.md-footer-copyright{max-width:75%;float:left}.md-footer-social{padding:1.2rem 0;float:right}}@media only screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(45);transform:scale(45)}}@media only screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(60);transform:scale(60)}}@media only screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(75);transform:scale(75)}}@media only screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:46.8rem}.md-search-result__teaser{max-height:5rem;-webkit-line-clamp:3}} +/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJhc3NldHMvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uYWM2NDI1MWUuY3NzIiwic291cmNlUm9vdCI6IiJ9*/ From 5cd6469cae57d8060150a0760bce689bb2e9ca4f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 19:35:45 +0300 Subject: [PATCH 118/297] fix some links --- .../en/operations/server_settings/settings.md | 4 ++-- docs/en/operations/settings/settings.md | 18 +++++++-------- .../table_engines/collapsingmergetree.md | 2 +- .../operations/table_engines/replication.md | 2 +- .../table_engines/summingmergetree.md | 2 +- .../versionedcollapsingmergetree.md | 2 +- .../dicts/external_dicts_dict_layout.md | 22 +++++++++---------- .../dicts/external_dicts_dict_sources.md | 14 ++++++------ docs/en/query_language/select.md | 4 ++-- docs/en/query_language/syntax.md | 2 +- .../ru/operations/server_settings/settings.md | 4 ++-- docs/ru/operations/settings/settings.md | 16 +++++++------- .../operations/table_engines/replication.md | 2 +- .../table_engines/summingmergetree.md | 2 +- .../dicts/external_dicts_dict_layout.md | 22 +++++++++---------- .../dicts/external_dicts_dict_sources.md | 14 ++++++------ docs/ru/query_language/select.md | 8 +++---- docs/zh/operations/configuration_files.md | 2 +- .../zh/operations/server_settings/settings.md | 6 ++--- docs/zh/operations/settings/settings.md | 16 +++++++------- .../table_engines/collapsingmergetree.md | 2 +- .../operations/table_engines/replication.md | 2 +- .../table_engines/summingmergetree.md | 2 +- docs/zh/query_language/select.md | 4 ++-- 24 files changed, 85 insertions(+), 89 deletions(-) diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index ba050176a35..cf9191377e6 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -61,7 +61,7 @@ ClickHouse checks `min_part_size` and `min_part_size_ratio` and processes the The default database. -To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc.md#query_language_queries_show_databases) query. +To get a list of databases, use the [SHOW DATABASES](../../query_language/misc.md#query_language_queries_show_databases) query. **Example** @@ -74,7 +74,7 @@ To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc. Default settings profile. -Settings profiles are located in the file specified in the parameter [user_config](). +Settings profiles are located in the file specified in the parameter [user_config](#user-config). **Example** diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index 01fdbea7db4..2d63c3e5e9a 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -14,7 +14,7 @@ Restrictions: - If the subquery concerns a distributed table containing more than one shard, - Not used for a table-valued [remote](../../query_language/table_functions/remote.md) function. -The possible values ​​are: +The possible values are: - `deny` — Default value. Prohibits using these types of subqueries (returns the "Double-distributed in/JOIN subqueries is denied" exception). - `local` — Replaces the database and table in the subquery with local ones for the destination server (shard), leaving the normal `IN` / `JOIN.` @@ -273,7 +273,7 @@ This parameter is useful when you are using formats that require a schema defini ## stream_flush_interval_ms -Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size]() rows. +Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size](#max-insert-block-size) rows. The default value is 7500. @@ -381,7 +381,7 @@ The default value is 0. All the replicas in the quorum are consistent, i.e., they contain data from all previous `INSERT` queries. The `INSERT` sequence is linearized. -When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency]() option. +When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency](#select-sequential-consistency) option. **ClickHouse generates an exception** @@ -390,8 +390,8 @@ When reading the data written from the `insert_quorum`, you can use the[select_s **See also the following parameters:** -- [insert_quorum_timeout]() -- [select_sequential_consistency]() +- [insert_quorum_timeout](#insert-quorum-timeout) +- [select_sequential_consistency](#select-sequential-consistency) ## insert_quorum_timeout @@ -402,8 +402,8 @@ By default, 60 seconds. **See also the following parameters:** -- [insert_quorum]() -- [select_sequential_consistency]() +- [insert_quorum](#insert-quorum) +- [select_sequential_consistency](#select-sequential-consistency) ## select_sequential_consistency @@ -417,8 +417,8 @@ When sequential consistency is enabled, ClickHouse allows the client to execute See also the following parameters: -- [insert_quorum]() -- [insert_quorum_timeout]() +- [insert_quorum](#insert-quorum) +- [insert_quorum_timeout](#insert-quorum-timeout) [Original article](https://clickhouse.yandex/docs/en/operations/settings/settings/) diff --git a/docs/en/operations/table_engines/collapsingmergetree.md b/docs/en/operations/table_engines/collapsingmergetree.md index f74b7986ed6..1c397165014 100644 --- a/docs/en/operations/table_engines/collapsingmergetree.md +++ b/docs/en/operations/table_engines/collapsingmergetree.md @@ -4,7 +4,7 @@ The engine inherits from [MergeTree](mergetree.md) and adds the logic of rows collapsing to data parts merge algorithm. -`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing]() section of the document. +`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing](#collapsing) section of the document. The engine may significantly reduce the volume of storage and increase efficiency of `SELECT` query as a consequence. diff --git a/docs/en/operations/table_engines/replication.md b/docs/en/operations/table_engines/replication.md index 51c99ed7ab0..ef4d8a976ab 100644 --- a/docs/en/operations/table_engines/replication.md +++ b/docs/en/operations/table_engines/replication.md @@ -172,7 +172,7 @@ If all data and metadata disappeared from one of the servers, follow these steps Then start the server (restart, if it is already running). Data will be downloaded from replicas. -An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicatable tables]()". +An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicated tables](#creating-replicated-tables)". There is no restriction on network bandwidth during recovery. Keep this in mind if you are restoring many replicas at once. diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index ed1cb2b359e..a6751998889 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -72,7 +72,7 @@ Insert data to it: :) INSERT INTO summtt Values(1,1),(1,2),(2,1) ``` -ClickHouse may sum all the rows not completely ([see below]()), so we use an aggregate function `sum` and `GROUP BY` clause in the query. +ClickHouse may sum all the rows not completely ([see below](#data-processing)), so we use an aggregate function `sum` and `GROUP BY` clause in the query. ```sql SELECT key, sum(value) FROM summtt GROUP BY key diff --git a/docs/en/operations/table_engines/versionedcollapsingmergetree.md b/docs/en/operations/table_engines/versionedcollapsingmergetree.md index fc5b5559bc4..90e90c96a4f 100644 --- a/docs/en/operations/table_engines/versionedcollapsingmergetree.md +++ b/docs/en/operations/table_engines/versionedcollapsingmergetree.md @@ -6,7 +6,7 @@ This engine: - Allows quick writing of continually changing states of objects. - Deletes old states of objects in the background. It causes to significant reduction of the volume of storage. -See the section [Collapsing]() for details. +See the section [Collapsing](#collapsing) for details. The engine inherits from [MergeTree](mergetree.md#table_engines-mergetree) and adds the logic of rows collapsing to data parts merge algorithm. `VersionedCollapsingMergeTree` solves the same problem as the [CollapsingMergeTree](collapsingmergetree.md) but uses another algorithm of collapsing. It allows inserting the data in any order with multiple threads. The particular `Version` column helps to collapse the rows properly even if they are inserted in the wrong order. `CollapsingMergeTree` allows only strictly consecutive insertion. diff --git a/docs/en/query_language/dicts/external_dicts_dict_layout.md b/docs/en/query_language/dicts/external_dicts_dict_layout.md index 23be493dfd7..178f98e323e 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/en/query_language/dicts/external_dicts_dict_layout.md @@ -2,11 +2,11 @@ # Storing Dictionaries in Memory -There are a [variety of ways]() to store dictionaries in memory. +There are a variety of ways to store dictionaries in memory. -We recommend [flat](#dicts-external_dicts_dict_layout-flat), [hashed](#dicts-external_dicts_dict_layout-hashed)and[complex_key_hashed](). which provide optimal processing speed. +We recommend [flat](#flat), [hashed](#hashed) and [complex_key_hashed](#complex-key-hashed). which provide optimal processing speed. -Caching is not recommended because of potentially poor performance and difficulties in selecting optimal parameters. Read more in the section "[cache]()". +Caching is not recommended because of potentially poor performance and difficulties in selecting optimal parameters. Read more in the section "[cache](#cache)". There are several ways to improve dictionary performance: @@ -39,15 +39,13 @@ The configuration looks like this: ## Ways to Store Dictionaries in Memory -- [flat]() -- [hashed]() -- [cache]() -- [range_hashed]() -- [complex_key_hashed]() -- [complex_key_cache]() -- [ip_trie]() - - +- [flat](#flat) +- [hashed](#hashed) +- [cache](#cache) +- [range_hashed](#range-hashed) +- [complex_key_hashed](#complex-key-hashed) +- [complex_key_cache](#complex-key-cache) +- [ip_trie](#ip-trie) ### flat diff --git a/docs/en/query_language/dicts/external_dicts_dict_sources.md b/docs/en/query_language/dicts/external_dicts_dict_sources.md index ef61edbf1a2..44007e87df0 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/en/query_language/dicts/external_dicts_dict_sources.md @@ -25,14 +25,14 @@ The source is configured in the `source` section. Types of sources (`source_type`): -- [Local file]() -- [Executable file]() -- [HTTP(s)]() +- [Local file](#local-file) +- [Executable file](#executable-file) +- [HTTP(s)](#http-s) - DBMS - - [MySQL]() - - [ClickHouse]() - - [MongoDB]() - - [ODBC]() + - [MySQL](#mysql) + - [ClickHouse](#clickhouse) + - [MongoDB](#mongodb) + - [ODBC](#odbc) diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index a168aca29e6..ee9ebb49047 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -339,7 +339,7 @@ The corresponding conversion can be performed before the WHERE/PREWHERE clause ( Joins the data in the usual [SQL JOIN](https://en.wikipedia.org/wiki/Join_(SQL)) sense. !!! info "Note" - Not related to [ARRAY JOIN](). + Not related to [ARRAY JOIN](#array-join). ``` sql @@ -374,7 +374,7 @@ When using a normal `JOIN`, the query is sent to remote servers. Subqueries are When using `GLOBAL ... JOIN`, first the requestor server runs a subquery to calculate the right table. This temporary table is passed to each remote server, and queries are run on them using the temporary data that was transmitted. -Be careful when using `GLOBAL`. For more information, see the section [Distributed subqueries](). +Be careful when using `GLOBAL`. For more information, see the section [Distributed subqueries](#distributed-subqueries). **Usage Recommendations** diff --git a/docs/en/query_language/syntax.md b/docs/en/query_language/syntax.md index 56a05d26534..923ae676ef2 100644 --- a/docs/en/query_language/syntax.md +++ b/docs/en/query_language/syntax.md @@ -118,7 +118,7 @@ expr AS alias For example `SELECT column_name * 2 AS double FROM some_table`. -- `alias` — [string literal](). If an alias contains spaces, enclose it in double quotes or backticks. +- `alias` — [string literal](#string-literals). If an alias contains spaces, enclose it in double quotes or backticks. For example, `SELECT "table t".col_name FROM t AS "table t"`. diff --git a/docs/ru/operations/server_settings/settings.md b/docs/ru/operations/server_settings/settings.md index cd993062417..370d8c4fd76 100644 --- a/docs/ru/operations/server_settings/settings.md +++ b/docs/ru/operations/server_settings/settings.md @@ -74,7 +74,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Профиль настроек по умолчанию. -Профили настроек находятся в файле, указанном в параметре [user_config](). +Профили настроек находятся в файле, указанном в параметре [user_config](#user-config). **Пример** @@ -197,7 +197,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Порт для обращений к серверу по протоколу HTTP(s). -Если указан `https_port`, то требуется конфигурирование [openSSL](). +Если указан `https_port`, то требуется конфигурирование [openSSL](#openssl). Если указан `http_port`, то настройка openSSL игнорируется, даже если она задана. diff --git a/docs/ru/operations/settings/settings.md b/docs/ru/operations/settings/settings.md index 31d40ebc0c7..60d82582678 100644 --- a/docs/ru/operations/settings/settings.md +++ b/docs/ru/operations/settings/settings.md @@ -256,7 +256,7 @@ ClickHouse применяет настройку в тех случаях, ко ## stream_flush_interval_ms -Работает для таблиц со стриммингом в случае тайм-аута, или когда поток генерирует [max_insert_block_size]() строк. +Работает для таблиц со стриммингом в случае тайм-аута, или когда поток генерирует [max_insert_block_size](#max-insert-block-size) строк. Значение по умолчанию - 7500. @@ -362,7 +362,7 @@ ClickHouse применяет настройку в тех случаях, ко Все реплики в кворуме консистентны, т.е. содержат данные всех более ранних запросов `INSERT`. Последовательность `INSERT` линеаризуется. -При чтении данных, записанных с `insert_quorum` можно использовать настройку [select_sequential_consistency](). +При чтении данных, записанных с `insert_quorum` можно использовать настройку [select_sequential_consistency](#select-sequential-consistency). **ClickHouse генерирует исключение** @@ -371,8 +371,8 @@ ClickHouse применяет настройку в тех случаях, ко **См. также параметры** -- [insert_quorum_timeout]() -- [select_sequential_consistency]() +- [insert_quorum_timeout](#insert-quorum-timeout) +- [select_sequential_consistency](#select-sequential-consitency) ## insert_quorum_timeout @@ -383,8 +383,8 @@ ClickHouse применяет настройку в тех случаях, ко **См. также параметры** -- [insert_quorum]() -- [select_sequential_consistency]() +- [insert_quorum](#insert-quorum) +- [select_sequential_consistency](#select-sequential-consistency) ## select_sequential_consistency @@ -398,7 +398,7 @@ ClickHouse применяет настройку в тех случаях, ко См. также параметры: -- [insert_quorum]() -- [insert_quorum_timeout]() +- [insert_quorum](#insert-quorum) +- [insert_quorum_timeout](#insert-quorum-timeout) [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/settings/settings/) diff --git a/docs/ru/operations/table_engines/replication.md b/docs/ru/operations/table_engines/replication.md index 3e0b4a68be7..e2925dc3783 100644 --- a/docs/ru/operations/table_engines/replication.md +++ b/docs/ru/operations/table_engines/replication.md @@ -168,7 +168,7 @@ sudo -u clickhouse touch /var/lib/clickhouse/flags/force_restore_data Затем запустите сервер (перезапустите, если уже запущен). Данные будут скачаны с реплик. -В качестве альтернативного варианта восстановления, вы можете удалить из ZooKeeper информацию о потерянной реплике - `/path_to_table/replica_name`, и затем создать реплику заново, как написано в разделе "[Создание реплицируемых таблиц]()". +В качестве альтернативного варианта восстановления, вы можете удалить из ZooKeeper информацию о потерянной реплике - `/path_to_table/replica_name`, и затем создать реплику заново, как написано в разделе "[Создание реплицируемых таблиц](#sozdanie-replitsiruemykh-tablits)". Отсутствует ограничение на использование сетевой полосы при восстановлении. Имейте это ввиду, если восстанавливаете сразу много реплик. diff --git a/docs/ru/operations/table_engines/summingmergetree.md b/docs/ru/operations/table_engines/summingmergetree.md index 6d6014de395..e1d027296d9 100644 --- a/docs/ru/operations/table_engines/summingmergetree.md +++ b/docs/ru/operations/table_engines/summingmergetree.md @@ -72,7 +72,7 @@ ORDER BY key :) INSERT INTO summtt Values(1,1),(1,2),(2,1) ``` -ClickHouse может не полностью просуммировать все строки ([смотрите ниже по тексту]()), поэтому при запросе мы используем агрегатную функцию `sum` и секцию `GROUP BY`. +ClickHouse может не полностью просуммировать все строки ([смотрите ниже по тексту](#obrabotka-dannykh)), поэтому при запросе мы используем агрегатную функцию `sum` и секцию `GROUP BY`. ```sql SELECT key, sum(value) FROM summtt GROUP BY key diff --git a/docs/ru/query_language/dicts/external_dicts_dict_layout.md b/docs/ru/query_language/dicts/external_dicts_dict_layout.md index 93a3e29c5d3..26bfa7ac564 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_layout.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_layout.md @@ -2,11 +2,11 @@ # Хранение словарей в памяти -Словари можно размещать в памяти [множеством способов](). +Словари можно размещать в памяти множеством способов. -Рекомендуем [flat](#dicts-external_dicts_dict_layout-flat), [hashed](#dicts-external_dicts_dict_layout-hashed) и [complex_key_hashed](). Скорость обработки словарей при этом максимальна. +Рекомендуем [flat](#flat), [hashed](#hashed) и [complex_key_hashed](#complex-key-hashed). Скорость обработки словарей при этом максимальна. -Размещение с кэшированием не рекомендуется использовать из-за потенциально низкой производительности и сложностей в подборе оптимальных параметров. Читайте об этом подробнее в разделе "[cache]()". +Размещение с кэшированием не рекомендуется использовать из-за потенциально низкой производительности и сложностей в подборе оптимальных параметров. Читайте об этом подробнее в разделе "[cache](#cache)". Повысить производительнось словарей можно следующими способами: @@ -39,15 +39,13 @@ ## Способы размещения словарей в памяти -- [flat]() -- [hashed]() -- [cache]() -- [range_hashed]() -- [complex_key_hashed]() -- [complex_key_cache]() -- [ip_trie]() - - +- [flat](#flat) +- [hashed](#hashed) +- [cache](#cache) +- [range_hashed](#range-hashed) +- [complex_key_hashed](#complex-key-hashed) +- [complex_key_cache](#complex-key-cache) +- [ip_trie](#ip-trie) ### flat diff --git a/docs/ru/query_language/dicts/external_dicts_dict_sources.md b/docs/ru/query_language/dicts/external_dicts_dict_sources.md index 76fd552f4d7..09653c8f6bd 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/ru/query_language/dicts/external_dicts_dict_sources.md @@ -24,14 +24,14 @@ Типы источников (`source_type`): -- [Локальный файл]() -- [Исполняемый файл]() -- [HTTP(s)]() +- [Локальный файл](#ispolniaemyi-fail) +- [Исполняемый файл](#ispolniaemyi-fail) +- [HTTP(s)](#http-s) - СУБД: - - [ODBC]() - - [MySQL]() - - [ClickHouse]() - - [MongoDB]() + - [ODBC](#odbc) + - [MySQL](#mysql) + - [ClickHouse](#clickhouse) + - [MongoDB](#mongodb) ## Локальный файл diff --git a/docs/ru/query_language/select.md b/docs/ru/query_language/select.md index ffb48a05599..14e84a28d5a 100644 --- a/docs/ru/query_language/select.md +++ b/docs/ru/query_language/select.md @@ -442,13 +442,13 @@ LIMIT 10 ### Секция WHERE -Позволяет задать выражение, которое ClickHouse использует для фильтрации данных перед всеми другими действиями в запросе кроме выражений, содержащихся в секции [PREWHERE](). Обычно, это выражение с логическими операторами. +Позволяет задать выражение, которое ClickHouse использует для фильтрации данных перед всеми другими действиями в запросе кроме выражений, содержащихся в секции [PREWHERE](#prewhere). Обычно, это выражение с логическими операторами. Результат выражения должен иметь тип `UInt8`. -ClickHouse использует в выражении индексы, если это позволяет [движок таблицы](../operations/table_engines/index.md#table_engines). +ClickHouse использует в выражении индексы, если это позволяет [движок таблицы](../operations/table_engines/index.md). -Если в секции необходимо проверить [NULL](syntax.md#null-literal), то используйте операторы [IS NULL](operators.md#operator-is-null) и [IS NOT NULL](operators.md), а также соответствующие функции `isNull` и `isNotNull`. В противном случае выражение будет считаться всегда не выполненным. +Если в секции необходимо проверить [NULL](syntax.md#null-literal), то используйте операторы [IS NULL](operators.md#operator-is-null) и [IS NOT NULL](operators.md#is-not-null), а также соответствующие функции `isNull` и `isNotNull`. В противном случае выражение будет считаться всегда не выполненным. Пример проверки на `NULL`: @@ -469,7 +469,7 @@ WHERE isNull(y) ### Секция PREWHERE -Имеет такой же смысл, как и секция [WHERE](). Отличие состоит в том, какие данные читаются из таблицы. +Имеет такой же смысл, как и секция [WHERE](#where). Отличие состоит в том, какие данные читаются из таблицы. При использовании `PREWHERE`, из таблицы сначала читаются только столбцы, необходимые для выполнения `PREWHERE`. Затем читаются остальные столбцы, нужные для выполнения запроса, но из них только те блоки, в которых выражение в `PREWHERE` истинное. `PREWHERE` имеет смысл использовать, если есть условия фильтрации, которые использует меньшинство столбцов из тех, что есть в запросе, но достаточно сильно фильтрует данные. Таким образом, сокращается количество читаемых данных. diff --git a/docs/zh/operations/configuration_files.md b/docs/zh/operations/configuration_files.md index e858ae25180..0f7fdd3ae09 100644 --- a/docs/zh/operations/configuration_files.md +++ b/docs/zh/operations/configuration_files.md @@ -14,7 +14,7 @@ If `replace` is specified, it replaces the entire element with the specified one If `remove` is specified, it deletes the element. -The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros]() server_settings/settings.md)). +The config can also define "substitutions". If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](server_settings/settings.md#server_settings-include_from) element in the server config. The substitution values are specified in `/yandex/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros](#macros) server_settings/settings.md)). Substitutions can also be performed from ZooKeeper. To do this, specify the attribute `from_zk = "/path/to/node"`. The element value is replaced with the contents of the node at `/path/to/node` in ZooKeeper. You can also put an entire XML subtree on the ZooKeeper node and it will be fully inserted into the source element. diff --git a/docs/zh/operations/server_settings/settings.md b/docs/zh/operations/server_settings/settings.md index 72b0bd860c4..b43db1f85b2 100644 --- a/docs/zh/operations/server_settings/settings.md +++ b/docs/zh/operations/server_settings/settings.md @@ -61,7 +61,7 @@ ClickHouse checks `min_part_size` and `min_part_size_ratio` and processes the The default database. -To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc.md#query_language_queries_show_databases) query. +To get a list of databases, use the [SHOW DATABASES](../../query_language/misc.md#query_language_queries_show_databases) query. **Example** @@ -74,7 +74,7 @@ To get a list of databases, use the [ SHOW DATABASES](../../query_language/misc. Default settings profile. -Settings profiles are located in the file specified in the parameter [user_config](). +Settings profiles are located in the file specified in the parameter [user_config](#user-config). **Example** @@ -196,7 +196,7 @@ For more details, see [GraphiteMergeTree](../../operations/table_engines/graphit The port for connecting to the server over HTTP(s). -If `https_port` is specified, [openSSL]() must be configured. +If `https_port` is specified, [openSSL](#openssl) must be configured. If `http_port` is specified, the openSSL configuration is ignored even if it is set. diff --git a/docs/zh/operations/settings/settings.md b/docs/zh/operations/settings/settings.md index e3170246054..2e77b8d0af7 100644 --- a/docs/zh/operations/settings/settings.md +++ b/docs/zh/operations/settings/settings.md @@ -258,7 +258,7 @@ This parameter is useful when you are using formats that require a schema defini ## stream_flush_interval_ms -Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size]() rows. +Works for tables with streaming in the case of a timeout, or when a thread generates[max_insert_block_size](#max-insert-block-size) rows. The default value is 7500. @@ -366,7 +366,7 @@ The default value is 0. All the replicas in the quorum are consistent, i.e., they contain data from all previous `INSERT` queries. The `INSERT` sequence is linearized. -When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency]() option. +When reading the data written from the `insert_quorum`, you can use the[select_sequential_consistency](#select-sequential-consistency) option. **ClickHouse generates an exception** @@ -375,8 +375,8 @@ When reading the data written from the `insert_quorum`, you can use the[select_s **See also the following parameters:** -- [insert_quorum_timeout]() -- [select_sequential_consistency]() +- [insert_quorum_timeout](#insert-quorum-timeout) +- [select_sequential_consistency](#select-sequential-consistency) ## insert_quorum_timeout @@ -387,8 +387,8 @@ By default, 60 seconds. **See also the following parameters:** -- [insert_quorum]() -- [select_sequential_consistency]() +- [insert_quorum](#insert-quorum) +- [select_sequential_consistency](#select-sequential-consistency) ## select_sequential_consistency @@ -402,8 +402,8 @@ When sequential consistency is enabled, ClickHouse allows the client to execute See also the following parameters: -- [insert_quorum]() -- [insert_quorum_timeout]() +- [insert_quorum](#insert-quorum) +- [insert_quorum_timeout](#insert-quorum-timeout) [Original article](https://clickhouse.yandex/docs/en/operations/settings/settings/) diff --git a/docs/zh/operations/table_engines/collapsingmergetree.md b/docs/zh/operations/table_engines/collapsingmergetree.md index c6140514693..02fa1a0e5a2 100644 --- a/docs/zh/operations/table_engines/collapsingmergetree.md +++ b/docs/zh/operations/table_engines/collapsingmergetree.md @@ -4,7 +4,7 @@ The engine inherits from [MergeTree](mergetree.md) and adds the logic of rows collapsing to data parts merge algorithm. -`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing]() section of the document. +`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing](#collapsing) section of the document. The engine may significantly reduce the volume of storage and increase efficiency of `SELECT` query as a consequence. diff --git a/docs/zh/operations/table_engines/replication.md b/docs/zh/operations/table_engines/replication.md index ad344f5c4ba..c7b2f97ee16 100644 --- a/docs/zh/operations/table_engines/replication.md +++ b/docs/zh/operations/table_engines/replication.md @@ -169,7 +169,7 @@ If all data and metadata disappeared from one of the servers, follow these steps Then start the server (restart, if it is already running). Data will be downloaded from replicas. -An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicatable tables]()". +An alternative recovery option is to delete information about the lost replica from ZooKeeper (`/path_to_table/replica_name`), then create the replica again as described in "[Creating replicated tables](#creating-replicated-tables)". There is no restriction on network bandwidth during recovery. Keep this in mind if you are restoring many replicas at once. diff --git a/docs/zh/operations/table_engines/summingmergetree.md b/docs/zh/operations/table_engines/summingmergetree.md index 2cad58f27cc..d7b4a1b812b 100644 --- a/docs/zh/operations/table_engines/summingmergetree.md +++ b/docs/zh/operations/table_engines/summingmergetree.md @@ -72,7 +72,7 @@ Insert data to it: :) INSERT INTO summtt Values(1,1),(1,2),(2,1) ``` -ClickHouse may sum all the rows not completely ([see below]()), so we use an aggregate function `sum` and `GROUP BY` clause in the query. +ClickHouse may sum all the rows not completely ([see below](#data-processing)), so we use an aggregate function `sum` and `GROUP BY` clause in the query. ```sql SELECT key, sum(value) FROM summtt GROUP BY key diff --git a/docs/zh/query_language/select.md b/docs/zh/query_language/select.md index b58f6886b35..2da781c39cb 100644 --- a/docs/zh/query_language/select.md +++ b/docs/zh/query_language/select.md @@ -339,7 +339,7 @@ ARRAY JOIN nest AS n, arrayEnumerate(`nest.x`) AS num JOIN子句用于连接数据,作用与[SQL JOIN](https://en.wikipedia.org/wiki/Join_(SQL))的定义相同。 !!! info "注意" - 与[ARRAY JOIN]()没有关系. + 与[ARRAY JOIN](#array-join)没有关系. ``` sql @@ -373,7 +373,7 @@ FROM 当使用`GLOBAL ... JOIN`,首先会在请求服务器上计算右表并以临时表的方式将其发送到所有服务器。这时每台服务器将直接使用它进行计算。 -使用`GLOBAL`时需要小心。更多信息,参阅[Distributed subqueries]()部分。 +使用`GLOBAL`时需要小心。更多信息,参阅[Distributed subqueries](#distributed-subqueries)部分。 **使用建议** From b065368d9c3dcd5cf9326e585f91eaec73c0499c Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 19:45:21 +0300 Subject: [PATCH 119/297] restore gifs --- docs/en/images/column_oriented.gif | Bin 40437 -> 45485 bytes docs/en/images/row_oriented.gif | Bin 37591 -> 41571 bytes docs/fa/images/column_oriented.gif | Bin 40437 -> 45485 bytes docs/fa/images/row_oriented.gif | Bin 37591 -> 41571 bytes docs/ru/images/column_oriented.gif | Bin 40437 -> 45485 bytes docs/ru/images/row_oriented.gif | Bin 37591 -> 41571 bytes docs/zh/images/column_oriented.gif | Bin 40437 -> 45485 bytes docs/zh/images/row_oriented.gif | Bin 37591 -> 41571 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/en/images/column_oriented.gif b/docs/en/images/column_oriented.gif index 5a0e5b8e15ef0314540506256cacd898a1d3a71e..15f4b12e697ac40c60bf77f964645316410da946 100644 GIT binary patch delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtm;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s diff --git a/docs/en/images/row_oriented.gif b/docs/en/images/row_oriented.gif index 6e7c5889ccfdcdd6158b5f5356785d665063bf1a..53daa20f322d37f67652e5f53c26a433ea8cb5c9 100644 GIT binary patch delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7yLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV diff --git a/docs/fa/images/column_oriented.gif b/docs/fa/images/column_oriented.gif index 5a0e5b8e15ef0314540506256cacd898a1d3a71e..15f4b12e697ac40c60bf77f964645316410da946 100644 GIT binary patch delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtm;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s diff --git a/docs/fa/images/row_oriented.gif b/docs/fa/images/row_oriented.gif index 6e7c5889ccfdcdd6158b5f5356785d665063bf1a..53daa20f322d37f67652e5f53c26a433ea8cb5c9 100644 GIT binary patch delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7yLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV diff --git a/docs/ru/images/column_oriented.gif b/docs/ru/images/column_oriented.gif index 5a0e5b8e15ef0314540506256cacd898a1d3a71e..15f4b12e697ac40c60bf77f964645316410da946 100644 GIT binary patch delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtm;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s diff --git a/docs/ru/images/row_oriented.gif b/docs/ru/images/row_oriented.gif index 6e7c5889ccfdcdd6158b5f5356785d665063bf1a..53daa20f322d37f67652e5f53c26a433ea8cb5c9 100644 GIT binary patch delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7yLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV diff --git a/docs/zh/images/column_oriented.gif b/docs/zh/images/column_oriented.gif index 5a0e5b8e15ef0314540506256cacd898a1d3a71e..15f4b12e697ac40c60bf77f964645316410da946 100644 GIT binary patch delta 5096 zcmZ{lWmFT6*T)Bnpb{z_0|W_`7)Y0dfG8n|bTeYoqhT;w8l(}VVWjj%jb^~;u2G^O z9m+`E(?Q8^kqAH{hHc>^@GeQc6%8OAi;Qu8WJK zEQbQv#ma{LjlGM9i@UvxE4z{syD&&dgq>Hz(i-CY&+zg8QW_dkYR>K+md@5TYA<9t z{_YWgK)_NWk`hWviYk)gDj-E6A!SiTkQhioQAAW!NL*M#L{aiT>qfv&Vm6 z@c+XK{|d{o%ltj`_w)-JD8$PKtO9j$Vt4n@v9Xnc{JV_!zwCqmwfR37{MY7RWF-Ct zmgErpYa<8++y0etw}wJoJs>X5{~77LQ2D3yk@~CaWaDA^w|Va4YH96Yuakk%ebY*h55PJndzy? ziSe<~k>Mfi;6Oj7ueYbWtFxmW-PYRD+=N0lHq_VE)>MC~s;nq4D@BwP7Zn!d=jG;n z&d&OjnUS8Bnv$IKF)<-NE;c4QD)K`_cvxtNL2wW}FaYN7=j-F`<>}!Lb#rxbc5-xh z53#qiwEjVGwBt_w9JMhyobzftMa<)q;B|@pYRbH6geN#3=wN#&)x5gt zSr>d4;`E!TvTO7i(mw?96WTImAkf&REPHqYr5`-ToRw`efk z#7Rrz>b#l^_2nFro?*T*Kv0N%^iSlZ|4iQKNo!e~yB?#gzRI^VM7ZXTN(0kYRc%wY zkepFmOxt(;blKfzu`eN-ocW@Mh1F z$ge%UeIwAhb-QQz%2Yh}H0g`idiZmg{v){`satIu>u~`CT5?x0Jn)t?{;_~uhn%f% zxk-3K)8D0Y?Q3OP{M%|Be#>JS-^OzAQOm5?(+vdLJ`}9~gZ&`F6}#nqcIJn%v%KoJ z{Vo2Iz;o9})&I$ve_^T@;tYmD1e4D@T_b`N>4K|V1Jsd$+`PW4;(^N_Lbgc*m$qEC zNJDq%eGg0CKOP{}suyEdB7t-6ju)8|vgqmz)5^zgDjX4qgBq%gZ#p$Pe_!;3e9^Q@ zuqaENa$d>p0gxU%%>Yeu^hQT5%Rp)?G16>^-xoXsY{)>u1C8>Fu?`=4A*4x7*9`zb z47!SOvKDt)1<3iOB#u3N5xBef?j}Rlieo&=Q}yuo63UgS??wi77rgnZAO*WK!m1b; zbMgFB#gBeJa=Rlb4lc5ECrIIKhc+49O zFq;Y!Yx|Oa=#cX&XUyP7{29f*uc|fGl6(O_^K3ttBrbo{WV1)j(g~(SW2Q2Us^bsQ zh?=pmqRv!m&F>pi8dqARQLs@c?~Sui+F{c^@De~5$EXHAUAtY@pbDp*Rg2qq%>zDc zs=m!c0!0FffI^X~p!>q%Y~T!lnmsM`0Tm&fRd@d3{bmY!vwIQnq;)+j{hl32mDj@S zPt%igN@^o7V2prs1E=e;K8!qm-dRfm5qEu>nmEo5_SM4+Hy~7ix-_p~Q$??x!@q zbSkevqQA@6B#%!)0yeInecQmi5Hk7EIFJPw4Y1E5T~d4VZEhOqdymSEI$bGfs)z|U zU;VlIBbE9X)U}lWga?zwI1$?s#&`w7MqB1kME}aNrZr`(WJ?o!o5mMfa`whg^nJ+3 z;yGAZA(ZxQ#YjrYp+#X?XZ-<>5a}yUN-T(o^(b%N_Mt8lrN*K(*92Mh{SvE73hHsl zuLTVe`Fvw!iQ^8D$eL4eI`f<`0&0YCQz1^hM+SI!ag&4;00-~^04ji(WZy?Xc!+=I zr>yMH>A89Nsh^9Avq%ccQb=;-+1^iu8I%Gm5`ATDv?>)O`hx83yh?H{9iCkd$2%u0O8&+zjL1oDr> zK64Y9MW_EQ)B7fo+w5h5l+yVRz%MDRuyab#>n6(4BfV!3Ih=r$XJsDcANbMD?$ykD}MwBV&+kDzVuaYQP`n zsjV6}rJK`-?tXD-rmeIeD29dw#TT|xeTa4l2KtwFAfUf}9TMuTVun+ zCvU_a2fw+lHu2X0wjca`A@=7G7z{)Q3T&E(9?dn!>N z-TXWBAVvUBB+|%a;GWQYy|f0H@-^p^a7QJ}7~^?7)!cdCHRuP8{`u@fU86Cw;`?zy z`4lS%#;AXlv8@DmI)q{^4-*y`gPe*gkFS3L(FaPBJJ`vqG6J+ZOxuo=~ z>j!Dehkd3|#KEU)I37a3f3=ipjGu3dW&Q|}v8(<162j(|TFHjPrSR6{F zbEunIpy26AWAQEcwyn)Okhl*M7TI}k3o1V4zD(w&&FcuJ;?d!^&vTf2{Puk$*CV7O zMYa8en7RXUKZ@FxFeQL};`y}K(rjrqPho@Kyxj&Jcmw_<$#p&FN5&+%xKfz){af!@ zGWd9dz7Mg>n^5NYx^DqsJTY?YRuPaXDjh`oueI992~siAM0TQ|TVrXK-kz0GjU#bA ztT9N9rC>Jz1_=JccX=F3T1zhdPF1(WDm~UzmCn@A%XVx<@Mm9~G2UkW3(#A3*|^bR zz7Dd4k%6z)*|ulf^f(7zHgm78-`tva#RtE^xsgc)nLx>(kP-(HMPgRoC%p6qdbZP$ zOohkEB7rvWj5A=snxU9k)T2*`f+&$}#A$?wRVnw*t~D_c~rAq+b+~=oyAwpVB+ozOvw^ zcz^PJ?vpE~KG#_M@54)8m_~|;mF)}qZ)AOjW|TDVs}Xy?X1OO`EZ(u5s2NU-V`JbV zQ@u|~_wf~t`J=otwm+_J*$)af8ptGT$!wwgW!Z#Dt~fy8fay(-OrpDyoj1GfgK-Xd zJFF5l25KM=nipv{blha8>+u0Cq2_(rblqzUE5^zp;_@gLJh=4PJ9IGMlj~5 zW45CZerav2^|Pj&jBw6}fMdM8ciw?hxx*|Q4F=Sutm!nB^~nIMTemBu!M}Jz=P=?$ z!{O~?0ks~}W0p0MUo+#tUFz4axUIHx;49&!y9Kta*63o5T2=X_oPO9`uY{}+OuOOj z#gRw5N9A7h(!f{$MRDHqUH+^fLM!jj-HLCVR8C&2S`8GbBqX56#^y|5mid z!{?jIP5mFJ4%uBo$i)+rxjj@jrSNFt^<7i)v(zujx5k0#{`8LwUsm7L5jGbtVxf4p z9m9-?36XaEOvPsVB{Hhk%4Rr2xISHls|CW`Q8<5Z!vOJEZz8^JxG*=UU#7zII6<|| zkiSHzWOjZu(hjc9ahP*E)_zkR#>lzClBK5_3Z`c8YtUi4OQM-I;gZ5Evi23TS))|0 zqZ@5PzeFZ65TbVCj(V}gW!O06UuTuPxC17U1`R`^bkagaGTNB*$90pQrUPX10dE=J z7!OvYC5Q3e(%zAe!FQ(%kZ@B;E>7GhcFR`2!N%wkHY(=JQJcBDw<4w_hB&rNhzGV7 zYRKlRVnoIgj0jog89_U};*^cHlCOAlmWp&|Kr;eIdH&i)ePCTk1S{_U1 z*w(pYy@1sjd5VQz<&pyfQ;Lx}JN;)%sb5d_ov)5=Y2{*Rm7j<5`=m8JlIO{j`AQ4- zWpE;4y}vUCzf&*mhr0{stnN1Is{yNiZle^Zrk58eNtDf!M@6JryNT{26woENwB{>< zO;0Us+TJl4OJs_Vg381RZI1ed=RMiv$CXNkyFDu{wYmZLFWWdH=^nbVl&NQaQ?I*E zi7&B++>re67<-o|mqU-Hc@V$=r7irM+&_(vgRUf(U;q3y;vWnDi5$_k13{14KG2;t z(aU0<-xV6)zID*joNfO=xXmbz?mc=4=JG@DGS~apnWyMy(_ktS=KMdbv7sXa=G5f1 zGnnFX#%3r0Z!lLB>1l-67veCNo_j2JAx%7E1+14z>k-J9xPeq3A2q3Iam0^=QtsLl zPHU#{zWuS;`_Q~a_6OX+VeV|Rkfja>ggjmsO30k z>0J$YA~qR>M?wq3Z-`K+K!glu7 zQrcHfvKJ?2&nM%jFR!k_>sNNetdIOU$#sYgV%d9wBCbvSBS&UBqo!#D6icT-S{-uP}9D^2*Yw0B2&Cu&EQ1B^W|?+OjyRpdbeFj>CG1E=j9k z!*PY2?+?BZs2 zvTkPul9tQC0KvL??+JZrtm;3v&d*S0<*|#BN?-vhC&0gCyLw)v%i-j6O+oTJhLsWfCPVCA`}1s diff --git a/docs/zh/images/row_oriented.gif b/docs/zh/images/row_oriented.gif index 6e7c5889ccfdcdd6158b5f5356785d665063bf1a..53daa20f322d37f67652e5f53c26a433ea8cb5c9 100644 GIT binary patch delta 4075 zcmZ{mc{mgb*T74ga#Oc%St?oTl58nE;S!@zxtcL4>kKotv5qmA8OxX%3?|zcX2_By zgt3flp)l6UGDFs6&6+Tz=JS5vcc1ThzUO`aJLf#l@0{OX=NwL+!1P;zGNVIS8EHwB zr?<9|FVxW=;cJaRc<4zRLJ&?+$paZ6Ip!qFM-^{?W!|E4S~ zw9UNy{2jfVp=QQ<())ds;Bbhxrm?Zf9WBE<8b*d{H*VZf(^A#CX>?OXQ%glnOXV*k zwSQP+gmVDa6YAyv4-EM~*yKOLw6{y!c)@E-wNuY4gWVXMykfQ z{!-Ua+wZ6HZ)C9hHva=d_HF*Z%>Tmb{{dE$R^GQ!_Jz3Y%lJ9_!oB_B2(N!iR>mg( z3Q^kox}H#f$NfYf~A)}KhL%szH{JpZ$Jr_{L&#GE8d50NiGx6b9Wdl;=c1zD|boGwX^3~#jjLW7=*%Hg3#bt z;Lr=Y=Yk7d{P9Pp>dGrW6=2xt$Gt`B`8k^l?zUg8hDNG${<`GqxS$PeuTZOKyyId2 zbHt|p=yoYmQOSEIdURHGh{f*t`T#G)osifr@9bG|km`CmhZL#9a>z=03(; zjN-4nPP?z@!1R%mh>+*^CT1D~>pvZN^>9we{^xE@Q@r)+f_2P$?&~e)Q5QMSbLNwW z-I2{Nu9op7&MZwHH{w>*=q-Eb)lCUce{U%t^YHTFj4yVA>bES)gA2PRelmDX_ZyUP zX+Orqr#WqXC)fNpATiFOFE!g#SJtEPA=6SEkq&)Exi0wPmlx`_HQGZZq_hmkWtrMe zn?Ea({fcL<`)PG432!9E)I-ICYZC;H(j(pLT!ex}n?+o1W_(g`)dr!evdK3Y6MK%g zUnRBrZEb`>PcUyEA3KPZvHv=@{cF3ScVj(9ca_LcZMmV3?n5;G4CU}1E3&xMd=E+r+So7nqe#dUD6DQf#GVi~ z1PT>Hg$~Pxii!qGqr#w|FgY&zieQK>0aIxdHsu=jNfs$3ijBBf5IWe-594Y?%$j1v z0TH)(5e6{i3@GyYT==V-LF<7yVO~&Hd*lHk?l)HCAx(UEJ{E|=+wd@_<(^ud_W{iV z&F~(rSAh@Y@Rl~XCsg1@V3aMu<0-)V3`^6BF7B z652ZwTILhp3Q{`cC~N?w6-H?wQW^^=O&t{0Jf%+X+3R_VG*;``S+UrwW--^aVy6o3l=UZ7pcbzy8#Or(1^r|QF~pf(PmU#DnDeDK%Erv1I%lOfYS)@ zNNO$hy#}>`Lp2mki%(0-UZ7GI(w+y=i~+Q(8fp1CDOs{nzfy5Avgws+QJ%F}d$u!D zEFHDrjfP())ubg?gK^!%n4{V*4Z}fAX|m1iWFcBsThR0Sf~oAZbitym)$n-a?%ra}B z&WfxV7k$sJc04;?_}f^LNTcSAAnE zy_)MjT=boMXbsiwNK6OgBIwou64->;L z$;80T-Lb=|rn+Tdep$H0o}?hB&9J(5IV|$yGgP}S5+gTXLhoR(o+@}klwD#|N2D3R${6RnaA!K&x_MxAF->n9wyrcW}Y2CX{mYp zvarveI=cPZz+3LJ3@0yT9gAaFQwd=2x0JfQ8AXiH+AHjnS@k}xUcb_fw2i$P z9llm~gpz;y*@k(OZLN=CrT)2>#}+K?cYAVrH}XZs7XND3?yCCbR|=vps%>lcrz#;+ zZc5FpCG5U$F5Rl=A6<5I4elFk45+<#X$4#pJpQS4JGZ}K1+p4E%3lenkEgGNXQC%X zl)p1`#;p6=wyLnMX3J3*Xwwnnm2a6w>wddpGx2j(hM{|a1j6X(Hf|%lW3 z{FRO-%=ZPa(B)(LKgL(Jd8vJ&Uu^k%=+(wucLZ;XgB@S*=i}R)Nju%CKR#}X)V!+& z_}&9TQS|i%aO*PZ;0;>74ot{^{ zPhZ2P)|PxN)cNVR>*`deS!0*`hgYW;nx7XcR2V3BZCA9lt{2C@JwD;FGa>3|nbD`u zKUPtE82I;7;p<*E#82%`b~cM zx&s!R>3-$mLqAQmiWR$_C5sOm13H{{X!;|5m2x!M6AILTs@EW8ch1Cn)>+7m#{B5H zHwIh9*ARxAE~L~y+Lf5hM!sr>=Xw9!1??_ssN7_mT*)L|TvAeF+;*IH6eij9Xv?0q z`e2FUo~F|Q8ug%qFjzmB-Yt<@aop;(<++n}4n=D@wWE*R0?!|oQpU93n5sR&Y=xEX z-{a)4#n{{{1*%ppr*rcm0OLa=oY2SJ*3Nm64mShM;(u3$2wOxM7Fo@56wo^R79M z6u$luZI(qZs~TVlSU-0gVxBlya;pjsWCpr1Pa4X6JNr^GlwvS!@*WtO9PQjw=q(mB z6!l`z`{bErbM1iY83vFpx`{LSIco{58mhVfR}tw)&zfn74QR!XBV7pR7@DobxV;oU=QIZ-EErLg73Oz8VC6`Def%JT3bp|$CqxiSq0D=hxY8G zUKG9^|G>uhgL%qiZ@|0Ww8*BqE7t@+3&4W_k6iel2_;%cwqoZaEW$DP3g}F@kf#dU8 zVOwVN^l%B9Yj(7fe7h1(bwn-`XXkzJx#rUYl*<{uMFa_Yl>Fl1f?V_o<~=-E04vi* zJ;J=!DQ%5guvV#tvBa_w4i2$7!oRENu*)gr*o#hG?|FK%$opVF2;`FMG4{^PLwWi z5|TRVk4gOw2W-|_`b1xpJ{3r1WAD0HIV5@HT!j{N3|09cPhGTE*E`R{%@8KfD5nO#++MfoouVf?ESk@&aBDS`#g!Nz z%$)@;nwf=u_9Mf)7YmKdt%qUaQpRZtRRALCgH4 z@B1YE120s3imaTTt>qf1vFj7oRqfb*p)oq(RVu6(`TKd^J&uuP65{ zyz|kI-_*b^@Wa|Ih-I*Fu{um!_}JR9d?i0r-L&c|C7)ShA&jjrKd^cFMgWC_gl-pEJV zR%L-ji5sYEWa#x)RT;U&!}Z>$k&&%xR>^X`Z8Y>cK%o4pSFDC)&t`Gc xf%4tWOAxvn_*l$|DPa!1{;rotKaiM=S$@%GJaet(0(cpTtPO@T-w;HE{tMJC7yLcDW6+ WtAy(bvp$bD1GD#%Spu^#mop2iNE~GV From 79f0c7feb9f7b544d3e347595acbfebd75c93da3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 19:49:16 +0300 Subject: [PATCH 120/297] fix lost words --- docs/en/operations/table_engines/aggregatingmergetree.md | 2 +- docs/zh/operations/table_engines/aggregatingmergetree.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/operations/table_engines/aggregatingmergetree.md b/docs/en/operations/table_engines/aggregatingmergetree.md index df84492c027..636f62cce51 100644 --- a/docs/en/operations/table_engines/aggregatingmergetree.md +++ b/docs/en/operations/table_engines/aggregatingmergetree.md @@ -49,7 +49,7 @@ All of the parameters have the same meaning as in `MergeTree`. ## SELECT and INSERT -To insert data, use [INSERT SELECT](../../query_language/insert_into.md +To insert data, use [INSERT SELECT](../../query_language/insert_into.md) query with aggregate -State- functions. When selecting data from `AggregatingMergeTree` table, use `GROUP BY` clause and the same aggregate functions as when inserting data, but using `-Merge` suffix. In the results of `SELECT` query the values of `AggregateFunction` type have implementation-specific binary representation for all of the ClickHouse output formats. If dump data into, for example, `TabSeparated` format with `SELECT` query then this dump can be loaded back using `INSERT` query. diff --git a/docs/zh/operations/table_engines/aggregatingmergetree.md b/docs/zh/operations/table_engines/aggregatingmergetree.md index 5b571f63a65..044e5624f8d 100644 --- a/docs/zh/operations/table_engines/aggregatingmergetree.md +++ b/docs/zh/operations/table_engines/aggregatingmergetree.md @@ -49,7 +49,7 @@ All of the parameters have the same meaning as in `MergeTree`. ## SELECT and INSERT -To insert data, use [INSERT SELECT](../../query_language/insert_into.md +To insert data, use [INSERT SELECT](../../query_language/insert_into.md) query with aggregate -State- functions.. When selecting data from `AggregatingMergeTree` table, use `GROUP BY` clause and the same aggregate functions as when inserting data, but using `-Merge` suffix. In the results of `SELECT` query the values of `AggregateFunction` type have implementation-specific binary representation for all of the ClickHouse output formats. If dump data into, for example, `TabSeparated` format with `SELECT` query then this dump can be loaded back using `INSERT` query. From 06e02bfd86e8390de894cd94a1aeb93067f27685 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 19:52:43 +0300 Subject: [PATCH 121/297] more docs fixes --- docs/en/operations/table_engines/file.md | 2 +- docs/en/operations/table_engines/mergetree.md | 2 +- docs/ru/operations/table_engines/mergetree.md | 4 +- docs/zh/operations/table_engines/file.md | 2 +- docs/zh/operations/table_engines/mergetree.md | 48 +++++++++++++++---- 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/docs/en/operations/table_engines/file.md b/docs/en/operations/table_engines/file.md index 816b8d94cd6..a394db256db 100644 --- a/docs/en/operations/table_engines/file.md +++ b/docs/en/operations/table_engines/file.md @@ -60,7 +60,7 @@ SELECT * FROM file_engine_table ## Usage in Clickhouse-local -In [clickhouse-local](../utils/clickhouse-local.md +In [clickhouse-local](../utils/clickhouse-local.md) File engine accepts file path in addition to `Format`. Default input/output streams can be specified using numeric or human-readable names like `0` or `stdin`, `1` or `stdout`. **Example:** ```bash diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index f8b2a00cf83..0aba93e4591 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -79,7 +79,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa In the example, we set partitioning by month. -We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. +We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md#sample) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. `index_granularity` could be omitted because 8192 is the default value. diff --git a/docs/ru/operations/table_engines/mergetree.md b/docs/ru/operations/table_engines/mergetree.md index 94143ce9d2a..2828a893fe5 100644 --- a/docs/ru/operations/table_engines/mergetree.md +++ b/docs/ru/operations/table_engines/mergetree.md @@ -78,7 +78,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa В примере мы устанавливаем партиционирование по месяцам. -Также мы задаем выражение для сэмплирования в виде хэша по идентификатору посетителя. Это позволяет псевдослучайным образом перемешать данные в таблице для каждого `CounterID` и `EventDate`. Если при выборке данных задать секцию [SAMPLE](../../query_language/select.md +Также мы задаем выражение для сэмплирования в виде хэша по идентификатору посетителя. Это позволяет псевдослучайным образом перемешать данные в таблице для каждого `CounterID` и `EventDate`. Если при выборке данных задать секцию [SAMPLE](../../query_language/select.md#sample], то ClickHouse вернёт равномерно-псевдослучайную выборку данных для подмножества посетителей. `index_granularity` можно было не указывать, поскольку 8192 — это значение по умолчанию.
    Устаревший способ создания таблицы @@ -189,7 +189,7 @@ ClickHouse не требует уникального первичного кл В этом сценарии имеет смысл оставить в первичном ключе всего несколько столбцов, которые обеспечат эффективную фильтрацию по индексу, а остальные столбцы-измерения добавить в выражение ключа сортировки. -[ALTER ключа сортировки](../../query_language/alter.mdоперация, так как при одновременном добавлении нового столбца в таблицу и ключ сортировки не нужно изменять +[ALTER ключа сортировки](../../query_language/alter.md) — легкая операция, так как при одновременном добавлении нового столбца в таблицу и ключ сортировки не нужно изменять данные кусков (они остаются упорядоченными и по новому выражению ключа). ### Использование индексов и партиций в запросах diff --git a/docs/zh/operations/table_engines/file.md b/docs/zh/operations/table_engines/file.md index 816b8d94cd6..a394db256db 100644 --- a/docs/zh/operations/table_engines/file.md +++ b/docs/zh/operations/table_engines/file.md @@ -60,7 +60,7 @@ SELECT * FROM file_engine_table ## Usage in Clickhouse-local -In [clickhouse-local](../utils/clickhouse-local.md +In [clickhouse-local](../utils/clickhouse-local.md) File engine accepts file path in addition to `Format`. Default input/output streams can be specified using numeric or human-readable names like `0` or `stdin`, `1` or `stdout`. **Example:** ```bash diff --git a/docs/zh/operations/table_engines/mergetree.md b/docs/zh/operations/table_engines/mergetree.md index 12ed0cc094f..0aba93e4591 100644 --- a/docs/zh/operations/table_engines/mergetree.md +++ b/docs/zh/operations/table_engines/mergetree.md @@ -39,6 +39,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] ) ENGINE = MergeTree() [PARTITION BY expr] [ORDER BY expr] +[PRIMARY KEY expr] [SAMPLE BY expr] [SETTINGS name=value, ...] ``` @@ -49,16 +50,23 @@ For a description of request parameters, see [request description](../../query_l - `ENGINE` - Name and parameters of the engine. `ENGINE = MergeTree()`. `MergeTree` engine does not have parameters. -- `ORDER BY` — Primary key. - - A tuple of columns or arbitrary expressions. Example: `ORDER BY (CounterID, EventDate)`. -If a sampling expression is used, the primary key must contain it. Example: `ORDER BY (CounerID, EventDate, intHash32(UserID))`. - - `PARTITION BY` — The [partitioning key](custom_partitioning_key.md). For partitioning by month, use the `toYYYYMM(date_column)` expression, where `date_column` is a column with a date of the type [Date](../../data_types/date.md). The partition names here have the `"YYYYMM"` format. -- `SAMPLE BY` — An expression for sampling. Example: `intHash32(UserID))`. +- `ORDER BY` — The sorting key. + + A tuple of columns or arbitrary expressions. Example: `ORDER BY (CounterID, EventDate)`. + +- `PRIMARY KEY` - The primary key if it [differs from the sorting key](mergetree.md). + + By default the primary key is the same as the sorting key (which is specified by the `ORDER BY` clause). + Thus in most cases it is unnecessary to specify a separate `PRIMARY KEY` clause. + +- `SAMPLE BY` — An expression for sampling. + + If a sampling expression is used, the primary key must contain it. Example: + `SAMPLE BY intHash32(UserID) ORDER BY (CounterID, EventDate, intHash32(UserID))`. - `SETTINGS` — Additional parameters that control the behavior of the `MergeTree`: - `index_granularity` — The granularity of an index. The number of data rows between the "marks" of an index. By default, 8192. @@ -71,7 +79,7 @@ ENGINE MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDa In the example, we set partitioning by month. -We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. +We also set an expression for sampling as a hash by the user ID. This allows you to pseudorandomize the data in the table for each `CounterID` and `EventDate`. If, when selecting the data, you define a [SAMPLE](../../query_language/select.md#sample) clause, ClickHouse will return an evenly pseudorandom data sample for a subset of users. `index_granularity` could be omitted because 8192 is the default value. @@ -133,7 +141,7 @@ If the data query specifies: - `CounterID in ('a', 'h')`, the server reads the data in the ranges of marks `[0, 3)` and `[6, 8)`. - `CounterID IN ('a', 'h') AND Date = 3`, the server reads the data in the ranges of marks `[1, 3)` and `[7, 8)`. -- `Date = 3`, the server reads the data in the range of marks `[1, 10)`. +- `Date = 3`, the server reads the data in the range of marks `[1, 10]`. The examples above show that it is always more effective to use an index than a full scan. @@ -159,10 +167,32 @@ The number of columns in the primary key is not explicitly limited. Depending on - Provide additional logic when data parts merging in the [CollapsingMergeTree](collapsingmergetree.md#table_engine-collapsingmergetree) and [SummingMergeTree](summingmergetree.md) engines. - You may need many fields in the primary key even if they are not necessary for the previous steps. + In this case it makes sense to specify the *sorting key* that is different from the primary key. A long primary key will negatively affect the insert performance and memory consumption, but extra columns in the primary key do not affect ClickHouse performance during `SELECT` queries. + +### Choosing the Primary Key that differs from the Sorting Key + +It is possible to specify the primary key (the expression, values of which are written into the index file +for each mark) that is different from the sorting key (the expression for sorting the rows in data parts). +In this case the primary key expression tuple must be a prefix of the sorting key expression tuple. + +This feature is helpful when using the [SummingMergeTree](summingmergetree.md) and +[AggregatingMergeTree](aggregatingmergetree.md) table engines. In a common case when using these engines the +table has two types of columns: *dimensions* and *measures*. Typical queries aggregate values of measure +columns with arbitrary `GROUP BY` and filtering by dimensions. As SummingMergeTree and AggregatingMergeTree +aggregate rows with the same value of the sorting key, it is natural to add all dimensions to it. As a result +the key expression consists of a long list of columns and this list must be frequently updated with newly +added dimensions. + +In this case it makes sense to leave only a few columns in the primary key that will provide efficient +range scans and add the remaining dimension columns to the sorting key tuple. + +[ALTER of the sorting key](../../query_language/alter.md) is a +lightweight operation because when a new column is simultaneously added to the table and to the sorting key +data parts need not be changed (they remain sorted by the new sorting key expression). + ### Use of Indexes and Partitions in Queries For`SELECT` queries, ClickHouse analyzes whether an index can be used. An index can be used if the `WHERE/PREWHERE` clause has an expression (as one of the conjunction elements, or entirely) that represents an equality or inequality comparison operation, or if it has `IN` or `LIKE` with a fixed prefix on columns or expressions that are in the primary key or partitioning key, or on certain partially repetitive functions of these columns, or logical relationships of these expressions. From c4472bfbe0904ef3386466b7066602fea5693112 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 20:04:08 +0300 Subject: [PATCH 122/297] docs fixes --- docs/en/operations/table_engines/summingmergetree.md | 2 +- docs/en/query_language/dicts/external_dicts.md | 2 +- docs/en/query_language/dicts/external_dicts_dict_layout.md | 2 +- docs/en/query_language/dicts/index.md | 2 +- docs/en/query_language/functions/array_functions.md | 2 +- docs/ru/operations/table_engines/summingmergetree.md | 2 +- docs/ru/query_language/dicts/external_dicts.md | 4 ++-- docs/ru/query_language/functions/array_functions.md | 2 +- docs/zh/operations/table_engines/summingmergetree.md | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/en/operations/table_engines/summingmergetree.md b/docs/en/operations/table_engines/summingmergetree.md index a6751998889..587613c33d7 100644 --- a/docs/en/operations/table_engines/summingmergetree.md +++ b/docs/en/operations/table_engines/summingmergetree.md @@ -90,7 +90,7 @@ SELECT key, sum(value) FROM summtt GROUP BY key When data are inserted into a table, they are saved as-is. Clickhouse merges the inserted parts of data periodically and this is when rows with the same primary key are summed and replaced with one for each resulting part of data. -ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md) and `GROUP BY` clause should be used in a query as described in the example above. +ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md#sum) and `GROUP BY` clause should be used in a query as described in the example above. ### Common rules for summation diff --git a/docs/en/query_language/dicts/external_dicts.md b/docs/en/query_language/dicts/external_dicts.md index 6b807289ed6..2c98ff18187 100644 --- a/docs/en/query_language/dicts/external_dicts.md +++ b/docs/en/query_language/dicts/external_dicts.md @@ -35,7 +35,7 @@ The dictionary config file has the following format: ``` -You can [configure](external_dicts_dict.md). +You can [configure](external_dicts_dict.md) any number of dictionaries in the same file. The file format is preserved even if there is only one dictionary (i.e. ` `). ->Вы можете преобразовывать значения по небольшому словарю, описав его в запросе `SELECT` (см. функцию [transform](../functions/other_functions.md)). Эта функциональность не связана с внешними словарями. +>можете преобразовывать значения по небольшому словарю, описав его в запросе `SELECT` (см. функцию [transform](../functions/other_functions.md)). Эта функциональность не связана с внешними словарями. Смотрите также: diff --git a/docs/ru/query_language/functions/array_functions.md b/docs/ru/query_language/functions/array_functions.md index c01ab568fba..af470725f3e 100644 --- a/docs/ru/query_language/functions/array_functions.md +++ b/docs/ru/query_language/functions/array_functions.md @@ -55,7 +55,7 @@ arrayConcat(arrays) **Параметры** -- `arrays` – произвольное количество элементов типа [Array][../../data_types/array.md +- `arrays` – произвольное количество элементов типа [Array](../../data_types/array.md) **Пример** ```sql diff --git a/docs/zh/operations/table_engines/summingmergetree.md b/docs/zh/operations/table_engines/summingmergetree.md index d7b4a1b812b..9b618b1eafd 100644 --- a/docs/zh/operations/table_engines/summingmergetree.md +++ b/docs/zh/operations/table_engines/summingmergetree.md @@ -90,7 +90,7 @@ SELECT key, sum(value) FROM summtt GROUP BY key When data are inserted into a table, they are saved as-is. Clickhouse merges the inserted parts of data periodically and this is when rows with the same primary key are summed and replaced with one for each resulting part of data. -ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md) and `GROUP BY` clause should be used in a query as described in the example above. +ClickHouse can merge the data parts so that different resulting parts of data cat consist rows with the same primary key, i.e. the summation will be incomplete. Therefore (`SELECT`) an aggregate function [sum()](../../query_language/agg_functions/reference.md#sum) and `GROUP BY` clause should be used in a query as described in the example above. ### Common rules for summation From 80be0286b0181d7544de3935b55dc43145d1bc60 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 20:06:26 +0300 Subject: [PATCH 123/297] NULL anchor --- docs/en/query_language/functions/functions_for_nulls.md | 4 ++-- docs/ru/query_language/dicts/index.md | 2 +- docs/ru/query_language/functions/functions_for_nulls.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/query_language/functions/functions_for_nulls.md b/docs/en/query_language/functions/functions_for_nulls.md index 67927dc879a..1cc0461233c 100644 --- a/docs/en/query_language/functions/functions_for_nulls.md +++ b/docs/en/query_language/functions/functions_for_nulls.md @@ -2,7 +2,7 @@ ## isNull -Checks whether the argument is [NULL](../syntax.md). +Checks whether the argument is [NULL](../syntax.md#null). ``` isNull(x) @@ -46,7 +46,7 @@ WHERE isNull(y) ## isNotNull -Checks whether the argument is [NULL](../syntax.md). +Checks whether the argument is [NULL](../syntax.md#null). ``` isNotNull(x) diff --git a/docs/ru/query_language/dicts/index.md b/docs/ru/query_language/dicts/index.md index 7ff6f6cbce4..c8816bb1fcf 100644 --- a/docs/ru/query_language/dicts/index.md +++ b/docs/ru/query_language/dicts/index.md @@ -4,7 +4,7 @@ ClickHouse поддерживает специальные функции для работы со словарями, которые можно использовать в запросах. Проще и эффективнее использовать словари с помощью функций, чем `JOIN` с таблицами-справочниками. -В словаре нельзя хранить значения [NULL](../syntax.md). +В словаре нельзя хранить значения [NULL](../syntax.md#null). ClickHouse поддерживает: diff --git a/docs/ru/query_language/functions/functions_for_nulls.md b/docs/ru/query_language/functions/functions_for_nulls.md index 6eb716294a8..9899fa8c786 100644 --- a/docs/ru/query_language/functions/functions_for_nulls.md +++ b/docs/ru/query_language/functions/functions_for_nulls.md @@ -2,7 +2,7 @@ ## isNull -Проверяет является ли аргумент [NULL](../syntax.md). +Проверяет является ли аргумент [NULL](../syntax.md#null). ``` isNull(x) @@ -46,7 +46,7 @@ WHERE isNull(y) ## isNotNull -Проверяет не является ли аргумент [NULL](../syntax.md). +Проверяет не является ли аргумент [NULL](../syntax.md#null). ``` isNotNull(x) From d09210f9be5cb9543fb3aefbba1275d000fab0a1 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 20:08:24 +0300 Subject: [PATCH 124/297] update urllib3 dependency --- docs/tools/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/requirements.txt b/docs/tools/requirements.txt index 879c697e67d..94a2feaed6c 100644 --- a/docs/tools/requirements.txt +++ b/docs/tools/requirements.txt @@ -28,4 +28,4 @@ sphinxcontrib-websupport==1.0.1 tornado==5.1 typing==3.6.2 Unidecode==1.0.23 -urllib3==1.22 +urllib3==1.23 From f3321719eb5b7424a686716d946bc0f58108d8eb Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 12 Dec 2018 20:23:10 +0300 Subject: [PATCH 125/297] more fixes --- docs/en/query_language/functions/functions_for_nulls.md | 3 ++- docs/en/query_language/operators.md | 2 +- docs/ru/operations/utils/index.md | 1 + docs/ru/query_language/dicts/external_dicts_dict.md | 8 ++++++-- docs/ru/query_language/functions/geo.md | 1 + docs/ru/query_language/functions/in_functions.md | 2 +- docs/ru/query_language/operators.md | 2 +- .../mkdocs-material-theme/assets/javascripts/modernizr.js | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/en/query_language/functions/functions_for_nulls.md b/docs/en/query_language/functions/functions_for_nulls.md index 1cc0461233c..dcbc745066a 100644 --- a/docs/en/query_language/functions/functions_for_nulls.md +++ b/docs/en/query_language/functions/functions_for_nulls.md @@ -207,7 +207,8 @@ SELECT nullIf(1, 2) ## assumeNotNull -Results in a value of type [Nullable](../../data_types/nullable.md +Results in a value of type [Nullable](../../data_types/nullable.md)i for a non- `Nullable`, if the value is not `NULL`. + ``` assumeNotNull(x) ``` diff --git a/docs/en/query_language/operators.md b/docs/en/query_language/operators.md index fbe4c3ace26..70312613ba1 100644 --- a/docs/en/query_language/operators.md +++ b/docs/en/query_language/operators.md @@ -53,7 +53,7 @@ Groups of operators are listed in order of priority (the higher it is in the lis ## Operators for Working With Data Sets -*See the section [IN operators](select.md/).* +*See the section [IN operators](select.md#in-operators).* `a IN ...` – The `in(a, b) function` diff --git a/docs/ru/operations/utils/index.md b/docs/ru/operations/utils/index.md index 06193cadcc4..3e71f2a3d28 100644 --- a/docs/ru/operations/utils/index.md +++ b/docs/ru/operations/utils/index.md @@ -1,5 +1,6 @@ # Утилиты ClickHouse * [clickhouse-local](clickhouse-local.md* [clickhouse-copier](clickhouse-copier.md) данные с одного кластера на другой. +* [clickhouse-copier](clickhouse-copier.md#utils-clickhouse-copier) - копирует (и перешардирует) данные с одного кластера на другой. [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/utils/) diff --git a/docs/ru/query_language/dicts/external_dicts_dict.md b/docs/ru/query_language/dicts/external_dicts_dict.md index 0aeb2d0ed6c..aa4d8a3a78d 100644 --- a/docs/ru/query_language/dicts/external_dicts_dict.md +++ b/docs/ru/query_language/dicts/external_dicts_dict.md @@ -26,6 +26,10 @@ ``` -- name - Идентификатор, под которым словарь будет доступен для использования. Используйте символы `[a-zA-Z0-9_\-]`. -- [source](external_dicts_dict_sources.md- [layout](external_dicts_dict_layout.md- [structure](external_dicts_dict_structure.md- [lifetime](external_dicts_dict_lifetime.md +- name - Идентификатор, под которым словарь будет доступен для использования. Используйте символы `[a-zA-Z0-9_\-]`. +- [source](external_dicts_dict_sources.md) - Источник словаря. +- [layout](external_dicts_dict_layout.md) - Размещение словаря в памяти. +- [structure](external_dicts_dict_structure.md) - Структура словаря. Ключ и атрибуты, которые можно получить по ключу. +- [lifetime](external_dicts_dict_lifetime.md) - Периодичность обновления словарей. + [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/external_dicts_dict/) diff --git a/docs/ru/query_language/functions/geo.md b/docs/ru/query_language/functions/geo.md index 53ae2e13fab..4423a167e2e 100644 --- a/docs/ru/query_language/functions/geo.md +++ b/docs/ru/query_language/functions/geo.md @@ -79,6 +79,7 @@ pointInPolygon((x, y), [(a, b), (c, d) ...], ...) **Входные значения** - `(x, y)` — координаты точки на плоскости. Тип данных — [Tuple](../../data_types/tuple.md- `[(a, b), (c, d) ...]` — вершины многоугольника. Тип данных — [Array](../../data_types/array.md). Каждая вершина представлена парой координат `(a, b)`. Вершины следует указывать в порядке обхода по или против часовой стрелки. Минимальное количество вершин — 3. Многоугольник должен быть константным. +- `[(a, b), (c, d) ...]` — вершины многоугольника. Тип данных — [Array](../../data_types/array.md). Каждая вершина представлена парой координат `(a, b)`. Вершины следует указывать в порядке обхода по или против часовой стрелки. Минимальное количество вершин — 3. Многоугольник должен быть константным. - функция поддерживает также многоугольники с дырками (вырезанными кусками). Для этого случая, добавьте многоугольники, описывающие вырезанные куски, дополнительными аргументами функции. Функция не поддерживает неодносвязные многоугольники. **Возвращаемые значения** diff --git a/docs/ru/query_language/functions/in_functions.md b/docs/ru/query_language/functions/in_functions.md index 44934ea0024..0663f5252e9 100644 --- a/docs/ru/query_language/functions/in_functions.md +++ b/docs/ru/query_language/functions/in_functions.md @@ -1,7 +1,7 @@ # Функции для реализации оператора IN. ## in, notIn, globalIn, globalNotIn -Смотрите раздел [Операторы IN](../select.md/). +Смотрите раздел [Операторы IN](../select.md#operatori-in). ## tuple(x, y, ...), оператор (x, y, ...) Функция, позволяющая сгруппировать несколько столбцов. diff --git a/docs/ru/query_language/operators.md b/docs/ru/query_language/operators.md index b3e9da24a31..21888259332 100644 --- a/docs/ru/query_language/operators.md +++ b/docs/ru/query_language/operators.md @@ -53,7 +53,7 @@ ## Операторы для работы с множествами -*Смотрите раздел [Операторы IN](select.md/).* +*Смотрите раздел [Операторы IN](select.md#operatori-in).* `a IN ...` - функция `in(a, b)` diff --git a/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js b/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js index 09d8976825b..847a8a3de8c 100644 --- a/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js +++ b/docs/tools/mkdocs-material-theme/assets/javascripts/modernizr.js @@ -81,7 +81,7 @@ __webpack_require__(5); ;(function(window){ /*! modernizr 3.5.0 (Custom Build) | MIT * * https://modernizr.com/download/?-checked-csstransforms3d-dataset-details-fetch-json-svg-target-addtest-setclasses !*/ -!function(e,t,n){function r(e,t){return typeof e===t}function i(){var e,t,n,i,o,s,a;for(var l in w)if(w.hasOwnProperty(l)){if(e=[],t=w[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nd;d++)if(m=e[d],g=E.style[m],f(m,"-")&&(m=h(m)),E.style[m]!==n){if(o||r(i,"undefined"))return s(),"pfx"==t?m:!0;try{E.style[m]=i}catch(y){}if(E.style[m]!=g)return s(),"pfx"==t?m:!0}return s(),!1}function g(e,t){return function(){return e.apply(t,arguments)}}function v(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?g(i,n||t):i);return!1}function y(e,t,n,i,o){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+P.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?m(a,t,i,o):(a=(e+" "+A.join(s+" ")+s).split(" "),v(a,t,n))}function S(e,t,r){return y(e,n,n,t,r)}var w=[],C={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){w.push({name:e,fn:t,options:n})},addAsyncTest:function(e){w.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr;var _,b=[],x=t.documentElement,T="svg"===x.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;_=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),C._l={},C.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},C._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;ed;d++)if(m=e[d],g=E.style[m],f(m,"-")&&(m=h(m)),E.style[m]!==n){if(o||r(i,"undefined"))return s(),"pfx"==t?m:!0;try{E.style[m]=i}catch(y){}if(E.style[m]!=g)return s(),"pfx"==t?m:!0}return s(),!1}function g(e,t){return function(){return e.apply(t,arguments)}}function v(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?g(i,n||t):i);return!1}function y(e,t,n,i,o){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+P.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?m(a,t,i,o):(a=(e+" "+A.join(s+" ")+s).split(" "),v(a,t,n))}function S(e,t,r){return y(e,n,n,t,r)}var w=[],C={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){w.push({name:e,fn:t,options:n})},addAsyncTest:function(e){w.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=C,Modernizr=new Modernizr;var _,b=[],x=t.documentElement,T="svg"===x.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;_=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),C._l={},C.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},C._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e Date: Wed, 12 Dec 2018 22:46:48 +0300 Subject: [PATCH 126/297] Remove excessive content from print version --- .../mkdocs-material-theme/assets/stylesheets/custom.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css index 51bbaf1727b..140b9a36d6e 100644 --- a/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css +++ b/docs/tools/mkdocs-material-theme/assets/stylesheets/custom.css @@ -169,3 +169,9 @@ h1, h2, h3, .md-logo { .headerlink:hover { text-decoration: none; } + +@media print { + .md-typeset a:after { + content: "" !important; + } +} From f5421b7c2db501ee723020b34b795a675805f677 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 13 Dec 2018 16:27:15 +0300 Subject: [PATCH 127/297] Try short license again --- LICENSE | 190 +------------------------------------------------------- 1 file changed, 1 insertion(+), 189 deletions(-) diff --git a/LICENSE b/LICENSE index 1460730b3ed..75d3bda7798 100644 --- a/LICENSE +++ b/LICENSE @@ -1,192 +1,4 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2018 Yandex LLC +Copyright 2016-2018 YANDEX LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 28544bdb905cd1135bc04a13638057cd1688e559 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 14 Dec 2018 11:34:56 +0300 Subject: [PATCH 128/297] Back to long license for now --- LICENSE | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 189 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 75d3bda7798..1460730b3ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,192 @@ -Copyright 2016-2018 YANDEX LLC + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2018 Yandex LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 2da56ac5689346ec25b5fc8971ea6debf7f031e2 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 14 Dec 2018 16:11:11 +0300 Subject: [PATCH 129/297] Introduce anchor integrity checks for single-page docs --- docs/tools/build.py | 15 ++++++++++++ docs/tools/requirements.txt | 1 + docs/tools/test.py | 46 +++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100755 docs/tools/test.py diff --git a/docs/tools/build.py b/docs/tools/build.py index 9b5ccf1fae3..c3dc329401a 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -22,6 +22,7 @@ from mkdocs.commands import build as mkdocs_build from concatenate import concatenate import mdx_clickhouse +import test @contextlib.contextmanager def temp_dir(): @@ -183,6 +184,20 @@ def build_single_page_version(lang, args, cfg): logging.debug(' '.join(create_pdf_command)) subprocess.check_call(' '.join(create_pdf_command), shell=True) + with temp_dir() as test_dir: + cfg.load_dict({ + 'docs_dir': docs_temp_lang, + 'site_dir': test_dir, + 'extra': { + 'single_page': False + }, + 'nav': [ + {cfg.data.get('site_name'): 'single.md'} + ] + }) + mkdocs_build.build(cfg) + test.test_single_page(os.path.join(test_dir, 'single', 'index.html'), lang) + def build_redirects(args): lang_re_fragment = args.lang.replace(',', '|') diff --git a/docs/tools/requirements.txt b/docs/tools/requirements.txt index 94a2feaed6c..e8680473939 100644 --- a/docs/tools/requirements.txt +++ b/docs/tools/requirements.txt @@ -1,6 +1,7 @@ alabaster==0.7.10 Babel==2.5.1 backports-abc==0.5 +beautifulsoup4==4.6.3 certifi==2017.11.5 chardet==3.0.4 click==6.7 diff --git a/docs/tools/test.py b/docs/tools/test.py new file mode 100755 index 00000000000..366f3532e88 --- /dev/null +++ b/docs/tools/test.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +import logging +import sys + +import bs4 + +def test_single_page(input_path, lang): + with open(input_path) as f: + soup = bs4.BeautifulSoup( + f, + features='html.parser' + ) + anchor_points = set() + duplicate_anchor_points = 0 + links_to_nowhere = 0 + for tag in soup.find_all(): + for anchor_point in [tag.attrs.get('name'), tag.attrs.get('id')]: + if anchor_point: + if anchor_point in anchor_points: + duplicate_anchor_points += 1 + logging.info('Duplicate anchor point: %s' % anchor_point) + else: + anchor_points.add(anchor_point) + for tag in soup.find_all(): + href = tag.attrs.get('href') + if href and href.startswith('#'): + if href[1:] not in anchor_points: + links_to_nowhere += 1 + logging.info('Link to nowhere: %s' % href) + + if duplicate_anchor_points: + logging.error('Found %d duplicate anchor points' % duplicate_anchor_points) + if links_to_nowhere: + logging.error('Found %d links to nowhere' % links_to_nowhere) + + assert len(anchor_points) > 10, 'Html parsing is probably broken' + + +if __name__ == '__main__': + logging.basicConfig( + level=logging.DEBUG, + stream=sys.stderr + ) + test_single_page(sys.argv[1], sys.argv[2]) From 68e4baf3b6491765b286ab86d568daa03461d49c Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 12:26:25 +0300 Subject: [PATCH 130/297] Add --save-raw-single-page option to build.py (helps to debug incorrect anchors) --- docs/tools/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/tools/build.py b/docs/tools/build.py index c3dc329401a..73676f0f30c 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -197,6 +197,8 @@ def build_single_page_version(lang, args, cfg): }) mkdocs_build.build(cfg) test.test_single_page(os.path.join(test_dir, 'single', 'index.html'), lang) + if args.save_raw_single_page: + shutil.copytree(test_dir, args.save_raw_single_page) def build_redirects(args): @@ -227,6 +229,7 @@ if __name__ == '__main__': arg_parser.add_argument('--theme-dir', default='mkdocs-material-theme') arg_parser.add_argument('--output-dir', default='build') arg_parser.add_argument('--skip-single-page', action='store_true') + arg_parser.add_argument('--save-raw-single-page', type=str) arg_parser.add_argument('--verbose', action='store_true') args = arg_parser.parse_args() From 014fd84ca4ba63bdab15b6b41dbdf4dae20005f0 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 12:29:45 +0300 Subject: [PATCH 131/297] fix kafka engine links --- CHANGELOG.md | 2 +- CHANGELOG_RU.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d88a6291b64..b9e23d6ea71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -926,7 +926,7 @@ This release contains bug fixes for the previous release 1.1.54310: ### New features: * Custom partitioning key for the MergeTree family of table engines. -* [ Kafka](https://clickhouse.yandex/docs/en/single/index.html#document-table_engines/kafka) table engine. +* [Kafka](https://clickhouse.yandex/docs/en/operations/table_engines/kafka/) table engine. * Added support for loading [CatBoost](https://catboost.yandex/) models and applying them to data stored in ClickHouse. * Added support for time zones with non-integer offsets from UTC. * Added support for arithmetic operations with time intervals. diff --git a/CHANGELOG_RU.md b/CHANGELOG_RU.md index a0fa9e3d337..32f0ca1dc06 100644 --- a/CHANGELOG_RU.md +++ b/CHANGELOG_RU.md @@ -897,7 +897,7 @@ ### Новые возможности: * Произвольный ключ партиционирования для таблиц семейства MergeTree. -* Движок таблиц [Kafka](https://clickhouse.yandex/docs/en/single/index.html#document-table_engines/kafka). +* Движок таблиц [Kafka](https://clickhouse.yandex/docs/en/operations/table_engines/kafka/). * Возможность загружать модели [CatBoost](https://catboost.yandex/) и применять их к данным, хранящимся в ClickHouse. * Поддержка часовых поясов с нецелым смещением от UTC. * Поддержка операций с временными интервалами. From 8f0b9b6022fd1224cf58b0854735e3006a2adc76 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 12:36:57 +0300 Subject: [PATCH 132/297] fix one class of broken anchors --- docs/tools/mdx_clickhouse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index aa6037bcab7..68bbb2c2f39 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -22,8 +22,9 @@ class ClickHouseLinkMixin(object): if el is not None: href = el.get('href') or '' is_external = href.startswith('http:') or href.startswith('https:') - if is_external and not href.startswith('https://clickhouse.yandex'): - el.set('rel', 'external nofollow') + if is_external: + if not href.startswith('https://clickhouse.yandex'): + el.set('rel', 'external nofollow') elif single_page: if '#' in href: el.set('href', '#' + href.split('#', 1)[1]) From 9f2111259ff181011ddcc4fecae76aade193412b Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 12:46:38 +0300 Subject: [PATCH 133/297] fix some broken links --- docs/en/operations/server_settings/settings.md | 4 ++-- docs/en/operations/table_engines/url.md | 2 +- docs/en/operations/utils/clickhouse-local.md | 2 +- docs/ru/operations/server_settings/settings.md | 2 +- docs/zh/operations/server_settings/settings.md | 2 +- docs/zh/operations/table_engines/url.md | 2 +- docs/zh/operations/utils/clickhouse-local.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index cf9191377e6..4275b5514c0 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -74,7 +74,7 @@ To get a list of databases, use the [SHOW DATABASES](../../query_language/misc.m Default settings profile. -Settings profiles are located in the file specified in the parameter [user_config](#user-config). +Settings profiles are located in the file specified in the parameter `user_config`. **Example** @@ -196,7 +196,7 @@ For more details, see [GraphiteMergeTree](../../operations/table_engines/graphit The port for connecting to the server over HTTP(s). -If `https_port` is specified, [openSSL]() must be configured. +If `https_port` is specified, [openSSL](#openssl) must be configured. If `http_port` is specified, the openSSL configuration is ignored even if it is set. diff --git a/docs/en/operations/table_engines/url.md b/docs/en/operations/table_engines/url.md index 54d742e409a..ded469798f4 100644 --- a/docs/en/operations/table_engines/url.md +++ b/docs/en/operations/table_engines/url.md @@ -3,7 +3,7 @@ # URL(URL, Format) Manages data on a remote HTTP/HTTPS server. This engine is similar -to the [`File`](./file.md#) engine. +to the [File](./file.md) engine. ## Using the engine in the ClickHouse server diff --git a/docs/en/operations/utils/clickhouse-local.md b/docs/en/operations/utils/clickhouse-local.md index 89c719531c1..e91d1eda2d7 100644 --- a/docs/en/operations/utils/clickhouse-local.md +++ b/docs/en/operations/utils/clickhouse-local.md @@ -3,7 +3,7 @@ The `clickhouse-local` program enables you to perform fast processing on local files, without having to deploy and configure the ClickHouse server. -Accepts data that represent tables and queries them using [ClickHouse SQL dialect](../../query_language/index.md#queries). +Accepts data that represent tables and queries them using [ClickHouse SQL dialect](../../query_language/index.md). `clickhouse-local` uses the same core as ClickHouse server, so it supports most of the features and the same set of formats and table engines. diff --git a/docs/ru/operations/server_settings/settings.md b/docs/ru/operations/server_settings/settings.md index 370d8c4fd76..b7e9095ebac 100644 --- a/docs/ru/operations/server_settings/settings.md +++ b/docs/ru/operations/server_settings/settings.md @@ -74,7 +74,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat Профиль настроек по умолчанию. -Профили настроек находятся в файле, указанном в параметре [user_config](#user-config). +Профили настроек находятся в файле, указанном в параметре `user_config`. **Пример** diff --git a/docs/zh/operations/server_settings/settings.md b/docs/zh/operations/server_settings/settings.md index b43db1f85b2..6e1e5e44e59 100644 --- a/docs/zh/operations/server_settings/settings.md +++ b/docs/zh/operations/server_settings/settings.md @@ -74,7 +74,7 @@ To get a list of databases, use the [SHOW DATABASES](../../query_language/misc.m Default settings profile. -Settings profiles are located in the file specified in the parameter [user_config](#user-config). +Settings profiles are located in the file specified in the parameter `user_config`. **Example** diff --git a/docs/zh/operations/table_engines/url.md b/docs/zh/operations/table_engines/url.md index 54d742e409a..77e690c4de5 100644 --- a/docs/zh/operations/table_engines/url.md +++ b/docs/zh/operations/table_engines/url.md @@ -3,7 +3,7 @@ # URL(URL, Format) Manages data on a remote HTTP/HTTPS server. This engine is similar -to the [`File`](./file.md#) engine. +to the [File](file.md) engine. ## Using the engine in the ClickHouse server diff --git a/docs/zh/operations/utils/clickhouse-local.md b/docs/zh/operations/utils/clickhouse-local.md index 89c719531c1..e91d1eda2d7 100644 --- a/docs/zh/operations/utils/clickhouse-local.md +++ b/docs/zh/operations/utils/clickhouse-local.md @@ -3,7 +3,7 @@ The `clickhouse-local` program enables you to perform fast processing on local files, without having to deploy and configure the ClickHouse server. -Accepts data that represent tables and queries them using [ClickHouse SQL dialect](../../query_language/index.md#queries). +Accepts data that represent tables and queries them using [ClickHouse SQL dialect](../../query_language/index.md). `clickhouse-local` uses the same core as ClickHouse server, so it supports most of the features and the same set of formats and table engines. From 3c18683f024cf6429fc7f03926b2541d2eba5e28 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 13:01:54 +0300 Subject: [PATCH 134/297] Add https://github.com/hatarist/clickhouse-cli to third-party section (in gui.md for now, maybe will add cli.md later) --- docs/en/interfaces/third-party/gui.md | 10 ++++++++++ docs/fa/interfaces/third-party/gui.md | 10 ++++++++++ docs/ru/interfaces/third-party/gui.md | 14 ++++++++++++-- docs/tools/concatenate.py | 2 +- docs/zh/interfaces/third-party/gui.md | 10 ++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/docs/en/interfaces/third-party/gui.md b/docs/en/interfaces/third-party/gui.md index 82228039b21..727d1ba7270 100644 --- a/docs/en/interfaces/third-party/gui.md +++ b/docs/en/interfaces/third-party/gui.md @@ -48,6 +48,16 @@ Features: - Table preview with filtering and sorting. - Read-only queries execution. +### clickhouse-cli + +[clickhouse-cli](https://github.com/hatarist/clickhouse-cli) is an alternative command line client for ClickHouse, written in Python 3. + +Features: +- Autocompletion. +- Syntax highlighting for the queries and data output. +- Pager support for the data output. +- Custom PostgreSQL-like commands. + ## Commercial ### DBeaver diff --git a/docs/fa/interfaces/third-party/gui.md b/docs/fa/interfaces/third-party/gui.md index d49457d18a6..bb9dcbe9c07 100644 --- a/docs/fa/interfaces/third-party/gui.md +++ b/docs/fa/interfaces/third-party/gui.md @@ -49,6 +49,16 @@ interface تحت وب برای ClickHouse در پروژه [Tabix](https://github - پیش نمایش جدول با فیلتر کردن و مرتب سازی. - اعداد نمایش داده شده فقط خواندنی +### clickhouse-cli + +[clickhouse-cli](https://github.com/hatarist/clickhouse-cli) یک مشتری خط فرمان برای ClickHouse است که در پایتون 3 نوشته شده است. + +امکانات: +- تکمیل خودکار +- نحو برجسته برای نمایش داده ها و خروجی داده ها. +- پشتیبانی از Pager برای خروجی داده. +- دستورات پست سفارشی مانند PostgreSQL. + ## تجاری ### DBeaver diff --git a/docs/ru/interfaces/third-party/gui.md b/docs/ru/interfaces/third-party/gui.md index 21b1d93b926..9eddc4461f0 100644 --- a/docs/ru/interfaces/third-party/gui.md +++ b/docs/ru/interfaces/third-party/gui.md @@ -47,10 +47,20 @@ Основные возможности: -- Список таблиц с фильтрацией и метаданными. -- Предварительный просмотр таблицы с фильтрацией и сортировкой. +- Список таблиц с фильтрацией и метаданными; +- Предварительный просмотр таблицы с фильтрацией и сортировкой; - Выполнение запросов только для чтения. +### clickhouse-cli + +[clickhouse-cli](https://github.com/hatarist/clickhouse-cli) - это альтернативный клиент командной строки для ClickHouse, написанный на Python 3. + +Основные возможности: +- Автодополнение; +- Подсветка синтаксиса для запросов и вывода данных; +- Поддержка постраничного просмотра для результирующих данных; +- Дополнительные PostgreSQL-подобные команды. + ## Коммерческие ### DBeaver diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index c0c438ce193..9717b8a64e9 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -48,7 +48,7 @@ def concatenate(lang, docs_path, single_page_file): for prefix in prefixes: single_page_file.write('\n' % (prefix + tmp_path)) tmp_path = tmp_path.replace(part, '..') - + for l in f: if l.startswith('#'): l = '#' + l diff --git a/docs/zh/interfaces/third-party/gui.md b/docs/zh/interfaces/third-party/gui.md index 8f873bbe535..e2f4a50d336 100644 --- a/docs/zh/interfaces/third-party/gui.md +++ b/docs/zh/interfaces/third-party/gui.md @@ -48,6 +48,16 @@ ClickHouse Web 界面 [Tabix](https://github.com/tabixio/tabix). - 带有过滤和排序的表格预览。 - 只读查询执行。 +### clickhouse-cli + +[clickhouse-cli](https://github.com/hatarist/clickhouse-cli)是ClickHouse的替代命令行客户端,用Python 3编写。 + +特征: + - 自动完成。 + - 查询和数据输出的语法高亮显示。 + - 寻呼机支持数据输出。 + - 自定义PostgreSQL类命令。 + ## 商业 ### DBeaver From 380d595a9691760741f881a530b31b833b9496eb Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 13:29:44 +0300 Subject: [PATCH 135/297] fix one more class of links to nowhere --- docs/tools/concatenate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index 9717b8a64e9..b6179a6b904 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -42,6 +42,7 @@ def concatenate(lang, docs_path, single_page_file): prefixes = ['', '../', '../../', '../../../'] parts = tmp_path.split('/') single_page_file.write('\n' % parts[-2]) + single_page_file.write('\n' % '/'.join(parts[1:])) single_page_file.write('\n\n') for part in parts[0:-2]: From 66c72a35ef25b4325919322f4bd9ea7737b0e4f4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 14:08:03 +0300 Subject: [PATCH 136/297] less duplicate anchors --- docs/tools/concatenate.py | 15 ++++++++++----- docs/tools/mdx_clickhouse.py | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index b6179a6b904..b57f72c8bb1 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -38,18 +38,23 @@ def concatenate(lang, docs_path, single_page_file): for path in files_to_concatenate: with open(os.path.join(lang_path, path)) as f: - tmp_path = path.replace('.md', '/') + anchors = set() + tmp_path = path.replace('/index.md', '/').replace('.md', '/') prefixes = ['', '../', '../../', '../../../'] parts = tmp_path.split('/') - single_page_file.write('\n' % parts[-2]) - single_page_file.write('\n' % '/'.join(parts[1:])) - single_page_file.write('\n\n') + anchors.add(parts[-2] + '/') + anchors.add('/'.join(parts[1:])) for part in parts[0:-2]: for prefix in prefixes: - single_page_file.write('\n' % (prefix + tmp_path)) + anchors.add(prefix + tmp_path) tmp_path = tmp_path.replace(part, '..') + for anchor in anchors: + single_page_file.write('\n' % anchor) + + single_page_file.write('\n\n') + for l in f: if l.startswith('#'): l = '#' + l diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index 68bbb2c2f39..8f72d4eec2f 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -29,7 +29,7 @@ class ClickHouseLinkMixin(object): if '#' in href: el.set('href', '#' + href.split('#', 1)[1]) else: - el.set('href', '#' + href.replace('.md', '/')) + el.set('href', '#' + href.replace('/index.md', '/').replace('.md', '/')) return el From 543316127a6736854a97cd248976a7bf54fe9b0f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 14:21:34 +0300 Subject: [PATCH 137/297] get rid of weird anchors --- docs/tools/concatenate.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/tools/concatenate.py b/docs/tools/concatenate.py index b57f72c8bb1..b916579d1cc 100755 --- a/docs/tools/concatenate.py +++ b/docs/tools/concatenate.py @@ -18,9 +18,9 @@ import os def concatenate(lang, docs_path, single_page_file): - proj_config = os.path.join(docs_path, 'toc_%s.yml' % lang) lang_path = os.path.join(docs_path, lang) + az_re = re.compile(r'[a-z]') with open(proj_config) as cfg_file: files_to_concatenate = [] @@ -45,13 +45,18 @@ def concatenate(lang, docs_path, single_page_file): anchors.add(parts[-2] + '/') anchors.add('/'.join(parts[1:])) - for part in parts[0:-2]: + for part in parts[0:-2] if len(parts) > 2 else parts: for prefix in prefixes: - anchors.add(prefix + tmp_path) + anchor = prefix + tmp_path + if anchor: + anchors.add(anchor) + anchors.add('../' + anchor) + anchors.add('../../' + anchor) tmp_path = tmp_path.replace(part, '..') for anchor in anchors: - single_page_file.write('\n' % anchor) + if re.search(az_re, anchor): + single_page_file.write('\n' % anchor) single_page_file.write('\n\n') From 4b81a12c66773f9ad36b5a5c933c6d234647d9fe Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 14:23:35 +0300 Subject: [PATCH 138/297] fix anchor --- docs/en/operations/access_rights.md | 2 +- docs/ru/operations/access_rights.md | 2 +- docs/zh/operations/access_rights.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/operations/access_rights.md b/docs/en/operations/access_rights.md index 92c040283ec..4764dead9fe 100644 --- a/docs/en/operations/access_rights.md +++ b/docs/en/operations/access_rights.md @@ -96,7 +96,7 @@ Access to the `system` database is always allowed (since this database is used f The user can get a list of all databases and tables in them by using `SHOW` queries or system tables, even if access to individual databases isn't allowed. -Database access is not related to the [readonly](settings/query_complexity.md#query_complexity_readonly) setting. You can't grant full access to one database and `readonly` access to another one. +Database access is not related to the [readonly](settings/query_complexity.md#readonly) setting. You can't grant full access to one database and `readonly` access to another one. [Original article](https://clickhouse.yandex/docs/en/operations/access_rights/) diff --git a/docs/ru/operations/access_rights.md b/docs/ru/operations/access_rights.md index 9c347126084..e9a8160ae5c 100644 --- a/docs/ru/operations/access_rights.md +++ b/docs/ru/operations/access_rights.md @@ -96,6 +96,6 @@ Пользователь может получить список всех БД и таблиц в них с помощью запросов `SHOW` или системных таблиц, даже если у него нет доступа к отдельным БД. -Доступ к БД не связан с настройкой [readonly](settings/query_complexity.md#query_complexity_readonly). Невозможно дать полный доступ к одной БД и `readonly` к другой. +Доступ к БД не связан с настройкой [readonly](settings/query_complexity.md#readonly). Невозможно дать полный доступ к одной БД и `readonly` к другой. [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/access_rights/) diff --git a/docs/zh/operations/access_rights.md b/docs/zh/operations/access_rights.md index f68cfd5078a..c72a131b173 100644 --- a/docs/zh/operations/access_rights.md +++ b/docs/zh/operations/access_rights.md @@ -96,7 +96,7 @@ Access to the `system` database is always allowed (since this database is used f The user can get a list of all databases and tables in them by using `SHOW` queries or system tables, even if access to individual databases isn't allowed. -Database access is not related to the [readonly](settings/query_complexity.md#query_complexity_readonly) setting. You can't grant full access to one database and `readonly` access to another one. +Database access is not related to the [readonly](settings/query_complexity.md#readonly) setting. You can't grant full access to one database and `readonly` access to another one. [Original article](https://clickhouse.yandex/docs/en/operations/access_rights/) From 37cd3a81aa5b0621b2c14e6e6683f727abb98e72 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 14:27:22 +0300 Subject: [PATCH 139/297] fix link --- docs/en/operations/table_engines/url.md | 2 +- docs/ru/operations/table_engines/url.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/operations/table_engines/url.md b/docs/en/operations/table_engines/url.md index ded469798f4..77e690c4de5 100644 --- a/docs/en/operations/table_engines/url.md +++ b/docs/en/operations/table_engines/url.md @@ -3,7 +3,7 @@ # URL(URL, Format) Manages data on a remote HTTP/HTTPS server. This engine is similar -to the [File](./file.md) engine. +to the [File](file.md) engine. ## Using the engine in the ClickHouse server diff --git a/docs/ru/operations/table_engines/url.md b/docs/ru/operations/table_engines/url.md index a4a0d511e8a..35d9a5170b3 100644 --- a/docs/ru/operations/table_engines/url.md +++ b/docs/ru/operations/table_engines/url.md @@ -3,7 +3,7 @@ # URL(URL, Format) Управляет данными на удаленном HTTP/HTTPS сервере. Данный движок похож -на движок [`File`](./file.md#). +на движок [File](file.md). ## Использование движка в сервере ClickHouse From c09f5cf4786c2666398f260f9e7f3b06b98dd993 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 14:29:11 +0300 Subject: [PATCH 140/297] fix couple links --- docs/en/query_language/dicts/index.md | 4 ++-- docs/ru/query_language/dicts/index.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/query_language/dicts/index.md b/docs/en/query_language/dicts/index.md index f7eecddefd7..8b6988b0504 100644 --- a/docs/en/query_language/dicts/index.md +++ b/docs/en/query_language/dicts/index.md @@ -8,8 +8,8 @@ ClickHouse supports special functions for working with dictionaries that can be ClickHouse supports: -- [Built-in dictionaries](internal_dicts.md#internal_dicts) with a specific [set of functions](../functions/ym_dict_functions.md#ym_dict_functions). -- [Plug-in (external) dictionaries](external_dicts.md) with a [set of functions](../functions/ext_dict_functions.md#ext_dict_functions). +- [Built-in dictionaries](internal_dicts.md#internal_dicts) with a specific [set of functions](../functions/ym_dict_functions.md). +- [Plug-in (external) dictionaries](external_dicts.md) with a [set of functions](../functions/ext_dict_functions.md). [Original article](https://clickhouse.yandex/docs/en/query_language/dicts/) diff --git a/docs/ru/query_language/dicts/index.md b/docs/ru/query_language/dicts/index.md index c8816bb1fcf..3820a0d49c9 100644 --- a/docs/ru/query_language/dicts/index.md +++ b/docs/ru/query_language/dicts/index.md @@ -8,7 +8,7 @@ ClickHouse поддерживает специальные функции для ClickHouse поддерживает: -- [Встроенные словари](internal_dicts.md#internal_dicts) со специфическим [набором функций](../functions/ym_dict_functions.md#ym_dict_functions). -- [Подключаемые (внешние) словари](external_dicts.md) с [набором функций](../functions/ext_dict_functions.md#ext_dict_functions). +- [Встроенные словари](internal_dicts.md#internal_dicts) со специфическим [набором функций](../functions/ym_dict_functions.md). +- [Подключаемые (внешние) словари](external_dicts.md) с [набором функций](../functions/ext_dict_functions.md). [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/dicts/) From a4bbaf3c99acba723d602d5aad0d0ed6f5549d87 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 18 Dec 2018 17:50:03 +0300 Subject: [PATCH 141/297] rearrange integrations.md a bit + sync zh version --- docs/en/interfaces/third-party/integrations.md | 6 +++--- docs/fa/interfaces/third-party/integrations.md | 6 +++--- docs/ru/interfaces/third-party/integrations.md | 6 +++--- docs/zh/interfaces/third-party/integrations.md | 3 +++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md index 8d4714a178a..88041a2146a 100644 --- a/docs/en/interfaces/third-party/integrations.md +++ b/docs/en/interfaces/third-party/integrations.md @@ -19,6 +19,9 @@ - Object storages - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- Configuration management + - [puppet](https://puppet.com) + - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) - Monitoring - [Graphite](https://graphiteapp.org) - [graphouse](https://github.com/yandex/graphouse) @@ -31,9 +34,6 @@ - Logging - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (for [Kubernetes](https://kubernetes.io)) -- Configuration management - - [puppet](https://puppet.com) - - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) ## Programming Language Ecosystems diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index 88aa4e80935..8bd394a8c94 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -21,6 +21,9 @@ - فروشگاه شی - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- مدیریت تنظیمات + - [puppet](https://puppet.com) + - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) - نظارت بر - [Graphite](https://graphiteapp.org) - [graphouse](https://github.com/yandex/graphouse) @@ -33,9 +36,6 @@ - ثبت نام - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (برای [Kubernetes](https://kubernetes.io)) -- مدیریت تنظیمات - - [puppet](https://puppet.com) - - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) ## اکوسیستم زبان برنامه نویسی diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index d32fd2a888c..3221e734068 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -18,6 +18,9 @@ - Хранилища объектов - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- Системы управления конфигурацией + - [puppet](https://puppet.com) + - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) - Мониторинг - [Graphite](https://graphiteapp.org) - [graphouse](https://github.com/yandex/graphouse) @@ -30,9 +33,6 @@ - Логирование - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (для [Kubernetes](https://kubernetes.io)) -- Системы управления конфигурацией - - [puppet](https://puppet.com) - - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) ## Экосистемы вокруг языков программирования diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index f3a2e49bfa5..2ccdf25eded 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -18,6 +18,9 @@ - 对象存储 - [S3](https://en.wikipedia.org/wiki/Amazon_S3) - [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup) +- 配置管理 + - [puppet](https://puppet.com) + - [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse) - 监控 - [Graphite](https://graphiteapp.org) - [graphouse](https://github.com/yandex/graphouse) From cac81f8e7d153a71da10fe3cccddaacd3c9ab073 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 20 Dec 2018 13:51:07 +0300 Subject: [PATCH 142/297] Mention nagios plugin in other languages --- docs/fa/interfaces/third-party/integrations.md | 2 ++ docs/ru/interfaces/third-party/integrations.md | 2 ++ docs/zh/interfaces/third-party/integrations.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index 8bd394a8c94..347951c8017 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -33,6 +33,8 @@ - [Prometheus](https://prometheus.io/) - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) - [PromHouse](https://github.com/Percona-Lab/PromHouse) + - [Nagios](https://www.nagios.org/) + - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - ثبت نام - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (برای [Kubernetes](https://kubernetes.io)) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index 3221e734068..cc11d88309f 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -30,6 +30,8 @@ - [Prometheus](https://prometheus.io/) - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) - [PromHouse](https://github.com/Percona-Lab/PromHouse) + - [Nagios](https://www.nagios.org/) + - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - Логирование - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (для [Kubernetes](https://kubernetes.io)) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index 2ccdf25eded..6a9a8c45422 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -30,6 +30,8 @@ - [Prometheus](https://prometheus.io/) - [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter) - [PromHouse](https://github.com/Percona-Lab/PromHouse) + - [Nagios](https://www.nagios.org/) + - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - 记录 - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (对于 [Kubernetes](https://kubernetes.io)) From 703b089eeef38b0da6e77fbd9ff72f43d2a2c8e4 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 20 Dec 2018 13:52:41 +0300 Subject: [PATCH 143/297] port summingmergetree.md fix to zh --- docs/zh/operations/table_engines/summingmergetree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/operations/table_engines/summingmergetree.md b/docs/zh/operations/table_engines/summingmergetree.md index 9b618b1eafd..71af1be3149 100644 --- a/docs/zh/operations/table_engines/summingmergetree.md +++ b/docs/zh/operations/table_engines/summingmergetree.md @@ -13,7 +13,7 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1], name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2], ... -) ENGINE = MergeTree() +) ENGINE = SummingMergeTree() [PARTITION BY expr] [ORDER BY expr] [SAMPLE BY expr] From dff6edf52acb88d65de37ca320cc53d7f5350e94 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 21 Dec 2018 22:34:44 +0300 Subject: [PATCH 144/297] Make doc links to nowhere fatal --- docs/tools/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tools/test.py b/docs/tools/test.py index 366f3532e88..48e246507f4 100755 --- a/docs/tools/test.py +++ b/docs/tools/test.py @@ -34,6 +34,7 @@ def test_single_page(input_path, lang): logging.error('Found %d duplicate anchor points' % duplicate_anchor_points) if links_to_nowhere: logging.error('Found %d links to nowhere' % links_to_nowhere) + sys.exit(10) assert len(anchor_points) > 10, 'Html parsing is probably broken' From cdd7486175b51d6315967b2e0163e7ef0c4cedca Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 21 Dec 2018 22:35:15 +0300 Subject: [PATCH 145/297] additional check in markdown extension --- docs/tools/mdx_clickhouse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/tools/mdx_clickhouse.py b/docs/tools/mdx_clickhouse.py index 8f72d4eec2f..ae57d1309e6 100755 --- a/docs/tools/mdx_clickhouse.py +++ b/docs/tools/mdx_clickhouse.py @@ -43,9 +43,10 @@ class ClickHouseLinkPattern(ClickHouseLinkMixin, markdown.inlinepatterns.LinkPat class ClickHousePreprocessor(markdown.util.Processor): def run(self, lines): - for line in lines: - if '' not in line: - yield line + if os.getenv('QLOUD_TOKEN'): + for line in lines: + if '' not in line: + yield line class ClickHouseMarkdown(markdown.extensions.Extension): From c24278184eb02ebd2fcc39c6ca8bcf11e1de301b Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 21 Dec 2018 22:37:05 +0300 Subject: [PATCH 146/297] add option to skip pdf --- docs/tools/build.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/tools/build.py b/docs/tools/build.py index 73676f0f30c..e3c90f2b956 100755 --- a/docs/tools/build.py +++ b/docs/tools/build.py @@ -178,11 +178,12 @@ def build_single_page_version(lang, args, cfg): single_page_output_path ) - single_page_index_html = os.path.abspath(os.path.join(single_page_output_path, 'index.html')) - single_page_pdf = single_page_index_html.replace('index.html', 'clickhouse_%s.pdf' % lang) - create_pdf_command = ['wkhtmltopdf', '--print-media-type', single_page_index_html, single_page_pdf] - logging.debug(' '.join(create_pdf_command)) - subprocess.check_call(' '.join(create_pdf_command), shell=True) + if not args.skip_pdf: + single_page_index_html = os.path.abspath(os.path.join(single_page_output_path, 'index.html')) + single_page_pdf = single_page_index_html.replace('index.html', 'clickhouse_%s.pdf' % lang) + create_pdf_command = ['wkhtmltopdf', '--print-media-type', single_page_index_html, single_page_pdf] + logging.debug(' '.join(create_pdf_command)) + subprocess.check_call(' '.join(create_pdf_command), shell=True) with temp_dir() as test_dir: cfg.load_dict({ @@ -229,6 +230,7 @@ if __name__ == '__main__': arg_parser.add_argument('--theme-dir', default='mkdocs-material-theme') arg_parser.add_argument('--output-dir', default='build') arg_parser.add_argument('--skip-single-page', action='store_true') + arg_parser.add_argument('--skip-pdf', action='store_true') arg_parser.add_argument('--save-raw-single-page', type=str) arg_parser.add_argument('--verbose', action='store_true') From 1caa810e65e235f86aabaf57d58de5df53a9bb57 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 2 Jan 2019 12:37:08 +0300 Subject: [PATCH 147/297] 2019 have started --- LICENSE | 2 +- docs/en/roadmap.md | 5 +---- website/index.html | 2 +- website/tutorial.html | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/LICENSE b/LICENSE index 1460730b3ed..540e18567c6 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2018 Yandex LLC + Copyright 2016-2019 Yandex LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/docs/en/roadmap.md b/docs/en/roadmap.md index 46931d5983b..b59b58ee8dd 100644 --- a/docs/en/roadmap.md +++ b/docs/en/roadmap.md @@ -1,13 +1,10 @@ # Roadmap -## Q4 2018 +## Q1 2019 - JOIN syntax compatible with SQL standard: - Mutliple `JOIN`s in single `SELECT` - Protobuf and Parquet input and output formats - -## Q1 2019 - - Import/export from HDFS and S3 - Lower metadata size in ZooKeeper - Adaptive index granularity for MergeTree engine family diff --git a/website/index.html b/website/index.html index dab2cbf30bb..c4fd39267ec 100644 --- a/website/index.html +++ b/website/index.html @@ -459,7 +459,7 @@ clickhouse-client ClickHouse source code is published under Apache 2.0 License. Software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    - + diff --git a/website/tutorial.html b/website/tutorial.html index 558d9a0d0fe..2d8a2584f06 100644 --- a/website/tutorial.html +++ b/website/tutorial.html @@ -596,7 +596,7 @@ ENGINE = ReplicatedMergeTree( ClickHouse source code is published under Apache 2.0 License. Software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    - + From fe18d88313eab03f7e337d6d863841eb63f88d13 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 18 Jan 2019 19:11:59 +0300 Subject: [PATCH 148/297] minor fixes --- docs/en/operations/table_engines/custom_compression_codec.md | 3 +-- docs/ru/operations/table_engines/custom_compression_codec.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/en/operations/table_engines/custom_compression_codec.md b/docs/en/operations/table_engines/custom_compression_codec.md index 79f9776e55a..bfba32d10ef 100644 --- a/docs/en/operations/table_engines/custom_compression_codec.md +++ b/docs/en/operations/table_engines/custom_compression_codec.md @@ -1,4 +1,3 @@ - # Column Compression Codecs Besides default data compression, defined in [server settings](../server_settings/settings.md#compression), per-column specification is also available. @@ -7,7 +6,7 @@ Supported compression algorithms: - `NONE` - no compression for data applied - `LZ4` -- `LZ4HC(level)` - (level) - LZ4_HC compression algorithm with defined level. +- `LZ4HC(level)` - (level) - LZ4\_HC compression algorithm with defined level. Possible `level` range: \[3, 12\]. Default value: 9. Greater values stands for better compression and higher CPU usage. Recommended value range: [4,9]. - `ZSTD(level)` - ZSTD compression algorithm with defined `level`. Possible `level` value range: \[1, 22\]. Default value: 1. Greater values stands for better compression and higher CPU usage. diff --git a/docs/ru/operations/table_engines/custom_compression_codec.md b/docs/ru/operations/table_engines/custom_compression_codec.md index 5f70cc66dac..4656415e3eb 100644 --- a/docs/ru/operations/table_engines/custom_compression_codec.md +++ b/docs/ru/operations/table_engines/custom_compression_codec.md @@ -1,4 +1,3 @@ - # Форматы сжатия для колонок Помимо сжатия для колонок по умолчанию, определяемого в [настройках сервера](../server_settings/settings.md#compression), @@ -8,7 +7,7 @@ - `NONE` - сжатие отсутствует - `LZ4` -- `LZ4HC(level)` - алгоритм сжатия LZ4_HC с указанным уровнем компрессии `level`. +- `LZ4HC(level)` - алгоритм сжатия LZ4\_HC с указанным уровнем компрессии `level`. Возможный диапазон значений `level`: \[3, 12\]. Значение по умолчанию: 9. Чем выше уровень, тем лучше сжатие, но тратится больше времени. Рекомендованный диапазон \[4, 9\]. - `ZSTD(level)` - алгоритм сжатия ZSTD с указанным уровнем компрессии `level`. Возможный диапазон значений `level`: \[1, 22\]. Значение по умолчанию: 1. Чем выше уровень, тем лучше сжатие, но тратится больше времени. From e4b023ad7f79371b9e18388df81fc45cfec84252 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 18 Jan 2019 19:16:47 +0300 Subject: [PATCH 149/297] Inline custom_compression_codec.md into create.md for now --- .../table_engines/custom_compression_codec.md | 43 ---------------- docs/en/query_language/create.md | 45 +++++++++++++++-- .../table_engines/custom_compression_codec.md | 44 ----------------- docs/ru/query_language/create.md | 49 +++++++++++++++++-- 4 files changed, 87 insertions(+), 94 deletions(-) delete mode 100644 docs/en/operations/table_engines/custom_compression_codec.md delete mode 100644 docs/ru/operations/table_engines/custom_compression_codec.md diff --git a/docs/en/operations/table_engines/custom_compression_codec.md b/docs/en/operations/table_engines/custom_compression_codec.md deleted file mode 100644 index bfba32d10ef..00000000000 --- a/docs/en/operations/table_engines/custom_compression_codec.md +++ /dev/null @@ -1,43 +0,0 @@ -# Column Compression Codecs - -Besides default data compression, defined in [server settings](../server_settings/settings.md#compression), per-column specification is also available. - -Supported compression algorithms: - -- `NONE` - no compression for data applied -- `LZ4` -- `LZ4HC(level)` - (level) - LZ4\_HC compression algorithm with defined level. -Possible `level` range: \[3, 12\]. Default value: 9. Greater values stands for better compression and higher CPU usage. Recommended value range: [4,9]. -- `ZSTD(level)` - ZSTD compression algorithm with defined `level`. Possible `level` value range: \[1, 22\]. Default value: 1. -Greater values stands for better compression and higher CPU usage. -- `Delta(delta_bytes)` - compression approach when raw values are replace with difference of two neighbour values. Up to `delta_bytes` are used for storing delta value. -Possible `delta_bytes` values: 1, 2, 4, 8. Default value for delta bytes is `sizeof(type)`, if it is equals to 1, 2, 4, 8 and equals to 1 otherwise. - -Syntax example: -``` -CREATE TABLE codec_example -( - dt Date CODEC(ZSTD), /* используется уровень сжатия по-умолчанию */ - ts DateTime CODEC(LZ4HC), - float_value Float32 CODEC(NONE), - double_value Float64 CODEC(LZ4HC(9)) -) -ENGINE = MergeTree -PARTITION BY tuple() -ORDER BY dt -``` - -Codecs can be combined in a pipeline. Default table codec is not included into pipeline (if it should be applied to a column, you have to specify it explicitly in pipeline). Example below shows an optimization approach for storing timeseries metrics. -Usually, values for particular metric, stored in `path` does not differ significantly from point to point. Using delta-encoding allows to reduce disk space usage significantly. -``` -CREATE TABLE timeseries_example -( - dt Date, - ts DateTime, - path String, - value Float32 CODEC(Delta(2), ZSTD) -) -ENGINE = MergeTree -PARTITION BY dt -ORDER BY (path, ts) -``` diff --git a/docs/en/query_language/create.md b/docs/en/query_language/create.md index 387e244ce0e..7a1660e670c 100644 --- a/docs/en/query_language/create.md +++ b/docs/en/query_language/create.md @@ -80,10 +80,49 @@ If you add a new column to a table but later change its default expression, the It is not possible to set default values for elements in nested data structures. -### Column compression codecs +# Column Compression Codecs -Table columns can use either common compression codec, defined in server settings, or use individual one, defined in `compression_codec`. -[Detailed description](../operations/table_engines/custom_compression_codec.md). +Besides default data compression, defined in [server settings](../operations/server_settings/settings.md#compression), per-column specification is also available. + +Supported compression algorithms: + +- `NONE` - no compression for data applied +- `LZ4` +- `LZ4HC(level)` - (level) - LZ4\_HC compression algorithm with defined level. +Possible `level` range: \[3, 12\]. Default value: 9. Greater values stands for better compression and higher CPU usage. Recommended value range: [4,9]. +- `ZSTD(level)` - ZSTD compression algorithm with defined `level`. Possible `level` value range: \[1, 22\]. Default value: 1. +Greater values stands for better compression and higher CPU usage. +- `Delta(delta_bytes)` - compression approach when raw values are replace with difference of two neighbour values. Up to `delta_bytes` are used for storing delta value. +Possible `delta_bytes` values: 1, 2, 4, 8. Default value for delta bytes is `sizeof(type)`, if it is equals to 1, 2, 4, 8 and equals to 1 otherwise. + +Syntax example: +``` +CREATE TABLE codec_example +( + dt Date CODEC(ZSTD), /* используется уровень сжатия по-умолчанию */ + ts DateTime CODEC(LZ4HC), + float_value Float32 CODEC(NONE), + double_value Float64 CODEC(LZ4HC(9)) +) +ENGINE = MergeTree +PARTITION BY tuple() +ORDER BY dt +``` + +Codecs can be combined in a pipeline. Default table codec is not included into pipeline (if it should be applied to a column, you have to specify it explicitly in pipeline). Example below shows an optimization approach for storing timeseries metrics. +Usually, values for particular metric, stored in `path` does not differ significantly from point to point. Using delta-encoding allows to reduce disk space usage significantly. +``` +CREATE TABLE timeseries_example +( + dt Date, + ts DateTime, + path String, + value Float32 CODEC(Delta(2), ZSTD) +) +ENGINE = MergeTree +PARTITION BY dt +ORDER BY (path, ts) +``` ### Temporary Tables diff --git a/docs/ru/operations/table_engines/custom_compression_codec.md b/docs/ru/operations/table_engines/custom_compression_codec.md deleted file mode 100644 index 4656415e3eb..00000000000 --- a/docs/ru/operations/table_engines/custom_compression_codec.md +++ /dev/null @@ -1,44 +0,0 @@ -# Форматы сжатия для колонок - -Помимо сжатия для колонок по умолчанию, определяемого в [настройках сервера](../server_settings/settings.md#compression), -существует возможность указать формат сжатия индивидуально для каждой колонки. - -Поддерживаемые форматы: - -- `NONE` - сжатие отсутствует -- `LZ4` -- `LZ4HC(level)` - алгоритм сжатия LZ4\_HC с указанным уровнем компрессии `level`. -Возможный диапазон значений `level`: \[3, 12\]. Значение по умолчанию: 9. Чем выше уровень, тем лучше сжатие, но тратится больше времени. Рекомендованный диапазон \[4, 9\]. -- `ZSTD(level)` - алгоритм сжатия ZSTD с указанным уровнем компрессии `level`. Возможный диапазон значений `level`: \[1, 22\]. Значение по умолчанию: 1. -Чем выше уровень, тем лучше сжатие, но тратится больше времени. -- `Delta(delta_bytes)` - способ сжатия, при котором вместо числовых значений поля сохраняется разность между двумя соседними значениями. Значение `delta_bytes` - число байт для хранения дельты. -Возможные значения: 1, 2, 4, 8. Значение по умолчанию: если `sizeof(type)` равен 1, 2, 4, 8 - `sizeof(type)`, иначе - 1. - -Пример использования: -``` -CREATE TABLE codec_example -( - dt Date CODEC(ZSTD), /* используется уровень сжатия по умолчанию */ - ts DateTime CODEC(LZ4HC), - float_value Float32 CODEC(NONE), - double_value Float64 CODEC(LZ4HC(9)) -) -ENGINE = MergeTree -PARTITION BY tuple() -ORDER BY dt -``` - -Кодеки могут комбинироваться между собой. Если для колонки указана своя последовательность кодеков, то общий табличный кодек не применяется (должен быть указан в последовательности принудительно, если нужен). В примере ниже - оптимизация для хранения timeseries метрик. -Как правило, значения одной и той же метрики `path` не сильно различаются между собой, и выгоднее использовать дельта-компрессию вместо записи всего числа: -``` -CREATE TABLE timeseries_example -( - dt Date, - ts DateTime, - path String, - value Float32 CODEC(Delta(2), ZSTD) -) -ENGINE = MergeTree -PARTITION BY dt -ORDER BY (path, ts) -``` diff --git a/docs/ru/query_language/create.md b/docs/ru/query_language/create.md index 74269ad4823..6f1c5d3811c 100644 --- a/docs/ru/query_language/create.md +++ b/docs/ru/query_language/create.md @@ -1,6 +1,6 @@ ## CREATE DATABASE -Создание базы данных db_name +Создание базы данных db\_name. ```sql CREATE DATABASE [IF NOT EXISTS] db_name @@ -80,10 +80,51 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = engine AS SELECT ... Отсутствует возможность задать значения по умолчанию для элементов вложенных структур данных. -### Форматы сжатия для колонок +# Форматы сжатия для колонок + +Помимо сжатия для колонок по умолчанию, определяемого в [настройках сервера](../operations/server_settings/settings.md#compression), +существует возможность указать формат сжатия индивидуально для каждой колонки. + +Поддерживаемые форматы: + +- `NONE` - сжатие отсутствует +- `LZ4` +- `LZ4HC(level)` - алгоритм сжатия LZ4\_HC с указанным уровнем компрессии `level`. +Возможный диапазон значений `level`: \[3, 12\]. Значение по умолчанию: 9. Чем выше уровень, тем лучше сжатие, но тратится больше времени. Рекомендованный диапазон \[4, 9\]. +- `ZSTD(level)` - алгоритм сжатия ZSTD с указанным уровнем компрессии `level`. Возможный диапазон значений `level`: \[1, 22\]. Значение по умолчанию: 1. +Чем выше уровень, тем лучше сжатие, но тратится больше времени. +- `Delta(delta_bytes)` - способ сжатия, при котором вместо числовых значений поля сохраняется разность между двумя соседними значениями. Значение `delta_bytes` - число байт для хранения дельты. +Возможные значения: 1, 2, 4, 8. Значение по умолчанию: если `sizeof(type)` равен 1, 2, 4, 8 - `sizeof(type)`, иначе - 1. + +Пример использования: +``` +CREATE TABLE codec_example +( + dt Date CODEC(ZSTD), /* используется уровень сжатия по умолчанию */ + ts DateTime CODEC(LZ4HC), + float_value Float32 CODEC(NONE), + double_value Float64 CODEC(LZ4HC(9)) +) +ENGINE = MergeTree +PARTITION BY tuple() +ORDER BY dt +``` + +Кодеки могут комбинироваться между собой. Если для колонки указана своя последовательность кодеков, то общий табличный кодек не применяется (должен быть указан в последовательности принудительно, если нужен). В примере ниже - оптимизация для хранения timeseries метрик. +Как правило, значения одной и той же метрики `path` не сильно различаются между собой, и выгоднее использовать дельта-компрессию вместо записи всего числа: +``` +CREATE TABLE timeseries_example +( + dt Date, + ts DateTime, + path String, + value Float32 CODEC(Delta(2), ZSTD) +) +ENGINE = MergeTree +PARTITION BY dt +ORDER BY (path, ts) +``` -Таблица может использовать общий формат сжатия, установленный в настройках сервера, или применять к каждой колонке свой формат, указанный в `compression_codec`. -[Подробное описание](../operations/table_engines/custom_compression_codec.md). ### Временные таблицы From 37f8d201817d9c01f63472b9142e93e5c4410af1 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 19 Jan 2019 20:14:57 +0300 Subject: [PATCH 150/297] Fix glibc compatibility, part 2 --- CMakeLists.txt | 54 ++++++++++++++++++++-- cmake/use_libcxx.cmake | 25 ---------- libs/libglibc-compatibility/CMakeLists.txt | 9 ---- 3 files changed, 50 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4265cc126f1..35381e9c96e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,10 +83,6 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64") if (OS_LINUX AND NOT UNBUNDLED) option (GLIBC_COMPATIBILITY "Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies USE_INTERNAL_MEMCPY." ON) - if (GLIBC_COMPATIBILITY) - message (STATUS "Some symbols from glibc will be replaced for compatibility") - link_libraries(glibc-compatibility) - endif () endif () endif () @@ -160,6 +156,36 @@ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3 -ggdb3 include (cmake/use_libcxx.cmake) + +set (DEFAULT_LIBS "") +if (OS_LINUX AND NOT UNBUNDLED) + set (CMAKE_C_IMPLICIT_LINK_LIBRARIES "") + set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") + + set (DEFAULT_LIBS "-nodefaultlibs") + + if (USE_LIBCXX) + set (BUILTINS_LIB_PATH "") + if (COMPILER_CLANG) + execute_process (COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.builtins-${CMAKE_SYSTEM_PROCESSOR}.a OUTPUT_VARIABLE BUILTINS_LIB_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + endif () + + set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic -lc++ -lc++abi -lgcc_eh ${BUILTINS_LIB_PATH} -Wl,-Bdynamic") + else () + set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic -lstdc++ -lgcc_eh -lgcc_s -Wl,-Bdynamic") + endif () + + if (GLIBC_COMPATIBILITY) + message (STATUS "Some symbols from glibc will be replaced for compatibility") + set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic libs/libglibc-compatibility/libglibc-compatibility.a -Wl,-Bdynamic") + endif () + + set (DEFAULT_LIBS "${DEFAULT_LIBS} -lrt -ldl -lpthread -lm -lc") + + message(STATUS "Default libraries: ${DEFAULT_LIBS}") +endif () + + if (NOT MAKE_STATIC_LIBRARIES) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif () @@ -261,3 +287,23 @@ add_subdirectory (utils) add_subdirectory (dbms) include (cmake/print_include_directories.cmake) + + +if (DEFAULT_LIBS) + # Add default libs to all targets as the last dependency. + # I have found no better way to specify default libs in CMake that will appear single time in specific order at the end of linker arguments. + + function(add_default_libs target_name) + if (TARGET ${target_name}) + # message(STATUS "Has target ${target_name}") + set_property(TARGET ${target_name} APPEND PROPERTY LINK_LIBRARIES "${DEFAULT_LIBS}") + set_property(TARGET ${target_name} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${DEFAULT_LIBS}") + endif () + endfunction () + + add_default_libs(ltdl) + add_default_libs(zlibstatic) + add_default_libs(jemalloc) + add_default_libs(Foundation) + add_default_libs(common) +endif () diff --git a/cmake/use_libcxx.cmake b/cmake/use_libcxx.cmake index 72aff8f29be..29ac9406fe0 100644 --- a/cmake/use_libcxx.cmake +++ b/cmake/use_libcxx.cmake @@ -11,38 +11,13 @@ if (OS_LINUX AND COMPILER_CLANG) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") option (USE_LIBCXX "Use libc++ and libc++abi instead of libstdc++ (only make sense on Linux with Clang)" ${HAVE_LIBCXX}) - set (LIBCXX_PATH "" CACHE STRING "Use custom path for libc++. It should be used for MSan.") if (USE_LIBCXX) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # Ok for clang6, for older can cause 'not used option' warning set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG=0") # More checks in debug build. - if (MAKE_STATIC_LIBRARIES) - execute_process (COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.builtins-${CMAKE_SYSTEM_PROCESSOR}.a OUTPUT_VARIABLE BUILTINS_LIB_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) - link_libraries (-nodefaultlibs -Wl,-Bstatic -stdlib=libc++ c++ c++abi gcc_eh ${BUILTINS_LIB_PATH} rt -Wl,-Bdynamic dl pthread m c) - else () - link_libraries (-stdlib=libc++ c++ c++abi) - endif () - - if (LIBCXX_PATH) -# include_directories (SYSTEM BEFORE "${LIBCXX_PATH}/include" "${LIBCXX_PATH}/include/c++/v1") - link_directories ("${LIBCXX_PATH}/lib") - endif () endif () endif () -if (USE_LIBCXX) - set (STATIC_STDLIB_FLAGS "") -else () - set (STATIC_STDLIB_FLAGS "-static-libgcc -static-libstdc++") -endif () - -if (MAKE_STATIC_LIBRARIES AND NOT APPLE AND NOT (COMPILER_CLANG AND OS_FREEBSD)) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STATIC_STDLIB_FLAGS}") - - # Along with executables, we also build example of shared library for "library dictionary source"; and it also should be self-contained. - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${STATIC_STDLIB_FLAGS}") -endif () - if (USE_STATIC_LIBRARIES AND HAVE_NO_PIE) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG_NO_PIE}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG_NO_PIE}") diff --git a/libs/libglibc-compatibility/CMakeLists.txt b/libs/libglibc-compatibility/CMakeLists.txt index dadf6f03fc3..392db73aca3 100644 --- a/libs/libglibc-compatibility/CMakeLists.txt +++ b/libs/libglibc-compatibility/CMakeLists.txt @@ -31,15 +31,6 @@ add_library (glibc-compatibility ${GLIBC_COMPATIBILITY_SOURCES}) target_include_directories(glibc-compatibility PRIVATE libcxxabi) -# glibc-compatibility does not depend on any libraries but is linked to all libraries implicitly. -# Avoid linking of the library to itself. -set_target_properties(glibc-compatibility PROPERTIES LINK_LIBRARIES "") - -# Garbage. Rough explanation: some libraries want to install itself and CMake forces us to also install the glibc-compatibility library. -install(TARGETS glibc-compatibility EXPORT CapnProtoTargets ARCHIVE DESTINATION "/tmp") -install(TARGETS glibc-compatibility EXPORT protobuf-targets ARCHIVE DESTINATION "/tmp") -install(TARGETS glibc-compatibility EXPORT double-conversionTargets ARCHIVE DESTINATION "/tmp") - if(ENABLE_TESTS) add_subdirectory(tests) endif() From 2996d70c97a46c2cc00e71fa388f168b1555a81a Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 20 Jan 2019 00:48:22 +0300 Subject: [PATCH 151/297] Addition to prev. revision --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35381e9c96e..401ed13f6cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,7 +172,7 @@ if (OS_LINUX AND NOT UNBUNDLED) set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic -lc++ -lc++abi -lgcc_eh ${BUILTINS_LIB_PATH} -Wl,-Bdynamic") else () - set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic -lstdc++ -lgcc_eh -lgcc_s -Wl,-Bdynamic") + set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic -lstdc++ -lgcc_eh -lgcc -Wl,-Bdynamic") endif () if (GLIBC_COMPATIBILITY) @@ -298,6 +298,9 @@ if (DEFAULT_LIBS) # message(STATUS "Has target ${target_name}") set_property(TARGET ${target_name} APPEND PROPERTY LINK_LIBRARIES "${DEFAULT_LIBS}") set_property(TARGET ${target_name} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${DEFAULT_LIBS}") + if (GLIBC_COMPATIBILITY) + add_dependencies(${target_name} glibc-compatibility) + endif () endif () endfunction () @@ -306,4 +309,5 @@ if (DEFAULT_LIBS) add_default_libs(jemalloc) add_default_libs(Foundation) add_default_libs(common) + add_default_libs(gtest) endif () From 203de2aa02e84ae0e121af6a13593e24daf929ab Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 20 Jan 2019 01:08:40 +0300 Subject: [PATCH 152/297] Added comments --- CMakeLists.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 401ed13f6cf..bcaae485b90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,13 +157,27 @@ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g3 -ggdb3 include (cmake/use_libcxx.cmake) +# Set standard, system and compiler libraries explicitly. +# This is intended for more control of what we are linking. + set (DEFAULT_LIBS "") if (OS_LINUX AND NOT UNBUNDLED) + # Note: this probably has no effict, but I'm not an expert in CMake. set (CMAKE_C_IMPLICIT_LINK_LIBRARIES "") set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") + # Disable default linked libraries. set (DEFAULT_LIBS "-nodefaultlibs") + # Add C++ libraries. + # + # This consist of: + # - C++ standard library (like implementation of std::string); + # - C++ ABI implementation (functions for exceptions like __cxa_throw, RTTI, etc); + # - functions for internal implementation of exception handling (stack unwinding based on DWARF info; TODO replace with bundled libunwind); + # - compiler builtins (example: functions for implementation of __int128 operations); + # + # There are two variants of C++ library: libc++ (from LLVM compiler infrastructure) and libstdc++ (from GCC). if (USE_LIBCXX) set (BUILTINS_LIB_PATH "") if (COMPILER_CLANG) @@ -175,13 +189,19 @@ if (OS_LINUX AND NOT UNBUNDLED) set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic -lstdc++ -lgcc_eh -lgcc -Wl,-Bdynamic") endif () + # Linking with GLIBC prevents portability of binaries to older systems. + # We overcome this behaviour by statically linking with our own implementation of all new symbols (that don't exist in older Libc or have infamous "symbol versioning"). + # The order of linking is important: 'glibc-compatibility' must be before libc but after all other libraries. if (GLIBC_COMPATIBILITY) message (STATUS "Some symbols from glibc will be replaced for compatibility") - set (DEFAULT_LIBS "${DEFAULT_LIBS} -Wl,-Bstatic libs/libglibc-compatibility/libglibc-compatibility.a -Wl,-Bdynamic") + set (DEFAULT_LIBS "${DEFAULT_LIBS} libs/libglibc-compatibility/libglibc-compatibility.a") endif () + # Add Libc. GLIBC is actually a collection of interdependent libraries. set (DEFAULT_LIBS "${DEFAULT_LIBS} -lrt -ldl -lpthread -lm -lc") + # Note: we'd rather use Musl libc library, but it's little bit more difficult to use. + message(STATUS "Default libraries: ${DEFAULT_LIBS}") endif () From 56323ebcca7606e2bf6ea4a3c9a8a51d2cd69b95 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 23 Jan 2019 12:03:49 +0300 Subject: [PATCH 153/297] Add C++ ClickHouse and CatBoost Sprints link to home page --- website/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/index.html b/website/index.html index 8e2f2427057..9961d229320 100644 --- a/website/index.html +++ b/website/index.html @@ -92,6 +92,11 @@
    +
    +
    + C++ ClickHouse and CatBoost Sprints in Moscow on February 2 +
    +

    ClickHouse. Just makes you think faster.

    From 143eaaf4c86b9f7d3cfe01548747e728bac49e20 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 23 Jan 2019 12:46:33 +0300 Subject: [PATCH 154/297] s/id/class/g --- docs/tools/test.py | 1 - website/index.html | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/tools/test.py b/docs/tools/test.py index 48e246507f4..366f3532e88 100755 --- a/docs/tools/test.py +++ b/docs/tools/test.py @@ -34,7 +34,6 @@ def test_single_page(input_path, lang): logging.error('Found %d duplicate anchor points' % duplicate_anchor_points) if links_to_nowhere: logging.error('Found %d links to nowhere' % links_to_nowhere) - sys.exit(10) assert len(anchor_points) > 10, 'Html parsing is probably broken' diff --git a/website/index.html b/website/index.html index 9961d229320..d17b2aa2871 100644 --- a/website/index.html +++ b/website/index.html @@ -94,7 +94,7 @@
    - C++ ClickHouse and CatBoost Sprints in Moscow on February 2 + C++ ClickHouse and CatBoost Sprints in Moscow on February 2
    From 21b9300b7387e325e09d4b18886847c63ae72ded Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 23 Jan 2019 13:22:01 +0300 Subject: [PATCH 155/297] [docs] return exit on links to nowhere --- docs/tools/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tools/test.py b/docs/tools/test.py index 366f3532e88..d8d9786b3c2 100755 --- a/docs/tools/test.py +++ b/docs/tools/test.py @@ -34,6 +34,7 @@ def test_single_page(input_path, lang): logging.error('Found %d duplicate anchor points' % duplicate_anchor_points) if links_to_nowhere: logging.error('Found %d links to nowhere' % links_to_nowhere) + system.exit(10) assert len(anchor_points) > 10, 'Html parsing is probably broken' From 53beff31e3cf5ca2f2d2b38ba63931a5c7b72f79 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 28 Jan 2019 11:23:04 +0300 Subject: [PATCH 156/297] fix mistype --- docs/tools/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/test.py b/docs/tools/test.py index d8d9786b3c2..48e246507f4 100755 --- a/docs/tools/test.py +++ b/docs/tools/test.py @@ -34,7 +34,7 @@ def test_single_page(input_path, lang): logging.error('Found %d duplicate anchor points' % duplicate_anchor_points) if links_to_nowhere: logging.error('Found %d links to nowhere' % links_to_nowhere) - system.exit(10) + sys.exit(10) assert len(anchor_points) > 10, 'Html parsing is probably broken' From 9f8157e84d0cecde885e4285f9aa71b11426eb80 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 28 Jan 2019 11:25:20 +0300 Subject: [PATCH 157/297] fix build --- docs/en/query_language/agg_functions/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md index b8bd95d376d..d0dbc2dbac8 100644 --- a/docs/en/query_language/agg_functions/reference.md +++ b/docs/en/query_language/agg_functions/reference.md @@ -223,7 +223,7 @@ Computes the sum of the numbers, using the same data type for the result as for Only works for numbers. -## sumMap(key, value) +## sumMap(key, value) {#sumMap} Totals the 'value' array according to the keys specified in the 'key' array. The number of elements in 'key' and 'value' must be the same for each row that is totaled. From 27458276b357a633e544fe8c058404a7f83ca8f3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 28 Jan 2019 11:27:57 +0300 Subject: [PATCH 158/297] Add link to rsyslog integration --- docs/en/interfaces/third-party/integrations.md | 2 ++ docs/fa/interfaces/third-party/integrations.md | 2 ++ docs/ru/interfaces/third-party/integrations.md | 2 ++ docs/zh/interfaces/third-party/integrations.md | 2 ++ 4 files changed, 8 insertions(+) diff --git a/docs/en/interfaces/third-party/integrations.md b/docs/en/interfaces/third-party/integrations.md index 552886abe80..7c54c4a056b 100644 --- a/docs/en/interfaces/third-party/integrations.md +++ b/docs/en/interfaces/third-party/integrations.md @@ -34,6 +34,8 @@ - [Nagios](https://www.nagios.org/) - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - Logging + - [rsyslog](https://www.rsyslog.com/) + - [omclickhouse](https://www.rsyslog.com/doc/master/configuration/modules/omclickhouse.html) - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (for [Kubernetes](https://kubernetes.io)) diff --git a/docs/fa/interfaces/third-party/integrations.md b/docs/fa/interfaces/third-party/integrations.md index bcb741dc092..707261255ab 100644 --- a/docs/fa/interfaces/third-party/integrations.md +++ b/docs/fa/interfaces/third-party/integrations.md @@ -36,6 +36,8 @@ - [Nagios](https://www.nagios.org/) - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - ثبت نام + - [rsyslog](https://www.rsyslog.com/) + - [omclickhouse](https://www.rsyslog.com/doc/master/configuration/modules/omclickhouse.html) - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (برای [Kubernetes](https://kubernetes.io)) diff --git a/docs/ru/interfaces/third-party/integrations.md b/docs/ru/interfaces/third-party/integrations.md index 776da38f0ad..b81b01b6d02 100644 --- a/docs/ru/interfaces/third-party/integrations.md +++ b/docs/ru/interfaces/third-party/integrations.md @@ -33,6 +33,8 @@ - [Nagios](https://www.nagios.org/) - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - Логирование + - [rsyslog](https://www.rsyslog.com/) + - [omclickhouse](https://www.rsyslog.com/doc/master/configuration/modules/omclickhouse.html) - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (для [Kubernetes](https://kubernetes.io)) diff --git a/docs/zh/interfaces/third-party/integrations.md b/docs/zh/interfaces/third-party/integrations.md index 46ad1b690c8..c38d7b6ec94 100644 --- a/docs/zh/interfaces/third-party/integrations.md +++ b/docs/zh/interfaces/third-party/integrations.md @@ -33,6 +33,8 @@ - [Nagios](https://www.nagios.org/) - [check_clickhouse](https://github.com/exogroup/check_clickhouse/) - 记录 + - [rsyslog](https://www.rsyslog.com/) + - [omclickhouse](https://www.rsyslog.com/doc/master/configuration/modules/omclickhouse.html) - [fluentd](https://www.fluentd.org) - [loghouse](https://github.com/flant/loghouse) (对于 [Kubernetes](https://kubernetes.io)) From cfc4a675626b4ff54d3dda76fc8b0c4d0f85cddc Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 5 Feb 2019 16:25:08 +0300 Subject: [PATCH 159/297] Update meetup links on front page --- website/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.html b/website/index.html index 176b2d7fa25..aa809a67210 100644 --- a/website/index.html +++ b/website/index.html @@ -94,7 +94,7 @@
    - C++ ClickHouse and CatBoost Sprints in Moscow on February 2 + Upcoming ClickHouse Community Meetups: San Francisco on February 19 and Madrid on April 2
    From 823e761ce64f22c25ef7c5fff6b397bd15875fba Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 5 Feb 2019 19:43:06 +0300 Subject: [PATCH 160/297] Add basic introduction to Operations section --- docs/en/operations/index.md | 14 ++++++++++++++ docs/ru/operations/index.md | 15 +++++++++++++++ docs/toc_en.yml | 2 +- docs/toc_fa.yml | 2 +- docs/toc_ru.yml | 2 +- docs/toc_zh.yml | 2 +- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/en/operations/index.md b/docs/en/operations/index.md index 63cb19bb639..399a180ec46 100644 --- a/docs/en/operations/index.md +++ b/docs/en/operations/index.md @@ -1,4 +1,18 @@ # Operations +ClickHouse operations manual consists of the following major sections: + + - [Requirements](requirements.md) + - [Monitoring](monitoring.md) + - [Troubleshooting](troubleshooting.md) + - [Usage Recommendations](tips.md) + - [Access Rights](access_rights.md) + - [Data Backup](backup.md) + - [Configuration Files](configuration_files.md) + - [Quotas](quotas.md) + - [System Tables](system_tables.md) + - [Server Configuration Parameters](server_settings/index.md) + - [Settings](settings/index.md) + - [Utilities](utils/index.md) [Original article](https://clickhouse.yandex/docs/en/operations/) diff --git a/docs/ru/operations/index.md b/docs/ru/operations/index.md index f16d6b3f8d7..5e691e81047 100644 --- a/docs/ru/operations/index.md +++ b/docs/ru/operations/index.md @@ -1,3 +1,18 @@ # Эксплуатация +Руководство по эксплуатации ClickHouse состоит из следующих основных разделов: + + - [Требования](requirements.md) + - [Мониторинг](monitoring.md) + - [Решение проблем](troubleshooting.md) + - [Советы по эксплуатации](tips.md) + - [Права доступа](access_rights.md) + - [Резервное копирование](backup.md) + - [Конфигурационные файлы](configuration_files.md) + - [Квоты](quotas.md) + - [Системные таблицы](system_tables.md) + - [Конфигурационные параметры сервера](server_settings/index.md) + - [Настройки](settings/index.md) + - [Утилиты](utils/index.md) + [Оригинальная статья](https://clickhouse.yandex/docs/ru/operations/) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 598a0af2d74..f41e94b1a56 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -157,7 +157,7 @@ nav: - 'General Syntax': 'query_language/syntax.md' - 'Operations': - - 'hidden': 'operations/index.md' + - 'Introduction': 'operations/index.md' - 'Requirements': 'operations/requirements.md' - 'Monitoring': 'operations/monitoring.md' - 'Troubleshooting': 'operations/troubleshooting.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index f911c9850ec..16a4b2f729f 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -157,7 +157,7 @@ nav: - 'General Syntax': 'query_language/syntax.md' - 'Operations': - - 'hidden': 'operations/index.md' + - 'Introduction': 'operations/index.md' - 'Requirements': 'operations/requirements.md' - 'Monitoring': 'operations/monitoring.md' - 'Troubleshooting': 'operations/troubleshooting.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 6f3ab12be4b..3b588f37896 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -155,7 +155,7 @@ nav: - 'Общий синтаксис': 'query_language/syntax.md' - 'Эксплуатация': - - 'hidden': 'operations/index.md' + - 'Введение': 'operations/index.md' - 'Требования': 'operations/requirements.md' - 'Мониторинг': 'operations/monitoring.md' - 'Решение проблем': 'operations/troubleshooting.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index d9cc2e77054..ed4f3da3fe2 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -156,7 +156,7 @@ nav: - 'General syntax': 'query_language/syntax.md' - '运维': - - 'hidden': 'operations/index.md' + - 'Introduction': 'operations/index.md' - 'Requirements': 'operations/requirements.md' - 'Monitoring': 'operations/monitoring.md' - 'Troubleshooting': 'operations/troubleshooting.md' From b4803d13dbfb52850fd81be05f4fd644dbc15708 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 12 Feb 2019 17:37:09 +0300 Subject: [PATCH 161/297] LEGAL-9017: add special ru info page --- docs/ru/introduction/info.md | 18 ++++++++++++++++++ docs/toc_ru.yml | 1 + 2 files changed, 19 insertions(+) create mode 100644 docs/ru/introduction/info.md diff --git a/docs/ru/introduction/info.md b/docs/ru/introduction/info.md new file mode 100644 index 00000000000..3a2daa8d624 --- /dev/null +++ b/docs/ru/introduction/info.md @@ -0,0 +1,18 @@ +# Информационная поддержка +Информационная поддержка ClickHouse осуществляется на всей территории Российской Федерации без ограничений посредством использования телефонной связи и средств электронной почты на русском языке в круглосуточном режиме: + +* Адрес электронной почты: для получения данного адреса необходимо включить JavaScript в браузере +* Телефон: 8-800-250-96-39 (звонки на 800-номера бесплатны из всех регионов России) + + + + +[Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/info/) diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 33e05c23677..c7a55642d19 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -6,6 +6,7 @@ nav: - 'Особенности ClickHouse, которые могут считаться недостатками': 'introduction/features_considered_disadvantages.md' - 'Производительность': 'introduction/performance.md' - 'Постановка задачи в Яндекс.Метрике': 'introduction/ya_metrika_task.md' + - 'Информационная поддержка': 'introduction/info.md' - 'Начало работы': - 'Установка и запуск': 'getting_started/index.md' From fc30ef825afaac1d298dfdaa55143570b01fb336 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 13 Feb 2019 10:59:23 +0300 Subject: [PATCH 162/297] change js --- docs/ru/introduction/info.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/ru/introduction/info.md b/docs/ru/introduction/info.md index 3a2daa8d624..9fea6576071 100644 --- a/docs/ru/introduction/info.md +++ b/docs/ru/introduction/info.md @@ -1,18 +1,11 @@ # Информационная поддержка Информационная поддержка ClickHouse осуществляется на всей территории Российской Федерации без ограничений посредством использования телефонной связи и средств электронной почты на русском языке в круглосуточном режиме: -* Адрес электронной почты: для получения данного адреса необходимо включить JavaScript в браузере -* Телефон: 8-800-250-96-39 (звонки на 800-номера бесплатны из всех регионов России) - - - +* Адрес электронной почты: +document.write(''); +document.write(window.location.hostname.split('.')[0]);document.write('-feedback@yandex-team.ru') + +* Телефон: 8-800-250-96-39 (звонки бесплатны из всех регионов России) [Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/info/) From 2f4413d1a29b8b0e04dfd1fa16ae72276c2e3543 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 13 Feb 2019 11:56:24 +0300 Subject: [PATCH 163/297] move js + temporary markup workaround --- docs/ru/introduction/info.md | 8 +++----- docs/tools/mkdocs-material-theme/base.html | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/ru/introduction/info.md b/docs/ru/introduction/info.md index 9fea6576071..69b40c1776d 100644 --- a/docs/ru/introduction/info.md +++ b/docs/ru/introduction/info.md @@ -1,11 +1,9 @@ # Информационная поддержка Информационная поддержка ClickHouse осуществляется на всей территории Российской Федерации без ограничений посредством использования телефонной связи и средств электронной почты на русском языке в круглосуточном режиме: -* Адрес электронной почты: -document.write(''); -document.write(window.location.hostname.split('.')[0]);document.write('-feedback@yandex-team.ru') - +* Адрес электронной почты: * Телефон: 8-800-250-96-39 (звонки бесплатны из всех регионов России) +

















    + [Оригинальная статья](https://clickhouse.yandex/docs/ru/introduction/info/) diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index 05708186299..2854f189d94 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -247,6 +247,12 @@ }); } window.onbeforeprint = beforePrint; + + var name = window.location.hostname.split('.')[0]; + var feedback_address = name + '-feedback' + '@yandex-team.ru'; + var feedback_email = document.getElementsByClassName('feedback-email'); + feedback_email.setAttribute('href', 'mailto:' + feedback_address); + feedback_email.innerHTML = feedback_address; }); From 809356f4796618d5db098a23e6dd56a3a196b1c3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 13 Feb 2019 12:14:03 +0300 Subject: [PATCH 164/297] fix js --- docs/tools/mkdocs-material-theme/base.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/tools/mkdocs-material-theme/base.html b/docs/tools/mkdocs-material-theme/base.html index 2854f189d94..91a10d8e6c3 100644 --- a/docs/tools/mkdocs-material-theme/base.html +++ b/docs/tools/mkdocs-material-theme/base.html @@ -223,6 +223,7 @@ }); } ready(function () { + var i; {% if config.extra.single_page and page.content %} document.getElementById("content").innerHTML = {{ page.content|tojson|safe }}; document.getElementsByClassName('md-footer')[0].style.display = 'block'; @@ -235,7 +236,7 @@ }); var beforePrint = function() { var details = document.getElementsByTagName("details"); - for (var i = 0; i < details.length; ++i) { + for (i = 0; i < details.length; ++i) { details[i].open = 1; } }; @@ -251,8 +252,10 @@ var name = window.location.hostname.split('.')[0]; var feedback_address = name + '-feedback' + '@yandex-team.ru'; var feedback_email = document.getElementsByClassName('feedback-email'); - feedback_email.setAttribute('href', 'mailto:' + feedback_address); - feedback_email.innerHTML = feedback_address; + for (i = 0; i < feedback_email.length; i++) { + feedback_email[i].setAttribute('href', 'mailto:' + feedback_address); + feedback_email[i].innerHTML = feedback_address; + } }); From c820ff071ff7c3e5b9dbb0423b676e1ddf4fdf2d Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 13 Feb 2019 14:42:18 +0300 Subject: [PATCH 165/297] Initial contrib.md --- docs/en/development/contrib.md | 33 +++++++++++++++++++++++++++++++++ docs/fa/development/contrib.md | 1 + docs/ru/development/contrib.md | 33 +++++++++++++++++++++++++++++++++ docs/toc_en.yml | 1 + docs/toc_fa.yml | 1 + docs/toc_ru.yml | 1 + docs/toc_zh.yml | 1 + docs/zh/development/contrib.md | 1 + 8 files changed, 72 insertions(+) create mode 100644 docs/en/development/contrib.md create mode 120000 docs/fa/development/contrib.md create mode 100644 docs/ru/development/contrib.md create mode 120000 docs/zh/development/contrib.md diff --git a/docs/en/development/contrib.md b/docs/en/development/contrib.md new file mode 100644 index 00000000000..cfbdd28dbf3 --- /dev/null +++ b/docs/en/development/contrib.md @@ -0,0 +1,33 @@ +# Third-Party Libraries Used + +| Library | License | +| ------- | ------- | +| base64 | [BSD 2-Clause License](https://github.com/aklomp/base64/blob/a27c565d1b6c676beaf297fe503c4518185666f7/LICENSE) | +| boost | [Boost Software License 1.0](https://github.com/ClickHouse-Extras/boost-extra/blob/6883b40449f378019aec792f9983ce3afc7ff16e/LICENSE_1_0.txt) | +| brotli | [MIT](https://github.com/google/brotli/blob/master/LICENSE) | +| capnproto | [MIT](https://github.com/capnproto/capnproto/blob/master/LICENSE) | +| cctz | [Apache License 2.0](https://github.com/google/cctz/blob/4f9776a310f4952454636363def82c2bf6641d5f/LICENSE.txt) | +| double-conversion | [BSD 3-Clause License](https://github.com/google/double-conversion/blob/cf2f0f3d547dc73b4612028a155b80536902ba02/LICENSE) | +| FastMemcpy | [MIT](https://github.com/yandex/ClickHouse/blob/master/libs/libmemcpy/impl/LICENSE) | +| googletest | [BSD 3-Clause License](https://github.com/google/googletest/blob/master/LICENSE) | +| libbtrie | [BSD 2-Clause License](https://github.com/yandex/ClickHouse/blob/master/contrib/libbtrie/LICENSE) | +| libcxxabi | [BSD + MIT](https://github.com/yandex/ClickHouse/blob/master/libs/libglibc-compatibility/libcxxabi/LICENSE.TXT) | +| libdivide | [Zlib License](https://github.com/yandex/ClickHouse/blob/master/contrib/libdivide/LICENSE.txt) | +| libgsasl | [LGPL v2.1](https://github.com/ClickHouse-Extras/libgsasl/blob/3b8948a4042e34fb00b4fb987535dc9e02e39040/LICENSE) +| libhdfs3 | [Apache License 2.0](https://github.com/ClickHouse-Extras/libhdfs3/blob/bd6505cbb0c130b0db695305b9a38546fa880e5a/LICENSE.txt) | +| libmetrohash | [Apache License 2.0](https://github.com/yandex/ClickHouse/blob/master/contrib/libmetrohash/LICENSE) | +| libpcg-random | [Apache License 2.0](https://github.com/yandex/ClickHouse/blob/master/contrib/libpcg-random/LICENSE-APACHE.txt) | +| libressl | [OpenSSL License](https://github.com/ClickHouse-Extras/ssl/blob/master/COPYING) | +| librdkafka | [BSD 2-Clause License](https://github.com/edenhill/librdkafka/blob/363dcad5a23dc29381cc626620e68ae418b3af19/LICENSE) | +| libwidechar\_width | [CC0 1.0 Universal](https://github.com/yandex/ClickHouse/blob/master/libs/libwidechar_width/LICENSE) | +| llvm | [BSD 3-Clause License](https://github.com/ClickHouse-Extras/llvm/blob/163def217817c90fb982a6daf384744d8472b92b/llvm/LICENSE.TXT) | +| lz4 | [BSD 2-Clause License](https://github.com/lz4/lz4/blob/c10863b98e1503af90616ae99725ecd120265dfb/LICENSE) | +| mariadb-connector-c | [LGPL v2.1](https://github.com/ClickHouse-Extras/mariadb-connector-c/blob/3.1/COPYING.LIB) | +| murmurhash | [Public Domain](https://github.com/yandex/ClickHouse/blob/master/contrib/murmurhash/LICENSE) +| pdqsort | [Zlib License](https://github.com/yandex/ClickHouse/blob/master/contrib/pdqsort/license.txt) | +| poco | [Boost Software License - Version 1.0](https://github.com/ClickHouse-Extras/poco/blob/fe5505e56c27b6ecb0dcbc40c49dc2caf4e9637f/LICENSE) | +| protobuf | [BSD 3-Clause License](https://github.com/ClickHouse-Extras/protobuf/blob/12735370922a35f03999afff478e1c6d7aa917a4/LICENSE) | +| re2 | [BSD 3-Clause License](https://github.com/google/re2/blob/7cf8b88e8f70f97fd4926b56aa87e7f53b2717e0/LICENSE) | +| UnixODBC | [LGPL v2.1](https://github.com/ClickHouse-Extras/UnixODBC/tree/b0ad30f7f6289c12b76f04bfb9d466374bb32168) | +| zlib-ng | [Zlib License](https://github.com/ClickHouse-Extras/zlib-ng/blob/develop/LICENSE.md) | +| zstd | [BSD 3-Clause License](https://github.com/facebook/zstd/blob/dev/LICENSE) | diff --git a/docs/fa/development/contrib.md b/docs/fa/development/contrib.md new file mode 120000 index 00000000000..4749f95f9ef --- /dev/null +++ b/docs/fa/development/contrib.md @@ -0,0 +1 @@ +../../en/development/contrib.md \ No newline at end of file diff --git a/docs/ru/development/contrib.md b/docs/ru/development/contrib.md new file mode 100644 index 00000000000..f7afd8bb0a8 --- /dev/null +++ b/docs/ru/development/contrib.md @@ -0,0 +1,33 @@ +# Используемые сторонние библиотеки + +| Библиотека | Лицензия | +| ------- | ------- | +| base64 | [BSD 2-Clause License](https://github.com/aklomp/base64/blob/a27c565d1b6c676beaf297fe503c4518185666f7/LICENSE) | +| boost | [Boost Software License 1.0](https://github.com/ClickHouse-Extras/boost-extra/blob/6883b40449f378019aec792f9983ce3afc7ff16e/LICENSE_1_0.txt) | +| brotli | [MIT](https://github.com/google/brotli/blob/master/LICENSE) | +| capnproto | [MIT](https://github.com/capnproto/capnproto/blob/master/LICENSE) | +| cctz | [Apache License 2.0](https://github.com/google/cctz/blob/4f9776a310f4952454636363def82c2bf6641d5f/LICENSE.txt) | +| double-conversion | [BSD 3-Clause License](https://github.com/google/double-conversion/blob/cf2f0f3d547dc73b4612028a155b80536902ba02/LICENSE) | +| FastMemcpy | [MIT](https://github.com/yandex/ClickHouse/blob/master/libs/libmemcpy/impl/LICENSE) | +| googletest | [BSD 3-Clause License](https://github.com/google/googletest/blob/master/LICENSE) | +| libbtrie | [BSD 2-Clause License](https://github.com/yandex/ClickHouse/blob/master/contrib/libbtrie/LICENSE) | +| libcxxabi | [BSD + MIT](https://github.com/yandex/ClickHouse/blob/master/libs/libglibc-compatibility/libcxxabi/LICENSE.TXT) | +| libdivide | [Zlib License](https://github.com/yandex/ClickHouse/blob/master/contrib/libdivide/LICENSE.txt) | +| libgsasl | [LGPL v2.1](https://github.com/ClickHouse-Extras/libgsasl/blob/3b8948a4042e34fb00b4fb987535dc9e02e39040/LICENSE) +| libhdfs3 | [Apache License 2.0](https://github.com/ClickHouse-Extras/libhdfs3/blob/bd6505cbb0c130b0db695305b9a38546fa880e5a/LICENSE.txt) | +| libmetrohash | [Apache License 2.0](https://github.com/yandex/ClickHouse/blob/master/contrib/libmetrohash/LICENSE) | +| libpcg-random | [Apache License 2.0](https://github.com/yandex/ClickHouse/blob/master/contrib/libpcg-random/LICENSE-APACHE.txt) | +| libressl | [OpenSSL License](https://github.com/ClickHouse-Extras/ssl/blob/master/COPYING) | +| librdkafka | [BSD 2-Clause License](https://github.com/edenhill/librdkafka/blob/363dcad5a23dc29381cc626620e68ae418b3af19/LICENSE) | +| libwidechar\_width | [CC0 1.0 Universal](https://github.com/yandex/ClickHouse/blob/master/libs/libwidechar_width/LICENSE) | +| llvm | [BSD 3-Clause License](https://github.com/ClickHouse-Extras/llvm/blob/163def217817c90fb982a6daf384744d8472b92b/llvm/LICENSE.TXT) | +| lz4 | [BSD 2-Clause License](https://github.com/lz4/lz4/blob/c10863b98e1503af90616ae99725ecd120265dfb/LICENSE) | +| mariadb-connector-c | [LGPL v2.1](https://github.com/ClickHouse-Extras/mariadb-connector-c/blob/3.1/COPYING.LIB) | +| murmurhash | [Public Domain](https://github.com/yandex/ClickHouse/blob/master/contrib/murmurhash/LICENSE) +| pdqsort | [Zlib License](https://github.com/yandex/ClickHouse/blob/master/contrib/pdqsort/license.txt) | +| poco | [Boost Software License - Version 1.0](https://github.com/ClickHouse-Extras/poco/blob/fe5505e56c27b6ecb0dcbc40c49dc2caf4e9637f/LICENSE) | +| protobuf | [BSD 3-Clause License](https://github.com/ClickHouse-Extras/protobuf/blob/12735370922a35f03999afff478e1c6d7aa917a4/LICENSE) | +| re2 | [BSD 3-Clause License](https://github.com/google/re2/blob/7cf8b88e8f70f97fd4926b56aa87e7f53b2717e0/LICENSE) | +| UnixODBC | [LGPL v2.1](https://github.com/ClickHouse-Extras/UnixODBC/tree/b0ad30f7f6289c12b76f04bfb9d466374bb32168) | +| zlib-ng | [Zlib License](https://github.com/ClickHouse-Extras/zlib-ng/blob/develop/LICENSE.md) | +| zstd | [BSD 3-Clause License](https://github.com/facebook/zstd/blob/dev/LICENSE) | diff --git a/docs/toc_en.yml b/docs/toc_en.yml index d27929eb855..aa9a7e2060f 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -192,6 +192,7 @@ nav: - 'How to Build ClickHouse on Mac OS X': 'development/build_osx.md' - 'How to Write C++ code': 'development/style.md' - 'How to Run ClickHouse Tests': 'development/tests.md' + - 'Third-Party Libraries Used': 'development/contrib.md' - 'What''s New': - 'Roadmap': 'roadmap.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index f51c11125c8..0b84040282a 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -192,6 +192,7 @@ nav: - 'How to Build ClickHouse on Mac OS X': 'development/build_osx.md' - 'How to Write C++ code': 'development/style.md' - 'How to Run ClickHouse Tests': 'development/tests.md' + - 'Third-Party Libraries Used': 'development/contrib.md' - 'What''s New': - 'Roadmap': 'roadmap.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index f3422e9d9b4..2840eaed6db 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -193,6 +193,7 @@ nav: - 'Как собрать ClickHouse на Mac OS X': 'development/build_osx.md' - 'Как писать код на C++': 'development/style.md' - 'Как запустить тесты': 'development/tests.md' + - 'Сторонние библиотеки': 'development/contrib.md' - 'Что нового': - 'Changelog': 'changelog.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 30fc4a2fa66..64cb2446f41 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -191,6 +191,7 @@ nav: - '如何在Mac OS X中编译ClickHouse': 'development/build_osx.md' - '如何编写C++代码': 'development/style.md' - '如何运行ClickHouse测试': 'development/tests.md' + - '使用的第三方库': 'development/contrib.md' - '新功能特性': - '路线图': 'roadmap.md' diff --git a/docs/zh/development/contrib.md b/docs/zh/development/contrib.md new file mode 120000 index 00000000000..4749f95f9ef --- /dev/null +++ b/docs/zh/development/contrib.md @@ -0,0 +1 @@ +../../en/development/contrib.md \ No newline at end of file From 842a9708e944704262bd4850fae05787c9074655 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 5 Mar 2019 19:01:13 +0300 Subject: [PATCH 166/297] ExternalDictionaries: don't lock when checking if a dictionary is modified --- dbms/src/Interpreters/ExternalLoader.cpp | 41 ++++++++++++------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/dbms/src/Interpreters/ExternalLoader.cpp b/dbms/src/Interpreters/ExternalLoader.cpp index 4e0f12ea254..089bda1752c 100644 --- a/dbms/src/Interpreters/ExternalLoader.cpp +++ b/dbms/src/Interpreters/ExternalLoader.cpp @@ -155,14 +155,6 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error) /// periodic update std::vector> objects_to_update; - auto getNextUpdateTime = [this](const LoadablePtr & current) - { - /// calculate next update time - const auto & lifetime = current->getLifetime(); - std::uniform_int_distribution distribution{lifetime.min_sec, lifetime.max_sec}; - return std::chrono::system_clock::now() + std::chrono::seconds{distribution(rnd_engine)}; - }; - /// Collect objects that needs to be updated under lock. Then create new versions without lock, and assign under lock. { std::lock_guard lock{map_mutex}; @@ -185,18 +177,12 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error) if (!current->supportUpdates()) continue; - auto & update_time = update_times[current->getName()]; + auto update_time = update_times[current->getName()]; /// check that timeout has passed if (std::chrono::system_clock::now() < update_time) continue; - if (!current->isModified()) - { - update_time = getNextUpdateTime(current); - continue; - } - objects_to_update.emplace_back(loadable_object.first, current); } catch (...) @@ -209,6 +195,14 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error) } } + auto getNextUpdateTime = [this](const LoadablePtr & current) + { + /// Calculate next update time. + const auto & lifetime = current->getLifetime(); + std::uniform_int_distribution distribution{lifetime.min_sec, lifetime.max_sec}; + return std::chrono::system_clock::now() + std::chrono::seconds{distribution(rnd_engine)}; + }; + for (auto & [name, current] : objects_to_update) { LoadablePtr new_version; @@ -216,9 +210,12 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error) try { - /// create new version of loadable object - new_version = current->clone(); - exception = new_version->getCreationException(); + if (current->isModified()) + { + /// Create new version of loadable object. + new_version = current->clone(); + exception = new_version->getCreationException(); + } } catch (...) { @@ -235,8 +232,12 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error) it->second.exception = exception; if (!exception) { - it->second.loadable.reset(); - it->second.loadable = std::move(new_version); + /// If the dictionary is not modified - leave old version. + if (new_version) + { + it->second.loadable.reset(); + it->second.loadable = std::move(new_version); + } } else { From 952b5ea24a09528d9f3caa4d3e033b182143a060 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 01:42:28 +0300 Subject: [PATCH 167/297] Rename trigramDistance to ngramDistance, add more functions with CaseInsensitive and UTF, update docs, more job done in perf, added some perf tests for string search that I would like to see --- .../Functions/FunctionsStringSimilarity.cpp | 340 ++++++++---- .../src/Functions/FunctionsStringSimilarity.h | 3 +- dbms/tests/performance/website/url_hits.xml | 6 + .../00909_ngram_distance.reference | 509 ++++++++++++++++++ .../0_stateless/00909_ngram_distance.sql | 106 ++++ .../00909_trigram_distance.reference | 119 ---- .../0_stateless/00909_trigram_distance.sql | 29 - .../functions/string_search_functions.md | 8 + .../functions/string_search_functions.md | 8 + 9 files changed, 878 insertions(+), 250 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00909_ngram_distance.reference create mode 100644 dbms/tests/queries/0_stateless/00909_ngram_distance.sql delete mode 100644 dbms/tests/queries/0_stateless/00909_trigram_distance.reference delete mode 100644 dbms/tests/queries/0_stateless/00909_trigram_distance.sql diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index 7f0267d6d59..a90c7e82acd 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -8,164 +8,271 @@ #include +#include + #include +#include #include #include #include +#include #ifdef __SSE4_2__ -#include +# include #endif namespace DB { /** Distance function implementation. - * We calculate all the trigrams from left string and count by the index of + * We calculate all the n-grams from left string and count by the index of * 16 bits hash of them in the map. - * Then calculate all the trigrams from the right string and calculate - * the trigram distance on the flight by adding and subtracting from the hashmap. + * Then calculate all the n-grams from the right string and calculate + * the n-gram distance on the flight by adding and subtracting from the hashmap. * Then return the map into the condition of which it was after the left string * calculation. If the right string size is big (more than 2**15 bytes), * the strings are not similar at all and we return 1. */ -struct TrigramDistanceImpl +template +struct NgramDistanceImpl { using ResultType = Float32; - using CodePoint = UInt32; - /// map_size for trigram difference + /// map_size for ngram difference. static constexpr size_t map_size = 1u << 16; - /// If the haystack size is bigger than this, behaviour is unspecified for this function + /// If the haystack size is bigger than this, behaviour is unspecified for this function. static constexpr size_t max_string_size = 1u << 15; + /// Default padding to read safely. + static constexpr size_t default_padding = 16; + + /// Max codepoints to store at once. 16 is for batching usage and PODArray has this padding. + static constexpr size_t simultaneously_codepoints_num = default_padding + N - 1; + /** This fits mostly in L2 cache all the time. * Actually use UInt16 as addings and subtractions do not UB overflow. But think of it as a signed * integer array. */ - using TrigramStats = UInt16[map_size]; + using NgramStats = UInt16[map_size]; - static ALWAYS_INLINE UInt16 trigramHash(CodePoint one, CodePoint two, CodePoint three) + static ALWAYS_INLINE UInt16 ASCIIHash(const CodePoint * code_points) { - UInt64 combined = (static_cast(one) << 32) | two; + return intHashCRC32(unalignedLoad(code_points)) & 0xFFFFu; + } + + static ALWAYS_INLINE UInt16 UTF8Hash(const CodePoint * code_points) + { + UInt64 combined = (static_cast(code_points[0]) << 32) | code_points[1]; #ifdef __SSE4_2__ - return _mm_crc32_u64(three, combined) & 0xFFFFu; + return _mm_crc32_u64(code_points[2], combined) & 0xFFFFu; #else - return (intHashCRC32(combined) ^ intHashCRC32(three)) & 0xFFFFu; + return (intHashCRC32(combined) ^ intHashCRC32(code_points[2])) & 0xFFFFu; #endif } - static ALWAYS_INLINE CodePoint readCodePoint(const char *& pos, const char * end) noexcept + template + static ALWAYS_INLINE inline void unrollLowering(Container & cont, const std::index_sequence &) { - size_t length = UTF8::seqLength(*pos); - - if (pos + length > end) - length = end - pos; - - CodePoint res; - /// This is faster than just memcpy because of compiler optimizations with moving bytes. - switch (length) - { - case 1: - res = 0; - memcpy(&res, pos, 1); - break; - case 2: - res = 0; - memcpy(&res, pos, 2); - break; - case 3: - res = 0; - memcpy(&res, pos, 3); - break; - default: - memcpy(&res, pos, 4); - } - - pos += length; - return res; + ((cont[Offset + I] = std::tolower(cont[Offset + I])), ...); } - static inline size_t calculateNeedleStats(const char * data, const size_t size, TrigramStats & trigram_stats) noexcept + static ALWAYS_INLINE size_t readASCIICodePoints(CodePoint * code_points, const char *& pos, const char * end) { - size_t len = 0; - const char * start = data; - const char * end = data + size; - CodePoint cp1 = 0; - CodePoint cp2 = 0; - CodePoint cp3 = 0; + /// Offset before which we copy some data. + constexpr size_t padding_offset = default_padding - N + 1; + /// We have an array like this for ASCII (N == 4, other cases are similar) + /// |a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18| + /// And we copy ^^^^^^^^^^^^^^^ these bytes to the start + /// Actually it is enough to copy 3 bytes, but memcpy for 4 bytes translates into 1 instruction + memcpy(code_points, code_points + padding_offset, roundUpToPowerOfTwoOrZero(N - 1) * sizeof(CodePoint)); + /// Now we have an array + /// |a13|a14|a15|a16|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18| + /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + /// Doing unaligned read of 16 bytes and copy them like above + /// 16 is also chosen to do two `movups`. + /// Such copying allow us to have 3 codepoints from the previous read to produce the n-gram with them. + memcpy(code_points + (N - 1), pos, default_padding * sizeof(CodePoint)); - while (start != end) + if constexpr (CaseInsensitive) { - cp1 = cp2; - cp2 = cp3; - cp3 = readCodePoint(start, end); - ++len; - if (len < 3) - continue; - ++trigram_stats[trigramHash(cp1, cp2, cp3)]; + /// We really need template lambdas with C++20 to do it inline + unrollLowering(code_points, std::make_index_sequence()); } - return std::max(static_cast(0), static_cast(len) - 2); + pos += padding_offset; + if (pos > end) + return default_padding - (pos - end); + return default_padding; } - static inline UInt64 calculateHaystackStatsAndMetric(const char * data, const size_t size, TrigramStats & trigram_stats, size_t & distance) + static ALWAYS_INLINE size_t readUTF8CodePoints(CodePoint * code_points, const char *& pos, const char * end) { - size_t len = 0; - size_t trigram_cnt = 0; + /// The same copying as described in the function above. + memcpy(code_points, code_points + default_padding - N + 1, roundUpToPowerOfTwoOrZero(N - 1) * sizeof(CodePoint)); + + size_t num = N - 1; + while (num < default_padding && pos < end) + { + size_t length = UTF8::seqLength(*pos); + + if (pos + length > end) + length = end - pos; + + CodePoint res; + /// This is faster than just memcpy because of compiler optimizations with moving bytes. + switch (length) + { + case 1: + res = 0; + memcpy(&res, pos, 1); + break; + case 2: + res = 0; + memcpy(&res, pos, 2); + break; + case 3: + res = 0; + memcpy(&res, pos, 3); + break; + default: + memcpy(&res, pos, 4); + } + + /// This is not a really true case insensitive utf8. We zero the 5-th bit of every byte. + /// For ASCII it works https://catonmat.net/ascii-case-conversion-trick. For most cyrrilic letters also does. + /// For others, we don't care now. Lowering UTF is not a cheap operation. + if constexpr (CaseInsensitive) + { + switch (length) + { + case 4: + res &= ~(1u << (5 + 3 * CHAR_BIT)); + [[fallthrough]]; + case 3: + res &= ~(1u << (5 + 2 * CHAR_BIT)); + [[fallthrough]]; + case 2: + res &= ~(1u << (5 + CHAR_BIT)); + [[fallthrough]]; + default: + res &= ~(1u << 5); + } + } + + pos += length; + code_points[num++] = res; + } + return num; + } + + static ALWAYS_INLINE inline size_t calculateNeedleStats( + const char * data, + const size_t size, + NgramStats & ngram_stats, + size_t (*read_code_points)(CodePoint *, const char *&, const char *), + UInt16 (*hash_functor)(const CodePoint *)) + { + // To prevent size_t overflow below. + if (size < N) + return 0; + const char * start = data; const char * end = data + size; - CodePoint cp1 = 0; - CodePoint cp2 = 0; - CodePoint cp3 = 0; + CodePoint cp[simultaneously_codepoints_num] = {}; + + /// read_code_points returns the position of cp where it stopped reading codepoints. + size_t found = read_code_points(cp, start, end); + /// We need to start for the first time here, because first N - 1 codepoints mean nothing. + size_t i = N - 1; + /// Initialize with this value because for the first time `found` does not initialize first N - 1 codepoints. + size_t len = -N + 1; + do + { + len += found - N + 1; + for (; i + N <= found; ++i) + ++ngram_stats[hash_functor(cp + i)]; + i = 0; + } while (start < end && (found = read_code_points(cp, start, end))); + + return len; + } + + static ALWAYS_INLINE inline UInt64 calculateHaystackStatsAndMetric( + const char * data, + const size_t size, + NgramStats & ngram_stats, + size_t & distance, + size_t (*read_code_points)(CodePoint *, const char *&, const char *), + UInt16 (*hash_functor)(const CodePoint *)) + { + size_t ngram_cnt = 0; + const char * start = data; + const char * end = data + size; + CodePoint cp[simultaneously_codepoints_num] = {}; /// allocation tricks, most strings are relatively small static constexpr size_t small_buffer_size = 256; std::unique_ptr big_buffer; UInt16 small_buffer[small_buffer_size]; - UInt16 * trigram_storage = small_buffer; + UInt16 * ngram_storage = small_buffer; if (size > small_buffer_size) { - trigram_storage = new UInt16[size]; - big_buffer.reset(trigram_storage); + ngram_storage = new UInt16[size]; + big_buffer.reset(ngram_storage); } - while (start != end) + /// read_code_points returns the position of cp where it stopped reading codepoints. + size_t found = read_code_points(cp, start, end); + /// We need to start for the first time here, because first N - 1 codepoints mean nothing. + size_t iter = N - 1; + + do { - cp1 = cp2; - cp2 = cp3; - cp3 = readCodePoint(start, end); - ++len; - if (len < 3) - continue; + for (; iter + N <= found; ++iter) + { + UInt16 hash = hash_functor(cp + iter); + if (static_cast(ngram_stats[hash]) > 0) + --distance; + else + ++distance; - UInt16 hash = trigramHash(cp1, cp2, cp3); - - if (static_cast(trigram_stats[hash]) > 0) - --distance; - else - ++distance; - - trigram_storage[trigram_cnt++] = hash; - --trigram_stats[hash]; - } + ngram_storage[ngram_cnt++] = hash; + --ngram_stats[hash]; + } + iter = 0; + } while (start < end && (found = read_code_points(cp, start, end))); /// Return the state of hash map to its initial. - for (size_t i = 0; i < trigram_cnt; ++i) - ++trigram_stats[trigram_storage[i]]; - - return trigram_cnt; + for (size_t i = 0; i < ngram_cnt; ++i) + ++ngram_stats[ngram_storage[i]]; + return ngram_cnt; } - static void constant_constant(const std::string & data, const std::string & needle, Float32 & res) + template + static inline size_t dispatchSearcher(Callback callback, Args &&... args) { - TrigramStats common_stats; + if constexpr (!UTF8) + return callback(std::forward(args)..., readASCIICodePoints, ASCIIHash); + else + return callback(std::forward(args)..., readUTF8CodePoints, UTF8Hash); + } + + static void constant_constant(std::string data, std::string needle, Float32 & res) + { + NgramStats common_stats; memset(common_stats, 0, sizeof(common_stats)); - size_t second_size = calculateNeedleStats(needle.data(), needle.size(), common_stats); + + /// We use unsafe versions of getting ngrams, so I decided to use padded strings. + const size_t needle_size = needle.size(); + const size_t data_size = data.size(); + needle.resize(needle_size + default_padding); + data.resize(data_size + default_padding); + + size_t second_size = dispatchSearcher(calculateNeedleStats, needle.data(), needle_size, common_stats); size_t distance = second_size; - if (data.size() <= max_string_size) + if (data_size <= max_string_size) { - size_t first_size = calculateHaystackStatsAndMetric(data.data(), data.size(), common_stats, distance); + size_t first_size = dispatchSearcher(calculateHaystackStatsAndMetric, data.data(), data_size, common_stats, distance); res = distance * 1.f / std::max(first_size + second_size, size_t(1)); } else @@ -175,11 +282,18 @@ struct TrigramDistanceImpl } static void vector_constant( - const ColumnString::Chars & data, const ColumnString::Offsets & offsets, const std::string & needle, PaddedPODArray & res) + const ColumnString::Chars & data, const ColumnString::Offsets & offsets, std::string needle, PaddedPODArray & res) { - TrigramStats common_stats; + /// zeroing our map + NgramStats common_stats; memset(common_stats, 0, sizeof(common_stats)); - const size_t needle_stats_size = calculateNeedleStats(needle.data(), needle.size(), common_stats); + + /// We use unsafe versions of getting ngrams, so I decided to use padded_data even in needle case. + const size_t needle_size = needle.size(); + needle.resize(needle_size + default_padding); + + const size_t needle_stats_size = dispatchSearcher(calculateNeedleStats, needle.data(), needle_size, common_stats); + size_t distance = needle_stats_size; size_t prev_offset = 0; for (size_t i = 0; i < offsets.size(); ++i) @@ -188,12 +302,13 @@ struct TrigramDistanceImpl const size_t haystack_size = offsets[i] - prev_offset - 1; if (haystack_size <= max_string_size) { - size_t haystack_stats_size - = calculateHaystackStatsAndMetric(reinterpret_cast(haystack), haystack_size, common_stats, distance); + size_t haystack_stats_size = dispatchSearcher( + calculateHaystackStatsAndMetric, reinterpret_cast(haystack), haystack_size, common_stats, distance); res[i] = distance * 1.f / std::max(haystack_stats_size + needle_stats_size, size_t(1)); } else { + /// if the strings are too big, we say they are completely not the same res[i] = 1.f; } distance = needle_stats_size; @@ -203,16 +318,39 @@ struct TrigramDistanceImpl }; -struct TrigramDistanceName +struct NgramDistanceName { - static constexpr auto name = "trigramDistance"; + static constexpr auto name = "ngramDistance"; }; -using FunctionTrigramsDistance = FunctionsStringSimilarity; +struct NgramDistanceCaseInsensitiveName +{ + static constexpr auto name = "ngramDistanceCaseInsensitive"; +}; + +struct NgramDistanceUTF8Name +{ + static constexpr auto name = "ngramDistanceUTF8"; +}; + +struct NgramDistanceUTF8CaseInsensitiveName +{ + static constexpr auto name = "ngramDistanceCaseInsensitiveUTF8"; +}; + +using FunctionNgramDistance = FunctionsStringSimilarity, NgramDistanceName>; +using FunctionNgramDistanceCaseInsensitive + = FunctionsStringSimilarity, NgramDistanceCaseInsensitiveName>; +using FunctionNgramDistanceUTF8 = FunctionsStringSimilarity, NgramDistanceUTF8Name>; +using FunctionNgramDistanceCaseInsensitiveUTF8 + = FunctionsStringSimilarity, NgramDistanceUTF8CaseInsensitiveName>; void registerFunctionsStringSimilarity(FunctionFactory & factory) { - factory.registerFunction(); + factory.registerFunction(); + factory.registerFunction(); + factory.registerFunction(); + factory.registerFunction(); } } diff --git a/dbms/src/Functions/FunctionsStringSimilarity.h b/dbms/src/Functions/FunctionsStringSimilarity.h index 00c90e20569..c23d9be999a 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.h +++ b/dbms/src/Functions/FunctionsStringSimilarity.h @@ -12,8 +12,9 @@ namespace DB /** Calculate similarity metrics: * - * trigramDistance(haystack, needle) --- calculate so called 3-gram distance between haystack and needle. + * ngramDistance(haystack, needle) --- calculate n-gram distance between haystack and needle. * Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. + * Also support CaseInsensitive and UTF8 formats. */ namespace ErrorCodes diff --git a/dbms/tests/performance/website/url_hits.xml b/dbms/tests/performance/website/url_hits.xml index f83ec663ef7..88f48705d9a 100644 --- a/dbms/tests/performance/website/url_hits.xml +++ b/dbms/tests/performance/website/url_hits.xml @@ -78,5 +78,11 @@ SELECT URLHash, EventDate, count() AS PageViews FROM {table} WHERE CounterID = 34 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND NOT Refresh AND TraficSourceID IN (-1, 6) AND RefererHash = halfMD5('http://example.ru/') GROUP BY URLHash, EventDate ORDER BY PageViews DESC LIMIT 100 SELECT WindowClientWidth, WindowClientHeight, count() AS PageViews FROM {table} WHERE CounterID = 34 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND NOT Refresh AND NOT DontCountHits AND URLHash = halfMD5('http://example.ru/') GROUP BY WindowClientWidth, WindowClientHeight ORDER BY PageViews DESC LIMIT 10000 SELECT toStartOfMinute(EventTime) AS Minute, count() AS PageViews FROM {table} WHERE CounterID = 34 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-02' AND NOT Refresh AND NOT DontCountHits GROUP BY Minute ORDER BY Minute +SELECT count(multiSearch(URL, ['yandex', 'google', 'rambler'])) from {table}; +SELECT count(match(URL, 'google|yandex|rambler')) from hits_100m_single; +SELECT count(match(URL, 'google')), count(match(URL, 'yandex')), count(match(URL, 'rambler')) from {table} +SELECT DISTINCT Title, ngramDistance(Title, 'what is love') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 +SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + diff --git a/dbms/tests/queries/0_stateless/00909_ngram_distance.reference b/dbms/tests/queries/0_stateless/00909_ngram_distance.reference new file mode 100644 index 00000000000..356cc5db466 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00909_ngram_distance.reference @@ -0,0 +1,509 @@ +0 +0 +0 +0 +0 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +0 +0 +0 +0 +0 +77 +77 +77 +77 +77 +636 +636 +636 +636 +636 +1000 +1000 +1000 +1000 +1000 +0 +1000 +1000 +0 +77 +636 +1000 +привет как дела?... Херсон 297 +пап привет как дела - Яндекс.Видео 422 +привет как дела клип - Яндекс.Видео 435 +привет братан как дела - Яндекс.Видео 500 +привет 529 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +привет как дела?... Херсон 459 +пап привет как дела - Яндекс.Видео 511 +привет 529 +привет как дела клип - Яндекс.Видео 565 +привет братан как дела - Яндекс.Видео 583 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +http://metrika.ru/ 524 +http://metric.ru/ 700 +http://metris.ru/ 700 +http://autometric.ru/ 750 +http://metrica.yandex.com/ 793 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 600 +http://metrica.yandex.com/ 655 +http://autometric.ru/ 667 +http://metris.ru/ 700 +http://metrika.ru/ 714 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrika.ru/ 619 +http://metric.ru/ 700 +http://metris.ru/ 700 +http://autometric.ru/ 750 +http://metrica.yandex.com/ 793 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 600 +http://autometric.ru/ 667 +http://metris.ru/ 700 +http://metrika.ru/ 714 +http://metrica.yandex.com/ 724 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrica.yandex.com/ 714 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +0 +0 +0 +0 +0 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +1000 +0 +0 +0 +0 +0 +77 +77 +77 +77 +77 +636 +636 +636 +636 +636 +1000 +1000 +1000 +1000 +1000 +0 +1000 +1000 +429 +77 +636 +1000 +привет как дела?... Херсон 297 +пап привет как дела - Яндекс.Видео 422 +привет как дела клип - Яндекс.Видео 435 +привет братан как дела - Яндекс.Видео 500 +привет 529 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +привет как дела?... Херсон 676 +пап привет как дела - Яндекс.Видео 733 +привет как дела клип - Яндекс.Видео 739 +привет братан как дела - Яндекс.Видео 750 +привет 882 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +http://metrika.ru/ 524 +http://metric.ru/ 700 +http://metris.ru/ 700 +http://autometric.ru/ 750 +http://metrica.yandex.com/ 793 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrika.ru/ 524 +http://metric.ru/ 700 +http://metris.ru/ 700 +http://autometric.ru/ 750 +http://metrica.yandex.com/ 793 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 600 +http://metrica.yandex.com/ 655 +http://autometric.ru/ 667 +http://metris.ru/ 700 +http://metrika.ru/ 714 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrika.ru/ 619 +http://metric.ru/ 700 +http://metris.ru/ 700 +http://autometric.ru/ 750 +http://metrica.yandex.com/ 793 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 600 +http://autometric.ru/ 667 +http://metris.ru/ 700 +http://metrika.ru/ 714 +http://metrica.yandex.com/ 724 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrica.yandex.com/ 714 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +привет как дела клип - Яндекс.Видео 182 +пап привет как дела - Яндекс.Видео 354 +привет братан как дела - Яндекс.Видео 382 +привет как дела?... Херсон 649 +привет 838 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +111 +111 +111 +111 +111 +429 +429 +429 +429 +429 +1000 +1000 +1000 +1000 +1000 +0 +0 +0 +0 +111 +429 +1000 +привет как дела?... Херсон 254 +пап привет как дела - Яндекс.Видео 398 +привет как дела клип - Яндекс.Видео 412 +привет братан как дела - Яндекс.Видео 461 +привет 471 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +привет как дела?... Херсон 343 +пап привет как дела - Яндекс.Видео 446 +привет 471 +привет как дела клип - Яндекс.Видео 482 +привет братан как дела - Яндекс.Видео 506 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +http://metrika.ru/ 579 +http://metric.ru/ 778 +http://metris.ru/ 778 +http://autometric.ru/ 818 +http://metrica.yandex.com/ 852 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 667 +http://metrica.yandex.com/ 704 +http://autometric.ru/ 727 +http://metris.ru/ 778 +http://metrika.ru/ 789 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrika.ru/ 684 +http://metric.ru/ 778 +http://metris.ru/ 778 +http://autometric.ru/ 818 +http://metrica.yandex.com/ 852 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 667 +http://autometric.ru/ 727 +http://metrica.yandex.com/ 778 +http://metris.ru/ 778 +http://metrika.ru/ 789 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrica.yandex.com/ 769 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +111 +111 +111 +111 +111 +600 +600 +600 +600 +600 +1000 +1000 +1000 +1000 +1000 +0 +0 +0 +0 +111 +600 +1000 +привет как дела?... Херсон 910 +пап привет как дела - Яндекс.Видео 928 +привет как дела клип - Яндекс.Видео 929 +привет братан как дела - Яндекс.Видео 955 +привет 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +привет как дела?... Херсон 672 +пап привет как дела - Яндекс.Видео 735 +привет как дела клип - Яндекс.Видео 741 +привет братан как дела - Яндекс.Видео 753 +привет 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 +http://metrika.ru/ 579 +http://metric.ru/ 778 +http://metris.ru/ 778 +http://autometric.ru/ 818 +http://metrica.yandex.com/ 852 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrika.ru/ 579 +http://metric.ru/ 778 +http://metris.ru/ 778 +http://autometric.ru/ 818 +http://metrica.yandex.com/ 852 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 667 +http://metrica.yandex.com/ 704 +http://autometric.ru/ 727 +http://metris.ru/ 778 +http://metrika.ru/ 789 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrika.ru/ 684 +http://metric.ru/ 778 +http://metris.ru/ 778 +http://autometric.ru/ 818 +http://metrica.yandex.com/ 852 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metric.ru/ 667 +http://autometric.ru/ 727 +http://metrica.yandex.com/ 778 +http://metris.ru/ 778 +http://metrika.ru/ 789 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 + 1000 +http://metrica.yandex.com/ 769 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 1000 diff --git a/dbms/tests/queries/0_stateless/00909_ngram_distance.sql b/dbms/tests/queries/0_stateless/00909_ngram_distance.sql new file mode 100644 index 00000000000..867e69f4fe7 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00909_ngram_distance.sql @@ -0,0 +1,106 @@ +select round(1000 * ngramDistanceUTF8(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абв'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize(''), 'абв')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абвгдеёжз')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абвгдеёж')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'гдеёзд')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'ёёёёёёёё')) from system.numbers limit 5; + +select round(1000 * ngramDistanceUTF8('', '')); +select round(1000 * ngramDistanceUTF8('абв', '')); +select round(1000 * ngramDistanceUTF8('', 'абв')); +select round(1000 * ngramDistanceUTF8('абвгдеёжз', 'абвгдеёжз')); +select round(1000 * ngramDistanceUTF8('абвгдеёжз', 'абвгдеёж')); +select round(1000 * ngramDistanceUTF8('абвгдеёжз', 'гдеёзд')); +select round(1000 * ngramDistanceUTF8('абвгдеёжз', 'ёёёёёёёё')); + +drop table if exists test.test_distance; +create table test.test_distance (Title String) engine = Memory; +insert into test.test_distance values ('привет как дела?... Херсон'), ('привет как дела клип - Яндекс.Видео'), ('привет'), ('пап привет как дела - Яндекс.Видео'), ('привет братан как дела - Яндекс.Видео'), ('http://metric.ru/'), ('http://autometric.ru/'), ('http://metrica.yandex.com/'), ('http://metris.ru/'), ('http://metrika.ru/'), (''); + +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'привет как дела') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'как привет дела') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'metrika') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'metrica') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'metriks') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'metrics') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceUTF8(Title, 'yandex') as distance; + + +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абв'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), 'абв')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвГДЕёжз'), 'АбвгдЕёжз')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('аБВГдеёЖз'), 'АбвГдеёж')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'гдеёЗД')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'ЁЁЁЁЁЁЁЁ')) from system.numbers limit 5; + +select round(1000 * ngramDistanceCaseInsensitiveUTF8('', '')); +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абв', '')); +select round(1000 * ngramDistanceCaseInsensitiveUTF8('', 'абв')); +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абвГДЕёжз', 'АбвгдЕЁжз')); +select round(1000 * ngramDistanceCaseInsensitiveUTF8('аБВГдеёЖз', 'АбвГдеёж')); +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абвгдеёжз', 'гдеёЗД')); +select round(1000 * ngramDistanceCaseInsensitiveUTF8('АБВГДеёжз', 'ЁЁЁЁЁЁЁЁ')); + +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'ПрИвЕт кАК ДЕЛа') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'как ПРИВЕТ дела') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'metrika') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'Metrika') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'mEtrica') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'metriKS') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'metrics') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'YanDEX') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'приВЕТ КАк ДеЛа КлИп - яндеКс.видео') as distance; + + +select round(1000 * ngramDistance(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abc'), '')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize(''), 'abc')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefgh')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefg')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), 'defgh')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), 'aaaaaaaa')) from system.numbers limit 5; + +select round(1000 * ngramDistance('', '')); +select round(1000 * ngramDistance('abc', '')); +select round(1000 * ngramDistance('', 'abc')); +select round(1000 * ngramDistance('abcdefgh', 'abcdefgh')); +select round(1000 * ngramDistance('abcdefgh', 'abcdefg')); +select round(1000 * ngramDistance('abcdefgh', 'defgh')); +select round(1000 * ngramDistance('abcdefgh', 'aaaaaaaa')); + +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'привет как дела') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'как привет дела') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'metrika') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'metrica') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'metriks') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'metrics') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistance(Title, 'yandex') as distance; + +select round(1000 * ngramDistanceCaseInsensitive(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('abc'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize(''), 'abc')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('abCdefgH'), 'Abcdefgh')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('abcdefgh'), 'abcdeFG')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('AAAAbcdefgh'), 'defgh')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('ABCdefgH'), 'aaaaaaaa')) from system.numbers limit 5; + +select round(1000 * ngramDistanceCaseInsensitive('', '')); +select round(1000 * ngramDistanceCaseInsensitive('abc', '')); +select round(1000 * ngramDistanceCaseInsensitive('', 'abc')); +select round(1000 * ngramDistanceCaseInsensitive('abCdefgH', 'Abcdefgh')); +select round(1000 * ngramDistanceCaseInsensitive('abcdefgh', 'abcdeFG')); +select round(1000 * ngramDistanceCaseInsensitive('AAAAbcdefgh', 'defgh')); +select round(1000 * ngramDistanceCaseInsensitive('ABCdefgH', 'aaaaaaaa')); + +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'ПрИвЕт кАК ДЕЛа') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'как ПРИВЕТ дела') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'metrika') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'Metrika') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'mEtrica') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'metriKS') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'metrics') as distance; +SELECT Title, round(1000 * distance) FROM test.test_distance ORDER BY ngramDistanceCaseInsensitive(Title, 'YanDEX') as distance; + +drop table if exists test.test_distance; diff --git a/dbms/tests/queries/0_stateless/00909_trigram_distance.reference b/dbms/tests/queries/0_stateless/00909_trigram_distance.reference deleted file mode 100644 index 14dba2a2dcf..00000000000 --- a/dbms/tests/queries/0_stateless/00909_trigram_distance.reference +++ /dev/null @@ -1,119 +0,0 @@ -0 -0 -0 -0 -0 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -1000 -0 -0 -0 -0 -0 -77 -77 -77 -77 -77 -636 -636 -636 -636 -636 -1000 -1000 -1000 -1000 -1000 -0 -1000 -1000 -0 -77 -636 -1000 -привет как дела?... Херсон -пап привет как дела - Яндекс.Видео -привет как дела клип - Яндекс.Видео -привет братан как дела - Яндекс.Видео -привет -http://metric.ru/ -http://autometric.ru/ -http://metrica.yandex.com/ -http://metris.ru/ -http://metrika.ru/ - -привет как дела?... Херсон -пап привет как дела - Яндекс.Видео -привет -привет как дела клип - Яндекс.Видео -привет братан как дела - Яндекс.Видео -http://metric.ru/ -http://autometric.ru/ -http://metrica.yandex.com/ -http://metris.ru/ -http://metrika.ru/ - -http://metrika.ru/ -http://metric.ru/ -http://metris.ru/ -http://autometric.ru/ -http://metrica.yandex.com/ -привет как дела?... Херсон -привет как дела клип - Яндекс.Видео -привет -пап привет как дела - Яндекс.Видео -привет братан как дела - Яндекс.Видео - -http://metric.ru/ -http://metrica.yandex.com/ -http://autometric.ru/ -http://metris.ru/ -http://metrika.ru/ -привет как дела?... Херсон -привет как дела клип - Яндекс.Видео -привет -пап привет как дела - Яндекс.Видео -привет братан как дела - Яндекс.Видео - -http://metrika.ru/ -http://metric.ru/ -http://metris.ru/ -http://autometric.ru/ -http://metrica.yandex.com/ -привет как дела?... Херсон -привет как дела клип - Яндекс.Видео -привет -пап привет как дела - Яндекс.Видео -привет братан как дела - Яндекс.Видео - -http://metric.ru/ -http://autometric.ru/ -http://metris.ru/ -http://metrika.ru/ -http://metrica.yandex.com/ -привет как дела?... Херсон -привет как дела клип - Яндекс.Видео -привет -пап привет как дела - Яндекс.Видео -привет братан как дела - Яндекс.Видео - -http://metrica.yandex.com/ -привет как дела?... Херсон -привет как дела клип - Яндекс.Видео -привет -пап привет как дела - Яндекс.Видео -привет братан как дела - Яндекс.Видео -http://metric.ru/ -http://autometric.ru/ -http://metris.ru/ -http://metrika.ru/ - diff --git a/dbms/tests/queries/0_stateless/00909_trigram_distance.sql b/dbms/tests/queries/0_stateless/00909_trigram_distance.sql deleted file mode 100644 index ca6a18d2513..00000000000 --- a/dbms/tests/queries/0_stateless/00909_trigram_distance.sql +++ /dev/null @@ -1,29 +0,0 @@ -select round(1000 * trigramDistance(materialize(''), '')) from system.numbers limit 5; -select round(1000 * trigramDistance(materialize('абв'), '')) from system.numbers limit 5; -select round(1000 * trigramDistance(materialize(''), 'абв')) from system.numbers limit 5; -select round(1000 * trigramDistance(materialize('абвгдеёжз'), 'абвгдеёжз')) from system.numbers limit 5; -select round(1000 * trigramDistance(materialize('абвгдеёжз'), 'абвгдеёж')) from system.numbers limit 5; -select round(1000 * trigramDistance(materialize('абвгдеёжз'), 'гдеёзд')) from system.numbers limit 5; -select round(1000 * trigramDistance(materialize('абвгдеёжз'), 'ёёёёёёёё')) from system.numbers limit 5; - -select round(1000 * trigramDistance('', '')); -select round(1000 * trigramDistance('абв', '')); -select round(1000 * trigramDistance('', 'абв')); -select round(1000 * trigramDistance('абвгдеёжз', 'абвгдеёжз')); -select round(1000 * trigramDistance('абвгдеёжз', 'абвгдеёж')); -select round(1000 * trigramDistance('абвгдеёжз', 'гдеёзд')); -select round(1000 * trigramDistance('абвгдеёжз', 'ёёёёёёёё')); - -drop table if exists test.test_distance; -create table test.test_distance (Title String) engine = Memory; -insert into test.test_distance values ('привет как дела?... Херсон'), ('привет как дела клип - Яндекс.Видео'), ('привет'), ('пап привет как дела - Яндекс.Видео'), ('привет братан как дела - Яндекс.Видео'), ('http://metric.ru/'), ('http://autometric.ru/'), ('http://metrica.yandex.com/'), ('http://metris.ru/'), ('http://metrika.ru/'), (''); - -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'привет как дела'); -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'как привет дела'); -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'metrika'); -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'metrica'); -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'metriks'); -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'metrics'); -SELECT Title FROM test.test_distance ORDER BY trigramDistance(Title, 'yandex'); - -drop table if exists test.test_distance; diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index b3b8b63d136..26890c4c920 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -70,5 +70,13 @@ For other regular expressions, the code is the same as for the 'match' function. The same thing as 'like', but negative. +## ngramDistance(haystack, needle) + +Calculate the 4-gram distance between `haystack` and `needle`: count the symmetric difference between two sets of 4-grams and normalize it by the sum of their cardinality. Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throw an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. + +For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. + +Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2 bytes hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. + [Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_search_functions/) diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index a79ea043716..b0f72e6474d 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -59,4 +59,12 @@ ## notLike(haystack, pattern), оператор haystack NOT LIKE pattern То же, что like, но с отрицанием. +## ngramDistance(haystack, needle) + +Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя множествами 4-грам и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 - чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строка из `haystack` больше 32КБ, расстояние всегда равно единице. + +Для поиска без учета регистра и/или в формате UTF-8 используйте функции `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. + +Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммовного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш-таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит каждого байта кодовой точки - это работает для латиницы и почти для всех кириллических букв. + [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_search_functions/) From 24cc9e4e65a3554d69b15305584393c582467827 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 01:44:47 +0300 Subject: [PATCH 168/297] Fix docs --- docs/en/query_language/functions/string_search_functions.md | 2 +- docs/ru/query_language/functions/string_search_functions.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index 26890c4c920..c900b52cf94 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -72,7 +72,7 @@ The same thing as 'like', but negative. ## ngramDistance(haystack, needle) -Calculate the 4-gram distance between `haystack` and `needle`: count the symmetric difference between two sets of 4-grams and normalize it by the sum of their cardinality. Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throw an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. +Calculate the 4-gram distance between `haystack` and `needle`: count the symmetric difference between two sets of 4-grams and normalize it by the sum of their cardinalities. Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throw an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index b0f72e6474d..48a255ded71 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -61,10 +61,10 @@ ## ngramDistance(haystack, needle) -Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя множествами 4-грам и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 - чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строка из `haystack` больше 32КБ, расстояние всегда равно единице. +Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя множествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 - чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строка из `haystack` больше 32КБ, расстояние всегда равно единице. Для поиска без учета регистра и/или в формате UTF-8 используйте функции `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммовного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш-таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит каждого байта кодовой точки - это работает для латиницы и почти для всех кириллических букв. +Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш-таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит каждого байта кодовой точки - это работает для латиницы и почти для всех кириллических букв. [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_search_functions/) From dcfd3fe37f1b025384ac0f444f189b79ba232079 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 02:08:08 +0300 Subject: [PATCH 169/297] Comment in FunctionsStringSimilarity --- dbms/src/Functions/FunctionsStringSimilarity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index a90c7e82acd..7c77857345a 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -90,7 +90,7 @@ struct NgramDistanceImpl /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /// Doing unaligned read of 16 bytes and copy them like above /// 16 is also chosen to do two `movups`. - /// Such copying allow us to have 3 codepoints from the previous read to produce the n-gram with them. + /// Such copying allow us to have 3 codepoints from the previous read to produce the 4-grams with them. memcpy(code_points + (N - 1), pos, default_padding * sizeof(CodePoint)); if constexpr (CaseInsensitive) From fb8e37f60f218ad9e09c362de02b8a44466a4cb2 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 6 Mar 2019 02:37:41 +0300 Subject: [PATCH 170/297] Fix segfault in function "replicate" --- dbms/src/Functions/replicate.cpp | 2 +- dbms/tests/queries/0_stateless/00914_replicate.reference | 1 + dbms/tests/queries/0_stateless/00914_replicate.sql | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 dbms/tests/queries/0_stateless/00914_replicate.reference create mode 100644 dbms/tests/queries/0_stateless/00914_replicate.sql diff --git a/dbms/src/Functions/replicate.cpp b/dbms/src/Functions/replicate.cpp index 756b745ccde..054106cfd5a 100644 --- a/dbms/src/Functions/replicate.cpp +++ b/dbms/src/Functions/replicate.cpp @@ -54,7 +54,7 @@ public: array_column = checkAndGetColumn(temp_column.get()); } block.getByPosition(result).column - = ColumnArray::create(first_column->replicate(array_column->getOffsets()), array_column->getOffsetsPtr()); + = ColumnArray::create(first_column->replicate(array_column->getOffsets())->convertToFullColumnIfConst(), array_column->getOffsetsPtr()); } }; diff --git a/dbms/tests/queries/0_stateless/00914_replicate.reference b/dbms/tests/queries/0_stateless/00914_replicate.reference new file mode 100644 index 00000000000..8932f7fcd7b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00914_replicate.reference @@ -0,0 +1 @@ +[[\'a\']] diff --git a/dbms/tests/queries/0_stateless/00914_replicate.sql b/dbms/tests/queries/0_stateless/00914_replicate.sql new file mode 100644 index 00000000000..4147df0ad45 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00914_replicate.sql @@ -0,0 +1 @@ +SELECT CAST(replicate(['a'], [1]) AS String); From 8800134b9a1d8ae9d5f0b87bf5ccefb2c1222455 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 02:43:23 +0300 Subject: [PATCH 171/297] remove public perf tests --- dbms/tests/performance/website/url_hits.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dbms/tests/performance/website/url_hits.xml b/dbms/tests/performance/website/url_hits.xml index 88f48705d9a..f83ec663ef7 100644 --- a/dbms/tests/performance/website/url_hits.xml +++ b/dbms/tests/performance/website/url_hits.xml @@ -78,11 +78,5 @@ SELECT URLHash, EventDate, count() AS PageViews FROM {table} WHERE CounterID = 34 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND NOT Refresh AND TraficSourceID IN (-1, 6) AND RefererHash = halfMD5('http://example.ru/') GROUP BY URLHash, EventDate ORDER BY PageViews DESC LIMIT 100 SELECT WindowClientWidth, WindowClientHeight, count() AS PageViews FROM {table} WHERE CounterID = 34 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND NOT Refresh AND NOT DontCountHits AND URLHash = halfMD5('http://example.ru/') GROUP BY WindowClientWidth, WindowClientHeight ORDER BY PageViews DESC LIMIT 10000 SELECT toStartOfMinute(EventTime) AS Minute, count() AS PageViews FROM {table} WHERE CounterID = 34 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-02' AND NOT Refresh AND NOT DontCountHits GROUP BY Minute ORDER BY Minute -SELECT count(multiSearch(URL, ['yandex', 'google', 'rambler'])) from {table}; -SELECT count(match(URL, 'google|yandex|rambler')) from hits_100m_single; -SELECT count(match(URL, 'google')), count(match(URL, 'yandex')), count(match(URL, 'rambler')) from {table} -SELECT DISTINCT Title, ngramDistance(Title, 'what is love') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 -SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 - From cb7158f615ebb445c0c013fc25091cb1e6615d76 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 02:52:19 +0300 Subject: [PATCH 172/297] perf test for distance functions in a proper folder --- .../string_search/ngram_distance.xml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dbms/tests/performance/string_search/ngram_distance.xml diff --git a/dbms/tests/performance/string_search/ngram_distance.xml b/dbms/tests/performance/string_search/ngram_distance.xml new file mode 100644 index 00000000000..557928cbf12 --- /dev/null +++ b/dbms/tests/performance/string_search/ngram_distance.xml @@ -0,0 +1,42 @@ + + Distance search performance search + + + search + + + + hits_100m_single + + + loop + + + + 5 + 10000 + + + 50 + 60000 + + + + SELECT DISTINCT Title, ngramDistance(Title, 'what is love') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistance(Title, 'baby dont hurt me') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistance(Title, 'no more') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'wHAt Is lovE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'BABY DonT hUrT me') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'nO MOrE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + + SELECT DISTINCT Title, ngramDistanceUTF8CaseInsensitive(Title, 'Метрика') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8CaseInsensitive(URL, 'как дЕлА') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8CaseInsensitive(URL, 'Чем зАнимаешЬся') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + + + + + From d09f2023c975c2b25156e2259e1ecb183b01e05c Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 02:54:00 +0300 Subject: [PATCH 173/297] typos in perf tests for distance function --- .../performance/string_search/ngram_distance.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbms/tests/performance/string_search/ngram_distance.xml b/dbms/tests/performance/string_search/ngram_distance.xml index 557928cbf12..2c75cd967cb 100644 --- a/dbms/tests/performance/string_search/ngram_distance.xml +++ b/dbms/tests/performance/string_search/ngram_distance.xml @@ -28,13 +28,13 @@ SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'wHAt Is lovE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'BABY DonT hUrT me') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'nO MOrE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT Title, ngramDistanceUTF8CaseInsensitive(Title, 'Метрика') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT URL, ngramDistanceUTF8CaseInsensitive(URL, 'как дЕлА') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT URL, ngramDistanceUTF8CaseInsensitive(URL, 'Чем зАнимаешЬся') AS distance FROM {table} ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT Title, ngramDistanceCaseInsensitiveUTF8(Title, 'Метрика') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceCaseInsensitiveUTF8(URL, 'как дЕлА') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceCaseInsensitiveUTF8(URL, 'Чем зАнимаешЬся') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 From 97349fb83ea66fcaaf05bfe9ef1fd40227f3dafa Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 02:55:51 +0300 Subject: [PATCH 174/297] typos in perf tests for distance function --- dbms/tests/performance/string_search/ngram_distance.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/tests/performance/string_search/ngram_distance.xml b/dbms/tests/performance/string_search/ngram_distance.xml index 2c75cd967cb..84b599dd882 100644 --- a/dbms/tests/performance/string_search/ngram_distance.xml +++ b/dbms/tests/performance/string_search/ngram_distance.xml @@ -1,5 +1,5 @@ - Distance search performance search + Distance search performance test search From 570af60bfa60d993941b95a5d3335fb8b3277249 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 03:05:14 +0300 Subject: [PATCH 175/297] more typos to the god of typos in distance perf test --- dbms/tests/performance/string_search/ngram_distance.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/tests/performance/string_search/ngram_distance.xml b/dbms/tests/performance/string_search/ngram_distance.xml index 84b599dd882..16960811067 100644 --- a/dbms/tests/performance/string_search/ngram_distance.xml +++ b/dbms/tests/performance/string_search/ngram_distance.xml @@ -30,7 +30,7 @@ SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'nO MOrE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 - SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'чем занимаешься') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceCaseInsensitiveUTF8(Title, 'Метрика') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT URL, ngramDistanceCaseInsensitiveUTF8(URL, 'как дЕлА') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 From dd22d1fb89e491020b7e9b5c13133e8add2f9967 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 6 Mar 2019 03:08:12 +0300 Subject: [PATCH 176/297] Better docs to the distance functions --- docs/en/query_language/functions/string_search_functions.md | 4 ++-- docs/ru/query_language/functions/string_search_functions.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index c900b52cf94..bde56693c36 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -72,11 +72,11 @@ The same thing as 'like', but negative. ## ngramDistance(haystack, needle) -Calculate the 4-gram distance between `haystack` and `needle`: count the symmetric difference between two sets of 4-grams and normalize it by the sum of their cardinalities. Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throw an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. +Calculate the 4-gram distance between `haystack` and `needle`: count the symmetric difference between two multisets of 4-grams and normalize it by the sum of their cardinalities. Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throw an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2 bytes hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. +Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2 bytes hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. [Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_search_functions/) diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index 48a255ded71..6658cc4ee19 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -61,10 +61,10 @@ ## ngramDistance(haystack, needle) -Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя множествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 - чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строка из `haystack` больше 32КБ, расстояние всегда равно единице. +Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя мультимножествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 - чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строка из `haystack` больше 32КБ, расстояние всегда равно единице. Для поиска без учета регистра и/или в формате UTF-8 используйте функции `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш-таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит каждого байта кодовой точки - это работает для латиницы и почти для всех кириллических букв. +Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит (нумерация с нуля) каждого байта кодовой точки - это работает для латиницы и почти для всех кириллических букв. [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_search_functions/) From bccbd52d783b7bdceb364e5f8e6051995cabfa70 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Mon, 4 Mar 2019 18:40:49 +0100 Subject: [PATCH 177/297] Rework system.graphite_retentions table --- .../GraphiteRollupSortedBlockInputStream.h | 1 + .../MergeTree/registerStorageMergeTree.cpp | 1 + .../Storages/System/StorageSystemGraphite.cpp | 253 ++++++++---------- .../Storages/System/StorageSystemGraphite.h | 14 + 4 files changed, 124 insertions(+), 145 deletions(-) diff --git a/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h b/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h index bb2f81fc81f..dc5260be0e7 100644 --- a/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h +++ b/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h @@ -124,6 +124,7 @@ namespace Graphite struct Params { + String config_name; String path_column_name; String time_column_name; String value_column_name; diff --git a/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp b/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp index 103be508564..4b934ea3122 100644 --- a/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp +++ b/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp @@ -165,6 +165,7 @@ static void setGraphitePatternsFromConfig(const Context & context, throw Exception("No '" + config_element + "' element in configuration file", ErrorCodes::NO_ELEMENTS_IN_CONFIG); + params.config_name = config_element; params.path_column_name = config.getString(config_element + ".path_column_name", "Path"); params.time_column_name = config.getString(config_element + ".time_column_name", "Time"); params.value_column_name = config.getString(config_element + ".value_column_name", "Value"); diff --git a/dbms/src/Storages/System/StorageSystemGraphite.cpp b/dbms/src/Storages/System/StorageSystemGraphite.cpp index d75eb71841e..ed37235e270 100644 --- a/dbms/src/Storages/System/StorageSystemGraphite.cpp +++ b/dbms/src/Storages/System/StorageSystemGraphite.cpp @@ -1,175 +1,138 @@ #include +#include +#include -#include -#include -#include -#include -#include -#include -#include #include -#include - namespace DB { -namespace ErrorCodes -{ - extern const int NO_ELEMENTS_IN_CONFIG; -} - -namespace -{ - -using namespace Poco::Util; - -struct Pattern -{ - struct Retention - { - UInt64 age; - UInt64 precision; - }; - - std::string regexp; - std::string function; - std::vector retentions; - UInt16 priority; - UInt8 is_default; -}; - -static Pattern readOnePattern( - const AbstractConfiguration & config, - const std::string & path) -{ - Pattern pattern; - AbstractConfiguration::Keys keys; - - config.keys(path, keys); - - if (keys.empty()) - throw Exception("Empty pattern in Graphite rollup configuration", ErrorCodes::NO_ELEMENTS_IN_CONFIG); - - for (const auto & key : keys) - { - const String key_path = path + "." + key; - - if (startsWith(key, "regexp")) - { - pattern.regexp = config.getString(key_path); - } - else if (startsWith(key, "function")) - { - pattern.function = config.getString(key_path); - } - else if (startsWith(key, "retention")) - { - pattern.retentions.push_back(Pattern::Retention{0, 0}); - pattern.retentions.back().age = config.getUInt64(key_path + ".age", 0); - pattern.retentions.back().precision = config.getUInt64(key_path + ".precision", 0); - } - } - - return pattern; -} - -static std::vector readPatterns( - const AbstractConfiguration & config, - const std::string & section) -{ - AbstractConfiguration::Keys keys; - std::vector result; - size_t count = 0; - - config.keys(section, keys); - - for (const auto & key : keys) - { - if (startsWith(key, "pattern")) - { - Pattern pattern(readOnePattern(config, section + "." + key)); - pattern.is_default = false; - pattern.priority = ++count; - result.push_back(pattern); - } - else if (startsWith(key, "default")) - { - Pattern pattern(readOnePattern(config, section + "." + key)); - pattern.is_default = true; - pattern.priority = std::numeric_limits::max(); - result.push_back(pattern); - } - } - - return result; -} - -static Strings getAllGraphiteSections(const AbstractConfiguration & config) -{ - Strings result; - - AbstractConfiguration::Keys keys; - config.keys(keys); - - for (const auto & key : keys) - { - if (startsWith(key, "graphite_")) - result.push_back(key); - } - - return result; -} - -} // namespace - NamesAndTypesList StorageSystemGraphite::getNamesAndTypes() { return { - {"config_name", std::make_shared()}, - {"regexp", std::make_shared()}, - {"function", std::make_shared()}, - {"age", std::make_shared()}, - {"precision", std::make_shared()}, - {"priority", std::make_shared()}, - {"is_default", std::make_shared()}, + {"config_name", std::make_shared()}, + {"regexp", std::make_shared()}, + {"function", std::make_shared()}, + {"age", std::make_shared()}, + {"precision", std::make_shared()}, + {"priority", std::make_shared()}, + {"is_default", std::make_shared()}, + {"Tables.database", std::make_shared(std::make_shared())}, + {"Tables.table", std::make_shared(std::make_shared())}, }; } +/* + * Looking for (Replicated)*GraphiteMergeTree and get all configuration parameters for them + */ +StorageSystemGraphite::Configs StorageSystemGraphite::getConfigs(const Context & context) const +{ + const Databases databases = context.getDatabases(); + Configs graphite_configs; + + for (const auto & db : databases) + { + for (auto iterator = db.second->getIterator(context); iterator->isValid(); iterator->next()) + { + auto & table = iterator->table(); + const MergeTreeData * table_data = nullptr; + + if (const StorageMergeTree * merge_tree = dynamic_cast(table.get())) + { + table_data = & merge_tree->getData(); + } + else if (const StorageReplicatedMergeTree * replicated_merge_tree = dynamic_cast(table.get())) + { + table_data = & replicated_merge_tree->getData(); + } + else + { + continue; + } + + if (table_data->merging_params.mode == MergeTreeData::MergingParams::Graphite) + { + const String config_name = table_data->merging_params.graphite_params.config_name; + + if (graphite_configs.find(config_name) == graphite_configs.end()) + { + Config new_config = { + & table_data->merging_params.graphite_params, + { table_data->getDatabaseName() }, + { table_data->getTableName() }, + }; + graphite_configs.insert(std::make_pair(config_name, new_config)); + } + else + { + graphite_configs[config_name].databases.emplace_back(table_data->getDatabaseName()); + graphite_configs[config_name].tables.emplace_back(table_data->getTableName()); + } + } + } + } + + return graphite_configs; +} + void StorageSystemGraphite::fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo &) const { - const auto & config = context.getConfigRef(); + Configs graphite_configs = StorageSystemGraphite::getConfigs(context); - Strings sections = getAllGraphiteSections(config); - for (const auto & section : sections) + for (const auto & config : graphite_configs) { - const auto patterns = readPatterns(config, section); - for (const auto & pattern : patterns) + UInt16 priority = 0; + for (const auto & pattern : config.second.graphite_params->patterns) { + bool is_default = pattern.regexp == nullptr; + String regexp = ""; + String function = ""; + + if (is_default) + { + priority = std::numeric_limits::max(); + } + else + { + priority++; + regexp = pattern.regexp->getRE2()->pattern(); + } + + if (pattern.function) + { + function = pattern.function->getName(); + } + if (!pattern.retentions.empty()) { - for (const auto & ret : pattern.retentions) + for (const auto & retention : pattern.retentions) { - res_columns[0]->insert(section); - res_columns[1]->insert(pattern.regexp); - res_columns[2]->insert(pattern.function); - res_columns[3]->insert(ret.age); - res_columns[4]->insert(ret.precision); - res_columns[5]->insert(pattern.priority); - res_columns[6]->insert(pattern.is_default); + size_t i = 0; + res_columns[i++]->insert(config.first); + res_columns[i++]->insert(regexp); + res_columns[i++]->insert(function); + res_columns[i++]->insert(retention.age); + res_columns[i++]->insert(retention.precision); + res_columns[i++]->insert(priority); + res_columns[i++]->insert(is_default); + res_columns[i++]->insert(config.second.databases); + res_columns[i++]->insert(config.second.tables); } } else { - res_columns[0]->insert(section); - res_columns[1]->insert(pattern.regexp); - res_columns[2]->insert(pattern.function); - res_columns[3]->insert(0); - res_columns[4]->insert(0); - res_columns[5]->insert(pattern.priority); - res_columns[6]->insert(pattern.is_default); + size_t i = 0; + res_columns[i++]->insert(config.first); + res_columns[i++]->insert(regexp); + res_columns[i++]->insert(function); + res_columns[i++]->insert(NULL); + res_columns[i++]->insert(NULL); + res_columns[i++]->insert(priority); + res_columns[i++]->insert(is_default); + res_columns[i++]->insert(config.second.databases); + res_columns[i++]->insert(config.second.tables); } } } diff --git a/dbms/src/Storages/System/StorageSystemGraphite.h b/dbms/src/Storages/System/StorageSystemGraphite.h index fa63c839857..4205f77f1ea 100644 --- a/dbms/src/Storages/System/StorageSystemGraphite.h +++ b/dbms/src/Storages/System/StorageSystemGraphite.h @@ -1,7 +1,10 @@ #pragma once +#include #include +#include #include +#include #include namespace DB @@ -15,10 +18,21 @@ public: static NamesAndTypesList getNamesAndTypes(); + struct Config + { + const Graphite::Params * graphite_params; + Array databases; + Array tables; + }; + + using Configs = std::map; + + protected: using IStorageSystemOneBlock::IStorageSystemOneBlock; void fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo & query_info) const override; + StorageSystemGraphite::Configs getConfigs(const Context & context) const; }; } From d1cb4932d7bf7d77a2774ab88cf869c20783346f Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Mon, 4 Mar 2019 19:22:20 +0100 Subject: [PATCH 178/297] Add documentation about system.graphite_retentions --- docs/en/operations/system_tables.md | 16 ++++++++++++++++ docs/ru/operations/system_tables.md | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index 34b44419cce..c6d90c89cb1 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -85,6 +85,22 @@ Columns: - `name`(`String`) – The name of the function. - `is_aggregate`(`UInt8`) — Whether the function is aggregate. +## system.graphite_retentions + +Contains information about parameters [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) which use in tables with [\*GraphiteMergeTree](table_engines/graphitemergetree.md) engines. + +Столбцы: +- `config_name` (String) - `graphite_rollup` parameter name. +- `regexp` (String) - A pattern for the metric name. +- `function` (String) - The name of the aggregating function. +- `age` (UInt64) - The minimum age of the data in seconds. +- `precision` (UInt64) - How precisely to define the age of the data in seconds. +- `priority` (UInt16) - Pattern priority. +- `is_default` (UInt8) - Is pattern default or not. +- `Tables.database` (Array(String)) - Array of databases names of tables, which use `config_name` parameter. +- `Tables.table` (Array(String)) - Array of tables names, which use `config_name` parameter. + + ## system.merges Contains information about merges and part mutations currently in process for tables in the MergeTree family. diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index 82aec59ec29..7a4e69ca1cd 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -83,6 +83,23 @@ default_expression String - выражение для значения по ум - `name` (`String`) – Имя функции. - `is_aggregate` (`UInt8`) – Признак, является ли функция агрегатной. + +## system.graphite_retentions + +Содержит информацию о том, какие параметры [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) используются в таблицах с движками [\*GraphiteMergeTree](table_engines/graphitemergetree.md). + +Столбцы: +- `config_name` (String) - Имя параметра, используемого для `graphite_rollup`. +- `regexp` (String) - Шаблон имени метрики. +- `function` (String) - Имя агрегирующей функции. +- `age` (UInt64) - Минимальный возраст данных в секундах. +- `precision` (UInt64) - Точность определения возраста данных в секундах. +- `priority` (UInt16) - Приоритет раздела pattern. +- `is_default` (UInt8) - Является ли раздел pattern дефолтным. +- `Tables.database` (Array(String)) - Массив имён баз данных таблиц, использующих параметр `config_name`. +- `Tables.table` (Array(String)) - Массив имён таблиц, использующих параметр `config_name`. + + ## system.merges Содержит информацию о производящихся прямо сейчас слияниях и мутациях кусков для таблиц семейства MergeTree. From 90466728c6a1fbfe2a21ecc5f35aa226f9f49ddd Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Mon, 4 Mar 2019 19:50:43 +0100 Subject: [PATCH 179/297] Add tests for system.graphite_retentions --- .../test_graphite_merge_tree/test.py | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dbms/tests/integration/test_graphite_merge_tree/test.py b/dbms/tests/integration/test_graphite_merge_tree/test.py index 8e98c97e077..509fbac97d0 100644 --- a/dbms/tests/integration/test_graphite_merge_tree/test.py +++ b/dbms/tests/integration/test_graphite_merge_tree/test.py @@ -231,6 +231,50 @@ SELECT * FROM test.graphite; assert TSV(result) == TSV(expected) +def test_system_graphite_retentions(graphite_table): + expected = ''' +graphite_rollup \\\\.count$ sum 0 0 1 0 ['test'] ['graphite'] +graphite_rollup \\\\.max$ max 0 0 2 0 ['test'] ['graphite'] +graphite_rollup ^five_min\\\\. 31536000 14400 3 0 ['test'] ['graphite'] +graphite_rollup ^five_min\\\\. 5184000 3600 3 0 ['test'] ['graphite'] +graphite_rollup ^five_min\\\\. 0 300 3 0 ['test'] ['graphite'] +graphite_rollup ^one_min avg 31536000 600 4 0 ['test'] ['graphite'] +graphite_rollup ^one_min avg 7776000 300 4 0 ['test'] ['graphite'] +graphite_rollup ^one_min avg 0 60 4 0 ['test'] ['graphite'] + ''' + result = q('SELECT * from system.graphite_retentions') + + assert TSV(result) == TSV(expected) + + q(''' +DROP TABLE IF EXISTS test.graphite2; +CREATE TABLE test.graphite2 + (metric String, value Float64, timestamp UInt32, date Date, updated UInt32) + ENGINE = GraphiteMergeTree('graphite_rollup') + PARTITION BY toYYYYMM(date) + ORDER BY (metric, timestamp) + SETTINGS index_granularity=8192; + ''') + expected = ''' +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] +graphite_rollup ['test','test'] ['graphite','graphite2'] + ''' + result = q(''' + SELECT + config_name, + Tables.database, + Tables.table + FROM system.graphite_retentions + ''') + assert TSV(result) == TSV(expected) + + def test_path_dangling_pointer(graphite_table): q(''' DROP TABLE IF EXISTS test.graphite2; From 4caf4472cc8280423f7ca3046d9f4ed61e986e99 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Tue, 5 Mar 2019 20:38:54 +0300 Subject: [PATCH 180/297] make test more stable --- .../0_stateless/00446_clear_column_in_partition_zookeeper.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/tests/queries/0_stateless/00446_clear_column_in_partition_zookeeper.sql b/dbms/tests/queries/0_stateless/00446_clear_column_in_partition_zookeeper.sql index 41d83ebe263..72f97d50886 100644 --- a/dbms/tests/queries/0_stateless/00446_clear_column_in_partition_zookeeper.sql +++ b/dbms/tests/queries/0_stateless/00446_clear_column_in_partition_zookeeper.sql @@ -26,6 +26,7 @@ CREATE TABLE test.clear_column1 (d Date, i Int64) ENGINE = ReplicatedMergeTree(' CREATE TABLE test.clear_column2 (d Date, i Int64) ENGINE = ReplicatedMergeTree('/clickhouse/test/tables/clear_column', '2', d, d, 8192); INSERT INTO test.clear_column1 (d) VALUES ('2000-01-01'), ('2000-02-01'); +SYSTEM SYNC REPLICA test.clear_column2; SET replication_alter_partitions_sync=2; ALTER TABLE test.clear_column1 ADD COLUMN s String; @@ -33,9 +34,10 @@ ALTER TABLE test.clear_column1 CLEAR COLUMN s IN PARTITION '200001'; INSERT INTO test.clear_column1 VALUES ('2000-01-01', 1, 'a'), ('2000-02-01', 2, 'b'); INSERT INTO test.clear_column1 VALUES ('2000-01-01', 3, 'c'), ('2000-02-01', 4, 'd'); +SYSTEM SYNC REPLICA test.clear_column2; SELECT 'all'; -SELECT * FROM test.clear_column1 ORDER BY d, i, s; +SELECT * FROM test.clear_column2 ORDER BY d, i, s; SELECT 'w/o i 1'; ALTER TABLE test.clear_column1 CLEAR COLUMN i IN PARTITION '200001'; From 4532b4be94663a02c2134ab96473527ee380bc88 Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 7 Mar 2019 16:42:58 +0300 Subject: [PATCH 181/297] Fix kill query test once again --- .../00909_kill_not_initialized_query.reference | 3 +-- .../00909_kill_not_initialized_query.sh | 15 ++++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.reference b/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.reference index aa47d0d46d4..b1616b08f0b 100644 --- a/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.reference +++ b/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.reference @@ -1,2 +1 @@ -0 -0 +killed diff --git a/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.sh b/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.sh index 76d6424e690..72c61b55cbf 100755 --- a/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.sh +++ b/dbms/tests/queries/0_stateless/00909_kill_not_initialized_query.sh @@ -36,11 +36,16 @@ sleep 1 # Kill $query_for_pending SYNC. This query is not blocker, so it should be killed fast. timeout 5 $CLICKHOUSE_CLIENT -q "KILL QUERY WHERE query='$query_for_pending' SYNC" &>/dev/null -# But let's sleep a little time, just to be sure -sleep 3 - # Both queries have to be killed, doesn't matter with SYNC or ASYNC kill -$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_for_pending'" -$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_to_kill'" +for run in {1..15} +do + sleep 1 + no_first_query=`$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_for_pending'"` + no_second_query=`$CLICKHOUSE_CLIENT -q "SELECT count() FROM system.processes where query='$query_to_kill'"` + if [ $no_first_query == "0" ] && [ $no_second_query == "0" ]; then + echo "killed" + break + fi +done $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS test.cannot_kill_query" &>/dev/null From 2c4dced9d2c41028d46f6a6c53e8f89dc50511dc Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 7 Mar 2019 19:26:22 +0300 Subject: [PATCH 182/297] Add functions used in arcadia --- dbms/src/Common/CompactArray.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dbms/src/Common/CompactArray.h b/dbms/src/Common/CompactArray.h index 434b475e262..785cd04b4d0 100644 --- a/dbms/src/Common/CompactArray.h +++ b/dbms/src/Common/CompactArray.h @@ -55,6 +55,28 @@ public: return locus; } + /// Used only in arcadia/metrika + void readText(ReadBuffer & in) + { + for (size_t i = 0; i < BITSET_SIZE; ++i) + { + if (i != 0) + assertChar(',', in); + readIntText(bitset[i], in); + } + } + + /// Used only in arcadia/metrika + void writeText(WriteBuffer & out) const + { + for (size_t i = 0; i < BITSET_SIZE; ++i) + { + if (i != 0) + writeCString(",", out); + writeIntText(bitset[i], out); + } + } + private: /// number of bytes in bitset static constexpr size_t BITSET_SIZE = (static_cast(bucket_count) * content_width + 7) / 8; From feb3afcf0976fc1ebc2e2587afa6514da0a81476 Mon Sep 17 00:00:00 2001 From: Konstantin Podshumok Date: Thu, 7 Mar 2019 19:38:39 +0300 Subject: [PATCH 183/297] fix wrong instructions --- libs/libdaemon/src/BaseDaemon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libdaemon/src/BaseDaemon.cpp b/libs/libdaemon/src/BaseDaemon.cpp index 005409bd08a..08bece59b51 100644 --- a/libs/libdaemon/src/BaseDaemon.cpp +++ b/libs/libdaemon/src/BaseDaemon.cpp @@ -700,12 +700,12 @@ static void checkRequiredInstructions(volatile InstructionFail & fail) #if __AVX2__ fail = InstructionFail::AVX2; - __asm__ volatile ("vpabsw %%ymm0, %%ymm0, %%ymm0" : : : "ymm0"); + __asm__ volatile ("vpabsw %%ymm0, %%ymm0" : : : "ymm0"); #endif #if __AVX512__ fail = InstructionFail::AVX512; - __asm__ volatile ("vpabsw %%zmm0, %%zmm0, %%zmm0" : : : "zmm0"); + __asm__ volatile ("vpabsw %%zmm0, %%zmm0" : : : "zmm0"); #endif fail = InstructionFail::NONE; From 64897faf8483bc115b0dc5fa40639e4d0b09ea37 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 7 Mar 2019 19:30:50 +0300 Subject: [PATCH 184/297] Fixed inconsistency of MemoryTracker usage in Allocator (tnx. proller) --- dbms/src/Common/Allocator.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/dbms/src/Common/Allocator.cpp b/dbms/src/Common/Allocator.cpp index 5c653a9a1c9..ba0c7820187 100644 --- a/dbms/src/Common/Allocator.cpp +++ b/dbms/src/Common/Allocator.cpp @@ -5,6 +5,7 @@ #endif #include +#include #include #include @@ -118,9 +119,11 @@ void * Allocator::realloc(void * buf, size_t old_size, size_t new if (old_size == new_size) { /// nothing to do. + /// BTW, it's not possible to change alignment while doing realloc. } else if (old_size < MMAP_THRESHOLD && new_size < MMAP_THRESHOLD && alignment <= MALLOC_MIN_ALIGNMENT) { + /// Resize malloc'd memory region with no special alignment requirement. CurrentMemoryTracker::realloc(old_size, new_size); void * new_buf = ::realloc(buf, new_size); @@ -133,6 +136,7 @@ void * Allocator::realloc(void * buf, size_t old_size, size_t new } else if (old_size >= MMAP_THRESHOLD && new_size >= MMAP_THRESHOLD) { + /// Resize mmap'd memory region. CurrentMemoryTracker::realloc(old_size, new_size); // On apple and freebsd self-implemented mremap used (common/mremap.h) @@ -142,21 +146,12 @@ void * Allocator::realloc(void * buf, size_t old_size, size_t new /// No need for zero-fill, because mmap guarantees it. } - else if (old_size >= MMAP_THRESHOLD && new_size < MMAP_THRESHOLD) - { - void * new_buf = alloc(new_size, alignment); - memcpy(new_buf, buf, new_size); - if (0 != munmap(buf, old_size)) - { - ::free(new_buf); - DB::throwFromErrno("Allocator: Cannot munmap " + formatReadableSizeWithBinarySuffix(old_size) + ".", DB::ErrorCodes::CANNOT_MUNMAP); - } - buf = new_buf; - } else { + /// All other cases that requires a copy. MemoryTracker is called inside 'alloc', 'free' methods. + void * new_buf = alloc(new_size, alignment); - memcpy(new_buf, buf, old_size); + memcpy(new_buf, buf, std::min(old_size, new_size)); free(buf, old_size); buf = new_buf; } From 8b0d8644c860c8dbd2117114d53fa6da4471d6bf Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Thu, 7 Mar 2019 19:55:53 +0300 Subject: [PATCH 185/297] Update StorageSystemGraphite.cpp --- .../Storages/System/StorageSystemGraphite.cpp | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/dbms/src/Storages/System/StorageSystemGraphite.cpp b/dbms/src/Storages/System/StorageSystemGraphite.cpp index ed37235e270..4f9fb755a23 100644 --- a/dbms/src/Storages/System/StorageSystemGraphite.cpp +++ b/dbms/src/Storages/System/StorageSystemGraphite.cpp @@ -41,11 +41,11 @@ StorageSystemGraphite::Configs StorageSystemGraphite::getConfigs(const Context & if (const StorageMergeTree * merge_tree = dynamic_cast(table.get())) { - table_data = & merge_tree->getData(); + table_data = &merge_tree->getData(); } else if (const StorageReplicatedMergeTree * replicated_merge_tree = dynamic_cast(table.get())) { - table_data = & replicated_merge_tree->getData(); + table_data = &replicated_merge_tree->getData(); } else { @@ -54,16 +54,18 @@ StorageSystemGraphite::Configs StorageSystemGraphite::getConfigs(const Context & if (table_data->merging_params.mode == MergeTreeData::MergingParams::Graphite) { - const String config_name = table_data->merging_params.graphite_params.config_name; + const String & config_name = table_data->merging_params.graphite_params.config_name; - if (graphite_configs.find(config_name) == graphite_configs.end()) + if (!graphite_configs.count(config_name)) { - Config new_config = { - & table_data->merging_params.graphite_params, - { table_data->getDatabaseName() }, - { table_data->getTableName() }, - }; - graphite_configs.insert(std::make_pair(config_name, new_config)); + Config new_config = + { + /// FIXME Do we own a table? (possible dangling reference) + &table_data->merging_params.graphite_params, + { table_data->getDatabaseName() }, + { table_data->getTableName() }, + }; + graphite_configs.emplace(config_name, new_config); } else { @@ -87,8 +89,8 @@ void StorageSystemGraphite::fillData(MutableColumns & res_columns, const Context for (const auto & pattern : config.second.graphite_params->patterns) { bool is_default = pattern.regexp == nullptr; - String regexp = ""; - String function = ""; + String regexp; + String function; if (is_default) { @@ -97,6 +99,7 @@ void StorageSystemGraphite::fillData(MutableColumns & res_columns, const Context else { priority++; + /// FIXME Null pointer dereference for trivial patterns. regexp = pattern.regexp->getRE2()->pattern(); } From ab025805a3cd09ea2de39003f0892374ea376eeb Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Tue, 5 Mar 2019 13:12:20 +0300 Subject: [PATCH 186/297] alter intention lock --- dbms/src/DataStreams/IBlockInputStream.h | 8 +- dbms/src/DataStreams/IBlockOutputStream.h | 12 +- dbms/src/Functions/FunctionJoinGet.h | 7 +- .../Interpreters/InterpreterAlterQuery.cpp | 3 +- .../Interpreters/InterpreterCreateQuery.cpp | 2 +- .../src/Interpreters/InterpreterDropQuery.cpp | 11 +- .../Interpreters/InterpreterRenameQuery.cpp | 4 +- .../src/Interpreters/InterpreterSelectQuery.h | 2 +- .../Interpreters/InterpreterSystemQuery.cpp | 2 +- dbms/src/Storages/IStorage.cpp | 13 +- dbms/src/Storages/IStorage.h | 114 ++++++++---------- .../ReplicatedMergeTreeAlterThread.cpp | 3 +- dbms/src/Storages/StorageBuffer.cpp | 4 +- dbms/src/Storages/StorageBuffer.h | 4 +- dbms/src/Storages/StorageDistributed.cpp | 6 +- dbms/src/Storages/StorageDistributed.h | 4 +- dbms/src/Storages/StorageMerge.cpp | 12 +- dbms/src/Storages/StorageMerge.h | 8 +- dbms/src/Storages/StorageMergeTree.cpp | 12 +- dbms/src/Storages/StorageMergeTree.h | 4 +- dbms/src/Storages/StorageNull.cpp | 6 +- dbms/src/Storages/StorageNull.h | 4 +- .../Storages/StorageReplicatedMergeTree.cpp | 11 +- .../src/Storages/StorageReplicatedMergeTree.h | 4 +- .../Storages/System/StorageSystemColumns.cpp | 2 +- .../Storages/System/StorageSystemPartsBase.h | 2 +- dbms/src/Storages/TableStructureLockHolder.h | 23 ++++ 27 files changed, 153 insertions(+), 134 deletions(-) create mode 100644 dbms/src/Storages/TableStructureLockHolder.h diff --git a/dbms/src/DataStreams/IBlockInputStream.h b/dbms/src/DataStreams/IBlockInputStream.h index 8a2b1e9b148..b1f7f2c3788 100644 --- a/dbms/src/DataStreams/IBlockInputStream.h +++ b/dbms/src/DataStreams/IBlockInputStream.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -24,12 +25,9 @@ class IBlockInputStream; class ProcessListElement; class QuotaForIntervals; class QueryStatus; -class TableStructureReadLock; using BlockInputStreamPtr = std::shared_ptr; using BlockInputStreams = std::vector; -using TableStructureReadLockPtr = std::shared_ptr; -using TableStructureReadLocks = std::vector; /** Callback to track the progress of the query. * Used in IBlockInputStream and Context. @@ -117,7 +115,7 @@ public: size_t checkDepth(size_t max_depth) const { return checkDepthImpl(max_depth, max_depth); } /// Do not allow to change the table while the blocks stream and its children are alive. - void addTableLock(const TableStructureReadLockPtr & lock) { table_locks.push_back(lock); } + void addTableLock(const TableStructureLockHolder & lock) { table_locks.push_back(lock); } /// Get information about execution speed. const BlockStreamProfileInfo & getProfileInfo() const { return info; } @@ -244,7 +242,7 @@ public: protected: /// Order is important: `table_locks` must be destroyed after `children` so that tables from /// which child streams read are protected by the locks during the lifetime of the child streams. - TableStructureReadLocks table_locks; + std::vector table_locks; BlockInputStreams children; std::shared_mutex children_mutex; diff --git a/dbms/src/DataStreams/IBlockOutputStream.h b/dbms/src/DataStreams/IBlockOutputStream.h index 33494422479..b98fa2067be 100644 --- a/dbms/src/DataStreams/IBlockOutputStream.h +++ b/dbms/src/DataStreams/IBlockOutputStream.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace DB @@ -12,13 +13,6 @@ namespace DB struct Progress; -class TableStructureReadLock; -using TableStructureReadLockPtr = std::shared_ptr; -using TableStructureReadLocks = std::vector; - -struct Progress; - - /** Interface of stream for writing data (into table, filesystem, network, terminal, etc.) */ class IBlockOutputStream : private boost::noncopyable @@ -64,10 +58,10 @@ public: /** Don't let to alter table while instance of stream is alive. */ - void addTableLock(const TableStructureReadLockPtr & lock) { table_locks.push_back(lock); } + void addTableLock(const TableStructureLockHolder & lock) { table_locks.push_back(lock); } private: - TableStructureReadLocks table_locks; + std::vector table_locks; }; using BlockOutputStreamPtr = std::shared_ptr; diff --git a/dbms/src/Functions/FunctionJoinGet.h b/dbms/src/Functions/FunctionJoinGet.h index edf45adab6a..fd9810f569c 100644 --- a/dbms/src/Functions/FunctionJoinGet.h +++ b/dbms/src/Functions/FunctionJoinGet.h @@ -1,4 +1,5 @@ #include +#include namespace DB { @@ -7,8 +8,6 @@ class IStorage; using StoragePtr = std::shared_ptr; class Join; using JoinPtr = std::shared_ptr; -class TableStructureReadLock; -using TableStructureReadLockPtr = std::shared_ptr; class FunctionJoinGet final : public IFunction, public std::enable_shared_from_this { @@ -16,7 +15,7 @@ public: static constexpr auto name = "joinGet"; FunctionJoinGet( - TableStructureReadLockPtr table_lock, StoragePtr storage_join, JoinPtr join, const String & attr_name, DataTypePtr return_type) + TableStructureLockHolder table_lock, StoragePtr storage_join, JoinPtr join, const String & attr_name, DataTypePtr return_type) : table_lock(std::move(table_lock)) , storage_join(std::move(storage_join)) , join(std::move(join)) @@ -36,7 +35,7 @@ private: size_t getNumberOfArguments() const override { return 0; } private: - TableStructureReadLockPtr table_lock; + TableStructureLockHolder table_lock; StoragePtr storage_join; JoinPtr join; const String attr_name; diff --git a/dbms/src/Interpreters/InterpreterAlterQuery.cpp b/dbms/src/Interpreters/InterpreterAlterQuery.cpp index c28c8aef32f..34104342413 100644 --- a/dbms/src/Interpreters/InterpreterAlterQuery.cpp +++ b/dbms/src/Interpreters/InterpreterAlterQuery.cpp @@ -74,8 +74,9 @@ BlockIO InterpreterAlterQuery::execute() if (!alter_commands.empty()) { + auto structure_lock = table->lockIntentionForAlter(context.getCurrentQueryId()); alter_commands.validate(*table, context); - table->alter(alter_commands, database_name, table_name, context); + table->alter(alter_commands, database_name, table_name, context, structure_lock); } return {}; diff --git a/dbms/src/Interpreters/InterpreterCreateQuery.cpp b/dbms/src/Interpreters/InterpreterCreateQuery.cpp index 708bd616828..1ed92b72e1c 100644 --- a/dbms/src/Interpreters/InterpreterCreateQuery.cpp +++ b/dbms/src/Interpreters/InterpreterCreateQuery.cpp @@ -587,7 +587,7 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create) String as_table_name = create.as_table; StoragePtr as_storage; - TableStructureReadLockPtr as_storage_lock; + TableStructureLockHolder as_storage_lock; if (!as_table_name.empty()) { as_storage = context.getTable(as_database_name, as_table_name); diff --git a/dbms/src/Interpreters/InterpreterDropQuery.cpp b/dbms/src/Interpreters/InterpreterDropQuery.cpp index c90017721c1..3d0af183f3d 100644 --- a/dbms/src/Interpreters/InterpreterDropQuery.cpp +++ b/dbms/src/Interpreters/InterpreterDropQuery.cpp @@ -69,7 +69,8 @@ BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & t { database_and_table.second->shutdown(); /// If table was already dropped by anyone, an exception will be thrown - auto table_lock = database_and_table.second->lockForAlter(context.getCurrentQueryId()); + // TODO + auto table_lock = database_and_table.second->lockExclusively(context.getCurrentQueryId()); /// Drop table from memory, don't touch data and metadata database_and_table.first->detachTable(database_and_table.second->getTableName()); } @@ -78,7 +79,7 @@ BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & t database_and_table.second->checkTableCanBeDropped(); /// If table was already dropped by anyone, an exception will be thrown - auto table_lock = database_and_table.second->lockForAlter(context.getCurrentQueryId()); + auto table_lock = database_and_table.second->lockExclusively(context.getCurrentQueryId()); /// Drop table data, don't touch metadata database_and_table.second->truncate(query_ptr, context); } @@ -89,7 +90,7 @@ BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & t database_and_table.second->shutdown(); /// If table was already dropped by anyone, an exception will be thrown - auto table_lock = database_and_table.second->lockForAlter(context.getCurrentQueryId()); + auto table_lock = database_and_table.second->lockExclusively(context.getCurrentQueryId()); /// Delete table metadata and table itself from memory database_and_table.first->removeTable(context, database_and_table.second->getTableName()); @@ -126,7 +127,7 @@ BlockIO InterpreterDropQuery::executeToTemporaryTable(String & table_name, ASTDr if (kind == ASTDropQuery::Kind::Truncate) { /// If table was already dropped by anyone, an exception will be thrown - auto table_lock = table->lockForAlter(context.getCurrentQueryId()); + auto table_lock = table->lockExclusively(context.getCurrentQueryId()); /// Drop table data, don't touch metadata table->truncate(query_ptr, context); } @@ -135,7 +136,7 @@ BlockIO InterpreterDropQuery::executeToTemporaryTable(String & table_name, ASTDr context_handle.tryRemoveExternalTable(table_name); table->shutdown(); /// If table was already dropped by anyone, an exception will be thrown - auto table_lock = table->lockForAlter(context.getCurrentQueryId()); + auto table_lock = table->lockExclusively(context.getCurrentQueryId()); /// Delete table data table->drop(); table->is_dropped = true; diff --git a/dbms/src/Interpreters/InterpreterRenameQuery.cpp b/dbms/src/Interpreters/InterpreterRenameQuery.cpp index e3fbe1f1de8..cebc30c9c87 100644 --- a/dbms/src/Interpreters/InterpreterRenameQuery.cpp +++ b/dbms/src/Interpreters/InterpreterRenameQuery.cpp @@ -96,12 +96,12 @@ BlockIO InterpreterRenameQuery::execute() table_guards.emplace(to, context.getDDLGuard(to.database_name, to.table_name)); } - std::vector locks; + std::vector locks; locks.reserve(unique_tables_from.size()); for (const auto & names : unique_tables_from) if (auto table = context.tryGetTable(names.database_name, names.table_name)) - locks.emplace_back(table->lockForAlter(context.getCurrentQueryId())); + locks.emplace_back(table->lockExclusively(context.getCurrentQueryId())); /** All tables are locked. If there are more than one rename in chain, * we need to hold global lock while doing all renames. Order matters to avoid deadlocks. diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.h b/dbms/src/Interpreters/InterpreterSelectQuery.h index de5a11e727b..78739593ebb 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.h +++ b/dbms/src/Interpreters/InterpreterSelectQuery.h @@ -248,7 +248,7 @@ private: /// Table from where to read data, if not subquery. StoragePtr storage; - TableStructureReadLockPtr table_lock; + TableStructureLockHolder table_lock; /// Used when we read from prepared input, not table or subquery. BlockInputStreamPtr input; diff --git a/dbms/src/Interpreters/InterpreterSystemQuery.cpp b/dbms/src/Interpreters/InterpreterSystemQuery.cpp index e1233a04180..20bd860fb26 100644 --- a/dbms/src/Interpreters/InterpreterSystemQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSystemQuery.cpp @@ -239,7 +239,7 @@ StoragePtr InterpreterSystemQuery::tryRestartReplica(const String & database_nam table->shutdown(); /// If table was already dropped by anyone, an exception will be thrown - auto table_lock = table->lockForAlter(context.getCurrentQueryId()); + auto table_lock = table->lockExclusively(context.getCurrentQueryId()); create_ast = system_context.getCreateTableQuery(database_name, table_name); database->detachTable(table_name); diff --git a/dbms/src/Storages/IStorage.cpp b/dbms/src/Storages/IStorage.cpp index e3d143adbb7..6b196c42221 100644 --- a/dbms/src/Storages/IStorage.cpp +++ b/dbms/src/Storages/IStorage.cpp @@ -5,16 +5,7 @@ namespace DB { -TableStructureReadLock::TableStructureReadLock(StoragePtr storage_, bool lock_structure, bool lock_data, const String & query_id) - : storage(storage_) -{ - if (lock_data) - data_lock = storage->data_lock->getLock(RWLockImpl::Read, query_id); - if (lock_structure) - structure_lock = storage->structure_lock->getLock(RWLockImpl::Read, query_id); -} - -void IStorage::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) +void IStorage::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureLockHolder & structure_lock) { for (const auto & param : params) { @@ -22,7 +13,7 @@ void IStorage::alter(const AlterCommands & params, const String & database_name, throw Exception("Method alter supports only change comment of column for storage " + getName(), ErrorCodes::NOT_IMPLEMENTED); } - auto lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); params.apply(new_columns); diff --git a/dbms/src/Storages/IStorage.h b/dbms/src/Storages/IStorage.h index 5841126e844..9c3175b96bc 100644 --- a/dbms/src/Storages/IStorage.h +++ b/dbms/src/Storages/IStorage.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -47,35 +48,6 @@ class MutationCommands; class PartitionCommands; -/** Does not allow changing the table description (including rename and delete the table). - * If during any operation the table structure should remain unchanged, you need to hold such a lock for all of its time. - * For example, you need to hold such a lock for the duration of the entire SELECT or INSERT query and for the whole time the merge of the set of parts - * (but between the selection of parts for the merge and their merging, the table structure can change). - * NOTE: This is a lock to "read" the table's description. To change the table description, you need to take the TableStructureWriteLock. - */ -class TableStructureReadLock -{ -private: - friend class IStorage; - - StoragePtr storage; - /// Order is important. - RWLockImpl::LockHolder data_lock; - RWLockImpl::LockHolder structure_lock; - -public: - TableStructureReadLock(StoragePtr storage_, bool lock_structure, bool lock_data, const String & query_id); -}; - - -using TableStructureReadLockPtr = std::shared_ptr; -using TableStructureReadLocks = std::vector; - -using TableStructureWriteLock = RWLockImpl::LockHolder; -using TableDataWriteLock = RWLockImpl::LockHolder; -using TableFullWriteLock = std::pair; - - /** Storage. Responsible for * - storage of the table data; * - the definition in which files (or not in files) the data is stored; @@ -111,50 +83,66 @@ public: /** Returns true if the storage supports deduplication of inserted data blocks . */ virtual bool supportsDeduplication() const { return false; } - /** Does not allow you to change the structure or name of the table. - * If you change the data in the table, you will need to specify will_modify_data = true. - * This will take an extra lock that does not allow starting ALTER MODIFY. - * - * WARNING: You need to call methods from ITableDeclaration under such a lock. Without it, they are not thread safe. - * WARNING: To avoid deadlocks, this method must not be called under lock of Context. - */ - TableStructureReadLockPtr lockStructure(bool will_modify_data, const String & query_id) + + TableStructureLockHolder lockStructure(bool will_add_new_data, const String & query_id) { - TableStructureReadLockPtr res = std::make_shared(shared_from_this(), true, will_modify_data, query_id); + TableStructureLockHolder result; + if (will_add_new_data) + result.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Read, query_id); + result.structure_lock = structure_lock->getLock(RWLockImpl::Read, query_id); + if (is_dropped) throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); - return res; + return result; } - /** Does not allow reading the table structure. It is taken for ALTER, RENAME and DROP, TRUNCATE. - */ - TableFullWriteLock lockForAlter(const String & query_id) + TableStructureLockHolder lockIntentionForAlter(const String & query_id) { - /// The calculation order is important. - auto res_data_lock = lockDataForAlter(query_id); - auto res_structure_lock = lockStructureForAlter(query_id); + TableStructureLockHolder result; + result.alter_intention_lock = alter_intention_lock->getLock(RWLockImpl::Write, query_id); - return {std::move(res_data_lock), std::move(res_structure_lock)}; - } - - /** Does not allow changing the data in the table. (Moreover, does not give a look at the structure of the table with the intention to change the data). - * It is taken during write temporary data in ALTER MODIFY. - * Under this lock, you can take lockStructureForAlter() to change the structure of the table. - */ - TableDataWriteLock lockDataForAlter(const String & query_id) - { - auto res = data_lock->getLock(RWLockImpl::Write, query_id); if (is_dropped) throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); - return res; + return result; } - TableStructureWriteLock lockStructureForAlter(const String & query_id) + void lockDataForAlter(TableStructureLockHolder & lock_holder, const String & query_id) { - auto res = structure_lock->getLock(RWLockImpl::Write, query_id); + if (!lock_holder.alter_intention_lock) + throw Exception("Alter intention lock for table " + getTableName() + " was not taken. This is a bug.", + ErrorCodes::LOGICAL_ERROR); + + lock_holder.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); + if (is_dropped) throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); - return res; + } + + void lockStructureForAlter(TableStructureLockHolder & lock_holder, const String & query_id) + { + if (!lock_holder.alter_intention_lock) + throw Exception("Alter intention lock for table " + getTableName() + " was not taken. This is a bug.", + ErrorCodes::LOGICAL_ERROR); + + if (!lock_holder.new_data_structure_lock) + lock_holder.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); + lock_holder.structure_lock = structure_lock->getLock(RWLockImpl::Write, query_id); + + if (is_dropped) + throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); + } + + TableStructureLockHolder lockExclusively(const String & query_id) + { + TableStructureLockHolder result; + result.alter_intention_lock = alter_intention_lock->getLock(RWLockImpl::Write, query_id); + result.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); + result.structure_lock = structure_lock->getLock(RWLockImpl::Write, query_id); + + if (is_dropped) + throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); + + return result; } /** Returns stage to which query is going to be processed in read() function. @@ -233,7 +221,7 @@ public: * This method must fully execute the ALTER query, taking care of the locks itself. * To update the table metadata on disk, this method should call InterpreterAlterQuery::updateMetadata. */ - virtual void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context); + virtual void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureLockHolder & structure_lock); /** ALTER tables with regard to its partitions. * Should handle locks for each command on its own. @@ -345,9 +333,9 @@ public: using std::enable_shared_from_this::shared_from_this; private: - friend class TableStructureReadLock; + /// You always need to take the next three locks in this order. - /// You always need to take the next two locks in this order. + mutable RWLock alter_intention_lock = RWLockImpl::create(); /** It is taken for read for the entire INSERT query and the entire merge of the parts (for MergeTree). * It is taken for write for the entire time ALTER MODIFY. @@ -358,7 +346,7 @@ private: * 2) all changes to the data after releasing the lock will be based on the structure of the table at the time after the lock was released. * You need to take for read for the entire time of the operation that changes the data. */ - mutable RWLock data_lock = RWLockImpl::create(); + mutable RWLock new_data_structure_lock = RWLockImpl::create(); /** Lock for multiple columns and path to table. It is taken for write at RENAME, ALTER (for ALTER MODIFY for a while) and DROP. * It is taken for read for the whole time of SELECT, INSERT and merge parts (for MergeTree). diff --git a/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp b/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp index 03b397e0390..398bbc810dc 100644 --- a/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp +++ b/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp @@ -108,7 +108,8 @@ void ReplicatedMergeTreeAlterThread::run() LOG_INFO(log, "Version of metadata nodes in ZooKeeper changed. Waiting for structure write lock."); - auto table_lock = storage.lockStructureForAlter(RWLockImpl::NO_QUERY); + // TODO + auto table_lock = storage.lockExclusively(RWLockImpl::NO_QUERY); if (columns_in_zk == storage.getColumns() && metadata_diff.empty()) { diff --git a/dbms/src/Storages/StorageBuffer.cpp b/dbms/src/Storages/StorageBuffer.cpp index b3cb485a6b4..c1eb128292b 100644 --- a/dbms/src/Storages/StorageBuffer.cpp +++ b/dbms/src/Storages/StorageBuffer.cpp @@ -677,9 +677,9 @@ void StorageBuffer::flushThread() } -void StorageBuffer::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) +void StorageBuffer::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureLockHolder & structure_lock) { - auto lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); /// So that no blocks of the old structure remain. optimize({} /*query*/, {} /*partition_id*/, false /*final*/, false /*deduplicate*/, context); diff --git a/dbms/src/Storages/StorageBuffer.h b/dbms/src/Storages/StorageBuffer.h index 854d4efd05d..a234a4efd7b 100644 --- a/dbms/src/Storages/StorageBuffer.h +++ b/dbms/src/Storages/StorageBuffer.h @@ -81,7 +81,9 @@ public: bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, const Context & query_context) const override; /// The structure of the subordinate table is not checked and does not change. - void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override; + void alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & context, TableStructureLockHolder & structure_locks) override; private: String name; diff --git a/dbms/src/Storages/StorageDistributed.cpp b/dbms/src/Storages/StorageDistributed.cpp index 644576272d0..965fff96c25 100644 --- a/dbms/src/Storages/StorageDistributed.cpp +++ b/dbms/src/Storages/StorageDistributed.cpp @@ -336,9 +336,11 @@ BlockOutputStreamPtr StorageDistributed::write(const ASTPtr &, const Context & c } -void StorageDistributed::alter(const AlterCommands & params, const String & database_name, const String & current_table_name, const Context & context) +void StorageDistributed::alter( + const AlterCommands & params, const String & database_name, const String & current_table_name, + const Context & context, TableStructureLockHolder & structure_lock) { - auto lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageDistributed.h b/dbms/src/Storages/StorageDistributed.h index eecab76ea8e..7f22ff94ee9 100644 --- a/dbms/src/Storages/StorageDistributed.h +++ b/dbms/src/Storages/StorageDistributed.h @@ -81,7 +81,9 @@ public: void rename(const String & /*new_path_to_db*/, const String & /*new_database_name*/, const String & new_table_name) override { table_name = new_table_name; } /// in the sub-tables, you need to manually add and delete columns /// the structure of the sub-table is not checked - void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override; + void alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & context, TableStructureLockHolder & structure_lock) override; void startup() override; void shutdown() override; diff --git a/dbms/src/Storages/StorageMerge.cpp b/dbms/src/Storages/StorageMerge.cpp index d8e3dfce649..f32f80e982f 100644 --- a/dbms/src/Storages/StorageMerge.cpp +++ b/dbms/src/Storages/StorageMerge.cpp @@ -224,7 +224,7 @@ BlockInputStreams StorageMerge::read( current_streams = std::max(size_t(1), current_streams); StoragePtr storage = it->first; - TableStructureReadLockPtr struct_lock = it->second; + TableStructureLockHolder struct_lock = it->second; BlockInputStreams source_streams; @@ -262,7 +262,7 @@ BlockInputStreams StorageMerge::read( BlockInputStreams StorageMerge::createSourceStreams(const SelectQueryInfo & query_info, const QueryProcessingStage::Enum & processed_stage, const UInt64 max_block_size, const Block & header, const StoragePtr & storage, - const TableStructureReadLockPtr & struct_lock, Names & real_column_names, + const TableStructureLockHolder & struct_lock, Names & real_column_names, Context & modified_context, size_t streams_num, bool has_table_virtual_column, bool concat_streams) { @@ -375,7 +375,7 @@ StorageMerge::StorageListWithLocks StorageMerge::getSelectedTables(const ASTPtr if (storage.get() != this) { virtual_column->insert(storage->getTableName()); - selected_tables.emplace_back(storage, get_lock ? storage->lockStructure(false, query_id) : TableStructureReadLockPtr{}); + selected_tables.emplace_back(storage, get_lock ? storage->lockStructure(false, query_id) : TableStructureLockHolder{}); } } @@ -395,9 +395,11 @@ StorageMerge::StorageListWithLocks StorageMerge::getSelectedTables(const ASTPtr return selected_tables; } -void StorageMerge::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) +void StorageMerge::alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & context, TableStructureLockHolder & structure_lock) { - auto lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageMerge.h b/dbms/src/Storages/StorageMerge.h index 000d8daed1a..acce2cbda0e 100644 --- a/dbms/src/Storages/StorageMerge.h +++ b/dbms/src/Storages/StorageMerge.h @@ -44,7 +44,9 @@ public: /// you need to add and remove columns in the sub-tables manually /// the structure of sub-tables is not checked - void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override; + void alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & context, TableStructureLockHolder & structure_lock) override; bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, const Context & query_context) const override; @@ -54,7 +56,7 @@ private: OptimizedRegularExpression table_name_regexp; Context global_context; - using StorageListWithLocks = std::list>; + using StorageListWithLocks = std::list>; StorageListWithLocks getSelectedTables(const String & query_id) const; @@ -76,7 +78,7 @@ protected: BlockInputStreams createSourceStreams(const SelectQueryInfo & query_info, const QueryProcessingStage::Enum & processed_stage, const UInt64 max_block_size, const Block & header, const StoragePtr & storage, - const TableStructureReadLockPtr & struct_lock, Names & real_column_names, + const TableStructureLockHolder & struct_lock, Names & real_column_names, Context & modified_context, size_t streams_num, bool has_table_virtual_column, bool concat_streams = false); diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index ba3fe04dd89..673c67c9334 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -195,11 +195,12 @@ void StorageMergeTree::alter( const AlterCommands & params, const String & current_database_name, const String & current_table_name, - const Context & context) + const Context & context, + TableStructureLockHolder & structure_lock) { if (!params.is_mutable()) { - auto table_soft_lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); params.apply(new_columns); @@ -211,7 +212,7 @@ void StorageMergeTree::alter( /// NOTE: Here, as in ReplicatedMergeTree, you can do ALTER which does not block the writing of data for a long time. auto merge_blocker = merger_mutator.actions_blocker.cancel(); - auto table_soft_lock = lockDataForAlter(context.getCurrentQueryId()); + lockDataForAlter(structure_lock, context.getCurrentQueryId()); data.checkAlter(params, context); @@ -230,7 +231,7 @@ void StorageMergeTree::alter( transactions.push_back(std::move(transaction)); } - auto table_hard_lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); IDatabase::ASTModifier storage_modifier = [&] (IAST & ast) { @@ -908,7 +909,8 @@ void StorageMergeTree::dropPartition(const ASTPtr & partition, bool detach, cons /// This protects against "revival" of data for a removed partition after completion of merge. auto merge_blocker = merger_mutator.actions_blocker.cancel(); /// Waits for completion of merge and does not start new ones. - auto lock = lockForAlter(context.getCurrentQueryId()); + // TODO + auto lock = lockExclusively(context.getCurrentQueryId()); String partition_id = data.getPartitionIDFromQuery(partition, context); diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index d17b496bd97..86722e39ba6 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -77,7 +77,9 @@ public: void rename(const String & new_path_to_db, const String & new_database_name, const String & new_table_name) override; - void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override; + void alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & context, TableStructureLockHolder & structure_lock) override; void checkTableCanBeDropped() const override; diff --git a/dbms/src/Storages/StorageNull.cpp b/dbms/src/Storages/StorageNull.cpp index a920fe3c395..b6b2b02bbd8 100644 --- a/dbms/src/Storages/StorageNull.cpp +++ b/dbms/src/Storages/StorageNull.cpp @@ -30,9 +30,11 @@ void registerStorageNull(StorageFactory & factory) }); } -void StorageNull::alter(const AlterCommands & params, const String & current_database_name, const String & current_table_name, const Context & context) +void StorageNull::alter( + const AlterCommands & params, const String & current_database_name, const String & current_table_name, + const Context & context, TableStructureLockHolder & structure_lock) { - auto lock = lockStructureForAlter(context.getCurrentQueryId()); + lockStructureForAlter(structure_lock, context.getCurrentQueryId()); ColumnsDescription new_columns = getColumns(); IndicesDescription new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageNull.h b/dbms/src/Storages/StorageNull.h index bf070480316..1cc68504518 100644 --- a/dbms/src/Storages/StorageNull.h +++ b/dbms/src/Storages/StorageNull.h @@ -41,7 +41,9 @@ public: table_name = new_table_name; } - void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context) override; + void alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & context, TableStructureLockHolder & structure_lock) override; private: String table_name; diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index b9bbf762c66..b227476029a 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -1662,7 +1662,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) } StoragePtr source_table; - TableStructureReadLockPtr structure_lock_src_table; + TableStructureLockHolder structure_lock_src_table; String source_table_name = entry_replace.from_database + "." + entry_replace.from_table; auto clone_data_parts_from_source_table = [&] () -> size_t @@ -2719,7 +2719,7 @@ bool StorageReplicatedMergeTree::fetchPart(const String & part_name, const Strin LOG_DEBUG(log, "Fetching part " << part_name << " from " << source_replica_path); - TableStructureReadLockPtr table_lock; + TableStructureLockHolder table_lock; if (!to_detached) table_lock = lockStructure(true, RWLockImpl::NO_QUERY); @@ -3087,8 +3087,9 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p } -void StorageReplicatedMergeTree::alter(const AlterCommands & params, - const String & /*database_name*/, const String & /*table_name*/, const Context & query_context) +void StorageReplicatedMergeTree::alter( + const AlterCommands & params, const String & /*database_name*/, const String & /*table_name*/, + const Context & query_context, TableStructureLockHolder & structure_lock) { assertNotReadonly(); @@ -3166,6 +3167,8 @@ void StorageReplicatedMergeTree::alter(const AlterCommands & params, LOG_DEBUG(log, "Updated shared metadata nodes in ZooKeeper. Waiting for replicas to apply changes."); + structure_lock.release(); + /// Wait until all replicas will apply ALTER. for (const auto & node : changed_nodes) diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.h b/dbms/src/Storages/StorageReplicatedMergeTree.h index e3a7d023066..0abbfb51136 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.h +++ b/dbms/src/Storages/StorageReplicatedMergeTree.h @@ -116,7 +116,9 @@ public: bool optimize(const ASTPtr & query, const ASTPtr & partition, bool final, bool deduplicate, const Context & query_context) override; - void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & query_context) override; + void alter( + const AlterCommands & params, const String & database_name, const String & table_name, + const Context & query_context, TableStructureLockHolder & structure_lock) override; void alterPartition(const ASTPtr & query, const PartitionCommands & commands, const Context & query_context) override; diff --git a/dbms/src/Storages/System/StorageSystemColumns.cpp b/dbms/src/Storages/System/StorageSystemColumns.cpp index fe0c3d90d69..abf0f83c7dd 100644 --- a/dbms/src/Storages/System/StorageSystemColumns.cpp +++ b/dbms/src/Storages/System/StorageSystemColumns.cpp @@ -100,7 +100,7 @@ protected: { StoragePtr storage = storages.at(std::make_pair(database_name, table_name)); - TableStructureReadLockPtr table_lock; + TableStructureLockHolder table_lock; try { diff --git a/dbms/src/Storages/System/StorageSystemPartsBase.h b/dbms/src/Storages/System/StorageSystemPartsBase.h index 920ae184e94..96d5de08423 100644 --- a/dbms/src/Storages/System/StorageSystemPartsBase.h +++ b/dbms/src/Storages/System/StorageSystemPartsBase.h @@ -34,7 +34,7 @@ public: struct StoragesInfo { StoragePtr storage; - TableStructureReadLockPtr table_lock; + TableStructureLockHolder table_lock; String database; String table; diff --git a/dbms/src/Storages/TableStructureLockHolder.h b/dbms/src/Storages/TableStructureLockHolder.h new file mode 100644 index 00000000000..f8d64dbf712 --- /dev/null +++ b/dbms/src/Storages/TableStructureLockHolder.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +namespace DB +{ + +struct TableStructureLockHolder +{ + /// Order is important. + RWLockImpl::LockHolder alter_intention_lock; + RWLockImpl::LockHolder new_data_structure_lock; + RWLockImpl::LockHolder structure_lock; + + void release() + { + structure_lock.reset(); + new_data_structure_lock.reset(); + alter_intention_lock.reset(); + } +}; + +} From d53da3d497e9ffda9f9e8af0853685f91305f19c Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 7 Mar 2019 20:58:28 +0300 Subject: [PATCH 187/297] Fixed typo --- .../Storages/MergeTree/MergeTreeSequentialBlockInputStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeSequentialBlockInputStream.cpp b/dbms/src/Storages/MergeTree/MergeTreeSequentialBlockInputStream.cpp index 2cfbe5f5539..0b4d56be8ea 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSequentialBlockInputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeSequentialBlockInputStream.cpp @@ -26,7 +26,7 @@ MergeTreeSequentialBlockInputStream::MergeTreeSequentialBlockInputStream( { std::stringstream message; message << "Reading " << data_part->marks_count << " marks from part " << data_part->name - << ", totaly " << data_part->rows_count + << ", total " << data_part->rows_count << " rows starting from the beginning of the part, columns: "; for (size_t i = 0, size = columns_to_read.size(); i < size; ++i) message << (i == 0 ? "" : ", ") << columns_to_read[i]; From 3344955154bb53559af8f02e9fc4c13b0f9b9960 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Thu, 7 Mar 2019 21:04:47 +0300 Subject: [PATCH 188/297] separate Read and Write lock holders, better method names --- dbms/src/DataStreams/IBlockInputStream.h | 4 +-- dbms/src/DataStreams/IBlockOutputStream.h | 4 +-- .../PushingToViewsBlockOutputStream.cpp | 4 +-- dbms/src/Functions/FunctionJoinGet.cpp | 2 +- dbms/src/Functions/FunctionJoinGet.h | 4 +-- .../Interpreters/InterpreterAlterQuery.cpp | 2 +- .../Interpreters/InterpreterCreateQuery.cpp | 4 +-- .../Interpreters/InterpreterDescribeQuery.cpp | 2 +- .../src/Interpreters/InterpreterDropQuery.cpp | 1 - .../Interpreters/InterpreterInsertQuery.cpp | 2 +- .../Interpreters/InterpreterOptimizeQuery.cpp | 2 +- .../Interpreters/InterpreterRenameQuery.cpp | 2 +- .../Interpreters/InterpreterSelectQuery.cpp | 2 +- .../src/Interpreters/InterpreterSelectQuery.h | 2 +- dbms/src/Storages/IStorage.cpp | 4 +-- dbms/src/Storages/IStorage.h | 29 ++++++++---------- .../Storages/MergeTree/DataPartsExchange.cpp | 2 +- .../ReplicatedMergeTreeAlterThread.cpp | 3 +- .../ReplicatedMergeTreePartCheckThread.cpp | 2 +- dbms/src/Storages/StorageBuffer.cpp | 6 ++-- dbms/src/Storages/StorageBuffer.h | 2 +- dbms/src/Storages/StorageDistributed.cpp | 4 +-- dbms/src/Storages/StorageDistributed.h | 2 +- dbms/src/Storages/StorageMaterializedView.cpp | 4 +-- dbms/src/Storages/StorageMerge.cpp | 12 ++++---- dbms/src/Storages/StorageMerge.h | 6 ++-- dbms/src/Storages/StorageMergeTree.cpp | 23 +++++++------- dbms/src/Storages/StorageMergeTree.h | 2 +- dbms/src/Storages/StorageNull.cpp | 4 +-- dbms/src/Storages/StorageNull.h | 2 +- .../Storages/StorageReplicatedMergeTree.cpp | 30 +++++++++---------- .../src/Storages/StorageReplicatedMergeTree.h | 2 +- .../Storages/System/StorageSystemColumns.cpp | 4 +-- .../System/StorageSystemPartsBase.cpp | 2 +- .../Storages/System/StorageSystemPartsBase.h | 2 +- dbms/src/Storages/TableStructureLockHolder.h | 25 +++++++++++----- 36 files changed, 106 insertions(+), 103 deletions(-) diff --git a/dbms/src/DataStreams/IBlockInputStream.h b/dbms/src/DataStreams/IBlockInputStream.h index b1f7f2c3788..dfcd1c38802 100644 --- a/dbms/src/DataStreams/IBlockInputStream.h +++ b/dbms/src/DataStreams/IBlockInputStream.h @@ -115,7 +115,7 @@ public: size_t checkDepth(size_t max_depth) const { return checkDepthImpl(max_depth, max_depth); } /// Do not allow to change the table while the blocks stream and its children are alive. - void addTableLock(const TableStructureLockHolder & lock) { table_locks.push_back(lock); } + void addTableLock(const TableStructureReadLockHolder & lock) { table_locks.push_back(lock); } /// Get information about execution speed. const BlockStreamProfileInfo & getProfileInfo() const { return info; } @@ -242,7 +242,7 @@ public: protected: /// Order is important: `table_locks` must be destroyed after `children` so that tables from /// which child streams read are protected by the locks during the lifetime of the child streams. - std::vector table_locks; + std::vector table_locks; BlockInputStreams children; std::shared_mutex children_mutex; diff --git a/dbms/src/DataStreams/IBlockOutputStream.h b/dbms/src/DataStreams/IBlockOutputStream.h index b98fa2067be..f4269a66422 100644 --- a/dbms/src/DataStreams/IBlockOutputStream.h +++ b/dbms/src/DataStreams/IBlockOutputStream.h @@ -58,10 +58,10 @@ public: /** Don't let to alter table while instance of stream is alive. */ - void addTableLock(const TableStructureLockHolder & lock) { table_locks.push_back(lock); } + void addTableLock(const TableStructureReadLockHolder & lock) { table_locks.push_back(lock); } private: - std::vector table_locks; + std::vector table_locks; }; using BlockOutputStreamPtr = std::shared_ptr; diff --git a/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp b/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp index 5cb0a1e57e4..195c5edcb07 100644 --- a/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp +++ b/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp @@ -20,7 +20,7 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream( * Although now any insertion into the table is done via PushingToViewsBlockOutputStream, * but it's clear that here is not the best place for this functionality. */ - addTableLock(storage->lockStructure(true, context.getCurrentQueryId())); + addTableLock(storage->lockStructureForShare(true, context.getCurrentQueryId())); /// If the "root" table deduplactes blocks, there are no need to make deduplication for children /// Moreover, deduplication for AggregatingMergeTree children could produce false positives due to low size of inserting blocks @@ -45,7 +45,7 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream( auto & materialized_view = dynamic_cast(*dependent_table); if (StoragePtr inner_table = materialized_view.tryGetTargetTable()) - addTableLock(inner_table->lockStructure(true, context.getCurrentQueryId())); + addTableLock(inner_table->lockStructureForShare(true, context.getCurrentQueryId())); auto query = materialized_view.getInnerQuery(); BlockOutputStreamPtr out = std::make_shared( diff --git a/dbms/src/Functions/FunctionJoinGet.cpp b/dbms/src/Functions/FunctionJoinGet.cpp index 3ee3145dcfc..5201a0ba5c2 100644 --- a/dbms/src/Functions/FunctionJoinGet.cpp +++ b/dbms/src/Functions/FunctionJoinGet.cpp @@ -65,7 +65,7 @@ FunctionBasePtr FunctionBuilderJoinGet::buildImpl(const ColumnsWithTypeAndName & auto join = storage_join->getJoin(); DataTypes data_types(arguments.size()); - auto table_lock = storage_join->lockStructure(false, context.getCurrentQueryId()); + auto table_lock = storage_join->lockStructureForShare(false, context.getCurrentQueryId()); for (size_t i = 0; i < arguments.size(); ++i) data_types[i] = arguments[i].type; diff --git a/dbms/src/Functions/FunctionJoinGet.h b/dbms/src/Functions/FunctionJoinGet.h index fd9810f569c..556574b1346 100644 --- a/dbms/src/Functions/FunctionJoinGet.h +++ b/dbms/src/Functions/FunctionJoinGet.h @@ -15,7 +15,7 @@ public: static constexpr auto name = "joinGet"; FunctionJoinGet( - TableStructureLockHolder table_lock, StoragePtr storage_join, JoinPtr join, const String & attr_name, DataTypePtr return_type) + TableStructureReadLockHolder table_lock, StoragePtr storage_join, JoinPtr join, const String & attr_name, DataTypePtr return_type) : table_lock(std::move(table_lock)) , storage_join(std::move(storage_join)) , join(std::move(join)) @@ -35,7 +35,7 @@ private: size_t getNumberOfArguments() const override { return 0; } private: - TableStructureLockHolder table_lock; + TableStructureReadLockHolder table_lock; StoragePtr storage_join; JoinPtr join; const String attr_name; diff --git a/dbms/src/Interpreters/InterpreterAlterQuery.cpp b/dbms/src/Interpreters/InterpreterAlterQuery.cpp index 34104342413..b0091263bb4 100644 --- a/dbms/src/Interpreters/InterpreterAlterQuery.cpp +++ b/dbms/src/Interpreters/InterpreterAlterQuery.cpp @@ -74,7 +74,7 @@ BlockIO InterpreterAlterQuery::execute() if (!alter_commands.empty()) { - auto structure_lock = table->lockIntentionForAlter(context.getCurrentQueryId()); + auto structure_lock = table->lockAlterIntention(context.getCurrentQueryId()); alter_commands.validate(*table, context); table->alter(alter_commands, database_name, table_name, context, structure_lock); } diff --git a/dbms/src/Interpreters/InterpreterCreateQuery.cpp b/dbms/src/Interpreters/InterpreterCreateQuery.cpp index 1ed92b72e1c..69415378dd6 100644 --- a/dbms/src/Interpreters/InterpreterCreateQuery.cpp +++ b/dbms/src/Interpreters/InterpreterCreateQuery.cpp @@ -587,11 +587,11 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create) String as_table_name = create.as_table; StoragePtr as_storage; - TableStructureLockHolder as_storage_lock; + TableStructureReadLockHolder as_storage_lock; if (!as_table_name.empty()) { as_storage = context.getTable(as_database_name, as_table_name); - as_storage_lock = as_storage->lockStructure(false, context.getCurrentQueryId()); + as_storage_lock = as_storage->lockStructureForShare(false, context.getCurrentQueryId()); } /// Set and retrieve list of columns. diff --git a/dbms/src/Interpreters/InterpreterDescribeQuery.cpp b/dbms/src/Interpreters/InterpreterDescribeQuery.cpp index 19cb167168e..dfca483f7ad 100644 --- a/dbms/src/Interpreters/InterpreterDescribeQuery.cpp +++ b/dbms/src/Interpreters/InterpreterDescribeQuery.cpp @@ -93,7 +93,7 @@ BlockInputStreamPtr InterpreterDescribeQuery::executeImpl() table = context.getTable(database_name, table_name); } - auto table_lock = table->lockStructure(false, context.getCurrentQueryId()); + auto table_lock = table->lockStructureForShare(false, context.getCurrentQueryId()); columns = table->getColumns().getAll(); column_defaults = table->getColumns().defaults; column_comments = table->getColumns().comments; diff --git a/dbms/src/Interpreters/InterpreterDropQuery.cpp b/dbms/src/Interpreters/InterpreterDropQuery.cpp index 3d0af183f3d..dcb892d4528 100644 --- a/dbms/src/Interpreters/InterpreterDropQuery.cpp +++ b/dbms/src/Interpreters/InterpreterDropQuery.cpp @@ -69,7 +69,6 @@ BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & t { database_and_table.second->shutdown(); /// If table was already dropped by anyone, an exception will be thrown - // TODO auto table_lock = database_and_table.second->lockExclusively(context.getCurrentQueryId()); /// Drop table from memory, don't touch data and metadata database_and_table.first->detachTable(database_and_table.second->getTableName()); diff --git a/dbms/src/Interpreters/InterpreterInsertQuery.cpp b/dbms/src/Interpreters/InterpreterInsertQuery.cpp index 00cf8e925cd..d5c2600eda4 100644 --- a/dbms/src/Interpreters/InterpreterInsertQuery.cpp +++ b/dbms/src/Interpreters/InterpreterInsertQuery.cpp @@ -96,7 +96,7 @@ BlockIO InterpreterInsertQuery::execute() checkAccess(query); StoragePtr table = getTable(query); - auto table_lock = table->lockStructure(true, context.getCurrentQueryId()); + auto table_lock = table->lockStructureForShare(true, context.getCurrentQueryId()); /// We create a pipeline of several streams, into which we will write data. BlockOutputStreamPtr out; diff --git a/dbms/src/Interpreters/InterpreterOptimizeQuery.cpp b/dbms/src/Interpreters/InterpreterOptimizeQuery.cpp index 78978794386..47e77172eae 100644 --- a/dbms/src/Interpreters/InterpreterOptimizeQuery.cpp +++ b/dbms/src/Interpreters/InterpreterOptimizeQuery.cpp @@ -23,7 +23,7 @@ BlockIO InterpreterOptimizeQuery::execute() return executeDDLQueryOnCluster(query_ptr, context, {ast.database}); StoragePtr table = context.getTable(ast.database, ast.table); - auto table_lock = table->lockStructure(true, context.getCurrentQueryId()); + auto table_lock = table->lockStructureForShare(true, context.getCurrentQueryId()); table->optimize(query_ptr, ast.partition, ast.final, ast.deduplicate, context); return {}; } diff --git a/dbms/src/Interpreters/InterpreterRenameQuery.cpp b/dbms/src/Interpreters/InterpreterRenameQuery.cpp index cebc30c9c87..77a0c862905 100644 --- a/dbms/src/Interpreters/InterpreterRenameQuery.cpp +++ b/dbms/src/Interpreters/InterpreterRenameQuery.cpp @@ -96,7 +96,7 @@ BlockIO InterpreterRenameQuery::execute() table_guards.emplace(to, context.getDDLGuard(to.database_name, to.table_name)); } - std::vector locks; + std::vector locks; locks.reserve(unique_tables_from.size()); for (const auto & names : unique_tables_from) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index 2b07ee9c881..c2d8d0f8abc 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -200,7 +200,7 @@ InterpreterSelectQuery::InterpreterSelectQuery( } if (storage) - table_lock = storage->lockStructure(false, context.getCurrentQueryId()); + table_lock = storage->lockStructureForShare(false, context.getCurrentQueryId()); syntax_analyzer_result = SyntaxAnalyzer(context, subquery_depth).analyze( query_ptr, source_header.getNamesAndTypesList(), required_result_column_names, storage); diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.h b/dbms/src/Interpreters/InterpreterSelectQuery.h index 78739593ebb..8655f0a9833 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.h +++ b/dbms/src/Interpreters/InterpreterSelectQuery.h @@ -248,7 +248,7 @@ private: /// Table from where to read data, if not subquery. StoragePtr storage; - TableStructureLockHolder table_lock; + TableStructureReadLockHolder table_lock; /// Used when we read from prepared input, not table or subquery. BlockInputStreamPtr input; diff --git a/dbms/src/Storages/IStorage.cpp b/dbms/src/Storages/IStorage.cpp index 6b196c42221..ecfe6bb9356 100644 --- a/dbms/src/Storages/IStorage.cpp +++ b/dbms/src/Storages/IStorage.cpp @@ -5,7 +5,7 @@ namespace DB { -void IStorage::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureLockHolder & structure_lock) +void IStorage::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & structure_lock) { for (const auto & param : params) { @@ -13,7 +13,7 @@ void IStorage::alter(const AlterCommands & params, const String & database_name, throw Exception("Method alter supports only change comment of column for storage " + getName(), ErrorCodes::NOT_IMPLEMENTED); } - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); params.apply(new_columns); diff --git a/dbms/src/Storages/IStorage.h b/dbms/src/Storages/IStorage.h index 9c3175b96bc..6d223f1929e 100644 --- a/dbms/src/Storages/IStorage.h +++ b/dbms/src/Storages/IStorage.h @@ -84,9 +84,9 @@ public: virtual bool supportsDeduplication() const { return false; } - TableStructureLockHolder lockStructure(bool will_add_new_data, const String & query_id) + TableStructureReadLockHolder lockStructureForShare(bool will_add_new_data, const String & query_id) { - TableStructureLockHolder result; + TableStructureReadLockHolder result; if (will_add_new_data) result.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Read, query_id); result.structure_lock = structure_lock->getLock(RWLockImpl::Read, query_id); @@ -96,9 +96,9 @@ public: return result; } - TableStructureLockHolder lockIntentionForAlter(const String & query_id) + TableStructureWriteLockHolder lockAlterIntention(const String & query_id) { - TableStructureLockHolder result; + TableStructureWriteLockHolder result; result.alter_intention_lock = alter_intention_lock->getLock(RWLockImpl::Write, query_id); if (is_dropped) @@ -106,19 +106,16 @@ public: return result; } - void lockDataForAlter(TableStructureLockHolder & lock_holder, const String & query_id) + void lockNewDataStructureExclusively(TableStructureWriteLockHolder & lock_holder, const String & query_id) { if (!lock_holder.alter_intention_lock) throw Exception("Alter intention lock for table " + getTableName() + " was not taken. This is a bug.", ErrorCodes::LOGICAL_ERROR); lock_holder.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); - - if (is_dropped) - throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); } - void lockStructureForAlter(TableStructureLockHolder & lock_holder, const String & query_id) + void lockStructureExclusively(TableStructureWriteLockHolder & lock_holder, const String & query_id) { if (!lock_holder.alter_intention_lock) throw Exception("Alter intention lock for table " + getTableName() + " was not taken. This is a bug.", @@ -127,21 +124,19 @@ public: if (!lock_holder.new_data_structure_lock) lock_holder.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); lock_holder.structure_lock = structure_lock->getLock(RWLockImpl::Write, query_id); - - if (is_dropped) - throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); } - TableStructureLockHolder lockExclusively(const String & query_id) + TableStructureWriteLockHolder lockExclusively(const String & query_id) { - TableStructureLockHolder result; + TableStructureWriteLockHolder result; result.alter_intention_lock = alter_intention_lock->getLock(RWLockImpl::Write, query_id); - result.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); - result.structure_lock = structure_lock->getLock(RWLockImpl::Write, query_id); if (is_dropped) throw Exception("Table is dropped", ErrorCodes::TABLE_IS_DROPPED); + result.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); + result.structure_lock = structure_lock->getLock(RWLockImpl::Write, query_id); + return result; } @@ -221,7 +216,7 @@ public: * This method must fully execute the ALTER query, taking care of the locks itself. * To update the table metadata on disk, this method should call InterpreterAlterQuery::updateMetadata. */ - virtual void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureLockHolder & structure_lock); + virtual void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & structure_lock); /** ALTER tables with regard to its partitions. * Should handle locks for each command on its own. diff --git a/dbms/src/Storages/MergeTree/DataPartsExchange.cpp b/dbms/src/Storages/MergeTree/DataPartsExchange.cpp index 9a8346d36a7..42c668c9fcb 100644 --- a/dbms/src/Storages/MergeTree/DataPartsExchange.cpp +++ b/dbms/src/Storages/MergeTree/DataPartsExchange.cpp @@ -79,7 +79,7 @@ void Service::processQuery(const Poco::Net::HTMLForm & params, ReadBuffer & /*bo try { - auto storage_lock = owned_storage->lockStructure(false, RWLockImpl::NO_QUERY); + auto storage_lock = owned_storage->lockStructureForShare(false, RWLockImpl::NO_QUERY); MergeTreeData::DataPartPtr part = findPart(part_name); diff --git a/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp b/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp index 398bbc810dc..ba3bc77af6b 100644 --- a/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp +++ b/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp @@ -108,7 +108,6 @@ void ReplicatedMergeTreeAlterThread::run() LOG_INFO(log, "Version of metadata nodes in ZooKeeper changed. Waiting for structure write lock."); - // TODO auto table_lock = storage.lockExclusively(RWLockImpl::NO_QUERY); if (columns_in_zk == storage.getColumns() && metadata_diff.empty()) @@ -135,7 +134,7 @@ void ReplicatedMergeTreeAlterThread::run() /// Update parts. if (changed_columns_version || force_recheck_parts) { - auto table_lock = storage.lockStructure(false, RWLockImpl::NO_QUERY); + auto table_lock = storage.lockStructureForShare(false, RWLockImpl::NO_QUERY); if (changed_columns_version) LOG_INFO(log, "ALTER-ing parts"); diff --git a/dbms/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp b/dbms/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp index f0dad30025c..a745af1e414 100644 --- a/dbms/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp +++ b/dbms/src/Storages/MergeTree/ReplicatedMergeTreePartCheckThread.cpp @@ -202,7 +202,7 @@ void ReplicatedMergeTreePartCheckThread::checkPart(const String & part_name) else if (part->name == part_name) { auto zookeeper = storage.getZooKeeper(); - auto table_lock = storage.lockStructure(false, RWLockImpl::NO_QUERY); + auto table_lock = storage.lockStructureForShare(false, RWLockImpl::NO_QUERY); auto local_part_header = ReplicatedMergeTreePartHeader::fromColumnsAndChecksums( part->columns, part->checksums); diff --git a/dbms/src/Storages/StorageBuffer.cpp b/dbms/src/Storages/StorageBuffer.cpp index c1eb128292b..e10bf410edc 100644 --- a/dbms/src/Storages/StorageBuffer.cpp +++ b/dbms/src/Storages/StorageBuffer.cpp @@ -150,7 +150,7 @@ BlockInputStreams StorageBuffer::read( if (destination.get() == this) throw Exception("Destination table is myself. Read will cause infinite loop.", ErrorCodes::INFINITE_LOOP); - auto destination_lock = destination->lockStructure(false, context.getCurrentQueryId()); + auto destination_lock = destination->lockStructureForShare(false, context.getCurrentQueryId()); const bool dst_has_same_structure = std::all_of(column_names.begin(), column_names.end(), [this, destination](const String& column_name) { @@ -677,9 +677,9 @@ void StorageBuffer::flushThread() } -void StorageBuffer::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureLockHolder & structure_lock) +void StorageBuffer::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & structure_lock) { - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); /// So that no blocks of the old structure remain. optimize({} /*query*/, {} /*partition_id*/, false /*final*/, false /*deduplicate*/, context); diff --git a/dbms/src/Storages/StorageBuffer.h b/dbms/src/Storages/StorageBuffer.h index a234a4efd7b..f03bb87f200 100644 --- a/dbms/src/Storages/StorageBuffer.h +++ b/dbms/src/Storages/StorageBuffer.h @@ -83,7 +83,7 @@ public: /// The structure of the subordinate table is not checked and does not change. void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureLockHolder & structure_locks) override; + const Context & context, TableStructureWriteLockHolder & structure_lock) override; private: String name; diff --git a/dbms/src/Storages/StorageDistributed.cpp b/dbms/src/Storages/StorageDistributed.cpp index 965fff96c25..0383863aa4f 100644 --- a/dbms/src/Storages/StorageDistributed.cpp +++ b/dbms/src/Storages/StorageDistributed.cpp @@ -338,9 +338,9 @@ BlockOutputStreamPtr StorageDistributed::write(const ASTPtr &, const Context & c void StorageDistributed::alter( const AlterCommands & params, const String & database_name, const String & current_table_name, - const Context & context, TableStructureLockHolder & structure_lock) + const Context & context, TableStructureWriteLockHolder & structure_lock) { - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageDistributed.h b/dbms/src/Storages/StorageDistributed.h index 7f22ff94ee9..c46c0af3061 100644 --- a/dbms/src/Storages/StorageDistributed.h +++ b/dbms/src/Storages/StorageDistributed.h @@ -83,7 +83,7 @@ public: /// the structure of the sub-table is not checked void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & structure_lock) override; void startup() override; void shutdown() override; diff --git a/dbms/src/Storages/StorageMaterializedView.cpp b/dbms/src/Storages/StorageMaterializedView.cpp index 93663badf56..b19dd53ff49 100644 --- a/dbms/src/Storages/StorageMaterializedView.cpp +++ b/dbms/src/Storages/StorageMaterializedView.cpp @@ -190,7 +190,7 @@ BlockInputStreams StorageMaterializedView::read( const unsigned num_streams) { auto storage = getTargetTable(); - auto lock = storage->lockStructure(false, context.getCurrentQueryId()); + auto lock = storage->lockStructureForShare(false, context.getCurrentQueryId()); auto streams = storage->read(column_names, query_info, context, processed_stage, max_block_size, num_streams); for (auto & stream : streams) stream->addTableLock(lock); @@ -200,7 +200,7 @@ BlockInputStreams StorageMaterializedView::read( BlockOutputStreamPtr StorageMaterializedView::write(const ASTPtr & query, const Context & context) { auto storage = getTargetTable(); - auto lock = storage->lockStructure(true, context.getCurrentQueryId()); + auto lock = storage->lockStructureForShare(true, context.getCurrentQueryId()); auto stream = storage->write(query, context); stream->addTableLock(lock); return stream; diff --git a/dbms/src/Storages/StorageMerge.cpp b/dbms/src/Storages/StorageMerge.cpp index f32f80e982f..1a67a04593c 100644 --- a/dbms/src/Storages/StorageMerge.cpp +++ b/dbms/src/Storages/StorageMerge.cpp @@ -224,7 +224,7 @@ BlockInputStreams StorageMerge::read( current_streams = std::max(size_t(1), current_streams); StoragePtr storage = it->first; - TableStructureLockHolder struct_lock = it->second; + TableStructureReadLockHolder struct_lock = it->second; BlockInputStreams source_streams; @@ -262,7 +262,7 @@ BlockInputStreams StorageMerge::read( BlockInputStreams StorageMerge::createSourceStreams(const SelectQueryInfo & query_info, const QueryProcessingStage::Enum & processed_stage, const UInt64 max_block_size, const Block & header, const StoragePtr & storage, - const TableStructureLockHolder & struct_lock, Names & real_column_names, + const TableStructureReadLockHolder & struct_lock, Names & real_column_names, Context & modified_context, size_t streams_num, bool has_table_virtual_column, bool concat_streams) { @@ -345,7 +345,7 @@ StorageMerge::StorageListWithLocks StorageMerge::getSelectedTables(const String { auto & table = iterator->table(); if (table.get() != this) - selected_tables.emplace_back(table, table->lockStructure(false, query_id)); + selected_tables.emplace_back(table, table->lockStructureForShare(false, query_id)); } iterator->next(); @@ -375,7 +375,7 @@ StorageMerge::StorageListWithLocks StorageMerge::getSelectedTables(const ASTPtr if (storage.get() != this) { virtual_column->insert(storage->getTableName()); - selected_tables.emplace_back(storage, get_lock ? storage->lockStructure(false, query_id) : TableStructureLockHolder{}); + selected_tables.emplace_back(storage, get_lock ? storage->lockStructureForShare(false, query_id) : TableStructureReadLockHolder{}); } } @@ -397,9 +397,9 @@ StorageMerge::StorageListWithLocks StorageMerge::getSelectedTables(const ASTPtr void StorageMerge::alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureLockHolder & structure_lock) + const Context & context, TableStructureWriteLockHolder & structure_lock) { - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageMerge.h b/dbms/src/Storages/StorageMerge.h index acce2cbda0e..78b2b224842 100644 --- a/dbms/src/Storages/StorageMerge.h +++ b/dbms/src/Storages/StorageMerge.h @@ -46,7 +46,7 @@ public: /// the structure of sub-tables is not checked void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & structure_lock) override; bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, const Context & query_context) const override; @@ -56,7 +56,7 @@ private: OptimizedRegularExpression table_name_regexp; Context global_context; - using StorageListWithLocks = std::list>; + using StorageListWithLocks = std::list>; StorageListWithLocks getSelectedTables(const String & query_id) const; @@ -78,7 +78,7 @@ protected: BlockInputStreams createSourceStreams(const SelectQueryInfo & query_info, const QueryProcessingStage::Enum & processed_stage, const UInt64 max_block_size, const Block & header, const StoragePtr & storage, - const TableStructureLockHolder & struct_lock, Names & real_column_names, + const TableStructureReadLockHolder & struct_lock, Names & real_column_names, Context & modified_context, size_t streams_num, bool has_table_virtual_column, bool concat_streams = false); diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 673c67c9334..e75a37ce420 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -196,11 +196,11 @@ void StorageMergeTree::alter( const String & current_database_name, const String & current_table_name, const Context & context, - TableStructureLockHolder & structure_lock) + TableStructureWriteLockHolder & structure_lock) { if (!params.is_mutable()) { - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); params.apply(new_columns); @@ -212,7 +212,7 @@ void StorageMergeTree::alter( /// NOTE: Here, as in ReplicatedMergeTree, you can do ALTER which does not block the writing of data for a long time. auto merge_blocker = merger_mutator.actions_blocker.cancel(); - lockDataForAlter(structure_lock, context.getCurrentQueryId()); + lockNewDataStructureExclusively(structure_lock, context.getCurrentQueryId()); data.checkAlter(params, context); @@ -231,7 +231,7 @@ void StorageMergeTree::alter( transactions.push_back(std::move(transaction)); } - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); IDatabase::ASTModifier storage_modifier = [&] (IAST & ast) { @@ -453,7 +453,7 @@ bool StorageMergeTree::merge( bool deduplicate, String * out_disable_reason) { - auto structure_lock = lockStructure(true, RWLockImpl::NO_QUERY); + auto structure_lock = lockStructureForShare(true, RWLockImpl::NO_QUERY); FutureMergedMutatedPart future_part; @@ -563,7 +563,7 @@ bool StorageMergeTree::merge( bool StorageMergeTree::tryMutatePart() { - auto structure_lock = lockStructure(true, RWLockImpl::NO_QUERY); + auto structure_lock = lockStructureForShare(true, RWLockImpl::NO_QUERY); FutureMergedMutatedPart future_part; MutationCommands commands; @@ -775,7 +775,7 @@ void StorageMergeTree::clearColumnInPartition(const ASTPtr & partition, const Fi auto merge_blocker = merger_mutator.actions_blocker.cancel(); /// We don't change table structure, only data in some parts, parts are locked inside alterDataPart() function - auto lock_read_structure = lockStructure(false, context.getCurrentQueryId()); + auto lock_read_structure = lockStructureForShare(false, context.getCurrentQueryId()); String partition_id = data.getPartitionIDFromQuery(partition, context); auto parts = data.getDataPartsVectorInPartition(MergeTreeDataPartState::Committed, partition_id); @@ -880,7 +880,7 @@ void StorageMergeTree::alterPartition(const ASTPtr & query, const PartitionComma case PartitionCommand::FREEZE_PARTITION: { - auto lock = lockStructure(false, context.getCurrentQueryId()); + auto lock = lockStructureForShare(false, context.getCurrentQueryId()); data.freezePartition(command.partition, command.with_name, context); } break; @@ -891,7 +891,7 @@ void StorageMergeTree::alterPartition(const ASTPtr & query, const PartitionComma case PartitionCommand::FREEZE_ALL_PARTITIONS: { - auto lock = lockStructure(false, context.getCurrentQueryId()); + auto lock = lockStructureForShare(false, context.getCurrentQueryId()); data.freezeAll(command.with_name, context); } break; @@ -909,7 +909,6 @@ void StorageMergeTree::dropPartition(const ASTPtr & partition, bool detach, cons /// This protects against "revival" of data for a removed partition after completion of merge. auto merge_blocker = merger_mutator.actions_blocker.cancel(); /// Waits for completion of merge and does not start new ones. - // TODO auto lock = lockExclusively(context.getCurrentQueryId()); String partition_id = data.getPartitionIDFromQuery(partition, context); @@ -993,8 +992,8 @@ void StorageMergeTree::attachPartition(const ASTPtr & partition, bool attach_par void StorageMergeTree::replacePartitionFrom(const StoragePtr & source_table, const ASTPtr & partition, bool replace, const Context & context) { - auto lock1 = lockStructure(false, context.getCurrentQueryId()); - auto lock2 = source_table->lockStructure(false, context.getCurrentQueryId()); + auto lock1 = lockStructureForShare(false, context.getCurrentQueryId()); + auto lock2 = source_table->lockStructureForShare(false, context.getCurrentQueryId()); Stopwatch watch; MergeTreeData * src_data = data.checkStructureAndGetMergeTreeData(source_table); diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index 86722e39ba6..853a14dfae7 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -79,7 +79,7 @@ public: void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & structure_lock) override; void checkTableCanBeDropped() const override; diff --git a/dbms/src/Storages/StorageNull.cpp b/dbms/src/Storages/StorageNull.cpp index b6b2b02bbd8..9fb425dba37 100644 --- a/dbms/src/Storages/StorageNull.cpp +++ b/dbms/src/Storages/StorageNull.cpp @@ -32,9 +32,9 @@ void registerStorageNull(StorageFactory & factory) void StorageNull::alter( const AlterCommands & params, const String & current_database_name, const String & current_table_name, - const Context & context, TableStructureLockHolder & structure_lock) + const Context & context, TableStructureWriteLockHolder & structure_lock) { - lockStructureForAlter(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(structure_lock, context.getCurrentQueryId()); ColumnsDescription new_columns = getColumns(); IndicesDescription new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageNull.h b/dbms/src/Storages/StorageNull.h index 1cc68504518..9f69bcb4c14 100644 --- a/dbms/src/Storages/StorageNull.h +++ b/dbms/src/Storages/StorageNull.h @@ -43,7 +43,7 @@ public: void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & structure_lock) override; private: String table_name; diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index b227476029a..427850733d7 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -1089,7 +1089,7 @@ bool StorageReplicatedMergeTree::tryExecuteMerge(const LogEntry & entry) /// Can throw an exception. DiskSpaceMonitor::ReservationPtr reserved_space = DiskSpaceMonitor::reserve(full_path, estimated_space_for_merge); - auto table_lock = lockStructure(false, RWLockImpl::NO_QUERY); + auto table_lock = lockStructureForShare(false, RWLockImpl::NO_QUERY); FutureMergedMutatedPart future_merged_part(parts); if (future_merged_part.name != entry.new_part_name) @@ -1219,7 +1219,7 @@ bool StorageReplicatedMergeTree::tryExecutePartMutation(const StorageReplicatedM /// Can throw an exception. DiskSpaceMonitor::ReservationPtr reserved_space = DiskSpaceMonitor::reserve(full_path, estimated_space_for_result); - auto table_lock = lockStructure(false, RWLockImpl::NO_QUERY); + auto table_lock = lockStructureForShare(false, RWLockImpl::NO_QUERY); MergeTreeData::MutableDataPartPtr new_part; MergeTreeData::Transaction transaction(data); @@ -1528,7 +1528,7 @@ void StorageReplicatedMergeTree::executeClearColumnInPartition(const LogEntry & /// We don't change table structure, only data in some parts /// To disable reading from these parts, we will sequentially acquire write lock for each part inside alterDataPart() /// If we will lock the whole table here, a deadlock can occur. For example, if use use Buffer table (CLICKHOUSE-3238) - auto lock_read_structure = lockStructure(false, RWLockImpl::NO_QUERY); + auto lock_read_structure = lockStructureForShare(false, RWLockImpl::NO_QUERY); auto zookeeper = getZooKeeper(); @@ -1624,7 +1624,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) PartDescriptions parts_to_add; MergeTreeData::DataPartsVector parts_to_remove; - auto structure_lock_dst_table = lockStructure(false, RWLockImpl::NO_QUERY); + auto structure_lock_dst_table = lockStructureForShare(false, RWLockImpl::NO_QUERY); for (size_t i = 0; i < entry_replace.new_part_names.size(); ++i) { @@ -1662,7 +1662,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) } StoragePtr source_table; - TableStructureLockHolder structure_lock_src_table; + TableStructureReadLockHolder structure_lock_src_table; String source_table_name = entry_replace.from_database + "." + entry_replace.from_table; auto clone_data_parts_from_source_table = [&] () -> size_t @@ -1686,7 +1686,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) return 0; } - structure_lock_src_table = source_table->lockStructure(false, RWLockImpl::NO_QUERY); + structure_lock_src_table = source_table->lockStructureForShare(false, RWLockImpl::NO_QUERY); MergeTreeData::DataPartStates valid_states{MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}; @@ -2719,9 +2719,9 @@ bool StorageReplicatedMergeTree::fetchPart(const String & part_name, const Strin LOG_DEBUG(log, "Fetching part " << part_name << " from " << source_replica_path); - TableStructureLockHolder table_lock; + TableStructureReadLockHolder table_lock; if (!to_detached) - table_lock = lockStructure(true, RWLockImpl::NO_QUERY); + table_lock = lockStructureForShare(true, RWLockImpl::NO_QUERY); /// Logging Stopwatch stopwatch; @@ -3089,7 +3089,7 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p void StorageReplicatedMergeTree::alter( const AlterCommands & params, const String & /*database_name*/, const String & /*table_name*/, - const Context & query_context, TableStructureLockHolder & structure_lock) + const Context & query_context, TableStructureWriteLockHolder & structure_lock) { assertNotReadonly(); @@ -3125,7 +3125,7 @@ void StorageReplicatedMergeTree::alter( { /// Just to read current structure. Alter will be done in separate thread. - auto table_lock = lockStructure(false, query_context.getCurrentQueryId()); + auto table_lock = lockStructureForShare(false, query_context.getCurrentQueryId()); if (is_readonly) throw Exception("Can't ALTER readonly table", ErrorCodes::TABLE_IS_READ_ONLY); @@ -3385,7 +3385,7 @@ void StorageReplicatedMergeTree::alterPartition(const ASTPtr & query, const Part case PartitionCommand::FREEZE_PARTITION: { - auto lock = lockStructure(false, query_context.getCurrentQueryId()); + auto lock = lockStructureForShare(false, query_context.getCurrentQueryId()); data.freezePartition(command.partition, command.with_name, query_context); } break; @@ -3396,7 +3396,7 @@ void StorageReplicatedMergeTree::alterPartition(const ASTPtr & query, const Part case PartitionCommand::FREEZE_ALL_PARTITIONS: { - auto lock = lockStructure(false, query_context.getCurrentQueryId()); + auto lock = lockStructureForShare(false, query_context.getCurrentQueryId()); data.freezeAll(command.with_name, query_context); } break; @@ -4451,7 +4451,7 @@ void StorageReplicatedMergeTree::clearOldPartsAndRemoveFromZK() { /// Critical section is not required (since grabOldParts() returns unique part set on each call) - auto table_lock = lockStructure(false, RWLockImpl::NO_QUERY); + auto table_lock = lockStructureForShare(false, RWLockImpl::NO_QUERY); auto zookeeper = getZooKeeper(); MergeTreeData::DataPartsVector parts = data.grabOldParts(); @@ -4743,8 +4743,8 @@ void StorageReplicatedMergeTree::clearBlocksInPartition( void StorageReplicatedMergeTree::replacePartitionFrom(const StoragePtr & source_table, const ASTPtr & partition, bool replace, const Context & context) { - auto lock1 = lockStructure(false, context.getCurrentQueryId()); - auto lock2 = source_table->lockStructure(false, context.getCurrentQueryId()); + auto lock1 = lockStructureForShare(false, context.getCurrentQueryId()); + auto lock2 = source_table->lockStructureForShare(false, context.getCurrentQueryId()); Stopwatch watch; MergeTreeData * src_data = data.checkStructureAndGetMergeTreeData(source_table); diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.h b/dbms/src/Storages/StorageReplicatedMergeTree.h index 0abbfb51136..4b7ffff1988 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.h +++ b/dbms/src/Storages/StorageReplicatedMergeTree.h @@ -118,7 +118,7 @@ public: void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & query_context, TableStructureLockHolder & structure_lock) override; + const Context & query_context, TableStructureWriteLockHolder & structure_lock) override; void alterPartition(const ASTPtr & query, const PartitionCommands & commands, const Context & query_context) override; diff --git a/dbms/src/Storages/System/StorageSystemColumns.cpp b/dbms/src/Storages/System/StorageSystemColumns.cpp index abf0f83c7dd..d94b8c0ab10 100644 --- a/dbms/src/Storages/System/StorageSystemColumns.cpp +++ b/dbms/src/Storages/System/StorageSystemColumns.cpp @@ -100,11 +100,11 @@ protected: { StoragePtr storage = storages.at(std::make_pair(database_name, table_name)); - TableStructureLockHolder table_lock; + TableStructureReadLockHolder table_lock; try { - table_lock = storage->lockStructure(false, query_id); + table_lock = storage->lockStructureForShare(false, query_id); } catch (const Exception & e) { diff --git a/dbms/src/Storages/System/StorageSystemPartsBase.cpp b/dbms/src/Storages/System/StorageSystemPartsBase.cpp index f8449e7a937..e65d780f629 100644 --- a/dbms/src/Storages/System/StorageSystemPartsBase.cpp +++ b/dbms/src/Storages/System/StorageSystemPartsBase.cpp @@ -167,7 +167,7 @@ public: try { /// For table not to be dropped and set of columns to remain constant. - info.table_lock = info.storage->lockStructure(false, query_id); + info.table_lock = info.storage->lockStructureForShare(false, query_id); } catch (const Exception & e) { diff --git a/dbms/src/Storages/System/StorageSystemPartsBase.h b/dbms/src/Storages/System/StorageSystemPartsBase.h index 96d5de08423..6fa92b02854 100644 --- a/dbms/src/Storages/System/StorageSystemPartsBase.h +++ b/dbms/src/Storages/System/StorageSystemPartsBase.h @@ -34,7 +34,7 @@ public: struct StoragesInfo { StoragePtr storage; - TableStructureLockHolder table_lock; + TableStructureReadLockHolder table_lock; String database; String table; diff --git a/dbms/src/Storages/TableStructureLockHolder.h b/dbms/src/Storages/TableStructureLockHolder.h index f8d64dbf712..af19d44cfbd 100644 --- a/dbms/src/Storages/TableStructureLockHolder.h +++ b/dbms/src/Storages/TableStructureLockHolder.h @@ -5,19 +5,30 @@ namespace DB { -struct TableStructureLockHolder +struct TableStructureWriteLockHolder { + void release() + { + *this = TableStructureWriteLockHolder(); + } + +private: + friend class IStorage; + /// Order is important. RWLockImpl::LockHolder alter_intention_lock; RWLockImpl::LockHolder new_data_structure_lock; RWLockImpl::LockHolder structure_lock; +}; - void release() - { - structure_lock.reset(); - new_data_structure_lock.reset(); - alter_intention_lock.reset(); - } +struct TableStructureReadLockHolder +{ +private: + friend class IStorage; + + /// Order is important. + RWLockImpl::LockHolder new_data_structure_lock; + RWLockImpl::LockHolder structure_lock; }; } From f7217d99dd857f9f8ea668c74e7e497063fa9351 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Thu, 7 Mar 2019 21:16:36 +0300 Subject: [PATCH 189/297] move test script that caused a crash from bugs/ to tests --- .../00816_concurrent_alter_column.reference | 1 + .../00816_concurrent_alter_column.sh | 21 +++++++++++++++++++ .../bugs/00816_concurrent_alter_column.sh | 18 ---------------- 3 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference create mode 100755 dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh delete mode 100755 dbms/tests/queries/bugs/00816_concurrent_alter_column.sh diff --git a/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference new file mode 100644 index 00000000000..85dfb778810 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference @@ -0,0 +1 @@ +did not crash diff --git a/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh new file mode 100755 index 00000000000..c1fc0ebce6a --- /dev/null +++ b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +echo "DROP TABLE IF EXISTS test.concurrent_alter_column" | ${CLICKHOUSE_CLIENT} +echo "CREATE TABLE test.concurrent_alter_column (ts DATETIME) ENGINE = MergeTree PARTITION BY toStartOfDay(ts) ORDER BY tuple()" | ${CLICKHOUSE_CLIENT} + +for i in {1..500}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN c$i DOUBLE;"; done | ${CLICKHOUSE_CLIENT} -n + +for i in {1..100}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN d DOUBLE" | ${CLICKHOUSE_CLIENT}; sleep `echo 0.0$RANDOM`; echo "ALTER TABLE test.concurrent_alter_column DROP COLUMN d" | ${CLICKHOUSE_CLIENT} -n; done & +for i in {1..100}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN e DOUBLE" | ${CLICKHOUSE_CLIENT}; sleep `echo 0.0$RANDOM`; echo "ALTER TABLE test.concurrent_alter_column DROP COLUMN e" | ${CLICKHOUSE_CLIENT} -n; done & +for i in {1..100}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN f DOUBLE" | ${CLICKHOUSE_CLIENT}; sleep `echo 0.0$RANDOM`; echo "ALTER TABLE test.concurrent_alter_column DROP COLUMN f" | ${CLICKHOUSE_CLIENT} -n; done & + +wait + +echo "DROP TABLE test.concurrent_alter_column" | ${CLICKHOUSE_CLIENT} + +echo 'did not crash' diff --git a/dbms/tests/queries/bugs/00816_concurrent_alter_column.sh b/dbms/tests/queries/bugs/00816_concurrent_alter_column.sh deleted file mode 100755 index 63e8e48e0bb..00000000000 --- a/dbms/tests/queries/bugs/00816_concurrent_alter_column.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -. $CURDIR/../shell_config.sh - -echo "DROP TABLE IF EXISTS test.test" | ${CLICKHOUSE_CLIENT} -echo "CREATE TABLE test.test (ts DATETIME) ENGINE = MergeTree PARTITION BY toStartOfDay(ts) ORDER BY tuple()" | ${CLICKHOUSE_CLIENT} - -for i in {1..500}; do echo "ALTER TABLE test.test ADD COLUMN c$i DOUBLE;"; done | ${CLICKHOUSE_CLIENT} -n - -for i in {1..500}; do echo "ALTER TABLE test.test ADD COLUMN d DOUBLE" | ${CLICKHOUSE_CLIENT}; echo "ALTER TABLE test.test DROP COLUMN d" | ${CLICKHOUSE_CLIENT} -n; done & -for i in {1..500}; do echo "ALTER TABLE test.test ADD COLUMN e DOUBLE" | ${CLICKHOUSE_CLIENT}; echo "ALTER TABLE test.test DROP COLUMN e" | ${CLICKHOUSE_CLIENT} -n; done & - -wait - -echo "DROP TABLE test.test" | ${CLICKHOUSE_CLIENT} From f3ea9541fc5043480effa11aaed4abded442b8ac Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Thu, 7 Mar 2019 21:34:46 +0300 Subject: [PATCH 190/297] add comments --- dbms/src/Storages/IStorage.h | 35 +++++++++++--------- dbms/src/Storages/TableStructureLockHolder.h | 3 ++ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/dbms/src/Storages/IStorage.h b/dbms/src/Storages/IStorage.h index 6d223f1929e..4afd6e94ebd 100644 --- a/dbms/src/Storages/IStorage.h +++ b/dbms/src/Storages/IStorage.h @@ -84,6 +84,9 @@ public: virtual bool supportsDeduplication() const { return false; } + /// Acquire this lock if you need the table structure to remain constant during the execution of + /// the query. If will_add_new_data is true, this means that the query will add new data to the table + /// (INSERT or a parts merge). TableStructureReadLockHolder lockStructureForShare(bool will_add_new_data, const String & query_id) { TableStructureReadLockHolder result; @@ -96,6 +99,8 @@ public: return result; } + /// Acquire this lock at the start of ALTER to lock out other ALTERs and make sure that only you + /// can modify the table structure. It can later be upgraded to the exclusive lock. TableStructureWriteLockHolder lockAlterIntention(const String & query_id) { TableStructureWriteLockHolder result; @@ -106,6 +111,9 @@ public: return result; } + /// Upgrade alter intention lock and make sure that no new data is inserted into the table. + /// This is used by the ALTER MODIFY of the MergeTree storage to consistently determine + /// the set of parts that needs to be altered. void lockNewDataStructureExclusively(TableStructureWriteLockHolder & lock_holder, const String & query_id) { if (!lock_holder.alter_intention_lock) @@ -115,6 +123,8 @@ public: lock_holder.new_data_structure_lock = new_data_structure_lock->getLock(RWLockImpl::Write, query_id); } + /// Upgrade alter intention lock to the full exclusive structure lock. This is done by ALTER queries + /// to ensure that no other query uses the table structure and it can be safely changed. void lockStructureExclusively(TableStructureWriteLockHolder & lock_holder, const String & query_id) { if (!lock_holder.alter_intention_lock) @@ -126,6 +136,7 @@ public: lock_holder.structure_lock = structure_lock->getLock(RWLockImpl::Write, query_id); } + /// Acquire the full exclusive lock immediately. No other queries can run concurrently. TableStructureWriteLockHolder lockExclusively(const String & query_id) { TableStructureWriteLockHolder result; @@ -330,26 +341,18 @@ public: private: /// You always need to take the next three locks in this order. + /// If you hold this lock exclusively, you can be sure that no other structure modifying queries + /// (e.g. ALTER, DROP) are concurrently executing. But queries that only read table structure + /// (e.g. SELECT, INSERT) can continue to execute. mutable RWLock alter_intention_lock = RWLockImpl::create(); - /** It is taken for read for the entire INSERT query and the entire merge of the parts (for MergeTree). - * It is taken for write for the entire time ALTER MODIFY. - * - * Formally: - * Taking a write lock ensures that: - * 1) the data in the table will not change while the lock is alive, - * 2) all changes to the data after releasing the lock will be based on the structure of the table at the time after the lock was released. - * You need to take for read for the entire time of the operation that changes the data. - */ + /// It is taken for share for the entire INSERT query and the entire merge of the parts (for MergeTree). + /// ALTER queries acquire an exclusive lock to ensure mutable RWLock new_data_structure_lock = RWLockImpl::create(); - /** Lock for multiple columns and path to table. It is taken for write at RENAME, ALTER (for ALTER MODIFY for a while) and DROP. - * It is taken for read for the whole time of SELECT, INSERT and merge parts (for MergeTree). - * - * Taking this lock for writing is a strictly "stronger" operation than taking parts_writing_lock for write record. - * That is, if this lock is taken for write, you should not worry about `parts_writing_lock`. - * parts_writing_lock is only needed for cases when you do not want to take `table_structure_lock` for long operations (ALTER MODIFY). - */ + /// Lock for the table column structure (names, types, etc.) and data path. + /// It is taken in exclusive mode by queries that modify them (e.g. RENAME, ALTER and DROP) + /// and in share mode by other queries. mutable RWLock structure_lock = RWLockImpl::create(); }; diff --git a/dbms/src/Storages/TableStructureLockHolder.h b/dbms/src/Storages/TableStructureLockHolder.h index af19d44cfbd..1413ead80a8 100644 --- a/dbms/src/Storages/TableStructureLockHolder.h +++ b/dbms/src/Storages/TableStructureLockHolder.h @@ -5,6 +5,9 @@ namespace DB { +/// Structs that hold table structure (columns, their types, default values etc.) locks when executing queries. +/// See IStorage::lock* methods for comments. + struct TableStructureWriteLockHolder { void release() From 896b8b15f63a2bae99b077e4ffad2dac39393bf5 Mon Sep 17 00:00:00 2001 From: Alex Zatelepin Date: Thu, 7 Mar 2019 23:52:25 +0300 Subject: [PATCH 191/297] fix build --- dbms/src/Interpreters/InterpreterAlterQuery.cpp | 4 ++-- dbms/src/Storages/IStorage.cpp | 4 ++-- dbms/src/Storages/IStorage.h | 2 +- dbms/src/Storages/StorageBuffer.cpp | 4 ++-- dbms/src/Storages/StorageBuffer.h | 2 +- dbms/src/Storages/StorageDistributed.cpp | 4 ++-- dbms/src/Storages/StorageDistributed.h | 2 +- dbms/src/Storages/StorageMerge.cpp | 4 ++-- dbms/src/Storages/StorageMerge.h | 2 +- dbms/src/Storages/StorageMergeTree.cpp | 12 ++++++------ dbms/src/Storages/StorageMergeTree.h | 2 +- dbms/src/Storages/StorageNull.cpp | 4 ++-- dbms/src/Storages/StorageNull.h | 2 +- dbms/src/Storages/StorageReplicatedMergeTree.cpp | 14 +++++++------- dbms/src/Storages/StorageReplicatedMergeTree.h | 2 +- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterAlterQuery.cpp b/dbms/src/Interpreters/InterpreterAlterQuery.cpp index b0091263bb4..c80001dc2fc 100644 --- a/dbms/src/Interpreters/InterpreterAlterQuery.cpp +++ b/dbms/src/Interpreters/InterpreterAlterQuery.cpp @@ -74,9 +74,9 @@ BlockIO InterpreterAlterQuery::execute() if (!alter_commands.empty()) { - auto structure_lock = table->lockAlterIntention(context.getCurrentQueryId()); + auto table_lock_holder = table->lockAlterIntention(context.getCurrentQueryId()); alter_commands.validate(*table, context); - table->alter(alter_commands, database_name, table_name, context, structure_lock); + table->alter(alter_commands, database_name, table_name, context, table_lock_holder); } return {}; diff --git a/dbms/src/Storages/IStorage.cpp b/dbms/src/Storages/IStorage.cpp index ecfe6bb9356..697e919987c 100644 --- a/dbms/src/Storages/IStorage.cpp +++ b/dbms/src/Storages/IStorage.cpp @@ -5,7 +5,7 @@ namespace DB { -void IStorage::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & structure_lock) +void IStorage::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & table_lock_holder) { for (const auto & param : params) { @@ -13,7 +13,7 @@ void IStorage::alter(const AlterCommands & params, const String & database_name, throw Exception("Method alter supports only change comment of column for storage " + getName(), ErrorCodes::NOT_IMPLEMENTED); } - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); params.apply(new_columns); diff --git a/dbms/src/Storages/IStorage.h b/dbms/src/Storages/IStorage.h index 4afd6e94ebd..8a362d33aae 100644 --- a/dbms/src/Storages/IStorage.h +++ b/dbms/src/Storages/IStorage.h @@ -227,7 +227,7 @@ public: * This method must fully execute the ALTER query, taking care of the locks itself. * To update the table metadata on disk, this method should call InterpreterAlterQuery::updateMetadata. */ - virtual void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & structure_lock); + virtual void alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & table_lock_holder); /** ALTER tables with regard to its partitions. * Should handle locks for each command on its own. diff --git a/dbms/src/Storages/StorageBuffer.cpp b/dbms/src/Storages/StorageBuffer.cpp index e10bf410edc..5487db29703 100644 --- a/dbms/src/Storages/StorageBuffer.cpp +++ b/dbms/src/Storages/StorageBuffer.cpp @@ -677,9 +677,9 @@ void StorageBuffer::flushThread() } -void StorageBuffer::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & structure_lock) +void StorageBuffer::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context, TableStructureWriteLockHolder & table_lock_holder) { - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); /// So that no blocks of the old structure remain. optimize({} /*query*/, {} /*partition_id*/, false /*final*/, false /*deduplicate*/, context); diff --git a/dbms/src/Storages/StorageBuffer.h b/dbms/src/Storages/StorageBuffer.h index f03bb87f200..f32a4c72c43 100644 --- a/dbms/src/Storages/StorageBuffer.h +++ b/dbms/src/Storages/StorageBuffer.h @@ -83,7 +83,7 @@ public: /// The structure of the subordinate table is not checked and does not change. void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & table_lock_holder) override; private: String name; diff --git a/dbms/src/Storages/StorageDistributed.cpp b/dbms/src/Storages/StorageDistributed.cpp index 0383863aa4f..582dd976c0d 100644 --- a/dbms/src/Storages/StorageDistributed.cpp +++ b/dbms/src/Storages/StorageDistributed.cpp @@ -338,9 +338,9 @@ BlockOutputStreamPtr StorageDistributed::write(const ASTPtr &, const Context & c void StorageDistributed::alter( const AlterCommands & params, const String & database_name, const String & current_table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) + const Context & context, TableStructureWriteLockHolder & table_lock_holder) { - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageDistributed.h b/dbms/src/Storages/StorageDistributed.h index c46c0af3061..a628f2c542a 100644 --- a/dbms/src/Storages/StorageDistributed.h +++ b/dbms/src/Storages/StorageDistributed.h @@ -83,7 +83,7 @@ public: /// the structure of the sub-table is not checked void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & table_lock_holder) override; void startup() override; void shutdown() override; diff --git a/dbms/src/Storages/StorageMerge.cpp b/dbms/src/Storages/StorageMerge.cpp index 1a67a04593c..4521083bc03 100644 --- a/dbms/src/Storages/StorageMerge.cpp +++ b/dbms/src/Storages/StorageMerge.cpp @@ -397,9 +397,9 @@ StorageMerge::StorageListWithLocks StorageMerge::getSelectedTables(const ASTPtr void StorageMerge::alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) + const Context & context, TableStructureWriteLockHolder & table_lock_holder) { - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageMerge.h b/dbms/src/Storages/StorageMerge.h index 78b2b224842..752872de885 100644 --- a/dbms/src/Storages/StorageMerge.h +++ b/dbms/src/Storages/StorageMerge.h @@ -46,7 +46,7 @@ public: /// the structure of sub-tables is not checked void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & table_lock_holder) override; bool mayBenefitFromIndexForIn(const ASTPtr & left_in_operand, const Context & query_context) const override; diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index e75a37ce420..856976ca35d 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -196,11 +196,11 @@ void StorageMergeTree::alter( const String & current_database_name, const String & current_table_name, const Context & context, - TableStructureWriteLockHolder & structure_lock) + TableStructureWriteLockHolder & table_lock_holder) { if (!params.is_mutable()) { - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); auto new_columns = getColumns(); auto new_indices = getIndicesDescription(); params.apply(new_columns); @@ -212,7 +212,7 @@ void StorageMergeTree::alter( /// NOTE: Here, as in ReplicatedMergeTree, you can do ALTER which does not block the writing of data for a long time. auto merge_blocker = merger_mutator.actions_blocker.cancel(); - lockNewDataStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockNewDataStructureExclusively(table_lock_holder, context.getCurrentQueryId()); data.checkAlter(params, context); @@ -231,7 +231,7 @@ void StorageMergeTree::alter( transactions.push_back(std::move(transaction)); } - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); IDatabase::ASTModifier storage_modifier = [&] (IAST & ast) { @@ -453,7 +453,7 @@ bool StorageMergeTree::merge( bool deduplicate, String * out_disable_reason) { - auto structure_lock = lockStructureForShare(true, RWLockImpl::NO_QUERY); + auto table_lock_holder = lockStructureForShare(true, RWLockImpl::NO_QUERY); FutureMergedMutatedPart future_part; @@ -563,7 +563,7 @@ bool StorageMergeTree::merge( bool StorageMergeTree::tryMutatePart() { - auto structure_lock = lockStructureForShare(true, RWLockImpl::NO_QUERY); + auto table_lock_holder = lockStructureForShare(true, RWLockImpl::NO_QUERY); FutureMergedMutatedPart future_part; MutationCommands commands; diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index 853a14dfae7..f7e4e10fc4e 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -79,7 +79,7 @@ public: void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & table_lock_holder) override; void checkTableCanBeDropped() const override; diff --git a/dbms/src/Storages/StorageNull.cpp b/dbms/src/Storages/StorageNull.cpp index 9fb425dba37..176f70d3e9f 100644 --- a/dbms/src/Storages/StorageNull.cpp +++ b/dbms/src/Storages/StorageNull.cpp @@ -32,9 +32,9 @@ void registerStorageNull(StorageFactory & factory) void StorageNull::alter( const AlterCommands & params, const String & current_database_name, const String & current_table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) + const Context & context, TableStructureWriteLockHolder & table_lock_holder) { - lockStructureExclusively(structure_lock, context.getCurrentQueryId()); + lockStructureExclusively(table_lock_holder, context.getCurrentQueryId()); ColumnsDescription new_columns = getColumns(); IndicesDescription new_indices = getIndicesDescription(); diff --git a/dbms/src/Storages/StorageNull.h b/dbms/src/Storages/StorageNull.h index 9f69bcb4c14..14ce1140680 100644 --- a/dbms/src/Storages/StorageNull.h +++ b/dbms/src/Storages/StorageNull.h @@ -43,7 +43,7 @@ public: void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & context, TableStructureWriteLockHolder & structure_lock) override; + const Context & context, TableStructureWriteLockHolder & table_lock_holder) override; private: String table_name; diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index 427850733d7..5e479e1ebee 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -1624,7 +1624,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) PartDescriptions parts_to_add; MergeTreeData::DataPartsVector parts_to_remove; - auto structure_lock_dst_table = lockStructureForShare(false, RWLockImpl::NO_QUERY); + auto table_lock_holder_dst_table = lockStructureForShare(false, RWLockImpl::NO_QUERY); for (size_t i = 0; i < entry_replace.new_part_names.size(); ++i) { @@ -1662,7 +1662,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) } StoragePtr source_table; - TableStructureReadLockHolder structure_lock_src_table; + TableStructureReadLockHolder table_lock_holder_src_table; String source_table_name = entry_replace.from_database + "." + entry_replace.from_table; auto clone_data_parts_from_source_table = [&] () -> size_t @@ -1686,7 +1686,7 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry) return 0; } - structure_lock_src_table = source_table->lockStructureForShare(false, RWLockImpl::NO_QUERY); + table_lock_holder_src_table = source_table->lockStructureForShare(false, RWLockImpl::NO_QUERY); MergeTreeData::DataPartStates valid_states{MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}; @@ -2719,9 +2719,9 @@ bool StorageReplicatedMergeTree::fetchPart(const String & part_name, const Strin LOG_DEBUG(log, "Fetching part " << part_name << " from " << source_replica_path); - TableStructureReadLockHolder table_lock; + TableStructureReadLockHolder table_lock_holder; if (!to_detached) - table_lock = lockStructureForShare(true, RWLockImpl::NO_QUERY); + table_lock_holder = lockStructureForShare(true, RWLockImpl::NO_QUERY); /// Logging Stopwatch stopwatch; @@ -3089,7 +3089,7 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p void StorageReplicatedMergeTree::alter( const AlterCommands & params, const String & /*database_name*/, const String & /*table_name*/, - const Context & query_context, TableStructureWriteLockHolder & structure_lock) + const Context & query_context, TableStructureWriteLockHolder & table_lock_holder) { assertNotReadonly(); @@ -3167,7 +3167,7 @@ void StorageReplicatedMergeTree::alter( LOG_DEBUG(log, "Updated shared metadata nodes in ZooKeeper. Waiting for replicas to apply changes."); - structure_lock.release(); + table_lock_holder.release(); /// Wait until all replicas will apply ALTER. diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.h b/dbms/src/Storages/StorageReplicatedMergeTree.h index 4b7ffff1988..caa75000d70 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.h +++ b/dbms/src/Storages/StorageReplicatedMergeTree.h @@ -118,7 +118,7 @@ public: void alter( const AlterCommands & params, const String & database_name, const String & table_name, - const Context & query_context, TableStructureWriteLockHolder & structure_lock) override; + const Context & query_context, TableStructureWriteLockHolder & table_lock_holder) override; void alterPartition(const ASTPtr & query, const PartitionCommands & commands, const Context & query_context) override; From 9d89cc0fc107a73e98bfa426b063e32eee5627cb Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 7 Mar 2019 23:04:59 +0300 Subject: [PATCH 192/297] Debugging PODArray --- .../AggregateFunctions/AggregateFunctionQuantile.h | 4 ++-- dbms/src/Columns/ColumnAggregateFunction.cpp | 2 +- dbms/src/Columns/ColumnDecimal.cpp | 2 +- dbms/src/Columns/ColumnFixedString.cpp | 10 +++++----- dbms/src/Columns/ColumnString.cpp | 2 +- dbms/src/Columns/ColumnString.h | 14 +++++++++----- dbms/src/Columns/ColumnVector.cpp | 2 +- dbms/src/Common/PODArray.h | 14 ++++++++++++-- dbms/src/DataTypes/DataTypeFixedString.cpp | 2 +- dbms/src/Dictionaries/Embedded/RegionsNames.cpp | 4 ++-- dbms/src/Formats/ProtobufWriter.cpp | 10 +++++----- dbms/src/IO/WriteBufferFromVector.h | 2 +- 12 files changed, 41 insertions(+), 27 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionQuantile.h b/dbms/src/AggregateFunctions/AggregateFunctionQuantile.h index ecfc0ba4df7..8968d990af5 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionQuantile.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionQuantile.h @@ -163,7 +163,7 @@ public: size_t old_size = data_to.size(); data_to.resize(data_to.size() + size); - data.getManyFloat(levels.levels.data(), levels.permutation.data(), size, &data_to[old_size]); + data.getManyFloat(levels.levels.data(), levels.permutation.data(), size, data_to.data() + old_size); } else { @@ -171,7 +171,7 @@ public: size_t old_size = data_to.size(); data_to.resize(data_to.size() + size); - data.getMany(levels.levels.data(), levels.permutation.data(), size, &data_to[old_size]); + data.getMany(levels.levels.data(), levels.permutation.data(), size, data_to.data() + old_size); } } else diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index e491ff942f4..69bcdac2ab7 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -152,7 +152,7 @@ void ColumnAggregateFunction::insertRangeFrom(const IColumn & from, size_t start size_t old_size = data.size(); data.resize(old_size + length); - memcpy(&data[old_size], &from_concrete.data[start], length * sizeof(data[0])); + memcpy(data.data() + old_size, &from_concrete.data[start], length * sizeof(data[0])); } } diff --git a/dbms/src/Columns/ColumnDecimal.cpp b/dbms/src/Columns/ColumnDecimal.cpp index 3663981b632..9377f924f81 100644 --- a/dbms/src/Columns/ColumnDecimal.cpp +++ b/dbms/src/Columns/ColumnDecimal.cpp @@ -140,7 +140,7 @@ void ColumnDecimal::insertRangeFrom(const IColumn & src, size_t start, size_t size_t old_size = data.size(); data.resize(old_size + length); - memcpy(&data[old_size], &src_vec.data[start], length * sizeof(data[0])); + memcpy(data.data() + old_size, &src_vec.data[start], length * sizeof(data[0])); } template diff --git a/dbms/src/Columns/ColumnFixedString.cpp b/dbms/src/Columns/ColumnFixedString.cpp index 728ae095901..686223f712f 100644 --- a/dbms/src/Columns/ColumnFixedString.cpp +++ b/dbms/src/Columns/ColumnFixedString.cpp @@ -55,7 +55,7 @@ void ColumnFixedString::insert(const Field & x) size_t old_size = chars.size(); chars.resize_fill(old_size + n); - memcpy(&chars[old_size], s.data(), s.size()); + memcpy(chars.data() + old_size, s.data(), s.size()); } void ColumnFixedString::insertFrom(const IColumn & src_, size_t index) @@ -67,7 +67,7 @@ void ColumnFixedString::insertFrom(const IColumn & src_, size_t index) size_t old_size = chars.size(); chars.resize(old_size + n); - memcpySmallAllowReadWriteOverflow15(&chars[old_size], &src.chars[n * index], n); + memcpySmallAllowReadWriteOverflow15(chars.data() + old_size, &src.chars[n * index], n); } void ColumnFixedString::insertData(const char * pos, size_t length) @@ -77,7 +77,7 @@ void ColumnFixedString::insertData(const char * pos, size_t length) size_t old_size = chars.size(); chars.resize_fill(old_size + n); - memcpy(&chars[old_size], pos, length); + memcpy(chars.data() + old_size, pos, length); } StringRef ColumnFixedString::serializeValueIntoArena(size_t index, Arena & arena, char const *& begin) const @@ -91,7 +91,7 @@ const char * ColumnFixedString::deserializeAndInsertFromArena(const char * pos) { size_t old_size = chars.size(); chars.resize(old_size + n); - memcpy(&chars[old_size], pos, n); + memcpy(chars.data() + old_size, pos, n); return pos + n; } @@ -151,7 +151,7 @@ void ColumnFixedString::insertRangeFrom(const IColumn & src, size_t start, size_ size_t old_size = chars.size(); chars.resize(old_size + length * n); - memcpy(&chars[old_size], &src_concrete.chars[start * n], length * n); + memcpy(chars.data() + old_size, &src_concrete.chars[start * n], length * n); } ColumnPtr ColumnFixedString::filter(const IColumn::Filter & filt, ssize_t result_size_hint) const diff --git a/dbms/src/Columns/ColumnString.cpp b/dbms/src/Columns/ColumnString.cpp index 863f39f9a52..1717c02f1df 100644 --- a/dbms/src/Columns/ColumnString.cpp +++ b/dbms/src/Columns/ColumnString.cpp @@ -185,7 +185,7 @@ const char * ColumnString::deserializeAndInsertFromArena(const char * pos) const size_t old_size = chars.size(); const size_t new_size = old_size + string_size; chars.resize(new_size); - memcpy(&chars[old_size], pos, string_size); + memcpy(chars.data() + old_size, pos, string_size); offsets.push_back(new_size); return pos + string_size; diff --git a/dbms/src/Columns/ColumnString.h b/dbms/src/Columns/ColumnString.h index 7117bab0d05..f167c4fd018 100644 --- a/dbms/src/Columns/ColumnString.h +++ b/dbms/src/Columns/ColumnString.h @@ -71,21 +71,25 @@ public: Field operator[](size_t n) const override { + assert(n < size()); return Field(&chars[offsetAt(n)], sizeAt(n) - 1); } void get(size_t n, Field & res) const override { + assert(n < size()); res.assignString(&chars[offsetAt(n)], sizeAt(n) - 1); } StringRef getDataAt(size_t n) const override { + assert(n < size()); return StringRef(&chars[offsetAt(n)], sizeAt(n) - 1); } StringRef getDataAtWithTerminatingZero(size_t n) const override { + assert(n < size()); return StringRef(&chars[offsetAt(n)], sizeAt(n)); } @@ -103,7 +107,7 @@ public: const size_t new_size = old_size + size_to_append; chars.resize(new_size); - memcpy(&chars[old_size], s.c_str(), size_to_append); + memcpy(chars.data() + old_size, s.c_str(), size_to_append); offsets.push_back(new_size); } @@ -132,7 +136,7 @@ public: const size_t new_size = old_size + size_to_append; chars.resize(new_size); - memcpySmallAllowReadWriteOverflow15(&chars[old_size], &src.chars[offset], size_to_append); + memcpySmallAllowReadWriteOverflow15(chars.data() + old_size, &src.chars[offset], size_to_append); offsets.push_back(new_size); } } @@ -143,7 +147,7 @@ public: const size_t new_size = old_size + size_to_append; chars.resize(new_size); - memcpySmallAllowReadWriteOverflow15(&chars[old_size], &src.chars[0], size_to_append); + memcpySmallAllowReadWriteOverflow15(chars.data() + old_size, &src.chars[0], size_to_append); offsets.push_back(new_size); } } @@ -155,7 +159,7 @@ public: chars.resize(new_size); if (length) - memcpy(&chars[old_size], pos, length); + memcpy(chars.data() + old_size, pos, length); chars[old_size + length] = 0; offsets.push_back(new_size); } @@ -167,7 +171,7 @@ public: const size_t new_size = old_size + length; chars.resize(new_size); - memcpy(&chars[old_size], pos, length); + memcpy(chars.data() + old_size, pos, length); offsets.push_back(new_size); } diff --git a/dbms/src/Columns/ColumnVector.cpp b/dbms/src/Columns/ColumnVector.cpp index 3201a463f64..8322e3f74eb 100644 --- a/dbms/src/Columns/ColumnVector.cpp +++ b/dbms/src/Columns/ColumnVector.cpp @@ -141,7 +141,7 @@ void ColumnVector::insertRangeFrom(const IColumn & src, size_t start, size_t size_t old_size = data.size(); data.resize(old_size + length); - memcpy(&data[old_size], &src_vec.data[start], length * sizeof(data[0])); + memcpy(data.data() + old_size, &src_vec.data[start], length * sizeof(data[0])); } template diff --git a/dbms/src/Common/PODArray.h b/dbms/src/Common/PODArray.h index d74e5b5d2c1..036b0239970 100644 --- a/dbms/src/Common/PODArray.h +++ b/dbms/src/Common/PODArray.h @@ -271,8 +271,18 @@ public: const T * data() const { return t_start(); } /// The index is signed to access -1th element without pointer overflow. - T & operator[] (ssize_t n) { return t_start()[n]; } - const T & operator[] (ssize_t n) const { return t_start()[n]; } + T & operator[] (ssize_t n) + { + /// <= size, because taking address of one element past memory range is Ok in C++ (expression like &arr[arr.size()] is perfectly valid). + assert((n >= (static_cast(pad_left_) ? -1 : 0)) && (n <= static_cast(this->size()))); + return t_start()[n]; + } + + const T & operator[] (ssize_t n) const + { + assert((n >= (static_cast(pad_left_) ? -1 : 0)) && (n <= static_cast(this->size()))); + return t_start()[n]; + } T & front() { return t_start()[0]; } T & back() { return t_end()[-1]; } diff --git a/dbms/src/DataTypes/DataTypeFixedString.cpp b/dbms/src/DataTypes/DataTypeFixedString.cpp index 356c69351ef..64c94602f8c 100644 --- a/dbms/src/DataTypes/DataTypeFixedString.cpp +++ b/dbms/src/DataTypes/DataTypeFixedString.cpp @@ -69,7 +69,7 @@ void DataTypeFixedString::deserializeBinary(IColumn & column, ReadBuffer & istr) data.resize(old_size + n); try { - istr.readStrict(reinterpret_cast(&data[old_size]), n); + istr.readStrict(reinterpret_cast(data.data() + old_size), n); } catch (...) { diff --git a/dbms/src/Dictionaries/Embedded/RegionsNames.cpp b/dbms/src/Dictionaries/Embedded/RegionsNames.cpp index f0b6a8b9514..9b19ab71373 100644 --- a/dbms/src/Dictionaries/Embedded/RegionsNames.cpp +++ b/dbms/src/Dictionaries/Embedded/RegionsNames.cpp @@ -77,7 +77,7 @@ void RegionsNames::reload() throw Poco::Exception("Logical error. Maybe size estimate of " + names_source->getSourceName() + " is wrong."); new_chars.resize(old_size + name_entry.name.length() + 1); - memcpy(&new_chars[old_size], name_entry.name.c_str(), name_entry.name.length() + 1); + memcpy(new_chars.data() + old_size, name_entry.name.c_str(), name_entry.name.length() + 1); if (name_entry.id > max_region_id) { @@ -92,7 +92,7 @@ void RegionsNames::reload() while (name_entry.id >= new_names_refs.size()) new_names_refs.resize(new_names_refs.size() * 2, StringRef("", 0)); - new_names_refs[name_entry.id] = StringRef(&new_chars[old_size], name_entry.name.length()); + new_names_refs[name_entry.id] = StringRef(new_chars.data() + old_size, name_entry.name.length()); } chars[language_id].swap(new_chars); diff --git a/dbms/src/Formats/ProtobufWriter.cpp b/dbms/src/Formats/ProtobufWriter.cpp index c6bfcbe01c4..07cdb413c86 100644 --- a/dbms/src/Formats/ProtobufWriter.cpp +++ b/dbms/src/Formats/ProtobufWriter.cpp @@ -59,7 +59,7 @@ namespace { size_t old_size = buf.size(); buf.reserve(old_size + MAX_VARINT_SIZE); - UInt8 * ptr = &buf[old_size]; + UInt8 * ptr = buf.data() + old_size; ptr = writeVarint(value, ptr); buf.resize_assume_reserved(ptr - buf.data()); } @@ -200,7 +200,7 @@ void ProtobufWriter::SimpleWriter::writeUInt(UInt32 field_number, UInt64 value) { size_t old_size = buffer.size(); buffer.reserve(old_size + 2 * MAX_VARINT_SIZE); - UInt8 * ptr = &buffer[old_size]; + UInt8 * ptr = buffer.data() + old_size; ptr = writeFieldNumber(field_number, VARINT, ptr); ptr = writeVarint(value, ptr); buffer.resize_assume_reserved(ptr - buffer.data()); @@ -223,7 +223,7 @@ void ProtobufWriter::SimpleWriter::writeFixed(UInt32 field_number, T value) constexpr WireType wire_type = (sizeof(T) == 4) ? BITS32 : BITS64; size_t old_size = buffer.size(); buffer.reserve(old_size + MAX_VARINT_SIZE + sizeof(T)); - UInt8 * ptr = &buffer[old_size]; + UInt8 * ptr = buffer.data() + old_size; ptr = writeFieldNumber(field_number, wire_type, ptr); memcpy(ptr, &value, sizeof(T)); ptr += sizeof(T); @@ -234,7 +234,7 @@ void ProtobufWriter::SimpleWriter::writeString(UInt32 field_number, const String { size_t old_size = buffer.size(); buffer.reserve(old_size + 2 * MAX_VARINT_SIZE + str.size); - UInt8 * ptr = &buffer[old_size]; + UInt8 * ptr = buffer.data() + old_size; ptr = writeFieldNumber(field_number, LENGTH_DELIMITED, ptr); ptr = writeVarint(str.size, ptr); memcpy(ptr, str.data, str.size); @@ -294,7 +294,7 @@ void ProtobufWriter::SimpleWriter::addFixedToRepeatedPack(T value) static_assert((sizeof(T) == 4) || (sizeof(T) == 8)); size_t old_size = buffer.size(); buffer.resize(old_size + sizeof(T)); - memcpy(&buffer[old_size], &value, sizeof(T)); + memcpy(buffer.data() + old_size, &value, sizeof(T)); } diff --git a/dbms/src/IO/WriteBufferFromVector.h b/dbms/src/IO/WriteBufferFromVector.h index 7cc7eaf25cb..e52ff7d8411 100644 --- a/dbms/src/IO/WriteBufferFromVector.h +++ b/dbms/src/IO/WriteBufferFromVector.h @@ -34,7 +34,7 @@ private: size_t old_size = vector.size(); vector.resize(old_size * 2); - internal_buffer = Buffer(reinterpret_cast(&vector[old_size]), reinterpret_cast(vector.data() + vector.size())); + internal_buffer = Buffer(reinterpret_cast(vector.data() + old_size), reinterpret_cast(vector.data() + vector.size())); working_buffer = internal_buffer; } From 356a5c54b85a994b4613c45495c39f2fec801871 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 Mar 2019 06:23:34 +0300 Subject: [PATCH 193/297] Whitespaces --- dbms/src/Interpreters/ExternalDictionaries.cpp | 2 +- dbms/src/Interpreters/Set.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Interpreters/ExternalDictionaries.cpp b/dbms/src/Interpreters/ExternalDictionaries.cpp index ba0a3a9e5fd..5dcfab4b72a 100644 --- a/dbms/src/Interpreters/ExternalDictionaries.cpp +++ b/dbms/src/Interpreters/ExternalDictionaries.cpp @@ -36,7 +36,7 @@ ExternalDictionaries::ExternalDictionaries( std::move(config_repository), &Logger::get("ExternalDictionaries"), "external dictionary"), - context(context) + context(context) { init(throw_on_error); } diff --git a/dbms/src/Interpreters/Set.h b/dbms/src/Interpreters/Set.h index 00e5113c574..ab6299a5891 100644 --- a/dbms/src/Interpreters/Set.h +++ b/dbms/src/Interpreters/Set.h @@ -192,4 +192,4 @@ private: std::vector indexes_mapping; }; - } +} From 5ef7c66c9291c59be2564fda0ca05357c3988965 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 Mar 2019 06:26:12 +0300 Subject: [PATCH 194/297] DataTypeString: remove asm code that most likely doesn't make sense for performance --- dbms/src/DataTypes/DataTypeString.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeString.cpp b/dbms/src/DataTypes/DataTypeString.cpp index a97a80ffc5e..576258b9a1d 100644 --- a/dbms/src/DataTypes/DataTypeString.cpp +++ b/dbms/src/DataTypes/DataTypeString.cpp @@ -130,7 +130,7 @@ static NO_INLINE void deserializeBinarySSE2(ColumnString::Chars & data, ColumnSt if (size) { -#ifdef __x86_64__ +#ifdef __SSE2__ /// An optimistic branch in which more efficient copying is possible. if (offset + 16 * UNROLL_TIMES <= data.allocated_bytes() && istr.position() + size + 16 * UNROLL_TIMES <= istr.buffer().end()) { @@ -140,22 +140,11 @@ static NO_INLINE void deserializeBinarySSE2(ColumnString::Chars & data, ColumnSt while (sse_src_pos < sse_src_end) { - /// NOTE gcc 4.9.2 unrolls the loop, but for some reason uses only one xmm register. - /// for (size_t j = 0; j < UNROLL_TIMES; ++j) - /// _mm_storeu_si128(sse_dst_pos + j, _mm_loadu_si128(sse_src_pos + j)); + for (size_t j = 0; j < UNROLL_TIMES; ++j) + _mm_storeu_si128(sse_dst_pos + j, _mm_loadu_si128(sse_src_pos + j)); sse_src_pos += UNROLL_TIMES; sse_dst_pos += UNROLL_TIMES; - - if (UNROLL_TIMES >= 4) __asm__("movdqu %0, %%xmm0" :: "m"(sse_src_pos[-4])); - if (UNROLL_TIMES >= 3) __asm__("movdqu %0, %%xmm1" :: "m"(sse_src_pos[-3])); - if (UNROLL_TIMES >= 2) __asm__("movdqu %0, %%xmm2" :: "m"(sse_src_pos[-2])); - if (UNROLL_TIMES >= 1) __asm__("movdqu %0, %%xmm3" :: "m"(sse_src_pos[-1])); - - if (UNROLL_TIMES >= 4) __asm__("movdqu %%xmm0, %0" : "=m"(sse_dst_pos[-4])); - if (UNROLL_TIMES >= 3) __asm__("movdqu %%xmm1, %0" : "=m"(sse_dst_pos[-3])); - if (UNROLL_TIMES >= 2) __asm__("movdqu %%xmm2, %0" : "=m"(sse_dst_pos[-2])); - if (UNROLL_TIMES >= 1) __asm__("movdqu %%xmm3, %0" : "=m"(sse_dst_pos[-1])); } istr.position() += size; From 73c571412cf5c711822f282d1c27f632aa43ec6f Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 Mar 2019 06:32:43 +0300 Subject: [PATCH 195/297] Fixed awful error after #3920 --- dbms/src/Common/PODArray.h | 1 + dbms/src/DataTypes/DataTypeString.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Common/PODArray.h b/dbms/src/Common/PODArray.h index d74e5b5d2c1..f7ea8c82faf 100644 --- a/dbms/src/Common/PODArray.h +++ b/dbms/src/Common/PODArray.h @@ -159,6 +159,7 @@ public: size_t size() const { return (c_end - c_start) / ELEMENT_SIZE; } size_t capacity() const { return (c_end_of_storage - c_start) / ELEMENT_SIZE; } + /// This method is safe to use only for information about memory usage. size_t allocated_bytes() const { return c_end_of_storage - c_start + pad_right + pad_left; } void clear() { c_end = c_start; } diff --git a/dbms/src/DataTypes/DataTypeString.cpp b/dbms/src/DataTypes/DataTypeString.cpp index a97a80ffc5e..86ffb7ec39c 100644 --- a/dbms/src/DataTypes/DataTypeString.cpp +++ b/dbms/src/DataTypes/DataTypeString.cpp @@ -132,7 +132,7 @@ static NO_INLINE void deserializeBinarySSE2(ColumnString::Chars & data, ColumnSt { #ifdef __x86_64__ /// An optimistic branch in which more efficient copying is possible. - if (offset + 16 * UNROLL_TIMES <= data.allocated_bytes() && istr.position() + size + 16 * UNROLL_TIMES <= istr.buffer().end()) + if (offset + 16 * UNROLL_TIMES <= data.capacity() && istr.position() + size + 16 * UNROLL_TIMES <= istr.buffer().end()) { const __m128i * sse_src_pos = reinterpret_cast(istr.position()); const __m128i * sse_src_end = sse_src_pos + (size + (16 * UNROLL_TIMES - 1)) / 16 / UNROLL_TIMES * UNROLL_TIMES; From 9e82b44b625b3150380bc11c06b88cebf1926de9 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Thu, 7 Mar 2019 21:17:06 +0100 Subject: [PATCH 196/297] Review adjustment --- .../DataStreams/GraphiteRollupSortedBlockInputStream.h | 2 ++ dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp | 1 + dbms/src/Storages/System/StorageSystemGraphite.cpp | 8 +++----- dbms/src/Storages/System/StorageSystemGraphite.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h b/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h index dc5260be0e7..00bd2f4b67e 100644 --- a/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h +++ b/dbms/src/DataStreams/GraphiteRollupSortedBlockInputStream.h @@ -113,6 +113,7 @@ namespace Graphite struct Pattern { std::shared_ptr regexp; + std::string regexp_str; AggregateFunctionPtr function; Retentions retentions; /// Must be ordered by 'age' descending. enum { TypeUndef, TypeRetention, TypeAggregation, TypeAll } type = TypeAll; /// The type of defined pattern, filled automatically @@ -216,6 +217,7 @@ private: const Graphite::Pattern undef_pattern = { /// temporary empty pattern for selectPatternForPath nullptr, + "", nullptr, DB::Graphite::Retentions(), undef_pattern.TypeUndef, diff --git a/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp b/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp index 4b934ea3122..6411ec21bac 100644 --- a/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp +++ b/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp @@ -102,6 +102,7 @@ static void appendGraphitePattern( if (key == "regexp") { pattern.regexp = std::make_shared(config.getString(config_element + ".regexp")); + pattern.regexp_str = config.getString(config_element + ".regexp"); } else if (key == "function") { diff --git a/dbms/src/Storages/System/StorageSystemGraphite.cpp b/dbms/src/Storages/System/StorageSystemGraphite.cpp index 4f9fb755a23..fa1b768ac98 100644 --- a/dbms/src/Storages/System/StorageSystemGraphite.cpp +++ b/dbms/src/Storages/System/StorageSystemGraphite.cpp @@ -60,8 +60,7 @@ StorageSystemGraphite::Configs StorageSystemGraphite::getConfigs(const Context & { Config new_config = { - /// FIXME Do we own a table? (possible dangling reference) - &table_data->merging_params.graphite_params, + table_data->merging_params.graphite_params, { table_data->getDatabaseName() }, { table_data->getTableName() }, }; @@ -86,7 +85,7 @@ void StorageSystemGraphite::fillData(MutableColumns & res_columns, const Context for (const auto & config : graphite_configs) { UInt16 priority = 0; - for (const auto & pattern : config.second.graphite_params->patterns) + for (const auto & pattern : config.second.graphite_params.patterns) { bool is_default = pattern.regexp == nullptr; String regexp; @@ -99,8 +98,7 @@ void StorageSystemGraphite::fillData(MutableColumns & res_columns, const Context else { priority++; - /// FIXME Null pointer dereference for trivial patterns. - regexp = pattern.regexp->getRE2()->pattern(); + regexp = pattern.regexp_str; } if (pattern.function) diff --git a/dbms/src/Storages/System/StorageSystemGraphite.h b/dbms/src/Storages/System/StorageSystemGraphite.h index 4205f77f1ea..b874e294782 100644 --- a/dbms/src/Storages/System/StorageSystemGraphite.h +++ b/dbms/src/Storages/System/StorageSystemGraphite.h @@ -20,7 +20,7 @@ public: struct Config { - const Graphite::Params * graphite_params; + Graphite::Params graphite_params; Array databases; Array tables; }; From 4905cd2b0a5f14c11ad1c172550d3852d527e8ee Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 Mar 2019 15:59:06 +0300 Subject: [PATCH 197/297] Added missing include --- dbms/src/Columns/ColumnString.h | 3 ++- dbms/src/Common/PODArray.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/src/Columns/ColumnString.h b/dbms/src/Columns/ColumnString.h index f167c4fd018..5ca05079bd5 100644 --- a/dbms/src/Columns/ColumnString.h +++ b/dbms/src/Columns/ColumnString.h @@ -1,6 +1,7 @@ #pragma once -#include +#include +#include #include #include diff --git a/dbms/src/Common/PODArray.h b/dbms/src/Common/PODArray.h index 036b0239970..ace36f0fe35 100644 --- a/dbms/src/Common/PODArray.h +++ b/dbms/src/Common/PODArray.h @@ -2,6 +2,7 @@ #include #include +#include #include #include From ee996c0c992bf514689f67ec76c5709cbb64333c Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 Mar 2019 16:14:40 +0300 Subject: [PATCH 198/297] Fixed excessive whitespace #4467 --- dbms/src/Compression/CompressionFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Compression/CompressionFactory.cpp b/dbms/src/Compression/CompressionFactory.cpp index 7f7dbac21df..1acede09bd2 100644 --- a/dbms/src/Compression/CompressionFactory.cpp +++ b/dbms/src/Compression/CompressionFactory.cpp @@ -85,7 +85,7 @@ CompressionCodecPtr CompressionCodecFactory::get(const UInt8 byte_code) const const auto family_code_and_creator = family_code_with_codec.find(byte_code); if (family_code_and_creator == family_code_with_codec.end()) - throw Exception("Unknown codec family code : " + toString(byte_code), ErrorCodes::UNKNOWN_CODEC); + throw Exception("Unknown codec family code: " + toString(byte_code), ErrorCodes::UNKNOWN_CODEC); return family_code_and_creator->second({}, nullptr); } From 1eb4c58bc04f956a9ccde1a08d042c73d6f681a0 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 Mar 2019 16:21:27 +0300 Subject: [PATCH 199/297] Added a test #3779 --- .../0_stateless/00914_join_bgranvea.reference | 4 ++++ .../queries/0_stateless/00914_join_bgranvea.sql | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00914_join_bgranvea.reference create mode 100644 dbms/tests/queries/0_stateless/00914_join_bgranvea.sql diff --git a/dbms/tests/queries/0_stateless/00914_join_bgranvea.reference b/dbms/tests/queries/0_stateless/00914_join_bgranvea.reference new file mode 100644 index 00000000000..be94ace11f1 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00914_join_bgranvea.reference @@ -0,0 +1,4 @@ +b1 b1 +b1 b1 +b1 b1 +b1 b1 diff --git a/dbms/tests/queries/0_stateless/00914_join_bgranvea.sql b/dbms/tests/queries/0_stateless/00914_join_bgranvea.sql new file mode 100644 index 00000000000..4f7820efbbb --- /dev/null +++ b/dbms/tests/queries/0_stateless/00914_join_bgranvea.sql @@ -0,0 +1,15 @@ +USE test; + +DROP TABLE IF EXISTS table1; +DROP TABLE IF EXISTS table2; + +CREATE TABLE table1 (A String, B String, ts DateTime) ENGINE = MergeTree PARTITION BY toStartOfDay(ts) ORDER BY (ts, A, B); +CREATE TABLE table2 (B String, ts DateTime) ENGINE = MergeTree PARTITION BY toStartOfDay(ts) ORDER BY (ts, B); + +insert into table1 values('a1','b1','2019-02-05 16:50:00'),('a1','b1','2019-02-05 16:55:00'); +insert into table2 values('b1','2019-02-05 16:50:00'),('b1','2019-02-05 16:55:00'); + +SELECT t1.B, t2.B FROM table1 t1 ALL INNER JOIN table2 t2 ON t1.B = t2.B ORDER BY t1.B, t2.B; + +DROP TABLE table1; +DROP TABLE table2; From 5f626dc99eae91fc93d70b46a12db9a9bdc485d3 Mon Sep 17 00:00:00 2001 From: Mikhail Filimonov <1549571+filimonov@users.noreply.github.com> Date: Fri, 8 Mar 2019 15:36:40 +0100 Subject: [PATCH 200/297] Fix broken progress in 19.3 (regression in 92769a24607ec5f78f605b2746699ffb2adba633) Introduce total_rows for table function `numbers()`. fixes https://github.com/yandex/ClickHouse/issues/4429 resolves https://github.com/yandex/ClickHouse/issues/4284 --- dbms/src/DataStreams/LimitBlockInputStream.cpp | 6 +++++- dbms/src/DataStreams/LimitBlockInputStream.h | 3 ++- dbms/src/IO/Progress.h | 5 +---- dbms/src/Storages/System/StorageSystemNumbers.cpp | 3 +-- .../00416_pocopatch_progress_in_http_headers.reference | 4 ++++ .../0_stateless/00416_pocopatch_progress_in_http_headers.sh | 1 + 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dbms/src/DataStreams/LimitBlockInputStream.cpp b/dbms/src/DataStreams/LimitBlockInputStream.cpp index c0ac474fb60..8915270a851 100644 --- a/dbms/src/DataStreams/LimitBlockInputStream.cpp +++ b/dbms/src/DataStreams/LimitBlockInputStream.cpp @@ -6,9 +6,13 @@ namespace DB { -LimitBlockInputStream::LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_) +LimitBlockInputStream::LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_, bool use_limit_as_total_rows_approx ) : limit(limit_), offset(offset_), always_read_till_end(always_read_till_end_) { + if (use_limit_as_total_rows_approx) { + addTotalRowsApprox(static_cast(limit)); + } + children.push_back(input); } diff --git a/dbms/src/DataStreams/LimitBlockInputStream.h b/dbms/src/DataStreams/LimitBlockInputStream.h index 6e77c5a2f6a..ed6dac8c5ac 100644 --- a/dbms/src/DataStreams/LimitBlockInputStream.h +++ b/dbms/src/DataStreams/LimitBlockInputStream.h @@ -16,8 +16,9 @@ public: * returns an empty block, and this causes the query to be canceled. * If always_read_till_end = true - reads all the data to the end, but ignores them. This is necessary in rare cases: * when otherwise, due to the cancellation of the request, we would not have received the data for GROUP BY WITH TOTALS from the remote server. + * If use_limit_as_total_rows_approx = true, then addTotalRowsApprox is called to use the limit in progress & stats */ - LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_ = false); + LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_ = false, bool use_limit_as_total_rows_approx = false); String getName() const override { return "Limit"; } diff --git a/dbms/src/IO/Progress.h b/dbms/src/IO/Progress.h index 54c1d230455..d7366d187aa 100644 --- a/dbms/src/IO/Progress.h +++ b/dbms/src/IO/Progress.h @@ -55,14 +55,11 @@ struct Progress /// Each value separately is changed atomically (but not whole object). bool incrementPiecewiseAtomically(const Progress & rhs) { - if (!rhs.rows) - return false; - rows += rhs.rows; bytes += rhs.bytes; total_rows += rhs.total_rows; - return true; + return rhs.rows ? true : false; } void reset() diff --git a/dbms/src/Storages/System/StorageSystemNumbers.cpp b/dbms/src/Storages/System/StorageSystemNumbers.cpp index 15b31212e9d..c909a338453 100644 --- a/dbms/src/Storages/System/StorageSystemNumbers.cpp +++ b/dbms/src/Storages/System/StorageSystemNumbers.cpp @@ -49,7 +49,6 @@ StorageSystemNumbers::StorageSystemNumbers(const std::string & name_, bool multi setColumns(ColumnsDescription({{"number", std::make_shared()}})); } - BlockInputStreams StorageSystemNumbers::read( const Names & column_names, const SelectQueryInfo &, @@ -75,7 +74,7 @@ BlockInputStreams StorageSystemNumbers::read( res[i] = std::make_shared(max_block_size, offset + i * max_block_size, num_streams * max_block_size); if (limit) /// This formula is how to split 'limit' elements to 'num_streams' chunks almost uniformly. - res[i] = std::make_shared(res[i], *limit * (i + 1) / num_streams - *limit * i / num_streams, 0); + res[i] = std::make_shared(res[i], *limit * (i + 1) / num_streams - *limit * i / num_streams, 0, false, true); } return res; diff --git a/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.reference b/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.reference index afe27bfae32..42036e1a81f 100644 --- a/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.reference +++ b/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.reference @@ -1,3 +1,7 @@ +< X-ClickHouse-Progress: {"read_rows":"0","read_bytes":"0","total_rows":"10"} +< X-ClickHouse-Progress: {"read_rows":"5","read_bytes":"40","total_rows":"10"} +< X-ClickHouse-Progress: {"read_rows":"10","read_bytes":"80","total_rows":"10"} +9 < X-ClickHouse-Progress: {"read_rows":"1","read_bytes":"8","total_rows":"0"} < X-ClickHouse-Progress: {"read_rows":"2","read_bytes":"16","total_rows":"0"} < X-ClickHouse-Progress: {"read_rows":"3","read_bytes":"24","total_rows":"0"} diff --git a/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.sh b/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.sh index 8e762515da1..4b1ca06aacc 100755 --- a/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.sh +++ b/dbms/tests/queries/0_stateless/00416_pocopatch_progress_in_http_headers.sh @@ -3,6 +3,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . $CURDIR/../shell_config.sh +${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}?max_block_size=5&send_progress_in_http_headers=1&http_headers_progress_interval_ms=0" -d 'SELECT max(number) FROM numbers(10)' 2>&1 | grep -E 'Content-Encoding|X-ClickHouse-Progress|^[0-9]' # This test will fail with external poco (progress not supported) ${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}?max_block_size=1&send_progress_in_http_headers=1&http_headers_progress_interval_ms=0" -d 'SELECT number FROM system.numbers LIMIT 10' 2>&1 | grep -E 'Content-Encoding|X-ClickHouse-Progress|^[0-9]' From 87e270c4a0ac977889cc0e4bab497d54e1121f6d Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Fri, 8 Mar 2019 17:54:32 +0300 Subject: [PATCH 201/297] Update LimitBlockInputStream.cpp --- dbms/src/DataStreams/LimitBlockInputStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/DataStreams/LimitBlockInputStream.cpp b/dbms/src/DataStreams/LimitBlockInputStream.cpp index 8915270a851..b5ec320bfed 100644 --- a/dbms/src/DataStreams/LimitBlockInputStream.cpp +++ b/dbms/src/DataStreams/LimitBlockInputStream.cpp @@ -9,7 +9,8 @@ namespace DB LimitBlockInputStream::LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_, bool use_limit_as_total_rows_approx ) : limit(limit_), offset(offset_), always_read_till_end(always_read_till_end_) { - if (use_limit_as_total_rows_approx) { + if (use_limit_as_total_rows_approx) + { addTotalRowsApprox(static_cast(limit)); } From bc6235c2f262a731e612e1d006a506bf2bba3c72 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Fri, 8 Mar 2019 18:15:30 +0300 Subject: [PATCH 202/297] Update LimitBlockInputStream.cpp --- dbms/src/DataStreams/LimitBlockInputStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/DataStreams/LimitBlockInputStream.cpp b/dbms/src/DataStreams/LimitBlockInputStream.cpp index b5ec320bfed..b1b8f5c95d1 100644 --- a/dbms/src/DataStreams/LimitBlockInputStream.cpp +++ b/dbms/src/DataStreams/LimitBlockInputStream.cpp @@ -6,7 +6,7 @@ namespace DB { -LimitBlockInputStream::LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_, bool use_limit_as_total_rows_approx ) +LimitBlockInputStream::LimitBlockInputStream(const BlockInputStreamPtr & input, UInt64 limit_, UInt64 offset_, bool always_read_till_end_, bool use_limit_as_total_rows_approx) : limit(limit_), offset(offset_), always_read_till_end(always_read_till_end_) { if (use_limit_as_total_rows_approx) From ecc05e2bba3e9c7e61fc193bf91cdb370376d47e Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Fri, 8 Mar 2019 18:18:39 +0300 Subject: [PATCH 203/297] Auto version update to [19.4.0] [54416] --- dbms/cmake/version.cmake | 12 ++++++------ debian/changelog | 4 ++-- docker/client/Dockerfile | 2 +- docker/server/Dockerfile | 2 +- docker/test/Dockerfile | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dbms/cmake/version.cmake b/dbms/cmake/version.cmake index 8cdbdc05344..a10b6949e14 100644 --- a/dbms/cmake/version.cmake +++ b/dbms/cmake/version.cmake @@ -1,11 +1,11 @@ # This strings autochanged from release_lib.sh: -set(VERSION_REVISION 54415) +set(VERSION_REVISION 54416) set(VERSION_MAJOR 19) -set(VERSION_MINOR 3) -set(VERSION_PATCH 4) -set(VERSION_GITHASH 263e69e861b769eae7e2bcc79d87673e3a08d376) -set(VERSION_DESCRIBE v19.3.4-testing) -set(VERSION_STRING 19.3.4) +set(VERSION_MINOR 4) +set(VERSION_PATCH 0) +set(VERSION_GITHASH 84dd4aac8bf9847b6a5a496af1babf2dc133966a) +set(VERSION_DESCRIBE v19.4.0-testing) +set(VERSION_STRING 19.4.0) # end of autochange set(VERSION_EXTRA "" CACHE STRING "") diff --git a/debian/changelog b/debian/changelog index d329555c1e1..f45d38aceda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -clickhouse (19.3.4) unstable; urgency=low +clickhouse (19.4.0) unstable; urgency=low * Modified source code - -- Fri, 15 Feb 2019 14:50:36 +0300 + -- Fri, 08 Mar 2019 18:18:39 +0300 diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile index 2aa8451d73f..1446028ec0b 100644 --- a/docker/client/Dockerfile +++ b/docker/client/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.3.4 +ARG version=19.4.0 RUN apt-get update \ && apt-get install --yes --no-install-recommends \ diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 9e2384a4272..e010c5e3ee7 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.3.4 +ARG version=19.4.0 ARG gosu_ver=1.10 RUN apt-get update \ diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index 4e5132efbd9..2b84c4fc39c 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.3.4 +ARG version=19.4.0 RUN apt-get update && \ apt-get install -y apt-transport-https dirmngr && \ From c2fa53d9d4c3d5b0b8d5369a11d66fb81dbdeab6 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 8 Mar 2019 18:36:39 +0300 Subject: [PATCH 204/297] aggregator --- dbms/src/Storages/MergeTree/MergeTreeIndices.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeIndices.h b/dbms/src/Storages/MergeTree/MergeTreeIndices.h index 1d62e9e9e9c..fc5f90d2713 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeIndices.h +++ b/dbms/src/Storages/MergeTree/MergeTreeIndices.h @@ -34,6 +34,20 @@ struct IMergeTreeIndexGranule virtual void deserializeBinary(ReadBuffer & istr) = 0; virtual bool empty() const = 0; +}; + +using MergeTreeIndexGranulePtr = std::shared_ptr; +using MergeTreeIndexGranules = std::vector; + + +/// Aggregates info about a single block of data. +struct IMergeTreeIndexAggregator +{ + virtual ~IMergeTreeIndexAggregator() = default; + + virtual void reset() = 0; + virtual bool empty() const = 0; + virtual MergeTreeIndexGranulePtr getGranule() const = 0; /// Updates the stored info using rows of the specified block. /// Reads no more than `limit` rows. @@ -41,8 +55,8 @@ struct IMergeTreeIndexGranule virtual void update(const Block & block, size_t * pos, size_t limit) = 0; }; -using MergeTreeIndexGranulePtr = std::shared_ptr; -using MergeTreeIndexGranules = std::vector; +using MergeTreeIndexAggregatorPtr = std::shared_ptr; +using MergeTreeIndexAggregators = std::vector; /// Condition on the index. From a2480d78128bb6c61ddc4aafc6250ada009549d6 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 8 Mar 2019 22:52:21 +0300 Subject: [PATCH 205/297] aggregation --- .../src/Storages/MergeTree/MergeTreeIndices.h | 4 +- .../MergeTree/MergeTreeMinMaxIndex.cpp | 26 ++++++++-- .../Storages/MergeTree/MergeTreeMinMaxIndex.h | 18 ++++++- .../MergeTree/MergeTreeSetSkippingIndex.cpp | 52 +++++++++++-------- .../MergeTree/MergeTreeSetSkippingIndex.h | 22 ++++++-- .../MergeTree/MergedBlockOutputStream.cpp | 21 +++----- .../MergeTree/MergedBlockOutputStream.h | 2 +- 7 files changed, 97 insertions(+), 48 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeIndices.h b/dbms/src/Storages/MergeTree/MergeTreeIndices.h index fc5f90d2713..fac3bc4c858 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeIndices.h +++ b/dbms/src/Storages/MergeTree/MergeTreeIndices.h @@ -45,9 +45,8 @@ struct IMergeTreeIndexAggregator { virtual ~IMergeTreeIndexAggregator() = default; - virtual void reset() = 0; virtual bool empty() const = 0; - virtual MergeTreeIndexGranulePtr getGranule() const = 0; + virtual MergeTreeIndexGranulePtr getGranuleAndReset() = 0; /// Updates the stored info using rows of the specified block. /// Reads no more than `limit` rows. @@ -97,6 +96,7 @@ public: String getFileName() const { return INDEX_FILE_PREFIX + name; } virtual MergeTreeIndexGranulePtr createIndexGranule() const = 0; + virtual MergeTreeIndexAggregatorPtr createIndexAggregator() const = 0; virtual IndexConditionPtr createIndexCondition( const SelectQueryInfo & query_info, const Context & context) const = 0; diff --git a/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.cpp index d9816c3e119..7f27785f911 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.cpp @@ -17,9 +17,11 @@ namespace ErrorCodes MergeTreeMinMaxGranule::MergeTreeMinMaxGranule(const MergeTreeMinMaxIndex & index) - : IMergeTreeIndexGranule(), index(index), parallelogram() -{ -} + : IMergeTreeIndexGranule(), index(index), parallelogram() {} + +MergeTreeMinMaxGranule::MergeTreeMinMaxGranule( + const MergeTreeMinMaxIndex & index, std::vector && parallelogram) + : IMergeTreeIndexGranule(), index(index), parallelogram(std::move(parallelogram)) {} void MergeTreeMinMaxGranule::serializeBinary(WriteBuffer & ostr) const { @@ -51,7 +53,16 @@ void MergeTreeMinMaxGranule::deserializeBinary(ReadBuffer & istr) } } -void MergeTreeMinMaxGranule::update(const Block & block, size_t * pos, size_t limit) + +MergeTreeMinMaxAggregator::MergeTreeMinMaxAggregator(const MergeTreeMinMaxIndex & index) + : index(index) {} + +MergeTreeIndexGranulePtr MergeTreeMinMaxAggregator::getGranuleAndReset() +{ + return std::make_shared(index, std::move(parallelogram)); +} + +void MergeTreeMinMaxAggregator::update(const Block & block, size_t * pos, size_t limit) { if (*pos >= block.rows()) throw Exception( @@ -109,6 +120,13 @@ MergeTreeIndexGranulePtr MergeTreeMinMaxIndex::createIndexGranule() const return std::make_shared(*this); } + +MergeTreeIndexAggregatorPtr MergeTreeMinMaxIndex::createIndexAggregator() const +{ + return std::make_shared(*this); +} + + IndexConditionPtr MergeTreeMinMaxIndex::createIndexCondition( const SelectQueryInfo & query, const Context & context) const { diff --git a/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.h b/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.h index 7a6206dccc7..24beada455b 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.h +++ b/dbms/src/Storages/MergeTree/MergeTreeMinMaxIndex.h @@ -16,14 +16,27 @@ class MergeTreeMinMaxIndex; struct MergeTreeMinMaxGranule : public IMergeTreeIndexGranule { explicit MergeTreeMinMaxGranule(const MergeTreeMinMaxIndex & index); + MergeTreeMinMaxGranule(const MergeTreeMinMaxIndex & index, std::vector && parallelogram); + ~MergeTreeMinMaxGranule() override = default; void serializeBinary(WriteBuffer & ostr) const override; void deserializeBinary(ReadBuffer & istr) override; bool empty() const override { return parallelogram.empty(); } - void update(const Block & block, size_t * pos, size_t limit) override; - ~MergeTreeMinMaxGranule() override = default; + const MergeTreeMinMaxIndex & index; + std::vector parallelogram; +}; + + +struct MergeTreeMinMaxAggregator : IMergeTreeIndexAggregator +{ + explicit MergeTreeMinMaxAggregator(const MergeTreeMinMaxIndex & index); + ~MergeTreeMinMaxAggregator() override = default; + + bool empty() const override { return parallelogram.empty(); } + MergeTreeIndexGranulePtr getGranuleAndReset() override; + void update(const Block & block, size_t * pos, size_t limit) override; const MergeTreeMinMaxIndex & index; std::vector parallelogram; @@ -64,6 +77,7 @@ public: ~MergeTreeMinMaxIndex() override = default; MergeTreeIndexGranulePtr createIndexGranule() const override; + MergeTreeIndexAggregatorPtr createIndexAggregator() const override; IndexConditionPtr createIndexCondition( const SelectQueryInfo & query, const Context & context) const override; diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp index 227c6bfd7f7..26eb105fafb 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp @@ -22,10 +22,11 @@ const Field UNKNOWN_FIELD(3u); MergeTreeSetIndexGranule::MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index) - : IMergeTreeIndexGranule(), index(index), set(new Set(SizeLimits{}, true)) -{ - set->setHeader(index.header); -} + : IMergeTreeIndexGranule(), index(index), block(index.header.cloneEmpty()) {} + +MergeTreeSetIndexGranule::MergeTreeSetIndexGranule( + const MergeTreeSetSkippingIndex & index, const Columns & columns) + : IMergeTreeIndexGranule(), index(index), block(index.header.cloneWithColumns(columns)) {} void MergeTreeSetIndexGranule::serializeBinary(WriteBuffer & ostr) const { @@ -33,7 +34,6 @@ void MergeTreeSetIndexGranule::serializeBinary(WriteBuffer & ostr) const throw Exception( "Attempt to write empty set index `" + index.name + "`", ErrorCodes::LOGICAL_ERROR); - const auto & columns = set->getSetElements(); const auto & size_type = DataTypePtr(std::make_shared()); if (size() > index.max_rows) @@ -55,21 +55,15 @@ void MergeTreeSetIndexGranule::serializeBinary(WriteBuffer & ostr) const IDataType::SerializeBinaryBulkStatePtr state; type->serializeBinaryBulkStatePrefix(settings, state); - type->serializeBinaryBulkWithMultipleStreams(*columns[i], 0, size(), settings, state); + type->serializeBinaryBulkWithMultipleStreams(*block.getByPosition(i).column, 0, size(), settings, state); type->serializeBinaryBulkStateSuffix(settings, state); } } void MergeTreeSetIndexGranule::deserializeBinary(ReadBuffer & istr) { - if (!set->empty()) - { - auto new_set = std::make_unique(SizeLimits{}, true); - new_set->setHeader(index.header); - set.swap(new_set); - } + block.clear(); - Block block; Field field_rows; const auto & size_type = DataTypePtr(std::make_shared()); size_type->deserializeBinary(field_rows, istr); @@ -93,11 +87,16 @@ void MergeTreeSetIndexGranule::deserializeBinary(ReadBuffer & istr) block.insert(ColumnWithTypeAndName(new_column->getPtr(), type, index.columns[i])); } - - set->insertFromBlock(block); } -void MergeTreeSetIndexGranule::update(const Block & new_block, size_t * pos, size_t limit) + +MergeTreeSetIndexAggregator::MergeTreeSetIndexAggregator(const MergeTreeSetSkippingIndex & index) + : index(index), set(new Set(SizeLimits{}, true)) +{ + set->setHeader(index.header); +} + +void MergeTreeSetIndexAggregator::update(const Block & new_block, size_t * pos, size_t limit) { if (*pos >= new_block.rows()) throw Exception( @@ -129,11 +128,15 @@ void MergeTreeSetIndexGranule::update(const Block & new_block, size_t * pos, siz *pos += rows_read; } -Block MergeTreeSetIndexGranule::getElementsBlock() const +MergeTreeIndexGranulePtr MergeTreeSetIndexAggregator::getGranuleAndReset() { - if (size() > index.max_rows) - return index.header; - return index.header.cloneWithColumns(set->getSetElements()); + auto granule = std::make_shared(index, set->getSetElements()); + + auto new_set = std::make_unique(SizeLimits{}, true); + new_set->setHeader(index.header); + set.swap(new_set); + + return granule; } @@ -193,7 +196,7 @@ bool SetIndexCondition::mayBeTrueOnGranule(MergeTreeIndexGranulePtr idx_granule) if (useless || !granule->size() || granule->size() > index.max_rows) return true; - Block result = granule->getElementsBlock(); + Block result = granule->block; actions->execute(result); auto column = result.getByName(expression_ast->getColumnName()).column->convertToFullColumnIfLowCardinality(); @@ -377,8 +380,13 @@ MergeTreeIndexGranulePtr MergeTreeSetSkippingIndex::createIndexGranule() const return std::make_shared(*this); } +MergeTreeIndexAggregatorPtr MergeTreeSetSkippingIndex::createIndexAggregator() const +{ + return std::make_shared(*this); +} + IndexConditionPtr MergeTreeSetSkippingIndex::createIndexCondition( - const SelectQueryInfo & query, const Context & context) const + const SelectQueryInfo & query, const Context & context) const { return std::make_shared(query, context, *this); }; diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h index 28be8788f98..ae2546fe9eb 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h @@ -17,18 +17,31 @@ class MergeTreeSetSkippingIndex; struct MergeTreeSetIndexGranule : public IMergeTreeIndexGranule { explicit MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index); + MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index, const Columns & columns); void serializeBinary(WriteBuffer & ostr) const override; void deserializeBinary(ReadBuffer & istr) override; - size_t size() const { return set->getTotalRowCount(); } + size_t size() const { return block.rows(); } bool empty() const override { return !size(); } - void update(const Block & block, size_t * pos, size_t limit) override; - Block getElementsBlock() const; - ~MergeTreeSetIndexGranule() override = default; + const MergeTreeSetSkippingIndex & index; + Block block; +}; + + +struct MergeTreeSetIndexAggregator : IMergeTreeIndexAggregator +{ + explicit MergeTreeSetIndexAggregator(const MergeTreeSetSkippingIndex & index); + ~MergeTreeSetIndexAggregator() override = default; + + size_t size() const { return set->getTotalRowCount(); } + bool empty() const override { return !size(); } + MergeTreeIndexGranulePtr getGranuleAndReset() override; + void update(const Block & block, size_t * pos, size_t limit) override; + const MergeTreeSetSkippingIndex & index; std::unique_ptr set; }; @@ -79,6 +92,7 @@ public: ~MergeTreeSetSkippingIndex() override = default; MergeTreeIndexGranulePtr createIndexGranule() const override; + MergeTreeIndexAggregatorPtr createIndexAggregator() const override; IndexConditionPtr createIndexCondition( const SelectQueryInfo & query, const Context & context) const override; diff --git a/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp b/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp index 22a7610e83b..18a5ee81923 100644 --- a/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp @@ -330,11 +330,8 @@ void MergedBlockOutputStream::writeSuffixAndFinalizePart( for (size_t i = 0; i < storage.skip_indices.size(); ++i) { auto & stream = *skip_indices_streams[i]; - if (skip_indices_granules[i] && !skip_indices_granules[i]->empty()) - { - skip_indices_granules[i]->serializeBinary(stream.compressed); - skip_indices_granules[i].reset(); - } + if (!skip_indices_aggregators[i]->empty()) + skip_indices_aggregators[i]->getGranuleAndReset()->serializeBinary(stream.compressed); } @@ -362,7 +359,7 @@ void MergedBlockOutputStream::writeSuffixAndFinalizePart( } skip_indices_streams.clear(); - skip_indices_granules.clear(); + skip_indices_aggregators.clear(); skip_index_filling.clear(); for (ColumnStreams::iterator it = column_streams.begin(); it != column_streams.end(); ++it) @@ -432,8 +429,7 @@ void MergedBlockOutputStream::init() part_path + stream_name, MARKS_FILE_EXTENSION, codec, max_compress_block_size, 0, aio_threshold)); - - skip_indices_granules.emplace_back(nullptr); + skip_indices_aggregators.push_back(index->createIndexAggregator()); skip_index_filling.push_back(0); } } @@ -563,9 +559,9 @@ void MergedBlockOutputStream::writeImpl(const Block & block, const IColumn::Perm else { limit = storage.index_granularity; - if (!skip_indices_granules[i]) + if (skip_indices_aggregators[i]->empty()) { - skip_indices_granules[i] = index->createIndexGranule(); + skip_indices_aggregators[i] = index->createIndexAggregator(); skip_index_filling[i] = 0; if (stream.compressed.offset() >= min_compress_block_size) @@ -577,7 +573,7 @@ void MergedBlockOutputStream::writeImpl(const Block & block, const IColumn::Perm } size_t pos = prev_pos; - skip_indices_granules[i]->update(indices_update_block, &pos, limit); + skip_indices_aggregators[i]->update(indices_update_block, &pos, limit); if (pos == prev_pos + limit) { @@ -586,8 +582,7 @@ void MergedBlockOutputStream::writeImpl(const Block & block, const IColumn::Perm /// write index if it is filled if (skip_index_filling[i] == index->granularity) { - skip_indices_granules[i]->serializeBinary(stream.compressed); - skip_indices_granules[i].reset(); + skip_indices_aggregators[i]->getGranuleAndReset()->serializeBinary(stream.compressed); skip_index_filling[i] = 0; } } diff --git a/dbms/src/Storages/MergeTree/MergedBlockOutputStream.h b/dbms/src/Storages/MergeTree/MergedBlockOutputStream.h index 6bc6e90e887..06acba26804 100644 --- a/dbms/src/Storages/MergeTree/MergedBlockOutputStream.h +++ b/dbms/src/Storages/MergeTree/MergedBlockOutputStream.h @@ -151,7 +151,7 @@ private: MutableColumns index_columns; std::vector> skip_indices_streams; - MergeTreeIndexGranules skip_indices_granules; + MergeTreeIndexAggregators skip_indices_aggregators; std::vector skip_index_filling; }; From daec753af64413ba94328cb4542db0732b873195 Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Sat, 9 Mar 2019 01:10:00 +0300 Subject: [PATCH 206/297] Auto version update to [19.4.1] [54416] --- dbms/cmake/version.cmake | 8 ++++---- debian/changelog | 4 ++-- docker/client/Dockerfile | 2 +- docker/server/Dockerfile | 2 +- docker/test/Dockerfile | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbms/cmake/version.cmake b/dbms/cmake/version.cmake index a10b6949e14..4cf69f4271f 100644 --- a/dbms/cmake/version.cmake +++ b/dbms/cmake/version.cmake @@ -2,10 +2,10 @@ set(VERSION_REVISION 54416) set(VERSION_MAJOR 19) set(VERSION_MINOR 4) -set(VERSION_PATCH 0) -set(VERSION_GITHASH 84dd4aac8bf9847b6a5a496af1babf2dc133966a) -set(VERSION_DESCRIBE v19.4.0-testing) -set(VERSION_STRING 19.4.0) +set(VERSION_PATCH 1) +set(VERSION_GITHASH 628ed349c335b79a441a1bd6e4bc791d61dfe62c) +set(VERSION_DESCRIBE v19.4.1-testing) +set(VERSION_STRING 19.4.1) # end of autochange set(VERSION_EXTRA "" CACHE STRING "") diff --git a/debian/changelog b/debian/changelog index f45d38aceda..5dbcaa02489 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -clickhouse (19.4.0) unstable; urgency=low +clickhouse (19.4.1) unstable; urgency=low * Modified source code - -- Fri, 08 Mar 2019 18:18:39 +0300 + -- Sat, 09 Mar 2019 01:10:00 +0300 diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile index 1446028ec0b..aaa2b888030 100644 --- a/docker/client/Dockerfile +++ b/docker/client/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.4.0 +ARG version=19.4.1 RUN apt-get update \ && apt-get install --yes --no-install-recommends \ diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index e010c5e3ee7..9fbeeecafb2 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.4.0 +ARG version=19.4.1 ARG gosu_ver=1.10 RUN apt-get update \ diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index 2b84c4fc39c..d837b1023b1 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.4.0 +ARG version=19.4.1 RUN apt-get update && \ apt-get install -y apt-transport-https dirmngr && \ From 698c022a5228cac6848e55a30587fd6fa738bc65 Mon Sep 17 00:00:00 2001 From: Kirill Danshin Date: Sat, 9 Mar 2019 03:12:58 +0300 Subject: [PATCH 207/297] topK and topKWeighted now supports custom loadFactor Signed-off-by: Kirill Danshin --- .../AggregateFunctionTopK.cpp | 28 ++++++++++++------- .../AggregateFunctionTopK.h | 12 +++----- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp b/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp index 04e74c17434..21c151b7882 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp @@ -39,19 +39,19 @@ class AggregateFunctionTopKDateTime : public AggregateFunctionTopK -static IAggregateFunction * createWithExtraTypes(const DataTypePtr & argument_type, UInt64 threshold, const Array & params) +static IAggregateFunction * createWithExtraTypes(const DataTypePtr & argument_type, UInt64 threshold, UInt64 loadFactor, const Array & params) { WhichDataType which(argument_type); if (which.idx == TypeIndex::Date) - return new AggregateFunctionTopKDate(threshold, {argument_type}, params); + return new AggregateFunctionTopKDate(threshold, loadFactor, {argument_type}, params); if (which.idx == TypeIndex::DateTime) - return new AggregateFunctionTopKDateTime(threshold, {argument_type}, params); + return new AggregateFunctionTopKDateTime(threshold, loadFactor, {argument_type}, params); /// Check that we can use plain version of AggregateFunctionTopKGeneric if (argument_type->isValueUnambiguouslyRepresentedInContiguousMemoryRegion()) - return new AggregateFunctionTopKGeneric(threshold, argument_type, params); + return new AggregateFunctionTopKGeneric(threshold, loadFactor, argument_type, params); else - return new AggregateFunctionTopKGeneric(threshold, argument_type, params); + return new AggregateFunctionTopKGeneric(threshold, loadFactor, argument_type, params); } @@ -69,15 +69,23 @@ AggregateFunctionPtr createAggregateFunctionTopK(const std::string & name, const throw Exception("The second argument for aggregate function 'topKWeighted' must have numeric type", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - UInt64 threshold = 10; /// default value + UInt64 threshold = 10; /// default values + UInt64 loadFactor = 3; if (!params.empty()) { - if (params.size() != 1) - throw Exception("Aggregate function " + name + " requires one parameter or less.", + if (params.size() > 2) + throw Exception("Aggregate function " + name + " requires two parameters or less.", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); UInt64 k = applyVisitor(FieldVisitorConvertToNumber(), params[0]); + if (params.size() == 2) { + loadFactor = applyVisitor(FieldVisitorConvertToNumber(), params[1]); + + if (loadFactor < 1) + throw Exception("Too small parameter for aggregate function " + name + ". Minimum: 1", + ErrorCodes::ARGUMENT_OUT_OF_BOUND); + } if (k > TOP_K_MAX_SIZE) throw Exception("Too large parameter for aggregate function " + name + ". Maximum: " + toString(TOP_K_MAX_SIZE), @@ -90,10 +98,10 @@ AggregateFunctionPtr createAggregateFunctionTopK(const std::string & name, const threshold = k; } - AggregateFunctionPtr res(createWithNumericType(*argument_types[0], threshold, argument_types, params)); + AggregateFunctionPtr res(createWithNumericType(*argument_types[0], threshold, loadFactor, argument_types, params)); if (!res) - res = AggregateFunctionPtr(createWithExtraTypes(argument_types[0], threshold, params)); + res = AggregateFunctionPtr(createWithExtraTypes(argument_types[0], threshold, loadFactor, params)); if (!res) throw Exception("Illegal type " + argument_types[0]->getName() + diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTopK.h b/dbms/src/AggregateFunctions/AggregateFunctionTopK.h index 76bca7dae86..9e509179712 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionTopK.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionTopK.h @@ -20,8 +20,6 @@ namespace DB { -// Allow NxK more space before calculating top K to increase accuracy -#define TOP_K_LOAD_FACTOR 3 template @@ -48,9 +46,9 @@ protected: UInt64 reserved; public: - AggregateFunctionTopK(UInt64 threshold, const DataTypes & argument_types_, const Array & params) + AggregateFunctionTopK(UInt64 threshold, UInt64 loadFactor, const DataTypes & argument_types_, const Array & params) : IAggregateFunctionDataHelper, AggregateFunctionTopK>(argument_types_, params) - , threshold(threshold), reserved(TOP_K_LOAD_FACTOR * threshold) {} + , threshold(threshold), reserved(loadFactor * threshold) {} String getName() const override { return is_weighted ? "topKWeighted" : "topK"; } @@ -143,9 +141,9 @@ private: public: AggregateFunctionTopKGeneric( - UInt64 threshold, const DataTypePtr & input_data_type, const Array & params) + UInt64 threshold, UInt64 loadFactor, const DataTypePtr & input_data_type, const Array & params) : IAggregateFunctionDataHelper>({input_data_type}, params) - , threshold(threshold), reserved(TOP_K_LOAD_FACTOR * threshold), input_data_type(this->argument_types[0]) {} + , threshold(threshold), reserved(loadFactor * threshold), input_data_type(this->argument_types[0]) {} String getName() const override { return is_weighted ? "topKWeighted" : "topK"; } @@ -238,6 +236,4 @@ public: const char * getHeaderFilePath() const override { return __FILE__; } }; -#undef TOP_K_LOAD_FACTOR - } From 72324ae09e0b67a2203618710cd81396e012d7bb Mon Sep 17 00:00:00 2001 From: robot-clickhouse Date: Sat, 9 Mar 2019 10:45:08 +0300 Subject: [PATCH 208/297] Auto version update to [19.5.1.1] [54417] --- dbms/cmake/version.cmake | 8 ++++---- debian/changelog | 4 ++-- docker/client/Dockerfile | 2 +- docker/server/Dockerfile | 2 +- docker/test/Dockerfile | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbms/cmake/version.cmake b/dbms/cmake/version.cmake index 4cf69f4271f..7df40c7c0d4 100644 --- a/dbms/cmake/version.cmake +++ b/dbms/cmake/version.cmake @@ -1,11 +1,11 @@ # This strings autochanged from release_lib.sh: -set(VERSION_REVISION 54416) +set(VERSION_REVISION 54417) set(VERSION_MAJOR 19) -set(VERSION_MINOR 4) +set(VERSION_MINOR 5) set(VERSION_PATCH 1) set(VERSION_GITHASH 628ed349c335b79a441a1bd6e4bc791d61dfe62c) -set(VERSION_DESCRIBE v19.4.1-testing) -set(VERSION_STRING 19.4.1) +set(VERSION_DESCRIBE v19.5.1.1-testing) +set(VERSION_STRING 19.5.1.1) # end of autochange set(VERSION_EXTRA "" CACHE STRING "") diff --git a/debian/changelog b/debian/changelog index 5dbcaa02489..e9bb4c1caa0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -clickhouse (19.4.1) unstable; urgency=low +clickhouse (19.5.1.1) unstable; urgency=low * Modified source code - -- Sat, 09 Mar 2019 01:10:00 +0300 + -- clickhouse-release Sat, 09 Mar 2019 10:45:02 +300 diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile index aaa2b888030..cbcc52c6f0d 100644 --- a/docker/client/Dockerfile +++ b/docker/client/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.4.1 +ARG version=19.5.1.1 RUN apt-get update \ && apt-get install --yes --no-install-recommends \ diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 9fbeeecafb2..5fdf50750ee 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.4.1 +ARG version=19.5.1.1 ARG gosu_ver=1.10 RUN apt-get update \ diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile index d837b1023b1..315cb2f958b 100644 --- a/docker/test/Dockerfile +++ b/docker/test/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 ARG repository="deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" -ARG version=19.4.1 +ARG version=19.5.1.1 RUN apt-get update && \ apt-get install -y apt-transport-https dirmngr && \ From 1e71559b2dbf53a4db2ae43c46f38bedf3b05714 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Sat, 9 Mar 2019 14:58:08 +0100 Subject: [PATCH 209/297] Upgrade librdkafka to RC7 --- contrib/librdkafka | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/librdkafka b/contrib/librdkafka index 363dcad5a23..51ae5f5fd8b 160000 --- a/contrib/librdkafka +++ b/contrib/librdkafka @@ -1 +1 @@ -Subproject commit 363dcad5a23dc29381cc626620e68ae418b3af19 +Subproject commit 51ae5f5fd8b742e56f47a8bb0136344868818285 From b9d258dc999e5feac9d6248921ea1c332ae5659d Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sat, 9 Mar 2019 17:03:41 +0300 Subject: [PATCH 210/297] new set --- .../MergeTree/MergeTreeSetSkippingIndex.cpp | 121 ++++++++++++++---- .../MergeTree/MergeTreeSetSkippingIndex.h | 23 +++- 2 files changed, 117 insertions(+), 27 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp index 26eb105fafb..65191d72d63 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp @@ -22,11 +22,15 @@ const Field UNKNOWN_FIELD(3u); MergeTreeSetIndexGranule::MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index) - : IMergeTreeIndexGranule(), index(index), block(index.header.cloneEmpty()) {} + : IMergeTreeIndexGranule() + , index(index) + , block(index.header.cloneEmpty()) {} MergeTreeSetIndexGranule::MergeTreeSetIndexGranule( - const MergeTreeSetSkippingIndex & index, const Columns & columns) - : IMergeTreeIndexGranule(), index(index), block(index.header.cloneWithColumns(columns)) {} + const MergeTreeSetSkippingIndex & index, MutableColumns && mutable_columns) + : IMergeTreeIndexGranule() + , index(index) + , block(index.header.cloneWithColumns(std::move(mutable_columns))) {} void MergeTreeSetIndexGranule::serializeBinary(WriteBuffer & ostr) const { @@ -91,19 +95,30 @@ void MergeTreeSetIndexGranule::deserializeBinary(ReadBuffer & istr) MergeTreeSetIndexAggregator::MergeTreeSetIndexAggregator(const MergeTreeSetSkippingIndex & index) - : index(index), set(new Set(SizeLimits{}, true)) + : index(index), columns(index.header.cloneEmptyColumns()) { - set->setHeader(index.header); + ColumnRawPtrs column_ptrs; + column_ptrs.reserve(index.columns.size()); + Columns materialized_columns; + for (const auto & column : index.header.getColumns()) + { + materialized_columns.emplace_back(column->convertToFullColumnIfConst()->convertToFullColumnIfLowCardinality()); + column_ptrs.emplace_back(materialized_columns.back().get()); + } + + data.init(ClearableSetVariants::chooseMethod(column_ptrs, key_sizes)); + + columns = index.header.cloneEmptyColumns(); } -void MergeTreeSetIndexAggregator::update(const Block & new_block, size_t * pos, size_t limit) +void MergeTreeSetIndexAggregator::update(const Block & block, size_t * pos, size_t limit) { - if (*pos >= new_block.rows()) + if (*pos >= block.rows()) throw Exception( "The provided position is not less than the number of block rows. Position: " - + toString(*pos) + ", Block rows: " + toString(new_block.rows()) + ".", ErrorCodes::LOGICAL_ERROR); + + toString(*pos) + ", Block rows: " + toString(block.rows()) + ".", ErrorCodes::LOGICAL_ERROR); - size_t rows_read = std::min(limit, new_block.rows() - *pos); + size_t rows_read = std::min(limit, block.rows() - *pos); if (size() > index.max_rows) { @@ -111,30 +126,90 @@ void MergeTreeSetIndexAggregator::update(const Block & new_block, size_t * pos, return; } - Block key_block; - for (size_t i = 0; i < index.columns.size(); ++i) + ColumnRawPtrs index_column_ptrs; + index_column_ptrs.reserve(index.columns.size()); + Columns materialized_columns; + for (const auto & column_name : index.columns) { - const auto & name = index.columns[i]; - const auto & type = index.data_types[i]; - key_block.insert( - ColumnWithTypeAndName( - new_block.getByName(name).column->cut(*pos, rows_read), - type, - name)); + materialized_columns.emplace_back( + block.getByName(column_name).column->convertToFullColumnIfConst()->convertToFullColumnIfLowCardinality()); + index_column_ptrs.emplace_back(materialized_columns.back().get()); } - set->insertFromBlock(key_block); + IColumn::Filter filter(block.rows(), 0); + + bool has_new_data = false; + switch (data.type) + { + case ClearableSetVariants::Type::EMPTY: + break; +#define M(NAME) \ + case ClearableSetVariants::Type::NAME: \ + has_new_data = buildFilter(*data.NAME, index_column_ptrs, filter, *pos, rows_read, data); \ + break; + APPLY_FOR_SET_VARIANTS(M) +#undef M + } + + if (!has_new_data) + { + *pos += rows_read; + return; + } + + for (size_t i = 0; i < columns.size(); ++i) + { + auto filtered_column = block.getByName(index.columns[i]).column->filter(filter, block.rows()); + columns[i]->insertRangeFrom(*filtered_column, 0, filtered_column->size()); + } *pos += rows_read; } +template +bool MergeTreeSetIndexAggregator::buildFilter( + Method & method, + const ColumnRawPtrs & columns, + IColumn::Filter & filter, + size_t pos, + size_t limit, + ClearableSetVariants & variants) const +{ + /// Like DistinctSortedBlockInputStream. + typename Method::State state(columns, key_sizes, nullptr); + + bool has_new_data = false; + for (size_t i = 0; i < limit; ++i) + { + auto emplace_result = state.emplaceKey(method.data, pos + i, variants.string_pool); + + if (emplace_result.isInserted()) + has_new_data = true; + + /// Emit the record if there is no such key in the current set yet. + /// Skip it otherwise. + filter[pos + i] = emplace_result.isInserted(); + } + return has_new_data; +} + MergeTreeIndexGranulePtr MergeTreeSetIndexAggregator::getGranuleAndReset() { - auto granule = std::make_shared(index, set->getSetElements()); + auto granule = std::make_shared(index, std::move(columns)); - auto new_set = std::make_unique(SizeLimits{}, true); - new_set->setHeader(index.header); - set.swap(new_set); + switch (data.type) + { + case ClearableSetVariants::Type::EMPTY: + break; +#define M(NAME) \ + case ClearableSetVariants::Type::NAME: \ + data.NAME->data.clear(); \ + break; + APPLY_FOR_SET_VARIANTS(M) +#undef M + } + + columns = index.header.cloneEmptyColumns(); return granule; } diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h index ae2546fe9eb..06f109a970f 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include @@ -17,7 +17,7 @@ class MergeTreeSetSkippingIndex; struct MergeTreeSetIndexGranule : public IMergeTreeIndexGranule { explicit MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index); - MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index, const Columns & columns); + MergeTreeSetIndexGranule(const MergeTreeSetSkippingIndex & index, MutableColumns && columns); void serializeBinary(WriteBuffer & ostr) const override; void deserializeBinary(ReadBuffer & istr) override; @@ -37,13 +37,28 @@ struct MergeTreeSetIndexAggregator : IMergeTreeIndexAggregator explicit MergeTreeSetIndexAggregator(const MergeTreeSetSkippingIndex & index); ~MergeTreeSetIndexAggregator() override = default; - size_t size() const { return set->getTotalRowCount(); } + size_t size() const { return data.getTotalRowCount(); } bool empty() const override { return !size(); } + MergeTreeIndexGranulePtr getGranuleAndReset() override; + void update(const Block & block, size_t * pos, size_t limit) override; +private: + /// return true if has new data + template + bool buildFilter( + Method & method, + const ColumnRawPtrs & key_columns, + IColumn::Filter & filter, + size_t pos, + size_t limit, + ClearableSetVariants & variants) const; + const MergeTreeSetSkippingIndex & index; - std::unique_ptr set; + ClearableSetVariants data; + Sizes key_sizes; + MutableColumns columns; }; From b1052cb72ebd00ad12a691ece2bd9ec4b742bc39 Mon Sep 17 00:00:00 2001 From: Alexey Elymanov Date: Sat, 9 Mar 2019 17:30:55 +0300 Subject: [PATCH 211/297] fix use_sampling for parallel replicas (mpetrov/madmike) --- dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp index 8886b0d157b..59b8a717d88 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp @@ -368,7 +368,7 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts( * It is also important that the entire universe can be covered using SAMPLE 0.1 OFFSET 0, ... OFFSET 0.9 and similar decimals. */ - bool use_sampling = relative_sample_size > 0 || settings.parallel_replicas_count > 1; + bool use_sampling = relative_sample_size > 0 || (settings.parallel_replicas_count > 1 && data.supportsSampling()); bool no_data = false; /// There is nothing left after sampling. if (use_sampling) From 9bb64bd6d2352b0827b589eebdc9f5b04d6363ce Mon Sep 17 00:00:00 2001 From: Alexey Elymanov Date: Sat, 9 Mar 2019 17:51:10 +0300 Subject: [PATCH 212/297] remove excessive check/exception --- dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp index 59b8a717d88..759980a4fab 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp @@ -373,9 +373,6 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts( if (use_sampling) { - if (!data.supportsSampling()) - throw Exception("Illegal SAMPLE: table doesn't support sampling", ErrorCodes::SAMPLING_NOT_SUPPORTED); - if (sample_factor_column_queried && relative_sample_size != RelativeSize(0)) used_sample_factor = 1.0 / boost::rational_cast(relative_sample_size); From 7f281327d9eb9f7de1f52741787b693daac0115c Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sat, 9 Mar 2019 18:26:52 +0300 Subject: [PATCH 213/297] fix --- dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp | 4 ++-- dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp index 65191d72d63..9d808ea93fa 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp @@ -169,14 +169,14 @@ void MergeTreeSetIndexAggregator::update(const Block & block, size_t * pos, size template bool MergeTreeSetIndexAggregator::buildFilter( Method & method, - const ColumnRawPtrs & columns, + const ColumnRawPtrs & column_ptrs, IColumn::Filter & filter, size_t pos, size_t limit, ClearableSetVariants & variants) const { /// Like DistinctSortedBlockInputStream. - typename Method::State state(columns, key_sizes, nullptr); + typename Method::State state(column_ptrs, key_sizes, nullptr); bool has_new_data = false; for (size_t i = 0; i < limit; ++i) diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h index 06f109a970f..9cdf9a1e3d4 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.h @@ -49,7 +49,7 @@ private: template bool buildFilter( Method & method, - const ColumnRawPtrs & key_columns, + const ColumnRawPtrs & column_ptrs, IColumn::Filter & filter, size_t pos, size_t limit, From 4e67678b642dc314aaf44eedf59c8aa817d0d20a Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Sat, 9 Mar 2019 19:57:52 +0300 Subject: [PATCH 214/297] Better docs to the distance functions --- docs/en/query_language/functions/string_search_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index bde56693c36..6ae7c03f73c 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -72,7 +72,7 @@ The same thing as 'like', but negative. ## ngramDistance(haystack, needle) -Calculate the 4-gram distance between `haystack` and `needle`: count the symmetric difference between two multisets of 4-grams and normalize it by the sum of their cardinalities. Returns float number from 0 to 1 - the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throw an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. +Calculates the 4-gram distance between `haystack` and `needle`: counts the symmetric difference between two multisets of 4-grams and normalizes it by the sum of their cardinalities. Returns float number from 0 to 1 -- the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throws an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. From 56872ef0e3d59b87d4761926c994aff447b41b14 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Sat, 9 Mar 2019 19:59:43 +0300 Subject: [PATCH 215/297] Better docs to the distance functions --- docs/ru/query_language/functions/string_search_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index 6658cc4ee19..8939e4c926c 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -61,10 +61,10 @@ ## ngramDistance(haystack, needle) -Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя мультимножествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 - чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строка из `haystack` больше 32КБ, расстояние всегда равно единице. +Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя мультимножествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 -- чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строки из `haystack` больше 32КБ, расстояние всегда равно единице. Для поиска без учета регистра и/или в формате UTF-8 используйте функции `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит (нумерация с нуля) каждого байта кодовой точки - это работает для латиницы и почти для всех кириллических букв. +Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит (нумерация с нуля) каждого байта кодовой точки -- это работает для латиницы и почти для всех кириллических букв. [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_search_functions/) From b8538c49c98b7e00728f897eaf4a7347c9517a87 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Sat, 9 Mar 2019 20:01:01 +0300 Subject: [PATCH 216/297] Better docs to the distance functions --- docs/en/query_language/functions/string_search_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index 6ae7c03f73c..dce9917776c 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -76,7 +76,7 @@ Calculates the 4-gram distance between `haystack` and `needle`: counts the symme For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2 bytes hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. +Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2-byte hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. [Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_search_functions/) From 86df0960d9595293fef7b784b59aa1c8f17a10b0 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Sat, 9 Mar 2019 20:07:45 +0300 Subject: [PATCH 217/297] Better docs to the distance functions --- docs/en/query_language/functions/string_search_functions.md | 2 +- docs/ru/query_language/functions/string_search_functions.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index dce9917776c..29e8bcf8a38 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -76,7 +76,7 @@ Calculates the 4-gram distance between `haystack` and `needle`: counts the symme For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2-byte hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. +Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 12-byte hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. [Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_search_functions/) diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index 8939e4c926c..4b335cce34c 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -9,7 +9,7 @@ Для поиска без учета регистра используйте функцию `positionCaseInsensitive`. ## positionUTF8(haystack, needle) -Так же, как `position`, но позиция возвращается в кодовых точках Unicode. Работает при допущении, что строка содержит набор байт, представляющий текст в кодировке UTF-8. Если допущение не выполнено - то возвращает какой-нибудь результат (не кидает исключение). +Так же, как `position`, но позиция возвращается в кодовых точках Unicode. Работает при допущении, что строка содержит набор байт, представляющий текст в кодировке UTF-8. Если допущение не выполнено -- то возвращает какой-нибудь результат (не кидает исключение). Для поиска без учета регистра используйте функцию `positionCaseInsensitiveUTF8`. @@ -65,6 +65,6 @@ Для поиска без учета регистра и/или в формате UTF-8 используйте функции `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш таблицами - могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` - мы обнуляем 5-й бит (нумерация с нуля) каждого байта кодовой точки -- это работает для латиницы и почти для всех кириллических букв. +Примечание: для случая UTF-8 мы используем триграммное расстояние. Вычисление n-граммного расстояния не совсем честное. Мы используем 2-х байтные хэши для хэширования n-грамм, а затем вычисляем симметричную разность между хэш таблицами -- могут возникнуть коллизии. В формате UTF-8 без учета регистра мы не используем честную функцию `tolower` -- мы обнуляем 5-й бит (нумерация с нуля) каждого байта кодовой точки -- это работает для латиницы и почти для всех кириллических букв. [Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/string_search_functions/) From 2905159c8598ab9cc90cc1b690f146cedfbea9df Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Sat, 9 Mar 2019 20:26:32 +0300 Subject: [PATCH 218/297] Better docs to the distance functions --- docs/en/query_language/functions/string_search_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index 29e8bcf8a38..dce9917776c 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -76,7 +76,7 @@ Calculates the 4-gram distance between `haystack` and `needle`: counts the symme For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. -Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 12-byte hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. +Notes: For UTF-8 case we use 3-gram distance. All these are not perfectly fair n-gram distances. We use 2-byte hashes to hash n-grams and then calculate the symmetric difference between these hash tables -- collisions may occur. With UTF-8 case-insensitive format we do not use fair `tolower` function -- we zero the 5-th bit (starting from zero) of each codepoint byte -- this works for Latin and mostly for all Cyrillic letters. [Original article](https://clickhouse.yandex/docs/en/query_language/functions/string_search_functions/) From d969b64237e8c14efd817124e553998de148271f Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sat, 9 Mar 2019 21:17:29 +0300 Subject: [PATCH 219/297] set(0) --- .../MergeTree/MergeTreeSetSkippingIndex.cpp | 21 ++++++++----------- docs/en/operations/table_engines/mergetree.md | 2 +- docs/ru/operations/table_engines/mergetree.md | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp index 9d808ea93fa..8560a7e3455 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp @@ -40,7 +40,7 @@ void MergeTreeSetIndexGranule::serializeBinary(WriteBuffer & ostr) const const auto & size_type = DataTypePtr(std::make_shared()); - if (size() > index.max_rows) + if (index.max_rows && size() > index.max_rows) { size_type->serializeBinary(0, ostr); return; @@ -120,7 +120,7 @@ void MergeTreeSetIndexAggregator::update(const Block & block, size_t * pos, size size_t rows_read = std::min(limit, block.rows() - *pos); - if (size() > index.max_rows) + if (index.max_rows > 0 && size() > index.max_rows) { *pos += rows_read; return; @@ -151,16 +151,13 @@ void MergeTreeSetIndexAggregator::update(const Block & block, size_t * pos, size #undef M } - if (!has_new_data) + if (has_new_data) { - *pos += rows_read; - return; - } - - for (size_t i = 0; i < columns.size(); ++i) - { - auto filtered_column = block.getByName(index.columns[i]).column->filter(filter, block.rows()); - columns[i]->insertRangeFrom(*filtered_column, 0, filtered_column->size()); + for (size_t i = 0; i < columns.size(); ++i) + { + auto filtered_column = block.getByName(index.columns[i]).column->filter(filter, block.rows()); + columns[i]->insertRangeFrom(*filtered_column, 0, filtered_column->size()); + } } *pos += rows_read; @@ -268,7 +265,7 @@ bool SetIndexCondition::mayBeTrueOnGranule(MergeTreeIndexGranulePtr idx_granule) throw Exception( "Set index condition got a granule with the wrong type.", ErrorCodes::LOGICAL_ERROR); - if (useless || !granule->size() || granule->size() > index.max_rows) + if (useless || !granule->size() || (index.max_rows > 0 && granule->size() > index.max_rows)) return true; Block result = granule->block; diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index 53bb909b16d..2c9ff68c562 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -271,7 +271,7 @@ SELECT count() FROM table WHERE u64 * i32 == 10 AND u64 * length(s) >= 1234 Stores extremes of the specified expression (if the expression is `tuple`, then it stores extremes for each element of `tuple`), uses stored info for skipping blocks of the data like the primary key. * `set(max_rows)` -Stores unique values of the specified expression (no more than `max_rows` rows), use them to check if the `WHERE` expression is not satisfiable on a block of the data. +Stores unique values of the specified expression (no more than `max_rows` rows, `max_rows=0` means "no limits"), use them to check if the `WHERE` expression is not satisfiable on a block of the data. ```sql INDEX sample_index (u64 * length(s)) TYPE minmax GRANULARITY 4 diff --git a/docs/ru/operations/table_engines/mergetree.md b/docs/ru/operations/table_engines/mergetree.md index 22df2d45e64..4318568edfb 100644 --- a/docs/ru/operations/table_engines/mergetree.md +++ b/docs/ru/operations/table_engines/mergetree.md @@ -260,7 +260,7 @@ SELECT count() FROM table WHERE u64 * i32 == 10 AND u64 * length(s) >= 1234 Хранит минимум и максимум выражения (если выражение - `tuple`, то для каждого элемента `tuple`), используя их для пропуска блоков аналогично первичному ключу. * `set(max_rows)` -Хранит уникальные значения выражения на блоке в количестве не более `max_rows`, используя их для пропуска блоков, оценивая выполнимость `WHERE` выражения на хранимых данных. +Хранит уникальные значения выражения на блоке в количестве не более `max_rows` (если `max_rows = 0`, то ограничений нет), используя их для пропуска блоков, оценивая выполнимость `WHERE` выражения на хранимых данных. Примеры From 0061df234a0c8fde2a6a2839f35285c441f50b8d Mon Sep 17 00:00:00 2001 From: proller Date: Sat, 9 Mar 2019 21:52:46 +0300 Subject: [PATCH 220/297] Build fix (split) (#4641) --- dbms/programs/server/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/programs/server/CMakeLists.txt b/dbms/programs/server/CMakeLists.txt index 217447413d5..5cb08018065 100644 --- a/dbms/programs/server/CMakeLists.txt +++ b/dbms/programs/server/CMakeLists.txt @@ -10,7 +10,7 @@ set(CLICKHOUSE_SERVER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/TCPHandler.cpp ) -set(CLICKHOUSE_SERVER_LINK PRIVATE clickhouse_dictionaries clickhouse_common_io daemon clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions ${Poco_Net_LIBRARY}) +set(CLICKHOUSE_SERVER_LINK PRIVATE clickhouse_dictionaries clickhouse_common_io PUBLIC daemon PRIVATE clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions ${Poco_Net_LIBRARY}) if (USE_POCO_NETSSL) set(CLICKHOUSE_SERVER_LINK ${CLICKHOUSE_SERVER_LINK} PRIVATE ${Poco_NetSSL_LIBRARY} ${Poco_Crypto_LIBRARY}) endif () From 446caea46efe6d297b4a044adc266a45dbd24abd Mon Sep 17 00:00:00 2001 From: proller Date: Sun, 10 Mar 2019 04:28:13 +0300 Subject: [PATCH 221/297] Update contrib/cppkafka (#4620) * Update contrib/cppkafka * Fix --- contrib/cppkafka | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/cppkafka b/contrib/cppkafka index 860c90e92ee..9b184d881c1 160000 --- a/contrib/cppkafka +++ b/contrib/cppkafka @@ -1 +1 @@ -Subproject commit 860c90e92eee6690aa74a2ca7b7c5c6930dffecd +Subproject commit 9b184d881c15cc50784b28688c7c99d3d764db24 From 128fd20adf5ab5861e7893d9d7e655bf8c773872 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Sun, 10 Mar 2019 04:30:42 +0300 Subject: [PATCH 222/297] Update registerStorageMergeTree.cpp --- dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp b/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp index 6411ec21bac..a64f376e3de 100644 --- a/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp +++ b/dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp @@ -101,8 +101,8 @@ static void appendGraphitePattern( { if (key == "regexp") { - pattern.regexp = std::make_shared(config.getString(config_element + ".regexp")); pattern.regexp_str = config.getString(config_element + ".regexp"); + pattern.regexp = std::make_shared(pattern.regexp_str); } else if (key == "function") { From b81f73bb132493aca5c184a195d298a261a3366f Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 10 Mar 2019 06:13:19 +0300 Subject: [PATCH 223/297] Added a test [#CLICKHOUSE-1704] --- dbms/tests/queries/0_stateless/00915_tuple_orantius.reference | 1 + dbms/tests/queries/0_stateless/00915_tuple_orantius.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00915_tuple_orantius.reference create mode 100644 dbms/tests/queries/0_stateless/00915_tuple_orantius.sql diff --git a/dbms/tests/queries/0_stateless/00915_tuple_orantius.reference b/dbms/tests/queries/0_stateless/00915_tuple_orantius.reference new file mode 100644 index 00000000000..6b303cbce8b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00915_tuple_orantius.reference @@ -0,0 +1 @@ +1 (1,2,3) 1 diff --git a/dbms/tests/queries/0_stateless/00915_tuple_orantius.sql b/dbms/tests/queries/0_stateless/00915_tuple_orantius.sql new file mode 100644 index 00000000000..938260c5123 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00915_tuple_orantius.sql @@ -0,0 +1 @@ +select 1 as x, (1,2,3) as y, x in y; From 6db73152d2e1b7b35a03b7e146549dd84fe2992d Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Sun, 10 Mar 2019 06:16:51 +0300 Subject: [PATCH 224/297] Hardening debug build (experimental) (#4632) * Hardening debug build: more granular memory mappings and ASLR; add memory protection for mark cache and index * Addition to prev. revision * Addition to prev. revision * Addition to prev. revision --- dbms/src/AggregateFunctions/QuantileTDigest.h | 2 +- dbms/src/Columns/ColumnAggregateFunction.cpp | 5 ++ dbms/src/Columns/ColumnAggregateFunction.h | 2 + dbms/src/Columns/ColumnArray.cpp | 7 +++ dbms/src/Columns/ColumnArray.h | 1 + dbms/src/Columns/ColumnDecimal.h | 1 + dbms/src/Columns/ColumnFixedString.h | 5 ++ dbms/src/Columns/ColumnLowCardinality.cpp | 1 - dbms/src/Columns/ColumnNullable.cpp | 6 ++ dbms/src/Columns/ColumnNullable.h | 1 + dbms/src/Columns/ColumnString.cpp | 7 +++ dbms/src/Columns/ColumnString.h | 2 + dbms/src/Columns/ColumnTuple.cpp | 6 ++ dbms/src/Columns/ColumnTuple.h | 1 + dbms/src/Columns/ColumnUnique.h | 1 + dbms/src/Columns/ColumnVector.h | 5 ++ dbms/src/Columns/ColumnVectorHelper.h | 3 +- dbms/src/Columns/IColumn.h | 4 ++ dbms/src/Common/Allocator.cpp | 23 ++++++- dbms/src/Common/Allocator.h | 19 ++++++ dbms/src/Common/ErrorCodes.cpp | 1 + dbms/src/Common/PODArray.h | 63 +++++++++++++++++++ dbms/src/Interpreters/AggregationCommon.h | 20 +++--- .../Storages/MergeTree/MergeTreeDataPart.cpp | 5 +- .../MergeTree/MergeTreeReaderStream.cpp | 1 + libs/libcommon/include/common/mremap.h | 9 ++- 26 files changed, 182 insertions(+), 19 deletions(-) diff --git a/dbms/src/AggregateFunctions/QuantileTDigest.h b/dbms/src/AggregateFunctions/QuantileTDigest.h index ca7d4f2fb1a..c4ee76b6eed 100644 --- a/dbms/src/AggregateFunctions/QuantileTDigest.h +++ b/dbms/src/AggregateFunctions/QuantileTDigest.h @@ -85,7 +85,7 @@ class QuantileTDigest Params params; /// The memory will be allocated to several elements at once, so that the state occupies 64 bytes. - static constexpr size_t bytes_in_arena = 64 - sizeof(PODArray) - sizeof(Count) - sizeof(UInt32); + static constexpr size_t bytes_in_arena = 128 - sizeof(PODArray) - sizeof(Count) - sizeof(UInt32); using Summary = PODArray, bytes_in_arena>>; diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 69bcdac2ab7..4652e4a08c8 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -255,6 +255,11 @@ size_t ColumnAggregateFunction::allocatedBytes() const return res; } +void ColumnAggregateFunction::protect() +{ + data.protect(); +} + MutableColumnPtr ColumnAggregateFunction::cloneEmpty() const { return create(func, Arenas(1, std::make_shared())); diff --git a/dbms/src/Columns/ColumnAggregateFunction.h b/dbms/src/Columns/ColumnAggregateFunction.h index 3fc76b4c047..a028a95d68c 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.h +++ b/dbms/src/Columns/ColumnAggregateFunction.h @@ -157,6 +157,8 @@ public: size_t allocatedBytes() const override; + void protect() override; + void insertRangeFrom(const IColumn & from, size_t start, size_t length) override; void popBack(size_t n) override; diff --git a/dbms/src/Columns/ColumnArray.cpp b/dbms/src/Columns/ColumnArray.cpp index 4ceda666db7..eeb06b64f49 100644 --- a/dbms/src/Columns/ColumnArray.cpp +++ b/dbms/src/Columns/ColumnArray.cpp @@ -311,6 +311,13 @@ size_t ColumnArray::allocatedBytes() const } +void ColumnArray::protect() +{ + getData().protect(); + getOffsets().protect(); +} + + bool ColumnArray::hasEqualOffsets(const ColumnArray & other) const { if (offsets == other.offsets) diff --git a/dbms/src/Columns/ColumnArray.h b/dbms/src/Columns/ColumnArray.h index 3e1b586e755..d58dfba025a 100644 --- a/dbms/src/Columns/ColumnArray.h +++ b/dbms/src/Columns/ColumnArray.h @@ -78,6 +78,7 @@ public: void reserve(size_t n) override; size_t byteSize() const override; size_t allocatedBytes() const override; + void protect() override; ColumnPtr replicate(const Offsets & replicate_offsets) const override; ColumnPtr convertToFullColumnIfConst() const override; void getExtremes(Field & min, Field & max) const override; diff --git a/dbms/src/Columns/ColumnDecimal.h b/dbms/src/Columns/ColumnDecimal.h index 50a6d9d67fb..372b0c245c0 100644 --- a/dbms/src/Columns/ColumnDecimal.h +++ b/dbms/src/Columns/ColumnDecimal.h @@ -87,6 +87,7 @@ public: size_t size() const override { return data.size(); } size_t byteSize() const override { return data.size() * sizeof(data[0]); } size_t allocatedBytes() const override { return data.allocated_bytes(); } + void protect() override { data.protect(); } void reserve(size_t n) override { data.reserve(n); } void insertFrom(const IColumn & src, size_t n) override { data.push_back(static_cast(src).getData()[n]); } diff --git a/dbms/src/Columns/ColumnFixedString.h b/dbms/src/Columns/ColumnFixedString.h index 941314b8888..b773d7c8eb4 100644 --- a/dbms/src/Columns/ColumnFixedString.h +++ b/dbms/src/Columns/ColumnFixedString.h @@ -57,6 +57,11 @@ public: return chars.allocated_bytes() + sizeof(n); } + void protect() override + { + chars.protect(); + } + Field operator[](size_t index) const override { return String(reinterpret_cast(&chars[n * index]), n); diff --git a/dbms/src/Columns/ColumnLowCardinality.cpp b/dbms/src/Columns/ColumnLowCardinality.cpp index c919116112c..c9a475fd8a6 100644 --- a/dbms/src/Columns/ColumnLowCardinality.cpp +++ b/dbms/src/Columns/ColumnLowCardinality.cpp @@ -363,7 +363,6 @@ ColumnPtr ColumnLowCardinality::countKeys() const } - ColumnLowCardinality::Index::Index() : positions(ColumnUInt8::create()), size_of_type(sizeof(UInt8)) {} ColumnLowCardinality::Index::Index(MutableColumnPtr && positions) : positions(std::move(positions)) diff --git a/dbms/src/Columns/ColumnNullable.cpp b/dbms/src/Columns/ColumnNullable.cpp index b88cf60581b..d9a8ea4f825 100644 --- a/dbms/src/Columns/ColumnNullable.cpp +++ b/dbms/src/Columns/ColumnNullable.cpp @@ -291,6 +291,12 @@ size_t ColumnNullable::allocatedBytes() const return getNestedColumn().allocatedBytes() + getNullMapColumn().allocatedBytes(); } +void ColumnNullable::protect() +{ + getNestedColumn().protect(); + getNullMapColumn().protect(); +} + namespace { diff --git a/dbms/src/Columns/ColumnNullable.h b/dbms/src/Columns/ColumnNullable.h index c8453a29689..8012d03b0e8 100644 --- a/dbms/src/Columns/ColumnNullable.h +++ b/dbms/src/Columns/ColumnNullable.h @@ -71,6 +71,7 @@ public: void reserve(size_t n) override; size_t byteSize() const override; size_t allocatedBytes() const override; + void protect() override; ColumnPtr replicate(const Offsets & replicate_offsets) const override; void updateHashWithValue(size_t n, SipHash & hash) const override; void getExtremes(Field & min, Field & max) const override; diff --git a/dbms/src/Columns/ColumnString.cpp b/dbms/src/Columns/ColumnString.cpp index 1717c02f1df..1443283783a 100644 --- a/dbms/src/Columns/ColumnString.cpp +++ b/dbms/src/Columns/ColumnString.cpp @@ -412,4 +412,11 @@ void ColumnString::getPermutationWithCollation(const Collator & collator, bool r } } + +void ColumnString::protect() +{ + getChars().protect(); + getOffsets().protect(); +} + } diff --git a/dbms/src/Columns/ColumnString.h b/dbms/src/Columns/ColumnString.h index 5ca05079bd5..a30a4ceb5a1 100644 --- a/dbms/src/Columns/ColumnString.h +++ b/dbms/src/Columns/ColumnString.h @@ -68,6 +68,8 @@ public: return chars.allocated_bytes() + offsets.allocated_bytes(); } + void protect() override; + MutableColumnPtr cloneResized(size_t to_size) const override; Field operator[](size_t n) const override diff --git a/dbms/src/Columns/ColumnTuple.cpp b/dbms/src/Columns/ColumnTuple.cpp index c235cd07c31..ec0bcc1f5b5 100644 --- a/dbms/src/Columns/ColumnTuple.cpp +++ b/dbms/src/Columns/ColumnTuple.cpp @@ -315,6 +315,12 @@ size_t ColumnTuple::allocatedBytes() const return res; } +void ColumnTuple::protect() +{ + for (auto & column : columns) + column->assumeMutableRef().protect(); +} + void ColumnTuple::getExtremes(Field & min, Field & max) const { const size_t tuple_size = columns.size(); diff --git a/dbms/src/Columns/ColumnTuple.h b/dbms/src/Columns/ColumnTuple.h index d146c8bff6c..c39a92e3c8c 100644 --- a/dbms/src/Columns/ColumnTuple.h +++ b/dbms/src/Columns/ColumnTuple.h @@ -71,6 +71,7 @@ public: void reserve(size_t n) override; size_t byteSize() const override; size_t allocatedBytes() const override; + void protect() override; void forEachSubcolumn(ColumnCallback callback) override; size_t tupleSize() const { return columns.size(); } diff --git a/dbms/src/Columns/ColumnUnique.h b/dbms/src/Columns/ColumnUnique.h index 85a9c498a94..5eee80dc9d8 100644 --- a/dbms/src/Columns/ColumnUnique.h +++ b/dbms/src/Columns/ColumnUnique.h @@ -80,6 +80,7 @@ public: bool isNumeric() const override { return column_holder->isNumeric(); } size_t byteSize() const override { return column_holder->byteSize(); } + void protect() override { column_holder->assumeMutableRef().protect(); } size_t allocatedBytes() const override { return column_holder->allocatedBytes() diff --git a/dbms/src/Columns/ColumnVector.h b/dbms/src/Columns/ColumnVector.h index 1c5a45ef6ad..9de84f95b4a 100644 --- a/dbms/src/Columns/ColumnVector.h +++ b/dbms/src/Columns/ColumnVector.h @@ -163,6 +163,11 @@ public: return data.allocated_bytes(); } + void protect() override + { + data.protect(); + } + void insertValue(const T value) { data.push_back(value); diff --git a/dbms/src/Columns/ColumnVectorHelper.h b/dbms/src/Columns/ColumnVectorHelper.h index 8a25812ffe7..d805f44218c 100644 --- a/dbms/src/Columns/ColumnVectorHelper.h +++ b/dbms/src/Columns/ColumnVectorHelper.h @@ -24,9 +24,10 @@ namespace DB class ColumnVectorHelper : public IColumn { public: + template const char * getRawDataBegin() const { - return *reinterpret_cast(reinterpret_cast(this) + sizeof(*this)); + return reinterpret_cast, 15, 16> *>(reinterpret_cast(this) + sizeof(*this))->raw_data(); } template diff --git a/dbms/src/Columns/IColumn.h b/dbms/src/Columns/IColumn.h index 2560b9639ad..86a1097d368 100644 --- a/dbms/src/Columns/IColumn.h +++ b/dbms/src/Columns/IColumn.h @@ -253,6 +253,10 @@ public: /// Zero, if could be determined. virtual size_t allocatedBytes() const = 0; + /// Make memory region readonly with mprotect if it is large enough. + /// The operation is slow and performed only for debug builds. + virtual void protect() {} + /// If the column contains subcolumns (such as Array, Nullable, etc), do callback on them. /// Shallow: doesn't do recursive calls; don't do call for itself. using ColumnCallback = std::function; diff --git a/dbms/src/Common/Allocator.cpp b/dbms/src/Common/Allocator.cpp index ba0c7820187..92ff10eafb7 100644 --- a/dbms/src/Common/Allocator.cpp +++ b/dbms/src/Common/Allocator.cpp @@ -43,11 +43,30 @@ namespace ErrorCodes * * PS. This is also required, because tcmalloc can not allocate a chunk of memory greater than 16 GB. */ -static constexpr size_t MMAP_THRESHOLD = 64 * (1ULL << 20); +#ifdef NDEBUG + static constexpr size_t MMAP_THRESHOLD = 64 * (1ULL << 20); +#else + /// In debug build, use small mmap threshold to reproduce more memory stomping bugs. + /// Along with ASLR it will hopefully detect more issues than ASan. + /// The program may fail due to the limit on number of memory mappings. + static constexpr size_t MMAP_THRESHOLD = 4096; +#endif + static constexpr size_t MMAP_MIN_ALIGNMENT = 4096; static constexpr size_t MALLOC_MIN_ALIGNMENT = 8; +template +void * Allocator::mmap_hint() +{ +#if ALLOCATOR_ASLR + return reinterpret_cast(std::uniform_int_distribution(0x100000000000UL, 0x700000000000UL)(rng)); +#else + return nullptr; +#endif +} + + template void * Allocator::alloc(size_t size, size_t alignment) { @@ -61,7 +80,7 @@ void * Allocator::alloc(size_t size, size_t alignment) throw DB::Exception("Too large alignment " + formatReadableSizeWithBinarySuffix(alignment) + ": more than page size when allocating " + formatReadableSizeWithBinarySuffix(size) + ".", DB::ErrorCodes::BAD_ARGUMENTS); - buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + buf = mmap(mmap_hint(), size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (MAP_FAILED == buf) DB::throwFromErrno("Allocator: Cannot mmap " + formatReadableSizeWithBinarySuffix(size) + ".", DB::ErrorCodes::CANNOT_ALLOCATE_MEMORY); diff --git a/dbms/src/Common/Allocator.h b/dbms/src/Common/Allocator.h index 9a2ab0b975c..d2a81f77b62 100644 --- a/dbms/src/Common/Allocator.h +++ b/dbms/src/Common/Allocator.h @@ -2,6 +2,19 @@ #include +#ifdef NDEBUG + /// If set to 1 - randomize memory mappings manually (address space layout randomization) to reproduce more memory stomping bugs. + /// Note that Linux doesn't do it by default. This may lead to worse TLB performance. + #define ALLOCATOR_ASLR 0 +#else + #define ALLOCATOR_ASLR 1 +#endif + +#if ALLOCATOR_ASLR + #include + #include +#endif + /** Responsible for allocating / freeing memory. Used, for example, in PODArray, Arena. * Also used in hash tables. @@ -14,6 +27,12 @@ template class Allocator { +#if ALLOCATOR_ASLR +private: + pcg64 rng{randomSeed()}; +#endif + void * mmap_hint(); + protected: static constexpr bool clear_memory = clear_memory_; diff --git a/dbms/src/Common/ErrorCodes.cpp b/dbms/src/Common/ErrorCodes.cpp index d3401427037..f974b2bdaf6 100644 --- a/dbms/src/Common/ErrorCodes.cpp +++ b/dbms/src/Common/ErrorCodes.cpp @@ -419,6 +419,7 @@ namespace ErrorCodes extern const int BAD_DATABASE_FOR_TEMPORARY_TABLE = 442; extern const int NO_COMMON_COLUMNS_WITH_PROTOBUF_SCHEMA = 443; extern const int UNKNOWN_PROTOBUF_FORMAT = 444; + extern const int CANNOT_MPROTECT = 445; extern const int KEEPER_EXCEPTION = 999; extern const int POCO_EXCEPTION = 1000; diff --git a/dbms/src/Common/PODArray.h b/dbms/src/Common/PODArray.h index 462842f8236..a7b8b02bb98 100644 --- a/dbms/src/Common/PODArray.h +++ b/dbms/src/Common/PODArray.h @@ -17,10 +17,19 @@ #include #include +#ifndef NDEBUG + #include +#endif + namespace DB { +namespace ErrorCodes +{ + extern const int CANNOT_MPROTECT; +} + inline constexpr size_t integerRoundUp(size_t value, size_t dividend) { return ((value + dividend - 1) / dividend) * dividend; @@ -108,6 +117,8 @@ protected: if (c_start == null) return; + unprotect(); + TAllocator::free(c_start - pad_left, allocated_bytes()); } @@ -120,6 +131,8 @@ protected: return; } + unprotect(); + ptrdiff_t end_diff = c_end - c_start; c_start = reinterpret_cast( @@ -155,6 +168,28 @@ protected: realloc(allocated_bytes() * 2, std::forward(allocator_params)...); } +#ifndef NDEBUG + /// Make memory region readonly with mprotect if it is large enough. + /// The operation is slow and performed only for debug builds. + void protectImpl(int prot) + { + static constexpr size_t PAGE_SIZE = 4096; + + char * left_rounded_up = reinterpret_cast((reinterpret_cast(c_start) - pad_left + PAGE_SIZE - 1) / PAGE_SIZE * PAGE_SIZE); + char * right_rounded_down = reinterpret_cast((reinterpret_cast(c_end_of_storage) + pad_right) / PAGE_SIZE * PAGE_SIZE); + + if (right_rounded_down > left_rounded_up) + { + size_t length = right_rounded_down - left_rounded_up; + if (0 != mprotect(left_rounded_up, length, prot)) + throwFromErrno("Cannot mprotect memory region", ErrorCodes::CANNOT_MPROTECT); + } + } + + /// Restore memory protection in destructor or realloc for further reuse by allocator. + bool mprotected = false; +#endif + public: bool empty() const { return c_end == c_start; } size_t size() const { return (c_end - c_start) / ELEMENT_SIZE; } @@ -199,6 +234,23 @@ public: c_end += byte_size(1); } + void protect() + { +#ifndef NDEBUG + protectImpl(PROT_READ); + mprotected = true; +#endif + } + + void unprotect() + { +#ifndef NDEBUG + if (mprotected) + protectImpl(PROT_WRITE); + mprotected = false; +#endif + } + ~PODArrayBase() { dealloc(); @@ -402,6 +454,11 @@ public: void swap(PODArray & rhs) { +#ifndef NDEBUG + this->unprotect(); + rhs.unprotect(); +#endif + /// Swap two PODArray objects, arr1 and arr2, that satisfy the following conditions: /// - The elements of arr1 are stored on stack. /// - The elements of arr2 are stored on heap. @@ -450,7 +507,9 @@ public: }; if (!this->isInitialized() && !rhs.isInitialized()) + { return; + } else if (!this->isInitialized() && rhs.isInitialized()) { do_move(rhs, *this); @@ -494,9 +553,13 @@ public: rhs.c_end = rhs.c_start + this->byte_size(lhs_size); } else if (this->isAllocatedFromStack() && !rhs.isAllocatedFromStack()) + { swap_stack_heap(*this, rhs); + } else if (!this->isAllocatedFromStack() && rhs.isAllocatedFromStack()) + { swap_stack_heap(rhs, *this); + } else { std::swap(this->c_start, rhs.c_start); diff --git a/dbms/src/Interpreters/AggregationCommon.h b/dbms/src/Interpreters/AggregationCommon.h index 12c2d53819b..74836d4463d 100644 --- a/dbms/src/Interpreters/AggregationCommon.h +++ b/dbms/src/Interpreters/AggregationCommon.h @@ -102,23 +102,23 @@ static inline T ALWAYS_INLINE packFixed( switch (key_sizes[j]) { case 1: - memcpy(bytes + offset, static_cast(column)->getRawDataBegin() + index, 1); + memcpy(bytes + offset, static_cast(column)->getRawDataBegin<1>() + index, 1); offset += 1; break; case 2: - memcpy(bytes + offset, static_cast(column)->getRawDataBegin() + index * 2, 2); + memcpy(bytes + offset, static_cast(column)->getRawDataBegin<2>() + index * 2, 2); offset += 2; break; case 4: - memcpy(bytes + offset, static_cast(column)->getRawDataBegin() + index * 4, 4); + memcpy(bytes + offset, static_cast(column)->getRawDataBegin<4>() + index * 4, 4); offset += 4; break; case 8: - memcpy(bytes + offset, static_cast(column)->getRawDataBegin() + index * 8, 8); + memcpy(bytes + offset, static_cast(column)->getRawDataBegin<8>() + index * 8, 8); offset += 8; break; default: - memcpy(bytes + offset, static_cast(column)->getRawDataBegin() + index * key_sizes[j], key_sizes[j]); + memcpy(bytes + offset, static_cast(column)->getRawDataBegin<1>() + index * key_sizes[j], key_sizes[j]); offset += key_sizes[j]; } } @@ -168,23 +168,23 @@ static inline T ALWAYS_INLINE packFixed( switch (key_sizes[j]) { case 1: - memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin() + i, 1); + memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin<1>() + i, 1); offset += 1; break; case 2: - memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin() + i * 2, 2); + memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin<2>() + i * 2, 2); offset += 2; break; case 4: - memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin() + i * 4, 4); + memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin<4>() + i * 4, 4); offset += 4; break; case 8: - memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin() + i * 8, 8); + memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin<8>() + i * 8, 8); offset += 8; break; default: - memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin() + i * key_sizes[j], key_sizes[j]); + memcpy(bytes + offset, static_cast(key_columns[j])->getRawDataBegin<1>() + i * key_sizes[j], key_sizes[j]); offset += key_sizes[j]; } } diff --git a/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp b/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp index bf9c5b3409d..01ff4c4cdac 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeDataPart.cpp @@ -513,13 +513,16 @@ void MergeTreeDataPart::loadIndex() for (size_t i = 0; i < marks_count; ++i) //-V756 for (size_t j = 0; j < key_size; ++j) - storage.primary_key_data_types[j]->deserializeBinary(*loaded_index[j].get(), index_file); + storage.primary_key_data_types[j]->deserializeBinary(*loaded_index[j], index_file); for (size_t i = 0; i < key_size; ++i) + { + loaded_index[i]->protect(); if (loaded_index[i]->size() != marks_count) throw Exception("Cannot read all data from index file " + index_path + "(expected size: " + toString(marks_count) + ", read: " + toString(loaded_index[i]->size()) + ")", ErrorCodes::CANNOT_READ_ALL_DATA); + } if (!index_file.eof()) throw Exception("Index file " + index_path + " is unexpectedly long", ErrorCodes::EXPECTED_END_OF_FILE); diff --git a/dbms/src/Storages/MergeTree/MergeTreeReaderStream.cpp b/dbms/src/Storages/MergeTree/MergeTreeReaderStream.cpp index 9091228d80a..89f5aaeafd5 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeReaderStream.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeReaderStream.cpp @@ -132,6 +132,7 @@ void MergeTreeReaderStream::loadMarks() if (buffer.eof() || buffer.buffer().size() != file_size) throw Exception("Cannot read all marks from file " + mrk_path, ErrorCodes::CANNOT_READ_ALL_DATA); + res->protect(); return res; }; diff --git a/libs/libcommon/include/common/mremap.h b/libs/libcommon/include/common/mremap.h index f569ff05d4e..31ca74da827 100644 --- a/libs/libcommon/include/common/mremap.h +++ b/libs/libcommon/include/common/mremap.h @@ -12,7 +12,8 @@ #define MREMAP_MAYMOVE 1 -void * mremap(void * old_address, +void * mremap( + void * old_address, size_t old_size, size_t new_size, int flags = 0, @@ -23,7 +24,8 @@ void * mremap(void * old_address, #endif -inline void * clickhouse_mremap(void * old_address, +inline void * clickhouse_mremap( + void * old_address, size_t old_size, size_t new_size, int flags = 0, @@ -32,7 +34,8 @@ inline void * clickhouse_mremap(void * old_address, [[maybe_unused]] int mmap_fd = -1, [[maybe_unused]] off_t mmap_offset = 0) { - return mremap(old_address, + return mremap( + old_address, old_size, new_size, flags From 861583480477e74c264c58e7d63fe6a2b666b8c9 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sun, 10 Mar 2019 11:23:59 +0300 Subject: [PATCH 225/297] fix --- dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp index 8560a7e3455..742d3971930 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeSetSkippingIndex.cpp @@ -120,7 +120,7 @@ void MergeTreeSetIndexAggregator::update(const Block & block, size_t * pos, size size_t rows_read = std::min(limit, block.rows() - *pos); - if (index.max_rows > 0 && size() > index.max_rows) + if (index.max_rows && size() > index.max_rows) { *pos += rows_read; return; @@ -265,7 +265,7 @@ bool SetIndexCondition::mayBeTrueOnGranule(MergeTreeIndexGranulePtr idx_granule) throw Exception( "Set index condition got a granule with the wrong type.", ErrorCodes::LOGICAL_ERROR); - if (useless || !granule->size() || (index.max_rows > 0 && granule->size() > index.max_rows)) + if (useless || !granule->size() || (index.max_rows && granule->size() > index.max_rows)) return true; Block result = granule->block; From 4af321728adeed717234f3e0af80084d111123e3 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 10 Mar 2019 18:55:22 +0300 Subject: [PATCH 226/297] Removed useless line --- dbms/src/Compression/CompressionFactory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dbms/src/Compression/CompressionFactory.cpp b/dbms/src/Compression/CompressionFactory.cpp index 1acede09bd2..b5b2bfe6b5e 100644 --- a/dbms/src/Compression/CompressionFactory.cpp +++ b/dbms/src/Compression/CompressionFactory.cpp @@ -19,7 +19,6 @@ namespace ErrorCodes { extern const int UNKNOWN_CODEC; extern const int UNEXPECTED_AST_STRUCTURE; - extern const int ILLEGAL_SYNTAX_FOR_CODEC_TYPE; extern const int DATA_TYPE_CANNOT_HAVE_ARGUMENTS; } From c9b83feae91d4080c67a1351c83bc116be206261 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 10 Mar 2019 22:01:30 +0300 Subject: [PATCH 227/297] Fixed debug build --- CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9680c197ce..13ceb3f63b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,7 +211,11 @@ if (OS_LINUX AND NOT UNBUNDLED) # The order of linking is important: 'glibc-compatibility' must be before libc but after all other libraries. if (GLIBC_COMPATIBILITY) message (STATUS "Some symbols from glibc will be replaced for compatibility") - set (DEFAULT_LIBS "${DEFAULT_LIBS} libs/libglibc-compatibility/libglibc-compatibility.a") + + string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) + set (CMAKE_POSTFIX_VARIABLE "CMAKE_${CMAKE_BUILD_TYPE_UC}_POSTFIX") + + set (DEFAULT_LIBS "${DEFAULT_LIBS} libs/libglibc-compatibility/libglibc-compatibility${${CMAKE_POSTFIX_VARIABLE}}.a") endif () # Add Libc. GLIBC is actually a collection of interdependent libraries. @@ -350,7 +354,15 @@ if (DEFAULT_LIBS) add_default_libs(ltdl) add_default_libs(zlibstatic) add_default_libs(jemalloc) + add_default_libs(unwind) + add_default_libs(memcpy) add_default_libs(Foundation) add_default_libs(common) add_default_libs(gtest) + add_default_libs(lz4) + add_default_libs(zstd) + add_default_libs(snappy) + add_default_libs(arrow) + add_default_libs(thrift_static) + add_default_libs(boost_regex_internal) endif () From b10b30ab0e111ab6c6b3d2e3fc74b06c4a54f5e0 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 10 Mar 2019 23:04:36 +0300 Subject: [PATCH 228/297] Fixed debug build --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13ceb3f63b5..cc922266161 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") set (CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Debug;Release;MinSizeRel" CACHE STRING "" FORCE) +set (CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Generate debug library name with a postfix.") # To be consistent with CMakeLists from contrib libs. option (USE_STATIC_LIBRARIES "Set to FALSE to use shared libraries" ON) option (MAKE_STATIC_LIBRARIES "Set to FALSE to make shared libraries" ${USE_STATIC_LIBRARIES}) From d9138ef8ba1cb073a6520854f562632ff69f83d4 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 00:24:27 +0300 Subject: [PATCH 229/297] Removed obsolete targets --- .../tests/CMakeLists.txt | 11 --------- libs/libglibc-compatibility/tests/longjmp.c | 23 ------------------- .../libglibc-compatibility/tests/siglongjmp.c | 23 ------------------- 3 files changed, 57 deletions(-) delete mode 100644 libs/libglibc-compatibility/tests/CMakeLists.txt delete mode 100644 libs/libglibc-compatibility/tests/longjmp.c delete mode 100644 libs/libglibc-compatibility/tests/siglongjmp.c diff --git a/libs/libglibc-compatibility/tests/CMakeLists.txt b/libs/libglibc-compatibility/tests/CMakeLists.txt deleted file mode 100644 index a4f95187485..00000000000 --- a/libs/libglibc-compatibility/tests/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -include (${ClickHouse_SOURCE_DIR}/cmake/add_check.cmake) - -foreach (T longjmp siglongjmp) - add_executable (${T} ${T}.c) - target_link_libraries (${T} PRIVATE glibc-compatibility) - if (USE_LIBCXX) - target_link_libraries (${T} PRIVATE Threads::Threads) - endif () - set_target_properties (${T} PROPERTIES LINKER_LANGUAGE CXX) - add_check (${T}) -endforeach () diff --git a/libs/libglibc-compatibility/tests/longjmp.c b/libs/libglibc-compatibility/tests/longjmp.c deleted file mode 100644 index aa96e6276b4..00000000000 --- a/libs/libglibc-compatibility/tests/longjmp.c +++ /dev/null @@ -1,23 +0,0 @@ -#include - -int main() -{ - jmp_buf env; - int val; - volatile int count = 0; - val = setjmp(env); - ++count; - if (count == 1 && val != 0) - { - return 1; - } - if (count == 2 && val == 42) - { - return 0; - } - if (count == 1) - { - longjmp(env, 42); - } - return 1; -} diff --git a/libs/libglibc-compatibility/tests/siglongjmp.c b/libs/libglibc-compatibility/tests/siglongjmp.c deleted file mode 100644 index e4befb34259..00000000000 --- a/libs/libglibc-compatibility/tests/siglongjmp.c +++ /dev/null @@ -1,23 +0,0 @@ -#include - -int main() -{ - sigjmp_buf env; - int val; - volatile int count = 0; - val = sigsetjmp(env, 0); - ++count; - if (count == 1 && val != 0) - { - return 1; - } - if (count == 2 && val == 42) - { - return 0; - } - if (count == 1) - { - siglongjmp(env, 42); - } - return 1; -} From ac4045c55d40acb04898226dc4c00290c3c550dd Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 00:31:10 +0300 Subject: [PATCH 230/297] Fixed UB in topKWeighted aggregate function #4634 --- dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp b/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp index 04e74c17434..d5d77c7ade6 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp @@ -65,8 +65,8 @@ AggregateFunctionPtr createAggregateFunctionTopK(const std::string & name, const else { assertBinary(name, argument_types); - if (!isNumber(argument_types[1])) - throw Exception("The second argument for aggregate function 'topKWeighted' must have numeric type", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + if (!isInteger(argument_types[1])) + throw Exception("The second argument for aggregate function 'topKWeighted' must have integer type", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } UInt64 threshold = 10; /// default value From a16c16152dba1b74759969afcbd67d1c9fb7d2f4 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 11 Mar 2019 00:32:42 +0300 Subject: [PATCH 231/297] Update AggregateFunctionTopK.cpp --- .../AggregateFunctionTopK.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp b/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp index 21c151b7882..b98bedbc480 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionTopK.cpp @@ -39,19 +39,19 @@ class AggregateFunctionTopKDateTime : public AggregateFunctionTopK -static IAggregateFunction * createWithExtraTypes(const DataTypePtr & argument_type, UInt64 threshold, UInt64 loadFactor, const Array & params) +static IAggregateFunction * createWithExtraTypes(const DataTypePtr & argument_type, UInt64 threshold, UInt64 load_factor, const Array & params) { WhichDataType which(argument_type); if (which.idx == TypeIndex::Date) - return new AggregateFunctionTopKDate(threshold, loadFactor, {argument_type}, params); + return new AggregateFunctionTopKDate(threshold, load_factor, {argument_type}, params); if (which.idx == TypeIndex::DateTime) - return new AggregateFunctionTopKDateTime(threshold, loadFactor, {argument_type}, params); + return new AggregateFunctionTopKDateTime(threshold, load_factor, {argument_type}, params); /// Check that we can use plain version of AggregateFunctionTopKGeneric if (argument_type->isValueUnambiguouslyRepresentedInContiguousMemoryRegion()) - return new AggregateFunctionTopKGeneric(threshold, loadFactor, argument_type, params); + return new AggregateFunctionTopKGeneric(threshold, load_factor, argument_type, params); else - return new AggregateFunctionTopKGeneric(threshold, loadFactor, argument_type, params); + return new AggregateFunctionTopKGeneric(threshold, load_factor, argument_type, params); } @@ -70,7 +70,7 @@ AggregateFunctionPtr createAggregateFunctionTopK(const std::string & name, const } UInt64 threshold = 10; /// default values - UInt64 loadFactor = 3; + UInt64 load_factor = 3; if (!params.empty()) { @@ -79,10 +79,11 @@ AggregateFunctionPtr createAggregateFunctionTopK(const std::string & name, const ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); UInt64 k = applyVisitor(FieldVisitorConvertToNumber(), params[0]); - if (params.size() == 2) { - loadFactor = applyVisitor(FieldVisitorConvertToNumber(), params[1]); + if (params.size() == 2) + { + load_factor = applyVisitor(FieldVisitorConvertToNumber(), params[1]); - if (loadFactor < 1) + if (load_factor < 1) throw Exception("Too small parameter for aggregate function " + name + ". Minimum: 1", ErrorCodes::ARGUMENT_OUT_OF_BOUND); } @@ -98,10 +99,10 @@ AggregateFunctionPtr createAggregateFunctionTopK(const std::string & name, const threshold = k; } - AggregateFunctionPtr res(createWithNumericType(*argument_types[0], threshold, loadFactor, argument_types, params)); + AggregateFunctionPtr res(createWithNumericType(*argument_types[0], threshold, load_factor, argument_types, params)); if (!res) - res = AggregateFunctionPtr(createWithExtraTypes(argument_types[0], threshold, loadFactor, params)); + res = AggregateFunctionPtr(createWithExtraTypes(argument_types[0], threshold, load_factor, params)); if (!res) throw Exception("Illegal type " + argument_types[0]->getName() + From 86e78896224818fa850678a76297b9373e98db8d Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 11 Mar 2019 00:33:57 +0300 Subject: [PATCH 232/297] Update AggregateFunctionTopK.h --- dbms/src/AggregateFunctions/AggregateFunctionTopK.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTopK.h b/dbms/src/AggregateFunctions/AggregateFunctionTopK.h index 9e509179712..72b724843a1 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionTopK.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionTopK.h @@ -20,8 +20,6 @@ namespace DB { - - template struct AggregateFunctionTopKData { @@ -46,9 +44,9 @@ protected: UInt64 reserved; public: - AggregateFunctionTopK(UInt64 threshold, UInt64 loadFactor, const DataTypes & argument_types_, const Array & params) + AggregateFunctionTopK(UInt64 threshold, UInt64 load_factor, const DataTypes & argument_types_, const Array & params) : IAggregateFunctionDataHelper, AggregateFunctionTopK>(argument_types_, params) - , threshold(threshold), reserved(loadFactor * threshold) {} + , threshold(threshold), reserved(load_factor * threshold) {} String getName() const override { return is_weighted ? "topKWeighted" : "topK"; } @@ -141,9 +139,9 @@ private: public: AggregateFunctionTopKGeneric( - UInt64 threshold, UInt64 loadFactor, const DataTypePtr & input_data_type, const Array & params) + UInt64 threshold, UInt64 load_factor, const DataTypePtr & input_data_type, const Array & params) : IAggregateFunctionDataHelper>({input_data_type}, params) - , threshold(threshold), reserved(loadFactor * threshold), input_data_type(this->argument_types[0]) {} + , threshold(threshold), reserved(load_factor * threshold), input_data_type(this->argument_types[0]) {} String getName() const override { return is_weighted ? "topKWeighted" : "topK"; } From d95cd4a3625f29e8eb75d671acfe151a15264a12 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 01:01:12 +0300 Subject: [PATCH 233/297] Removed obsolete code after #3920 --- dbms/src/Columns/ColumnString.h | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/dbms/src/Columns/ColumnString.h b/dbms/src/Columns/ColumnString.h index a30a4ceb5a1..d2d9bf2fb61 100644 --- a/dbms/src/Columns/ColumnString.h +++ b/dbms/src/Columns/ColumnString.h @@ -121,36 +121,22 @@ public: void insertFrom(const IColumn & src_, size_t n) override { const ColumnString & src = static_cast(src_); + const size_t size_to_append = src.offsets[n] - src.offsets[n - 1]; /// -1th index is Ok, see PaddedPODArray. - if (n != 0) + if (size_to_append == 1) { - const size_t size_to_append = src.offsets[n] - src.offsets[n - 1]; - - if (size_to_append == 1) - { - /// shortcut for empty string - chars.push_back(0); - offsets.push_back(chars.size()); - } - else - { - const size_t old_size = chars.size(); - const size_t offset = src.offsets[n - 1]; - const size_t new_size = old_size + size_to_append; - - chars.resize(new_size); - memcpySmallAllowReadWriteOverflow15(chars.data() + old_size, &src.chars[offset], size_to_append); - offsets.push_back(new_size); - } + /// shortcut for empty string + chars.push_back(0); + offsets.push_back(chars.size()); } else { const size_t old_size = chars.size(); - const size_t size_to_append = src.offsets[0]; + const size_t offset = src.offsets[n - 1]; const size_t new_size = old_size + size_to_append; chars.resize(new_size); - memcpySmallAllowReadWriteOverflow15(chars.data() + old_size, &src.chars[0], size_to_append); + memcpySmallAllowReadWriteOverflow15(chars.data() + old_size, &src.chars[offset], size_to_append); offsets.push_back(new_size); } } From c3938b2977f283673df72acedef690acd7e22895 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 01:28:32 +0300 Subject: [PATCH 234/297] Addition to prev. revision --- libs/libglibc-compatibility/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libs/libglibc-compatibility/CMakeLists.txt b/libs/libglibc-compatibility/CMakeLists.txt index 160227c5274..5bf83b9263f 100644 --- a/libs/libglibc-compatibility/CMakeLists.txt +++ b/libs/libglibc-compatibility/CMakeLists.txt @@ -33,7 +33,3 @@ endif () add_library (glibc-compatibility ${GLIBC_COMPATIBILITY_SOURCES}) target_include_directories(glibc-compatibility PRIVATE libcxxabi) - -if(ENABLE_TESTS) - add_subdirectory(tests) -endif() From 09a3b24cbc81c12a7f2747d21f497da8546444cd Mon Sep 17 00:00:00 2001 From: chertus Date: Mon, 11 Mar 2019 14:14:09 +0300 Subject: [PATCH 235/297] join kind helpers --- dbms/src/Interpreters/ExpressionActions.cpp | 2 +- .../Interpreters/InterpreterSelectQuery.cpp | 2 +- dbms/src/Interpreters/Join.cpp | 21 +++++++------------ dbms/src/Interpreters/SyntaxAnalyzer.cpp | 2 +- dbms/src/Parsers/ASTTablesInSelectQuery.h | 5 +++++ 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/dbms/src/Interpreters/ExpressionActions.cpp b/dbms/src/Interpreters/ExpressionActions.cpp index 08bb663a75b..21477badac2 100644 --- a/dbms/src/Interpreters/ExpressionActions.cpp +++ b/dbms/src/Interpreters/ExpressionActions.cpp @@ -1112,7 +1112,7 @@ void ExpressionActions::optimizeArrayJoin() BlockInputStreamPtr ExpressionActions::createStreamWithNonJoinedDataIfFullOrRightJoin(const Block & source_header, UInt64 max_block_size) const { for (const auto & action : actions) - if (action.join && (action.join->getKind() == ASTTableJoin::Kind::Full || action.join->getKind() == ASTTableJoin::Kind::Right)) + if (action.join && isRightOrFull(action.join->getKind())) return action.join->createStreamWithNonJoinedRows( source_header, action.join_key_names_left, action.columns_added_by_join, max_block_size); diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index c2d8d0f8abc..dcfeaf1f683 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -569,7 +569,7 @@ void InterpreterSelectQuery::executeImpl(Pipeline & pipeline, const BlockInputSt if (expressions.hasJoin()) { const ASTTableJoin & join = static_cast(*query.join()->table_join); - if (join.kind == ASTTableJoin::Kind::Full || join.kind == ASTTableJoin::Kind::Right) + if (isRightOrFull(join.kind)) pipeline.stream_with_non_joined_data = expressions.before_join->createStreamWithNonJoinedDataIfFullOrRightJoin( pipeline.firstStream()->getHeader(), settings.max_block_size); diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index 7b4b1783fa6..7ce39e12a00 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -220,13 +220,6 @@ struct KeyGetterForType }; -/// Do I need to use the hash table maps_*_full, in which we remember whether the row was joined. -static bool getFullness(ASTTableJoin::Kind kind) -{ - return kind == ASTTableJoin::Kind::Right || kind == ASTTableJoin::Kind::Full; -} - - void Join::init(Type type_) { type = type_; @@ -340,7 +333,7 @@ void Join::setSampleBlock(const Block & block) } /// In case of LEFT and FULL joins, if use_nulls, convert joined columns to Nullable. - if (use_nulls && (kind == ASTTableJoin::Kind::Left || kind == ASTTableJoin::Kind::Full)) + if (use_nulls && isLeftOrFull(kind)) for (size_t i = 0; i < num_columns_to_add; ++i) convertColumnToNullable(sample_block_with_columns_to_add.getByPosition(i)); } @@ -476,7 +469,7 @@ bool Join::insertFromBlock(const Block & block) blocks.push_back(block); Block * stored_block = &blocks.back(); - if (getFullness(kind)) + if (isRightOrFull(kind)) { /** Move the key columns to the beginning of the block. * This is where NonJoinedBlockInputStream will expect. @@ -511,9 +504,9 @@ bool Join::insertFromBlock(const Block & block) stored_block->safeGetByPosition(i).column = stored_block->safeGetByPosition(i).column->convertToFullColumnIfConst(); /// In case of LEFT and FULL joins, if use_nulls, convert joined columns to Nullable. - if (use_nulls && (kind == ASTTableJoin::Kind::Left || kind == ASTTableJoin::Kind::Full)) + if (use_nulls && isLeftOrFull(kind)) { - for (size_t i = getFullness(kind) ? keys_size : 0; i < size; ++i) + for (size_t i = isFull(kind) ? keys_size : 0; i < size; ++i) { convertColumnToNullable(stored_block->getByPosition(i)); } @@ -721,7 +714,7 @@ void Join::joinBlockImpl( * Because if they are constants, then in the "not joined" rows, they may have different values * - default values, which can differ from the values of these constants. */ - if (getFullness(kind)) + if (isRightOrFull(kind)) { for (size_t i = 0; i < existing_columns; ++i) { @@ -741,7 +734,7 @@ void Join::joinBlockImpl( * but they will not be used at this stage of joining (and will be in `AdderNonJoined`), and they need to be skipped. */ size_t num_columns_to_skip = 0; - if (getFullness(kind)) + if (isRightOrFull(kind)) num_columns_to_skip = keys_size; /// Add new columns to the block. @@ -798,7 +791,7 @@ void Join::joinBlockImpl( if (strictness == ASTTableJoin::Strictness::Any) { - if (kind == ASTTableJoin::Kind::Inner || kind == ASTTableJoin::Kind::Right) + if (isInnerOrRight(kind)) { /// If ANY INNER | RIGHT JOIN - filter all the columns except the new ones. for (size_t i = 0; i < existing_columns; ++i) diff --git a/dbms/src/Interpreters/SyntaxAnalyzer.cpp b/dbms/src/Interpreters/SyntaxAnalyzer.cpp index 6d274e326b4..bc808c3d37f 100644 --- a/dbms/src/Interpreters/SyntaxAnalyzer.cpp +++ b/dbms/src/Interpreters/SyntaxAnalyzer.cpp @@ -573,7 +573,7 @@ void collectJoinedColumns(AnalyzedJoin & analyzed_join, const ASTSelectQuery & s else if (table_join.on_expression) collectJoinedColumnsFromJoinOnExpr(analyzed_join, table_join); - bool make_nullable = join_use_nulls && (table_join.kind == ASTTableJoin::Kind::Left || table_join.kind == ASTTableJoin::Kind::Full); + bool make_nullable = join_use_nulls && isLeftOrFull(table_join.kind); analyzed_join.calculateAvailableJoinedColumns(make_nullable); } diff --git a/dbms/src/Parsers/ASTTablesInSelectQuery.h b/dbms/src/Parsers/ASTTablesInSelectQuery.h index 4d4d0471ca1..54c97e7f237 100644 --- a/dbms/src/Parsers/ASTTablesInSelectQuery.h +++ b/dbms/src/Parsers/ASTTablesInSelectQuery.h @@ -106,6 +106,11 @@ struct ASTTableJoin : public IAST void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; }; +inline bool isFull(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Full; } +inline bool isRightOrFull(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Right || kind == ASTTableJoin::Kind::Full; } +inline bool isLeftOrFull(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Left || kind == ASTTableJoin::Kind::Full; } +inline bool isInnerOrRight(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Inner || kind == ASTTableJoin::Kind::Right; } + /// Specification of ARRAY JOIN. struct ASTArrayJoin : public IAST From 04f5584d7287c9ffde06a7387fc6d9afc567bb5c Mon Sep 17 00:00:00 2001 From: chertus Date: Mon, 11 Mar 2019 15:20:55 +0300 Subject: [PATCH 236/297] move JOIn convertions to InterpreterSelectQuery --- .../Interpreters/InterpreterSelectQuery.cpp | 42 ++++++++++++++++--- .../src/Interpreters/InterpreterSelectQuery.h | 2 +- dbms/src/Interpreters/executeQuery.cpp | 18 -------- .../00826_cross_to_inner_join.reference | 32 +++++++------- .../0_stateless/00826_cross_to_inner_join.sql | 32 +++++++------- 5 files changed, 69 insertions(+), 57 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index c2d8d0f8abc..0c3a2ae19c6 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include @@ -139,7 +141,6 @@ InterpreterSelectQuery::InterpreterSelectQuery( bool modify_inplace) /// NOTE: the query almost always should be cloned because it will be modified during analysis. : query_ptr(modify_inplace ? query_ptr_ : query_ptr_->clone()) - , query(typeid_cast(*query_ptr)) , context(context_) , to_stage(to_stage_) , subquery_depth(subquery_depth_) @@ -155,7 +156,20 @@ InterpreterSelectQuery::InterpreterSelectQuery( throw Exception("Too deep subqueries. Maximum: " + settings.max_subquery_depth.toString(), ErrorCodes::TOO_DEEP_SUBQUERIES); + if (settings.allow_experimental_multiple_joins_emulation) + { + JoinToSubqueryTransformVisitor::Data join_to_subs_data; + JoinToSubqueryTransformVisitor(join_to_subs_data).visit(query_ptr); + } + + if (settings.allow_experimental_cross_to_join_conversion) + { + CrossToInnerJoinVisitor::Data cross_to_inner; + CrossToInnerJoinVisitor(cross_to_inner).visit(query_ptr); + } + max_streams = settings.max_threads; + ASTSelectQuery & query = selectQuery(); ASTPtr table_expression = extractTableExpression(query, 0); @@ -263,9 +277,15 @@ InterpreterSelectQuery::InterpreterSelectQuery( } +ASTSelectQuery & InterpreterSelectQuery::selectQuery() +{ + return typeid_cast(*query_ptr); +} + + void InterpreterSelectQuery::getDatabaseAndTableNames(String & database_name, String & table_name) { - if (auto db_and_table = getDatabaseAndTable(query, 0)) + if (auto db_and_table = getDatabaseAndTable(selectQuery(), 0)) { table_name = db_and_table->table; database_name = db_and_table->database; @@ -364,6 +384,7 @@ InterpreterSelectQuery::AnalysisResult InterpreterSelectQuery::analyzeExpression { ExpressionActionsChain chain(context); + ASTSelectQuery & query = selectQuery(); Names additional_required_columns_after_prewhere; @@ -487,6 +508,7 @@ void InterpreterSelectQuery::executeImpl(Pipeline & pipeline, const BlockInputSt * then perform the remaining operations with one resulting stream. */ + ASTSelectQuery & query = selectQuery(); const Settings & settings = context.getSettingsRef(); QueryProcessingStage::Enum from_stage = QueryProcessingStage::FetchColumns; @@ -780,6 +802,7 @@ void InterpreterSelectQuery::executeFetchColumns( QueryProcessingStage::Enum processing_stage, Pipeline & pipeline, const PrewhereInfoPtr & prewhere_info, const Names & columns_to_remove_after_prewhere) { + ASTSelectQuery & query = selectQuery(); const Settings & settings = context.getSettingsRef(); /// Actions to calculate ALIAS if required. @@ -1074,7 +1097,7 @@ void InterpreterSelectQuery::executeWhere(Pipeline & pipeline, const ExpressionA { pipeline.transform([&](auto & stream) { - stream = std::make_shared(stream, expression, query.where_expression->getColumnName(), remove_fiter); + stream = std::make_shared(stream, expression, selectQuery().where_expression->getColumnName(), remove_fiter); }); } @@ -1202,7 +1225,7 @@ void InterpreterSelectQuery::executeHaving(Pipeline & pipeline, const Expression { pipeline.transform([&](auto & stream) { - stream = std::make_shared(stream, expression, query.having_expression->getColumnName()); + stream = std::make_shared(stream, expression, selectQuery().having_expression->getColumnName()); }); } @@ -1215,7 +1238,7 @@ void InterpreterSelectQuery::executeTotalsAndHaving(Pipeline & pipeline, bool ha pipeline.firstStream() = std::make_shared( pipeline.firstStream(), overflow_row, expression, - has_having ? query.having_expression->getColumnName() : "", settings.totals_mode, settings.totals_auto_threshold, final); + has_having ? selectQuery().having_expression->getColumnName() : "", settings.totals_mode, settings.totals_auto_threshold, final); } void InterpreterSelectQuery::executeRollupOrCube(Pipeline & pipeline, Modificator modificator) @@ -1280,6 +1303,7 @@ static SortDescription getSortDescription(ASTSelectQuery & query) void InterpreterSelectQuery::executeOrder(Pipeline & pipeline) { + ASTSelectQuery & query = selectQuery(); SortDescription order_descr = getSortDescription(query); UInt64 limit = getLimitForSorting(query, context); @@ -1311,6 +1335,7 @@ void InterpreterSelectQuery::executeOrder(Pipeline & pipeline) void InterpreterSelectQuery::executeMergeSorted(Pipeline & pipeline) { + ASTSelectQuery & query = selectQuery(); SortDescription order_descr = getSortDescription(query); UInt64 limit = getLimitForSorting(query, context); @@ -1347,6 +1372,7 @@ void InterpreterSelectQuery::executeProjection(Pipeline & pipeline, const Expres void InterpreterSelectQuery::executeDistinct(Pipeline & pipeline, bool before_order, Names columns) { + ASTSelectQuery & query = selectQuery(); if (query.distinct) { const Settings & settings = context.getSettingsRef(); @@ -1389,6 +1415,7 @@ void InterpreterSelectQuery::executeUnion(Pipeline & pipeline) /// Preliminary LIMIT - is used in every source, if there are several sources, before they are combined. void InterpreterSelectQuery::executePreLimit(Pipeline & pipeline) { + ASTSelectQuery & query = selectQuery(); /// If there is LIMIT if (query.limit_length) { @@ -1403,6 +1430,7 @@ void InterpreterSelectQuery::executePreLimit(Pipeline & pipeline) void InterpreterSelectQuery::executeLimitBy(Pipeline & pipeline) { + ASTSelectQuery & query = selectQuery(); if (!query.limit_by_value || !query.limit_by_expression_list) return; @@ -1444,6 +1472,7 @@ bool hasWithTotalsInAnySubqueryInFromClause(const ASTSelectQuery & query) void InterpreterSelectQuery::executeLimit(Pipeline & pipeline) { + ASTSelectQuery & query = selectQuery(); /// If there is LIMIT if (query.limit_length) { @@ -1515,12 +1544,13 @@ void InterpreterSelectQuery::unifyStreams(Pipeline & pipeline) void InterpreterSelectQuery::ignoreWithTotals() { - query.group_by_with_totals = false; + selectQuery().group_by_with_totals = false; } void InterpreterSelectQuery::initSettings() { + ASTSelectQuery & query = selectQuery(); if (query.settings) InterpreterSetQuery(query.settings, context).executeForCurrentContext(); } diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.h b/dbms/src/Interpreters/InterpreterSelectQuery.h index 8655f0a9833..89fdc35eb7b 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.h +++ b/dbms/src/Interpreters/InterpreterSelectQuery.h @@ -133,6 +133,7 @@ private: } }; + ASTSelectQuery & selectQuery(); void executeImpl(Pipeline & pipeline, const BlockInputStreamPtr & prepared_input, bool dry_run); @@ -222,7 +223,6 @@ private: void initSettings(); ASTPtr query_ptr; - ASTSelectQuery & query; Context context; QueryProcessingStage::Enum to_stage; size_t subquery_depth = 0; diff --git a/dbms/src/Interpreters/executeQuery.cpp b/dbms/src/Interpreters/executeQuery.cpp index bba4202e7c0..069c5c67abc 100644 --- a/dbms/src/Interpreters/executeQuery.cpp +++ b/dbms/src/Interpreters/executeQuery.cpp @@ -21,8 +21,6 @@ #include #include -#include -#include #include #include #include @@ -200,22 +198,6 @@ static std::tuple executeQueryImpl( { logQuery(query.substr(0, settings.log_queries_cut_to_length), context, internal); - if (!internal && settings.allow_experimental_multiple_joins_emulation) - { - JoinToSubqueryTransformVisitor::Data join_to_subs_data; - JoinToSubqueryTransformVisitor(join_to_subs_data).visit(ast); - if (join_to_subs_data.done) - logQuery(queryToString(*ast), context, internal); - } - - if (!internal && settings.allow_experimental_cross_to_join_conversion) - { - CrossToInnerJoinVisitor::Data cross_to_inner; - CrossToInnerJoinVisitor(cross_to_inner).visit(ast); - if (cross_to_inner.done) - logQuery(queryToString(*ast), context, internal); - } - /// Check the limits. checkASTSizeLimits(*ast, settings); diff --git a/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference b/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference index 93cdf438a0f..024026d2c8c 100644 --- a/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference +++ b/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference @@ -56,26 +56,26 @@ comma nullable 1 1 1 1 2 2 1 2 cross -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 2)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n TableExpression (children 1)\n Identifier t2\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = t2.a +SELECT *\nFROM t1 \nALL INNER JOIN t2 ON t1.a = t2.a cross nullable -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 2)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n TableExpression (children 1)\n Identifier t2\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \n, t2 \nWHERE a = t2.a +SELECT *\nFROM t1 \nALL INNER JOIN t2 ON t1.a = t2.a cross nullable vs not nullable -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.b\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 2)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.b\n TableExpression (children 1)\n Identifier t2\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = t2.b +SELECT *\nFROM t1 \nALL INNER JOIN t2 ON t1.a = t2.b cross self -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1 (alias x)\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t1 (alias y)\n TableJoin\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier x.a\n Identifier y.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier x.b\n Identifier y.b\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 2)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1 (alias x)\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier x.a\n Identifier y.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier x.b\n Identifier y.b\n TableExpression (children 1)\n Identifier t1 (alias y)\n +SELECT \n a, \n b, \n y.a, \n y.b\nFROM t1 AS x \nCROSS JOIN t1 AS y \nWHERE (a = y.a) AND (b = y.b) +SELECT *\nFROM t1 AS x \nALL INNER JOIN t1 AS y ON (x.a = y.a) AND (x.b = y.b) cross one table expr -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t1.b\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t1.b\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = b +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = b cross multiple ands -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 2)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n TableExpression (children 1)\n Identifier t2\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE (a = t2.a) AND (b = t2.b) +SELECT *\nFROM t1 \nALL INNER JOIN t2 ON (t1.a = t2.a) AND (t1.b = t2.b) cross and inside and -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 2)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function and (children 1)\n ExpressionList (children 4)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n TableExpression (children 1)\n Identifier t2\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE (a = t2.a) AND ((a = t2.a) AND ((a = t2.a) AND (b = t2.b))) +SELECT *\nFROM t1 \nALL INNER JOIN t2 ON (t1.a = t2.a) AND (t1.a = t2.a) AND (t1.a = t2.a) AND (t1.b = t2.b) cross split conjunction -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableExpression (children 1)\n Identifier t2\n TableJoin\n Function and (children 1)\n ExpressionList (children 4)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n Function greaterOrEquals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Literal UInt64_1\n Function greater (children 1)\n ExpressionList (children 2)\n Identifier t2.b\n Literal UInt64_0\n -Explain ParsedAST (children 1)\n SelectWithUnionQuery (children 1)\n ExpressionList (children 1)\n SelectQuery (children 3)\n ExpressionList (children 1)\n Asterisk\n TablesInSelectQuery (children 2)\n TablesInSelectQueryElement (children 1)\n TableExpression (children 1)\n Identifier t1\n TablesInSelectQueryElement (children 2)\n TableJoin (children 1)\n Function and (children 1)\n ExpressionList (children 2)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n TableExpression (children 1)\n Identifier t2\n Function and (children 1)\n ExpressionList (children 4)\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Identifier t2.a\n Function equals (children 1)\n ExpressionList (children 2)\n Identifier t1.b\n Identifier t2.b\n Function greaterOrEquals (children 1)\n ExpressionList (children 2)\n Identifier t1.a\n Literal UInt64_1\n Function greater (children 1)\n ExpressionList (children 2)\n Identifier t2.b\n Literal UInt64_0\n +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE (a = t2.a) AND (b = t2.b) AND (a >= 1) AND (t2.b > 0) +SELECT *\nFROM t1 \nALL INNER JOIN t2 ON (t1.a = t2.a) AND (t1.b = t2.b)\nWHERE (t1.a = t2.a) AND (t1.b = t2.b) AND (t1.a >= 1) AND (t2.b > 0) diff --git a/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.sql b/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.sql index 218ea1f1e45..b84cb268107 100644 --- a/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.sql +++ b/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.sql @@ -69,30 +69,30 @@ SELECT * FROM t1, t2 where t1.b = t2.b; SELECT 'cross'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a; SELECT 'cross nullable'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1, t2 where t1.a = t2.a; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1, t2 where t1.a = t2.a; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1, t2 where t1.a = t2.a; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1, t2 where t1.a = t2.a; SELECT 'cross nullable vs not nullable'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 cross join t2 where t1.a = t2.b; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 cross join t2 where t1.a = t2.b; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.b; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.b; SELECT 'cross self'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 x cross join t1 y where x.a = y.a and x.b = y.b; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 x cross join t1 y where x.a = y.a and x.b = y.b; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 x cross join t1 y where x.a = y.a and x.b = y.b; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 x cross join t1 y where x.a = y.a and x.b = y.b; SELECT 'cross one table expr'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 cross join t2 where t1.a = t1.b; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 cross join t2 where t1.a = t1.b; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t1.b; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t1.b; SELECT 'cross multiple ands'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b; SELECT 'cross and inside and'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a and (t1.a = t2.a and (t1.a = t2.a and t1.b = t2.b)); -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a and (t1.a = t2.a and (t1.a = t2.a and t1.b = t2.b)); +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a and (t1.a = t2.a and (t1.a = t2.a and t1.b = t2.b)); +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a and (t1.a = t2.a and (t1.a = t2.a and t1.b = t2.b)); SELECT 'cross split conjunction'; -SET allow_experimental_cross_to_join_conversion = 0; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b and t1.a >= 1 and t2.b > 0; -SET allow_experimental_cross_to_join_conversion = 1; AST SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b and t1.a >= 1 and t2.b > 0; +SET allow_experimental_cross_to_join_conversion = 0; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b and t1.a >= 1 and t2.b > 0; +SET allow_experimental_cross_to_join_conversion = 1; ANALYZE SELECT * FROM t1 cross join t2 where t1.a = t2.a and t1.b = t2.b and t1.a >= 1 and t2.b > 0; DROP TABLE t1; DROP TABLE t2; From c089d5b88a57d68cce145242c7a58a3fd9a23fdc Mon Sep 17 00:00:00 2001 From: chertus Date: Mon, 11 Mar 2019 16:08:51 +0300 Subject: [PATCH 237/297] CrossToInnerJoinVisitor before JoinToSubqueryTransformVisitor --- dbms/src/Interpreters/InterpreterSelectQuery.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index 0c3a2ae19c6..cfdc5da4f2e 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -156,18 +156,18 @@ InterpreterSelectQuery::InterpreterSelectQuery( throw Exception("Too deep subqueries. Maximum: " + settings.max_subquery_depth.toString(), ErrorCodes::TOO_DEEP_SUBQUERIES); - if (settings.allow_experimental_multiple_joins_emulation) - { - JoinToSubqueryTransformVisitor::Data join_to_subs_data; - JoinToSubqueryTransformVisitor(join_to_subs_data).visit(query_ptr); - } - if (settings.allow_experimental_cross_to_join_conversion) { CrossToInnerJoinVisitor::Data cross_to_inner; CrossToInnerJoinVisitor(cross_to_inner).visit(query_ptr); } + if (settings.allow_experimental_multiple_joins_emulation) + { + JoinToSubqueryTransformVisitor::Data join_to_subs_data; + JoinToSubqueryTransformVisitor(join_to_subs_data).visit(query_ptr); + } + max_streams = settings.max_threads; ASTSelectQuery & query = selectQuery(); From b5efce5b8a40275d24c353c629d43533b7f4761d Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 11 Mar 2019 16:10:47 +0300 Subject: [PATCH 238/297] Freebsd build fix (#4650) * Update contrib/cppkafka * Fix * Freebsd build fix --- dbms/src/Common/PODArray.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Common/PODArray.h b/dbms/src/Common/PODArray.h index a7b8b02bb98..0e7d547a7d0 100644 --- a/dbms/src/Common/PODArray.h +++ b/dbms/src/Common/PODArray.h @@ -173,10 +173,10 @@ protected: /// The operation is slow and performed only for debug builds. void protectImpl(int prot) { - static constexpr size_t PAGE_SIZE = 4096; + static constexpr size_t PROTECT_PAGE_SIZE = 4096; - char * left_rounded_up = reinterpret_cast((reinterpret_cast(c_start) - pad_left + PAGE_SIZE - 1) / PAGE_SIZE * PAGE_SIZE); - char * right_rounded_down = reinterpret_cast((reinterpret_cast(c_end_of_storage) + pad_right) / PAGE_SIZE * PAGE_SIZE); + char * left_rounded_up = reinterpret_cast((reinterpret_cast(c_start) - pad_left + PROTECT_PAGE_SIZE - 1) / PROTECT_PAGE_SIZE * PROTECT_PAGE_SIZE); + char * right_rounded_down = reinterpret_cast((reinterpret_cast(c_end_of_storage) + pad_right) / PROTECT_PAGE_SIZE * PROTECT_PAGE_SIZE); if (right_rounded_down > left_rounded_up) { From b0c6d213469927bdcd27fdfe331807cd8cdfaf4f Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 11 Mar 2019 16:33:17 +0300 Subject: [PATCH 239/297] Update cli.md --- docs/ru/interfaces/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/interfaces/cli.md b/docs/ru/interfaces/cli.md index 4cb4742078e..2523bc0395c 100644 --- a/docs/ru/interfaces/cli.md +++ b/docs/ru/interfaces/cli.md @@ -103,7 +103,7 @@ cat file.csv | clickhouse-client --database=test --query="INSERT INTO test FORMA - Определенного параметром `--config-file`. - `./clickhouse-client.xml` -- `\~/.clickhouse-client/config.xml` +- `~/.clickhouse-client/config.xml` - `/etc/clickhouse-client/config.xml` Пример конфигурационного файла: From c8ce2cf23ecfe6d5a158b8d4ac895d3cdfc89f6f Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 11 Mar 2019 16:33:49 +0300 Subject: [PATCH 240/297] Update cli.md --- docs/en/interfaces/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/interfaces/cli.md b/docs/en/interfaces/cli.md index 632049b5901..b2b88870ddb 100644 --- a/docs/en/interfaces/cli.md +++ b/docs/en/interfaces/cli.md @@ -100,7 +100,7 @@ You can pass parameters to `clickhouse-client` (all parameters have a default va - Defined in the `-config-file` parameter. - `./clickhouse-client.xml` -- `\~/.clickhouse-client/config.xml` +- `~/.clickhouse-client/config.xml` - `/etc/clickhouse-client/config.xml` Example of a config file: From fb2620aeae3d60be92877c9a8fd3b8fb37282103 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 11 Mar 2019 16:34:28 +0300 Subject: [PATCH 241/297] Update configuration_files.md --- docs/ru/operations/configuration_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/operations/configuration_files.md b/docs/ru/operations/configuration_files.md index ebb95652d61..9514734678d 100644 --- a/docs/ru/operations/configuration_files.md +++ b/docs/ru/operations/configuration_files.md @@ -2,7 +2,7 @@ Основной конфигурационный файл сервера - `config.xml`. Он расположен в директории `/etc/clickhouse-server/`. -Отдельные настройки могут быть переопределены в файлах `*.xml` и `*.conf` из директорий `conf.d` и `config.d` рядом с конфигом. +Отдельные настройки могут быть переопределены в файлах `*.xml` и `*.conf` из директории `config.d` рядом с конфигом. У элементов этих конфигурационных файлов могут быть указаны атрибуты `replace` или `remove`. From 0f33986c1f2799eca24874bcb4004da40fa022f0 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Mon, 11 Mar 2019 16:35:00 +0300 Subject: [PATCH 242/297] Update configuration_files.md --- docs/en/operations/configuration_files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/configuration_files.md b/docs/en/operations/configuration_files.md index 2184bb95122..1ee72ab188e 100644 --- a/docs/en/operations/configuration_files.md +++ b/docs/en/operations/configuration_files.md @@ -2,7 +2,7 @@ The main server config file is `config.xml`. It resides in the `/etc/clickhouse-server/` directory. -Individual settings can be overridden in the `*.xml` and `*.conf` files in the `conf.d` and `config.d` directories next to the config file. +Individual settings can be overridden in the `*.xml` and `*.conf` files in the `config.d` directory next to the config file. The `replace` or `remove` attributes can be specified for the elements of these config files. From f945c784c54f2d31f15cc0fa11cb3f18be74ebf2 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 11 Mar 2019 16:38:54 +0300 Subject: [PATCH 243/297] toc fix --- docs/toc_en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/toc_en.yml b/docs/toc_en.yml index 886721763a1..a67bc9cd309 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -115,7 +115,7 @@ nav: - 'Working with Arrays': 'query_language/functions/array_functions.md' - 'Splitting and Merging Strings and Arrays': 'query_language/functions/splitting_merging_functions.md' - 'Bit': 'query_language/functions/bit_functions.md' - - 'Bitmap functions': 'query_language/functions/bitmap_functions.md' + - 'Bitmap': 'query_language/functions/bitmap_functions.md' - 'Hash': 'query_language/functions/hash_functions.md' - 'Generating Pseudo-Random Numbers': 'query_language/functions/random_functions.md' - 'Encoding': 'query_language/functions/encoding_functions.md' From 571abfffd4df12e9d83e64f13dd367422d7396a3 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 11 Mar 2019 16:43:08 +0300 Subject: [PATCH 244/297] fix build --- docs/en/operations/system_tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index c6d90c89cb1..8387818043e 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -87,7 +87,7 @@ Columns: ## system.graphite_retentions -Contains information about parameters [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) which use in tables with [\*GraphiteMergeTree](table_engines/graphitemergetree.md) engines. +Contains information about parameters [graphite_rollup](server_settings/settings.md#server_settings-graphite_rollup) which use in tables with [\*GraphiteMergeTree](table_engines/graphitemergetree.md) engines. Столбцы: - `config_name` (String) - `graphite_rollup` parameter name. From e7cb81450807a5f3b7fc86997bc3d21425c555cd Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 11 Mar 2019 16:47:32 +0300 Subject: [PATCH 245/297] fix build --- docs/ru/operations/system_tables.md | 2 +- docs/toc_zh.yml | 1 + docs/zh/query_language/functions/bitmap_functions.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 120000 docs/zh/query_language/functions/bitmap_functions.md diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index 7a4e69ca1cd..91d3991edcd 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -86,7 +86,7 @@ default_expression String - выражение для значения по ум ## system.graphite_retentions -Содержит информацию о том, какие параметры [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) используются в таблицах с движками [\*GraphiteMergeTree](table_engines/graphitemergetree.md). +Содержит информацию о том, какие параметры [graphite_rollup](server_settings/settings.md#server_settings-graphite_rollup) используются в таблицах с движками [\*GraphiteMergeTree](table_engines/graphitemergetree.md). Столбцы: - `config_name` (String) - Имя параметра, используемого для `graphite_rollup`. diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 64cb2446f41..81866ae7af8 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -114,6 +114,7 @@ nav: - 'Working with Arrays': 'query_language/functions/array_functions.md' - 'Splitting and Merging Strings and Arrays': 'query_language/functions/splitting_merging_functions.md' - 'Bit': 'query_language/functions/bit_functions.md' + - 'Bitmap': 'query_language/functions/bitmap_functions.md' - 'Hash': 'query_language/functions/hash_functions.md' - 'Generating Pseudo-Random Numbers': 'query_language/functions/random_functions.md' - 'Encoding': 'query_language/functions/encoding_functions.md' diff --git a/docs/zh/query_language/functions/bitmap_functions.md b/docs/zh/query_language/functions/bitmap_functions.md new file mode 120000 index 00000000000..0a31d3d71d8 --- /dev/null +++ b/docs/zh/query_language/functions/bitmap_functions.md @@ -0,0 +1 @@ +../../../en/query_language/functions/bitmap_functions.md \ No newline at end of file From 2029f71869f47db6e9bc289fe66fa8d10298253c Mon Sep 17 00:00:00 2001 From: bgranvea Date: Mon, 11 Mar 2019 17:50:31 +0100 Subject: [PATCH 246/297] support for CREATE OR REPLACE VIEW --- dbms/src/Databases/DatabasesCommon.cpp | 1 + dbms/src/Interpreters/InterpreterCreateQuery.cpp | 12 ++++++++++++ dbms/src/Interpreters/InterpreterDropQuery.cpp | 8 ++++---- dbms/src/Interpreters/InterpreterDropQuery.h | 2 +- dbms/src/Parsers/ASTCreateQuery.h | 2 ++ dbms/src/Parsers/ASTDropQuery.h | 3 +++ dbms/src/Parsers/ParserCreateQuery.cpp | 12 ++++++++++-- dbms/src/Parsers/ParserCreateQuery.h | 2 +- .../00916_create_or_replace_view.reference | 2 ++ .../0_stateless/00916_create_or_replace_view.sql | 6 ++++++ 10 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference create mode 100644 dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql diff --git a/dbms/src/Databases/DatabasesCommon.cpp b/dbms/src/Databases/DatabasesCommon.cpp index 780140969ad..006d65ede7b 100644 --- a/dbms/src/Databases/DatabasesCommon.cpp +++ b/dbms/src/Databases/DatabasesCommon.cpp @@ -35,6 +35,7 @@ String getTableDefinitionFromCreateQuery(const ASTPtr & query) create.as_table.clear(); create.if_not_exists = false; create.is_populate = false; + create.replace_view = false; /// For views it is necessary to save the SELECT query itself, for the rest - on the contrary if (!create.is_view && !create.is_materialized_view) diff --git a/dbms/src/Interpreters/InterpreterCreateQuery.cpp b/dbms/src/Interpreters/InterpreterCreateQuery.cpp index 69415378dd6..e4eb78c2b01 100644 --- a/dbms/src/Interpreters/InterpreterCreateQuery.cpp +++ b/dbms/src/Interpreters/InterpreterCreateQuery.cpp @@ -45,6 +45,7 @@ #include #include +#include namespace DB @@ -623,6 +624,17 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create) { if (create.if_not_exists) return {}; + else if (create.replace_view) + { + /// when executing CREATE OR REPLACE VIEW, drop current existing view + auto drop_ast = std::make_shared(); + drop_ast->database = database_name; + drop_ast->table = table_name; + drop_ast->no_ddl_lock = true; + + InterpreterDropQuery interpreter(drop_ast, context); + interpreter.execute(); + } else throw Exception("Table " + database_name + "." + table_name + " already exists.", ErrorCodes::TABLE_ALREADY_EXISTS); } diff --git a/dbms/src/Interpreters/InterpreterDropQuery.cpp b/dbms/src/Interpreters/InterpreterDropQuery.cpp index dcb892d4528..cc422c445fc 100644 --- a/dbms/src/Interpreters/InterpreterDropQuery.cpp +++ b/dbms/src/Interpreters/InterpreterDropQuery.cpp @@ -39,7 +39,7 @@ BlockIO InterpreterDropQuery::execute() return executeDDLQueryOnCluster(query_ptr, context, {drop.database}); if (!drop.table.empty()) - return executeToTable(drop.database, drop.table, drop.kind, drop.if_exists, drop.temporary); + return executeToTable(drop.database, drop.table, drop.kind, drop.if_exists, drop.temporary, drop.no_ddl_lock); else if (!drop.database.empty()) return executeToDatabase(drop.database, drop.kind, drop.if_exists); else @@ -47,7 +47,7 @@ BlockIO InterpreterDropQuery::execute() } -BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & table_name, ASTDropQuery::Kind kind, bool if_exists, bool if_temporary) +BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & table_name, ASTDropQuery::Kind kind, bool if_exists, bool if_temporary, bool no_ddl_lock) { if (if_temporary || database_name_.empty()) { @@ -59,7 +59,7 @@ BlockIO InterpreterDropQuery::executeToTable(String & database_name_, String & t String database_name = database_name_.empty() ? context.getCurrentDatabase() : database_name_; - auto ddl_guard = context.getDDLGuard(database_name, table_name); + auto ddl_guard = (!no_ddl_lock ? context.getDDLGuard(database_name, table_name) : nullptr); DatabaseAndTable database_and_table = tryGetDatabaseAndTable(database_name, table_name, if_exists); @@ -166,7 +166,7 @@ BlockIO InterpreterDropQuery::executeToDatabase(String & database_name, ASTDropQ for (auto iterator = database->getIterator(context); iterator->isValid(); iterator->next()) { String current_table_name = iterator->table()->getTableName(); - executeToTable(database_name, current_table_name, kind, false, false); + executeToTable(database_name, current_table_name, kind, false, false, false); } auto context_lock = context.getLock(); diff --git a/dbms/src/Interpreters/InterpreterDropQuery.h b/dbms/src/Interpreters/InterpreterDropQuery.h index 2bea9f85c99..986c73f8465 100644 --- a/dbms/src/Interpreters/InterpreterDropQuery.h +++ b/dbms/src/Interpreters/InterpreterDropQuery.h @@ -32,7 +32,7 @@ private: BlockIO executeToDatabase(String & database_name, ASTDropQuery::Kind kind, bool if_exists); - BlockIO executeToTable(String & database_name, String & table_name, ASTDropQuery::Kind kind, bool if_exists, bool if_temporary); + BlockIO executeToTable(String & database_name, String & table_name, ASTDropQuery::Kind kind, bool if_exists, bool if_temporary, bool no_ddl_lock); DatabasePtr tryGetDatabase(String & database_name, bool exists); diff --git a/dbms/src/Parsers/ASTCreateQuery.h b/dbms/src/Parsers/ASTCreateQuery.h index 6be7451529d..5b6d7398452 100644 --- a/dbms/src/Parsers/ASTCreateQuery.h +++ b/dbms/src/Parsers/ASTCreateQuery.h @@ -180,6 +180,7 @@ public: bool is_view{false}; bool is_materialized_view{false}; bool is_populate{false}; + bool replace_view{false}; /// CREATE OR REPLACE VIEW ASTColumns * columns_list = nullptr; String to_database; /// For CREATE MATERIALIZED VIEW mv TO table. String to_table; @@ -244,6 +245,7 @@ protected: << (settings.hilite ? hilite_keyword : "") << (attach ? "ATTACH " : "CREATE ") << (temporary ? "TEMPORARY " : "") + << (replace_view ? "OR REPLACE " : "") << what << " " << (if_not_exists ? "IF NOT EXISTS " : "") << (settings.hilite ? hilite_none : "") diff --git a/dbms/src/Parsers/ASTDropQuery.h b/dbms/src/Parsers/ASTDropQuery.h index 1c230e30aea..fce4cee8131 100644 --- a/dbms/src/Parsers/ASTDropQuery.h +++ b/dbms/src/Parsers/ASTDropQuery.h @@ -22,6 +22,9 @@ public: Kind kind; bool if_exists{false}; + /// Useful if we already have a DDL lock + bool no_ddl_lock{false}; + /** Get the text that identifies this element. */ String getID(char) const override; ASTPtr clone() const override; diff --git a/dbms/src/Parsers/ParserCreateQuery.cpp b/dbms/src/Parsers/ParserCreateQuery.cpp index fe343b31618..5a8ad919b58 100644 --- a/dbms/src/Parsers/ParserCreateQuery.cpp +++ b/dbms/src/Parsers/ParserCreateQuery.cpp @@ -298,6 +298,7 @@ bool ParserCreateQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) ParserKeyword s_view("VIEW"); ParserKeyword s_materialized("MATERIALIZED"); ParserKeyword s_populate("POPULATE"); + ParserKeyword s_or_replace("OR REPLACE"); ParserToken s_dot(TokenType::Dot); ParserToken s_lparen(TokenType::OpeningRoundBracket); ParserToken s_rparen(TokenType::ClosingRoundBracket); @@ -322,6 +323,7 @@ bool ParserCreateQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) bool is_materialized_view = false; bool is_populate = false; bool is_temporary = false; + bool replace_view = false; if (!s_create.ignore(pos, expected)) { @@ -432,7 +434,12 @@ bool ParserCreateQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) else { /// VIEW or MATERIALIZED VIEW - if (s_materialized.ignore(pos, expected)) + if (s_or_replace.ignore(pos, expected)) + { + replace_view = true; + } + + if (!replace_view && s_materialized.ignore(pos, expected)) { is_materialized_view = true; } @@ -442,7 +449,7 @@ bool ParserCreateQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) if (!s_view.ignore(pos, expected)) return false; - if (s_if_not_exists.ignore(pos, expected)) + if (!replace_view && s_if_not_exists.ignore(pos, expected)) if_not_exists = true; if (!name_p.parse(pos, table, expected)) @@ -512,6 +519,7 @@ bool ParserCreateQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) query->is_materialized_view = is_materialized_view; query->is_populate = is_populate; query->temporary = is_temporary; + query->replace_view = replace_view; getIdentifierName(database, query->database); getIdentifierName(table, query->table); diff --git a/dbms/src/Parsers/ParserCreateQuery.h b/dbms/src/Parsers/ParserCreateQuery.h index 46dee1c8fa3..140a153e990 100644 --- a/dbms/src/Parsers/ParserCreateQuery.h +++ b/dbms/src/Parsers/ParserCreateQuery.h @@ -285,7 +285,7 @@ protected: * CREATE|ATTACH DATABASE db [ENGINE = engine] * * Or: - * CREATE|ATTACH [MATERIALIZED] VIEW [IF NOT EXISTS] [db.]name [TO [db.]name] [ENGINE = engine] [POPULATE] AS SELECT ... + * CREATE [OR REPLACE]|ATTACH [MATERIALIZED] VIEW [IF NOT EXISTS] [db.]name [TO [db.]name] [ENGINE = engine] [POPULATE] AS SELECT ... */ class ParserCreateQuery : public IParserBase { diff --git a/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference new file mode 100644 index 00000000000..67943761a47 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference @@ -0,0 +1,2 @@ +CREATE VIEW test.t ( number UInt64) AS SELECT number FROM system.numbers +CREATE VIEW test.t ( next_number UInt64) AS SELECT number + 1 FROM system.numbers diff --git a/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql new file mode 100644 index 00000000000..a246a53cf50 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql @@ -0,0 +1,6 @@ +DROP TABLE IF EXISTS test.t; + +CREATE OR REPLACE VIEW test.t (number UInt64) AS SELECT number FROM system.numbers; +SHOW CREATE TABLE test.t; +CREATE OR REPLACE VIEW test.t (next_number UInt64) AS SELECT number+1 FROM system.numbers; +SHOW CREATE TABLE test.t; From 95d6154e8adc764e5a57afda693db033d21cb904 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 20:54:01 +0300 Subject: [PATCH 247/297] Better link --- website/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.html b/website/index.html index 55badbf2363..9f59864002e 100644 --- a/website/index.html +++ b/website/index.html @@ -319,7 +319,7 @@
  • ClickHouse for Experimentation at Spotify
  • ClickHouse DB in DDoS mitigation
  • + rel="external nofollow" target="_blank">ClickHouse DB in DDoS mitigation at Qrator
  • Migrating to Yandex ClickHouse by LifeStreet (machine translation from Russian)
  • Date: Mon, 11 Mar 2019 21:03:32 +0300 Subject: [PATCH 248/297] Build fixes (#4655) --- dbms/programs/CMakeLists.txt | 29 ++++++++++++------------ dbms/programs/clickhouse | 6 +++++ dbms/programs/copier/CMakeLists.txt | 4 ++-- dbms/programs/main.cpp | 6 ----- dbms/programs/odbc-bridge/CMakeLists.txt | 2 +- 5 files changed, 24 insertions(+), 23 deletions(-) create mode 100755 dbms/programs/clickhouse diff --git a/dbms/programs/CMakeLists.txt b/dbms/programs/CMakeLists.txt index 57067074527..94953a49226 100644 --- a/dbms/programs/CMakeLists.txt +++ b/dbms/programs/CMakeLists.txt @@ -22,7 +22,6 @@ endif() configure_file (config_tools.h.in ${CMAKE_CURRENT_BINARY_DIR}/config_tools.h) - macro(clickhouse_target_link_split_lib target name) if(NOT CLICKHOUSE_ONE_SHARED) target_link_libraries(${target} PRIVATE clickhouse-${name}-lib) @@ -91,9 +90,9 @@ endif () if (CLICKHOUSE_ONE_SHARED) add_library(clickhouse-lib SHARED ${CLICKHOUSE_SERVER_SOURCES} ${CLICKHOUSE_CLIENT_SOURCES} ${CLICKHOUSE_LOCAL_SOURCES} ${CLICKHOUSE_BENCHMARK_SOURCES} ${CLICKHOUSE_PERFORMANCE_TEST_SOURCES} ${CLICKHOUSE_COPIER_SOURCES} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_SOURCES} ${CLICKHOUSE_COMPRESSOR_SOURCES} ${CLICKHOUSE_FORMAT_SOURCES} ${CLICKHOUSE_OBFUSCATOR_SOURCES} ${CLICKHOUSE_COMPILER_SOURCES} ${CLICKHOUSE_ODBC_BRIDGE_SOURCES}) - target_link_libraries(clickhouse-lib PUBLIC ${CLICKHOUSE_SERVER_LINK} ${CLICKHOUSE_CLIENT_LINK} ${CLICKHOUSE_LOCAL_LINK} ${CLICKHOUSE_BENCHMARK_LINK} ${CLICKHOUSE_PERFORMANCE_TEST_LINK} ${CLICKHOUSE_COPIER_LINK} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_LINK} ${CLICKHOUSE_COMPRESSOR_LINK} ${CLICKHOUSE_FORMAT_LINK} ${CLICKHOUSE_OBFUSCATOR_LINK} ${CLICKHOUSE_COMPILER_LINK} ${CLICKHOUSE_ODBC_BRIDGE_LINK}) - set_target_properties(clickhouse-lib PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse) + target_link_libraries(clickhouse-lib ${CLICKHOUSE_SERVER_LINK} ${CLICKHOUSE_CLIENT_LINK} ${CLICKHOUSE_LOCAL_LINK} ${CLICKHOUSE_BENCHMARK_LINK} ${CLICKHOUSE_PERFORMANCE_TEST_LINK} ${CLICKHOUSE_COPIER_LINK} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_LINK} ${CLICKHOUSE_COMPRESSOR_LINK} ${CLICKHOUSE_FORMAT_LINK} ${CLICKHOUSE_OBFUSCATOR_LINK} ${CLICKHOUSE_COMPILER_LINK} ${CLICKHOUSE_ODBC_BRIDGE_LINK}) target_include_directories(clickhouse-lib ${CLICKHOUSE_SERVER_INCLUDE} ${CLICKHOUSE_CLIENT_INCLUDE} ${CLICKHOUSE_LOCAL_INCLUDE} ${CLICKHOUSE_BENCHMARK_INCLUDE} ${CLICKHOUSE_PERFORMANCE_TEST_INCLUDE} ${CLICKHOUSE_COPIER_INCLUDE} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_INCLUDE} ${CLICKHOUSE_COMPRESSOR_INCLUDE} ${CLICKHOUSE_FORMAT_INCLUDE} ${CLICKHOUSE_OBFUSCATOR_INCLUDE} ${CLICKHOUSE_COMPILER_INCLUDE} ${CLICKHOUSE_ODBC_BRIDGE_INCLUDE}) + set_target_properties(clickhouse-lib PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse) endif() if (CLICKHOUSE_SPLIT_BINARY) @@ -112,6 +111,8 @@ if (CLICKHOUSE_SPLIT_BINARY) add_custom_target (clickhouse-bundle ALL DEPENDS ${CLICKHOUSE_ALL_TARGETS}) add_custom_target (clickhouse ALL DEPENDS clickhouse-bundle) + + install (PROGRAMS clickhouse DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse) else () if (USE_EMBEDDED_COMPILER) # before add_executable ! @@ -123,37 +124,37 @@ else () target_include_directories (clickhouse PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) if (ENABLE_CLICKHOUSE_SERVER) - target_link_libraries (clickhouse PRIVATE clickhouse-server-lib) + clickhouse_target_link_split_lib(clickhouse server) endif () if (ENABLE_CLICKHOUSE_CLIENT) - target_link_libraries (clickhouse PRIVATE clickhouse-client-lib) + clickhouse_target_link_split_lib(clickhouse client) endif () if (ENABLE_CLICKHOUSE_LOCAL) - target_link_libraries (clickhouse PRIVATE clickhouse-local-lib) + clickhouse_target_link_split_lib(clickhouse local) endif () if (ENABLE_CLICKHOUSE_BENCHMARK) - target_link_libraries (clickhouse PRIVATE clickhouse-benchmark-lib) + clickhouse_target_link_split_lib(clickhouse benchmark) endif () if (ENABLE_CLICKHOUSE_PERFORMANCE_TEST) - target_link_libraries (clickhouse PRIVATE clickhouse-performance-test-lib) + clickhouse_target_link_split_lib(clickhouse performance-test) endif () if (ENABLE_CLICKHOUSE_COPIER) - target_link_libraries (clickhouse PRIVATE clickhouse-copier-lib) + clickhouse_target_link_split_lib(clickhouse copier) endif () if (ENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG) - target_link_libraries (clickhouse PRIVATE clickhouse-extract-from-config-lib) + clickhouse_target_link_split_lib(clickhouse extract-from-config) endif () if (ENABLE_CLICKHOUSE_COMPRESSOR) - target_link_libraries (clickhouse PRIVATE clickhouse-compressor-lib) + clickhouse_target_link_split_lib(clickhouse compressor) endif () if (ENABLE_CLICKHOUSE_FORMAT) - target_link_libraries (clickhouse PRIVATE clickhouse-format-lib) + clickhouse_target_link_split_lib(clickhouse format) endif () if (ENABLE_CLICKHOUSE_OBFUSCATOR) - target_link_libraries (clickhouse PRIVATE clickhouse-obfuscator-lib) + clickhouse_target_link_split_lib(clickhouse obfuscator) endif () if (USE_EMBEDDED_COMPILER) - target_link_libraries (clickhouse PRIVATE clickhouse-compiler-lib) + clickhouse_target_link_split_lib(clickhouse compiler) endif () set (CLICKHOUSE_BUNDLE) diff --git a/dbms/programs/clickhouse b/dbms/programs/clickhouse new file mode 100755 index 00000000000..2495160e02a --- /dev/null +++ b/dbms/programs/clickhouse @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e +CMD=$1 +shift +clickhouse-$CMD $* diff --git a/dbms/programs/copier/CMakeLists.txt b/dbms/programs/copier/CMakeLists.txt index 1be75dff22d..55b2fc7e1cb 100644 --- a/dbms/programs/copier/CMakeLists.txt +++ b/dbms/programs/copier/CMakeLists.txt @@ -1,5 +1,5 @@ set(CLICKHOUSE_COPIER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ClusterCopier.cpp) -set(CLICKHOUSE_COPIER_LINK PRIVATE clickhouse_functions clickhouse_table_functions clickhouse_aggregate_functions daemon) -#set(CLICKHOUSE_COPIER_INCLUDE SYSTEM PRIVATE ...) +set(CLICKHOUSE_COPIER_LINK PRIVATE clickhouse_functions clickhouse_table_functions clickhouse_aggregate_functions PUBLIC daemon) +set(CLICKHOUSE_COPIER_INCLUDE SYSTEM PRIVATE ${PCG_RANDOM_INCLUDE_DIR}) clickhouse_program_add(copier) diff --git a/dbms/programs/main.cpp b/dbms/programs/main.cpp index 9ee2df0fab6..34b04a0d7fe 100644 --- a/dbms/programs/main.cpp +++ b/dbms/programs/main.cpp @@ -17,12 +17,6 @@ #include // Y_IGNORE #endif -#if ENABLE_CLICKHOUSE_SERVER -#include "server/Server.h" -#endif -#if ENABLE_CLICKHOUSE_LOCAL -#include "local/LocalServer.h" -#endif #include /// Universal executable for various clickhouse applications diff --git a/dbms/programs/odbc-bridge/CMakeLists.txt b/dbms/programs/odbc-bridge/CMakeLists.txt index b32fe363b73..143d7edf738 100644 --- a/dbms/programs/odbc-bridge/CMakeLists.txt +++ b/dbms/programs/odbc-bridge/CMakeLists.txt @@ -11,7 +11,7 @@ set(CLICKHOUSE_ODBC_BRIDGE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/validateODBCConnectionString.cpp ) -set(CLICKHOUSE_ODBC_BRIDGE_LINK PRIVATE daemon dbms clickhouse_common_io) +set(CLICKHOUSE_ODBC_BRIDGE_LINK PRIVATE dbms clickhouse_common_io PUBLIC daemon) set(CLICKHOUSE_ODBC_BRIDGE_INCLUDE PUBLIC ${ClickHouse_SOURCE_DIR}/libs/libdaemon/include) if (USE_POCO_SQLODBC) From 0336adeac116f1c660f86e026269c7056450f2ca Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 11 Mar 2019 21:19:35 +0300 Subject: [PATCH 249/297] build fix --- docs/fa/query_language/functions/bitmap_functions.md | 1 + docs/toc_fa.yml | 1 + 2 files changed, 2 insertions(+) create mode 120000 docs/fa/query_language/functions/bitmap_functions.md diff --git a/docs/fa/query_language/functions/bitmap_functions.md b/docs/fa/query_language/functions/bitmap_functions.md new file mode 120000 index 00000000000..0a31d3d71d8 --- /dev/null +++ b/docs/fa/query_language/functions/bitmap_functions.md @@ -0,0 +1 @@ +../../../en/query_language/functions/bitmap_functions.md \ No newline at end of file diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 0b84040282a..67335934850 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -115,6 +115,7 @@ nav: - 'Working with Arrays': 'query_language/functions/array_functions.md' - 'Splitting and Merging Strings and Arrays': 'query_language/functions/splitting_merging_functions.md' - 'Bit': 'query_language/functions/bit_functions.md' + - 'Bitmap': 'query_language/functions/bitmap_functions.md' - 'Hash': 'query_language/functions/hash_functions.md' - 'Generating Pseudo-Random Numbers': 'query_language/functions/random_functions.md' - 'Encoding': 'query_language/functions/encoding_functions.md' From b9c4908edb065f5537056ba60c2872a7d27e16d7 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Mon, 11 Mar 2019 22:05:59 +0300 Subject: [PATCH 250/297] add the missing part of the comment --- contrib/cppkafka | 2 +- contrib/librdkafka | 2 +- dbms/src/Storages/IStorage.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/cppkafka b/contrib/cppkafka index 9b184d881c1..860c90e92ee 160000 --- a/contrib/cppkafka +++ b/contrib/cppkafka @@ -1 +1 @@ -Subproject commit 9b184d881c15cc50784b28688c7c99d3d764db24 +Subproject commit 860c90e92eee6690aa74a2ca7b7c5c6930dffecd diff --git a/contrib/librdkafka b/contrib/librdkafka index 51ae5f5fd8b..363dcad5a23 160000 --- a/contrib/librdkafka +++ b/contrib/librdkafka @@ -1 +1 @@ -Subproject commit 51ae5f5fd8b742e56f47a8bb0136344868818285 +Subproject commit 363dcad5a23dc29381cc626620e68ae418b3af19 diff --git a/dbms/src/Storages/IStorage.h b/dbms/src/Storages/IStorage.h index 8a362d33aae..6d52afe5314 100644 --- a/dbms/src/Storages/IStorage.h +++ b/dbms/src/Storages/IStorage.h @@ -347,7 +347,8 @@ private: mutable RWLock alter_intention_lock = RWLockImpl::create(); /// It is taken for share for the entire INSERT query and the entire merge of the parts (for MergeTree). - /// ALTER queries acquire an exclusive lock to ensure + /// ALTER COLUMN queries acquire an exclusive lock to ensure that no new parts with the old structure + /// are added to the table and thus the set of parts to modify doesn't change. mutable RWLock new_data_structure_lock = RWLockImpl::create(); /// Lock for the table column structure (names, types, etc.) and data path. From 150fbc43c25d547cabbab7dd64562c0dea0ee85f Mon Sep 17 00:00:00 2001 From: chertus Date: Mon, 11 Mar 2019 22:45:04 +0300 Subject: [PATCH 251/297] improve CrossToInnerJoinVisitor for multiple JOINS --- .../Interpreters/CrossToInnerJoinVisitor.cpp | 219 +++++++++++------- 1 file changed, 129 insertions(+), 90 deletions(-) diff --git a/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp b/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp index 8c74ddf699a..f73e10ae578 100644 --- a/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp +++ b/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp @@ -18,22 +18,67 @@ namespace DB namespace ErrorCodes { extern const int LOGICAL_ERROR; + extern const int NOT_IMPLEMENTED; } +namespace +{ + +struct JoinedTable +{ + DatabaseAndTableWithAlias table; + ASTTablesInSelectQueryElement * element = nullptr; + ASTTableJoin * join = nullptr; + + JoinedTable(ASTPtr table_element) + { + element = typeid_cast(table_element.get()); + if (!element) + throw Exception("Logical error: TablesInSelectQueryElement expected", ErrorCodes::LOGICAL_ERROR); + + if (element->table_join) + { + join = typeid_cast(element->table_join.get()); + if (join->kind == ASTTableJoin::Kind::Cross || + join->kind == ASTTableJoin::Kind::Comma) + { + if (!join->children.empty()) + throw Exception("Logical error: CROSS JOIN has expressions", ErrorCodes::LOGICAL_ERROR); + } + + if (join->using_expression_list) + throw Exception("Multiple CROSS/COMMA JOIN do not support USING", ErrorCodes::NOT_IMPLEMENTED); + } + + auto & expr = typeid_cast(*element->table_expression); + table = DatabaseAndTableWithAlias(expr); + } + + void rewriteCommaToCross() + { + if (join) + join->kind = ASTTableJoin::Kind::Cross; + } + + bool canAttachOnExpression() const { return join && !join->on_expression; } +}; + /// It checks if where expression could be moved to JOIN ON expression partially or entirely. class CheckExpressionVisitorData { public: using TypeToVisit = const ASTFunction; - CheckExpressionVisitorData(const std::vector & tables_) + CheckExpressionVisitorData(const std::vector & tables_) : tables(tables_) - , save_where(false) - , flat_ands(true) + , ands_only(true) {} void visit(const ASTFunction & node, ASTPtr & ast) { + if (!ands_only) + return; + if (node.name == "and") { if (!node.arguments || node.arguments->children.empty()) @@ -42,50 +87,50 @@ public: for (auto & child : node.arguments->children) { if (auto func = typeid_cast(child.get())) - { - if (func->name == "and") - flat_ands = false; visit(*func, child); - } else - save_where = true; + ands_only = false; } } else if (node.name == "equals") { - if (checkEquals(node)) - asts_to_join_on.push_back(ast); - else - save_where = true; + if (size_t min_table = canMoveEqualsToJoinOn(node)) + asts_to_join_on[min_table].push_back(ast); } else - save_where = true; + { + ands_only = false; + asts_to_join_on.clear(); + } } - bool matchAny() const { return !asts_to_join_on.empty(); } - bool matchAll() const { return matchAny() && !save_where; } - bool canReuseWhere() const { return matchAll() && flat_ands; } + bool complex() const { return !ands_only; } + bool matchAny(size_t t) const { return asts_to_join_on.count(t); } - ASTPtr makeOnExpression() + ASTPtr makeOnExpression(size_t table_pos) { - if (asts_to_join_on.size() == 1) - return asts_to_join_on[0]->clone(); + if (!asts_to_join_on.count(table_pos)) + return {}; + + std::vector & expressions = asts_to_join_on[table_pos]; + + if (expressions.size() == 1) + return expressions[0]->clone(); std::vector arguments; - arguments.reserve(asts_to_join_on.size()); - for (auto & ast : asts_to_join_on) + arguments.reserve(expressions.size()); + for (auto & ast : expressions) arguments.emplace_back(ast->clone()); return makeASTFunction("and", std::move(arguments)); } private: - const std::vector & tables; - std::vector asts_to_join_on; - bool save_where; - bool flat_ands; + const std::vector & tables; + std::map> asts_to_join_on; + bool ands_only; - bool checkEquals(const ASTFunction & node) + size_t canMoveEqualsToJoinOn(const ASTFunction & node) { if (!node.arguments) throw Exception("Logical error: function requires argiment", ErrorCodes::LOGICAL_ERROR); @@ -102,7 +147,8 @@ private: /// Check if the identifiers are from different joined tables. If it's a self joint, tables should have aliases. /// select * from t1 a cross join t2 b where a.x = b.x - bool checkIdentifiers(const ASTIdentifier & left, const ASTIdentifier & right) + /// @return table position to attach expression to or 0. + size_t checkIdentifiers(const ASTIdentifier & left, const ASTIdentifier & right) { /// {best_match, berst_table_pos} std::pair left_best{0, 0}; @@ -110,14 +156,14 @@ private: for (size_t i = 0; i < tables.size(); ++i) { - size_t match = IdentifierSemantic::canReferColumnToTable(left, tables[i]); + size_t match = IdentifierSemantic::canReferColumnToTable(left, tables[i].table); if (match > left_best.first) { left_best.first = match; left_best.second = i; } - match = IdentifierSemantic::canReferColumnToTable(right, tables[i]); + match = IdentifierSemantic::canReferColumnToTable(right, tables[i].table); if (match > right_best.first) { right_best.first = match; @@ -125,59 +171,45 @@ private: } } - return left_best.first && right_best.first && (left_best.second != right_best.second); + if (left_best.first && right_best.first && (left_best.second != right_best.second)) + { + size_t table_pos = std::max(left_best.second, right_best.second); + if (tables[table_pos].canAttachOnExpression()) + return table_pos; + } + return 0; } }; - -static bool extractTableName(const ASTTableExpression & expr, std::vector & names) -{ - /// Subselects are not supported. - if (!expr.database_and_table_name) - return false; - - names.emplace_back(DatabaseAndTableWithAlias(expr)); - return true; -} +using CheckExpressionMatcher = OneTypeMatcher; +using CheckExpressionVisitor = InDepthNodeVisitor; -static ASTPtr getCrossJoin(ASTSelectQuery & select, std::vector & table_names) +bool getTables(ASTSelectQuery & select, std::vector & joined_tables, size_t & num_comma) { if (!select.tables) - return {}; + return false; auto tables = typeid_cast(select.tables.get()); if (!tables) - return {}; + return false; size_t num_tables = tables->children.size(); - if (num_tables != 2) - return {}; + if (num_tables < 2) + return false; - auto left = typeid_cast(tables->children[0].get()); - auto right = typeid_cast(tables->children[1].get()); - if (!left || !right || !right->table_join) - return {}; - - if (auto join = typeid_cast(right->table_join.get())) + joined_tables.reserve(num_tables); + for (auto & child : tables->children) { - if (join->kind == ASTTableJoin::Kind::Cross || - join->kind == ASTTableJoin::Kind::Comma) - { - if (!join->children.empty()) - throw Exception("Logical error: CROSS JOIN has expressions", ErrorCodes::LOGICAL_ERROR); + joined_tables.emplace_back(JoinedTable(child)); - auto & left_expr = typeid_cast(*left->table_expression); - auto & right_expr = typeid_cast(*right->table_expression); - - table_names.reserve(2); - if (extractTableName(left_expr, table_names) && - extractTableName(right_expr, table_names)) - return right->table_join; - } + if (ASTTableJoin * join = joined_tables.back().join) + if (join->kind == ASTTableJoin::Kind::Comma) + ++num_comma; } + return true; +} - return {}; } @@ -187,40 +219,47 @@ void CrossToInnerJoinMatcher::visit(ASTPtr & ast, Data & data) visit(*t, ast, data); } -void CrossToInnerJoinMatcher::visit(ASTSelectQuery & select, ASTPtr & ast, Data & data) +void CrossToInnerJoinMatcher::visit(ASTSelectQuery & select, ASTPtr &, Data & data) { - using CheckExpressionMatcher = OneTypeMatcher; - using CheckExpressionVisitor = InDepthNodeVisitor; + size_t num_comma = 0; + std::vector joined_tables; + if (!getTables(select, joined_tables, num_comma)) + return; + + /// COMMA to CROSS + + if (num_comma) + { + if (num_comma != (joined_tables.size() - 1)) + throw Exception("Mix of COMMA and other JOINS is not supported", ErrorCodes::NOT_IMPLEMENTED); + + for (auto & table : joined_tables) + table.rewriteCommaToCross(); + } + + /// CROSS to INNER if (!select.where_expression) return; - std::vector table_names; - ASTPtr ast_join = getCrossJoin(select, table_names); - if (!ast_join) - return; - - CheckExpressionVisitor::Data visitor_data{table_names}; + CheckExpressionVisitor::Data visitor_data{joined_tables}; CheckExpressionVisitor(visitor_data).visit(select.where_expression); - if (visitor_data.matchAny()) + if (visitor_data.complex()) + return; + + for (size_t i = 1; i < joined_tables.size(); ++i) { - auto & join = typeid_cast(*ast_join); - join.kind = ASTTableJoin::Kind::Inner; - join.strictness = ASTTableJoin::Strictness::All; + if (visitor_data.matchAny(i)) + { + ASTTableJoin & join = *joined_tables[i].join; + join.kind = ASTTableJoin::Kind::Inner; + join.strictness = ASTTableJoin::Strictness::All; - if (visitor_data.canReuseWhere()) - join.on_expression.swap(select.where_expression); - else - join.on_expression = visitor_data.makeOnExpression(); - - if (visitor_data.matchAll()) - select.where_expression.reset(); - - join.children.push_back(join.on_expression); - - ast = ast->clone(); /// rewrite AST in right manner - data.done = true; + join.on_expression = visitor_data.makeOnExpression(i); + join.children.push_back(join.on_expression); + data.done = true; + } } } From 104b0fd7e5ffa688d832b8bb8742be3e8cc29dbe Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 22:47:06 +0300 Subject: [PATCH 252/297] Fixed build --- dbms/programs/clickhouse | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 dbms/programs/clickhouse diff --git a/dbms/programs/clickhouse b/dbms/programs/clickhouse deleted file mode 100755 index 2495160e02a..00000000000 --- a/dbms/programs/clickhouse +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -CMD=$1 -shift -clickhouse-$CMD $* From be57a14906ce691edf06e01d801c9c56cb7d7905 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 11 Mar 2019 22:51:44 +0300 Subject: [PATCH 253/297] Fixed build --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc922266161..8c0627ce569 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,7 @@ if (DEFAULT_LIBS) add_default_libs(zstd) add_default_libs(snappy) add_default_libs(arrow) + add_default_libs(protoc) add_default_libs(thrift_static) add_default_libs(boost_regex_internal) endif () From fb5d339335b8982cefceb24786b337ebc0ba2aa9 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 12 Mar 2019 12:55:43 +0300 Subject: [PATCH 254/297] Fix build (freebsd + clang + asan) (#4656) --- cmake/find_protobuf.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmake/find_protobuf.cmake b/cmake/find_protobuf.cmake index e2fe9ca2fcd..3512c6bb694 100644 --- a/cmake/find_protobuf.cmake +++ b/cmake/find_protobuf.cmake @@ -1,11 +1,5 @@ option(USE_INTERNAL_PROTOBUF_LIBRARY "Set to FALSE to use system protobuf instead of bundled" ${NOT_UNBUNDLED}) -if(OS_FREEBSD AND SANITIZE STREQUAL "address") - # ../contrib/protobuf/src/google/protobuf/arena_impl.h:45:10: fatal error: 'sanitizer/asan_interface.h' file not found - set(MISSING_INTERNAL_PROTOBUF_LIBRARY 1) - set(USE_INTERNAL_PROTOBUF_LIBRARY 0) -endif() - if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/protobuf/cmake/CMakeLists.txt") if(USE_INTERNAL_PROTOBUF_LIBRARY) message(WARNING "submodule contrib/protobuf is missing. to fix try run: \n git submodule update --init --recursive") @@ -94,4 +88,14 @@ elseif(NOT MISSING_INTERNAL_PROTOBUF_LIBRARY) endfunction() endif() +if(OS_FREEBSD AND SANITIZE STREQUAL "address") + # ../contrib/protobuf/src/google/protobuf/arena_impl.h:45:10: fatal error: 'sanitizer/asan_interface.h' file not found + # #include + if(LLVM_INCLUDE_DIRS) + set(Protobuf_INCLUDE_DIR ${Protobuf_INCLUDE_DIR} ${LLVM_INCLUDE_DIRS}) + else() + set(USE_PROTOBUF 0) + endif() +endif() + message(STATUS "Using protobuf=${USE_PROTOBUF}: ${Protobuf_INCLUDE_DIR} : ${Protobuf_LIBRARY}") From 114e55c9565161d568ca7b21064ae5d0ab6947ae Mon Sep 17 00:00:00 2001 From: chertus Date: Tue, 12 Mar 2019 14:06:54 +0300 Subject: [PATCH 255/297] multiple COMMA/CROSS JOIN --- .../JoinToSubqueryTransformVisitor.cpp | 15 ++--- dbms/src/Parsers/ASTTablesInSelectQuery.h | 2 + .../00849_multiple_comma_join.reference | 55 +++++++++++++++++ .../0_stateless/00849_multiple_comma_join.sql | 59 +++++++++++++++++++ 4 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00849_multiple_comma_join.reference create mode 100644 dbms/tests/queries/0_stateless/00849_multiple_comma_join.sql diff --git a/dbms/src/Interpreters/JoinToSubqueryTransformVisitor.cpp b/dbms/src/Interpreters/JoinToSubqueryTransformVisitor.cpp index 5a1f7260a4f..1a110a6c8e0 100644 --- a/dbms/src/Interpreters/JoinToSubqueryTransformVisitor.cpp +++ b/dbms/src/Interpreters/JoinToSubqueryTransformVisitor.cpp @@ -210,13 +210,13 @@ bool needRewrite(ASTSelectQuery & select) if (!table || !table->table_join) throw Exception("Multiple JOIN expects joined tables", ErrorCodes::LOGICAL_ERROR); - auto join = typeid_cast(table->table_join.get()); - if (join->kind == ASTTableJoin::Kind::Comma) - throw Exception("Multiple COMMA JOIN is not supported", ErrorCodes::NOT_IMPLEMENTED); + auto join = typeid_cast(*table->table_join); + if (isComma(join.kind)) + throw Exception("COMMA to CROSS JOIN rewriter is not enabled or cannot rewrite query", ErrorCodes::NOT_IMPLEMENTED); /// it's not trivial to support mix of JOIN ON & JOIN USING cause of short names - if (!join || !join->on_expression) - throw Exception("Multiple JOIN expects JOIN with ON section", ErrorCodes::NOT_IMPLEMENTED); + if (join.using_expression_list) + throw Exception("Multiple JOIN does not support USING", ErrorCodes::NOT_IMPLEMENTED); } return true; @@ -264,8 +264,9 @@ void JoinToSubqueryTransformMatcher::visit(ASTSelectQuery & select, ASTPtr &, Da auto table = typeid_cast(child.get()); if (table->table_join) { - auto * join = typeid_cast(table->table_join.get()); - ColumnAliasesVisitor(aliases_data).visit(join->on_expression); + auto & join = typeid_cast(*table->table_join); + if (join.on_expression) + ColumnAliasesVisitor(aliases_data).visit(join.on_expression); } } diff --git a/dbms/src/Parsers/ASTTablesInSelectQuery.h b/dbms/src/Parsers/ASTTablesInSelectQuery.h index 54c97e7f237..5565d0ba3f8 100644 --- a/dbms/src/Parsers/ASTTablesInSelectQuery.h +++ b/dbms/src/Parsers/ASTTablesInSelectQuery.h @@ -107,6 +107,8 @@ struct ASTTableJoin : public IAST }; inline bool isFull(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Full; } +inline bool isCross(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Cross; } +inline bool isComma(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Comma; } inline bool isRightOrFull(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Right || kind == ASTTableJoin::Kind::Full; } inline bool isLeftOrFull(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Left || kind == ASTTableJoin::Kind::Full; } inline bool isInnerOrRight(ASTTableJoin::Kind kind) { return kind == ASTTableJoin::Kind::Inner || kind == ASTTableJoin::Kind::Right; } diff --git a/dbms/tests/queries/0_stateless/00849_multiple_comma_join.reference b/dbms/tests/queries/0_stateless/00849_multiple_comma_join.reference new file mode 100644 index 00000000000..15333f14e53 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00849_multiple_comma_join.reference @@ -0,0 +1,55 @@ +SELECT a\nFROM t1 \nCROSS JOIN t2 +SELECT a\nFROM t1 \nALL INNER JOIN t2 ON a = t2.a\nWHERE a = t2.a +SELECT a\nFROM t1 \nALL INNER JOIN t2 ON b = t2.b\nWHERE b = t2.b +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n) \nALL INNER JOIN t3 ON `--t1.a` = a\nWHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = a) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n a AS `--t1.a`, \n b AS `--t1.b`, \n t2.a, \n t2.b AS `--t2.b`\n FROM t1 \n ALL INNER JOIN t2 ON `--t1.b` = `--t2.b`\n) \nALL INNER JOIN t3 ON `--t1.b` = b\nWHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = b) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `--t2.a`, \n `t2.b`, \n a AS `--t3.a`, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n ) \n ALL INNER JOIN t3 ON `--t1.a` = `--t3.a`\n) \nALL INNER JOIN t4 ON `--t1.a` = a\nWHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = `--t3.a`) AND (`--t1.a` = a) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n `--t1.b`, \n `t2.a`, \n `--t2.b`, \n a, \n b AS `--t3.b`\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b AS `--t1.b`, \n t2.a, \n t2.b AS `--t2.b`\n FROM t1 \n ALL INNER JOIN t2 ON `--t1.b` = `--t2.b`\n ) \n ALL INNER JOIN t3 ON `--t1.b` = `--t3.b`\n) \nALL INNER JOIN t4 ON `--t1.b` = b\nWHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = `--t3.b`) AND (`--t1.b` = b) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `--t2.a`, \n `t2.b`, \n a AS `--t3.a`, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n ALL INNER JOIN t2 ON `--t2.a` = `--t1.a`\n ) \n ALL INNER JOIN t3 ON `--t2.a` = `--t3.a`\n) \nALL INNER JOIN t4 ON `--t2.a` = a\nWHERE (`--t2.a` = `--t1.a`) AND (`--t2.a` = `--t3.a`) AND (`--t2.a` = a) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `--t2.a`, \n `t2.b`, \n a AS `--t3.a`, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n CROSS JOIN t2 \n ) \n ALL INNER JOIN t3 ON (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`)\n) \nALL INNER JOIN t4 ON `--t3.a` = a\nWHERE (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`) AND (`--t3.a` = a) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `--t2.a`, \n `t2.b`, \n a AS `--t3.a`, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n CROSS JOIN t2 \n ) \n CROSS JOIN t3 \n) \nALL INNER JOIN t4 ON (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`)\nWHERE (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `--t2.a`, \n `t2.b`, \n a AS `--t3.a`, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n ) \n ALL INNER JOIN t3 ON `--t2.a` = `--t3.a`\n) \nALL INNER JOIN t4 ON `--t3.a` = a\nWHERE (`--t1.a` = `--t2.a`) AND (`--t2.a` = `--t3.a`) AND (`--t3.a` = a) +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `t2.a`, \n `t2.b`, \n a, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a, \n t2.b\n FROM t1 \n CROSS JOIN t2 \n ) \n CROSS JOIN t3 \n) \nCROSS JOIN t4 +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`, \n b, \n `t2.a`, \n `t2.b`, \n a, \n t3.b\n FROM \n (\n SELECT \n a AS `--t1.a`, \n b, \n t2.a, \n t2.b\n FROM t1 \n CROSS JOIN t2 \n ) \n CROSS JOIN t3 \n) \nCROSS JOIN t4 +SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n a AS `--t1.a`, \n b, \n t2.a AS `--t2.a`, \n t2.b\n FROM t1 \n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n) \nCROSS JOIN t3 +SELECT * FROM t1, t2 +1 1 1 1 +1 1 1 \N +2 2 1 1 +2 2 1 \N +3 3 1 1 +3 3 1 \N +4 4 1 1 +4 4 1 \N +SELECT * FROM t1, t2 WHERE t1.a = t2.a +1 1 1 1 +1 1 1 \N +SELECT t1.a, t2.a FROM t1, t2 WHERE t1.b = t2.b +1 1 +SELECT t1.a, t2.b, t3.b FROM t1, t2, t3 WHERE t1.a = t2.a AND t1.a = t3.a +1 1 1 +1 1 \N +1 \N 1 +1 \N \N +SELECT t1.a, t2.b, t3.b FROM t1, t2, t3 WHERE t1.b = t2.b AND t1.b = t3.b +1 1 1 +SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a +1 1 1 1 +1 1 1 \N +1 1 \N 1 +1 1 \N \N +1 \N 1 1 +1 \N 1 \N +1 \N \N 1 +1 \N \N \N +SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b +1 1 1 1 +SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a +1 1 1 1 +1 1 1 \N +1 1 \N 1 +1 1 \N \N +1 \N 1 1 +1 \N 1 \N +1 \N \N 1 +1 \N \N \N diff --git a/dbms/tests/queries/0_stateless/00849_multiple_comma_join.sql b/dbms/tests/queries/0_stateless/00849_multiple_comma_join.sql new file mode 100644 index 00000000000..0e5aa4884a5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00849_multiple_comma_join.sql @@ -0,0 +1,59 @@ +SET enable_debug_queries = 1; +USE test; + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; + +CREATE TABLE t1 (a UInt32, b Nullable(Int32)) ENGINE = Memory; +CREATE TABLE t2 (a UInt32, b Nullable(Int32)) ENGINE = Memory; +CREATE TABLE t3 (a UInt32, b Nullable(Int32)) ENGINE = Memory; +CREATE TABLE t4 (a UInt32, b Nullable(Int32)) ENGINE = Memory; + +ANALYZE SELECT t1.a FROM t1, t2; +ANALYZE SELECT t1.a FROM t1, t2 WHERE t1.a = t2.a; +ANALYZE SELECT t1.a FROM t1, t2 WHERE t1.b = t2.b; +ANALYZE SELECT t1.a FROM t1, t2, t3 WHERE t1.a = t2.a AND t1.a = t3.a; +ANALYZE SELECT t1.a FROM t1, t2, t3 WHERE t1.b = t2.b AND t1.b = t3.b; +ANALYZE SELECT t1.a FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a; +ANALYZE SELECT t1.a FROM t1, t2, t3, t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b; + +ANALYZE SELECT t1.a FROM t1, t2, t3, t4 WHERE t2.a = t1.a AND t2.a = t3.a AND t2.a = t4.a; +ANALYZE SELECT t1.a FROM t1, t2, t3, t4 WHERE t3.a = t1.a AND t3.a = t2.a AND t3.a = t4.a; +ANALYZE SELECT t1.a FROM t1, t2, t3, t4 WHERE t4.a = t1.a AND t4.a = t2.a AND t4.a = t3.a; +ANALYZE SELECT t1.a FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a; + +ANALYZE SELECT t1.a FROM t1, t2, t3, t4; +ANALYZE SELECT t1.a FROM t1 CROSS JOIN t2 CROSS JOIN t3 CROSS JOIN t4; + +ANALYZE SELECT t1.a FROM t1, t2 CROSS JOIN t3; -- { serverError 48 } +ANALYZE SELECT t1.a FROM t1 JOIN t2 USING a CROSS JOIN t3; -- { serverError 48 } +ANALYZE SELECT t1.a FROM t1 JOIN t2 ON t1.a = t2.a CROSS JOIN t3; + +INSERT INTO t1 values (1,1), (2,2), (3,3), (4,4); +INSERT INTO t2 values (1,1), (1, Null); +INSERT INTO t3 values (1,1), (1, Null); +INSERT INTO t4 values (1,1), (1, Null); + +SELECT 'SELECT * FROM t1, t2'; +SELECT * FROM t1, t2; +SELECT 'SELECT * FROM t1, t2 WHERE t1.a = t2.a'; +SELECT * FROM t1, t2 WHERE t1.a = t2.a; +SELECT 'SELECT t1.a, t2.a FROM t1, t2 WHERE t1.b = t2.b'; +SELECT t1.a, t2.b FROM t1, t2 WHERE t1.b = t2.b; +SELECT 'SELECT t1.a, t2.b, t3.b FROM t1, t2, t3 WHERE t1.a = t2.a AND t1.a = t3.a'; +SELECT t1.a, t2.b, t3.b FROM t1, t2, t3 WHERE t1.a = t2.a AND t1.a = t3.a; +SELECT 'SELECT t1.a, t2.b, t3.b FROM t1, t2, t3 WHERE t1.b = t2.b AND t1.b = t3.b'; +SELECT t1.a, t2.b, t3.b FROM t1, t2, t3 WHERE t1.b = t2.b AND t1.b = t3.b; +SELECT 'SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a'; +SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t1.a = t3.a AND t1.a = t4.a; +SELECT 'SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b'; +SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.b = t2.b AND t1.b = t3.b AND t1.b = t4.b; +SELECT 'SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a'; +SELECT t1.a, t2.b, t3.b, t4.b FROM t1, t2, t3, t4 WHERE t1.a = t2.a AND t2.a = t3.a AND t3.a = t4.a; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; From 8227f5fe63751abdb515b097a846763cf86e6e81 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 12 Mar 2019 15:06:17 +0300 Subject: [PATCH 256/297] Arcadia fix --- dbms/src/Interpreters/DDLWorker.cpp | 2 +- dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Interpreters/DDLWorker.cpp b/dbms/src/Interpreters/DDLWorker.cpp index a0777422e87..35639bf213b 100644 --- a/dbms/src/Interpreters/DDLWorker.cpp +++ b/dbms/src/Interpreters/DDLWorker.cpp @@ -224,7 +224,7 @@ DDLWorker::DDLWorker(const std::string & zk_root_dir, Context & context_, const { task_max_lifetime = config->getUInt64(prefix + ".task_max_lifetime", static_cast(task_max_lifetime)); cleanup_delay_period = config->getUInt64(prefix + ".cleanup_delay_period", static_cast(cleanup_delay_period)); - max_tasks_in_queue = std::max(static_cast(1), config->getUInt64(prefix + ".max_tasks_in_queue", max_tasks_in_queue)); + max_tasks_in_queue = std::max(1, config->getUInt64(prefix + ".max_tasks_in_queue", max_tasks_in_queue)); if (config->has(prefix + ".profile")) context.setSetting("profile", config->getString(prefix + ".profile")); diff --git a/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp b/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp index 4b4d66849aa..c511a1053b3 100644 --- a/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp +++ b/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp @@ -7,7 +7,7 @@ namespace DB { KafkaBlockInputStream::KafkaBlockInputStream( - StorageKafka & storage_, const Context & context_, const String & schema, UInt64 max_block_size_) + StorageKafka & storage_, const Context & context_, const String & schema, size_t max_block_size_) : storage(storage_), context(context_), max_block_size(max_block_size_) { context.setSetting("input_format_skip_unknown_fields", 1u); // Always skip unknown fields regardless of the context (JSON or TSKV) From b76e3ad1c4fa28cf06ec1d4589cb690faee9d41f Mon Sep 17 00:00:00 2001 From: chertus Date: Tue, 12 Mar 2019 16:17:17 +0300 Subject: [PATCH 257/297] fix tests --- .../Interpreters/CrossToInnerJoinVisitor.cpp | 43 ++++++++++++++++--- .../00826_cross_to_inner_join.reference | 14 +++--- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp b/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp index f73e10ae578..ede49b90538 100644 --- a/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp +++ b/dbms/src/Interpreters/CrossToInnerJoinVisitor.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -29,6 +31,8 @@ struct JoinedTable DatabaseAndTableWithAlias table; ASTTablesInSelectQueryElement * element = nullptr; ASTTableJoin * join = nullptr; + ASTPtr array_join = nullptr; + bool has_using = false; JoinedTable(ASTPtr table_element) { @@ -47,11 +51,16 @@ struct JoinedTable } if (join->using_expression_list) - throw Exception("Multiple CROSS/COMMA JOIN do not support USING", ErrorCodes::NOT_IMPLEMENTED); + has_using = true; } - auto & expr = typeid_cast(*element->table_expression); - table = DatabaseAndTableWithAlias(expr); + if (element->table_expression) + { + auto & expr = typeid_cast(*element->table_expression); + table = DatabaseAndTableWithAlias(expr); + } + + array_join = element->array_join; } void rewriteCommaToCross() @@ -63,6 +72,16 @@ struct JoinedTable bool canAttachOnExpression() const { return join && !join->on_expression; } }; +bool isComparison(const String & name) +{ + return name == NameEquals::name || + name == NameNotEquals::name || + name == NameLess::name || + name == NameGreater::name || + name == NameLessOrEquals::name || + name == NameGreaterOrEquals::name; +} + /// It checks if where expression could be moved to JOIN ON expression partially or entirely. class CheckExpressionVisitorData { @@ -79,7 +98,7 @@ public: if (!ands_only) return; - if (node.name == "and") + if (node.name == NameAnd::name) { if (!node.arguments || node.arguments->children.empty()) throw Exception("Logical error: function requires argiment", ErrorCodes::LOGICAL_ERROR); @@ -92,11 +111,15 @@ public: ands_only = false; } } - else if (node.name == "equals") + else if (node.name == NameEquals::name) { if (size_t min_table = canMoveEqualsToJoinOn(node)) asts_to_join_on[min_table].push_back(ast); } + else if (isComparison(node.name)) + { + /// leave other comparisons as is + } else { ands_only = false; @@ -122,7 +145,7 @@ public: for (auto & ast : expressions) arguments.emplace_back(ast->clone()); - return makeASTFunction("and", std::move(arguments)); + return makeASTFunction(NameAnd::name, std::move(arguments)); } private: @@ -202,8 +225,14 @@ bool getTables(ASTSelectQuery & select, std::vector & joined_tables for (auto & child : tables->children) { joined_tables.emplace_back(JoinedTable(child)); + JoinedTable & t = joined_tables.back(); + if (t.array_join) + return false; - if (ASTTableJoin * join = joined_tables.back().join) + if (num_tables > 2 && t.has_using) + throw Exception("Multiple CROSS/COMMA JOIN do not support USING", ErrorCodes::NOT_IMPLEMENTED); + + if (ASTTableJoin * join = t.join) if (join->kind == ASTTableJoin::Kind::Comma) ++num_comma; } diff --git a/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference b/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference index 024026d2c8c..244ff8c9600 100644 --- a/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference +++ b/dbms/tests/queries/0_stateless/00826_cross_to_inner_join.reference @@ -57,25 +57,25 @@ comma nullable 2 2 1 2 cross SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = t2.a -SELECT *\nFROM t1 \nALL INNER JOIN t2 ON t1.a = t2.a +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nALL INNER JOIN t2 ON a = t2.a\nWHERE a = t2.a cross nullable SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \n, t2 \nWHERE a = t2.a -SELECT *\nFROM t1 \nALL INNER JOIN t2 ON t1.a = t2.a +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nALL INNER JOIN t2 ON a = t2.a\nWHERE a = t2.a cross nullable vs not nullable SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = t2.b -SELECT *\nFROM t1 \nALL INNER JOIN t2 ON t1.a = t2.b +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nALL INNER JOIN t2 ON a = t2.b\nWHERE a = t2.b cross self SELECT \n a, \n b, \n y.a, \n y.b\nFROM t1 AS x \nCROSS JOIN t1 AS y \nWHERE (a = y.a) AND (b = y.b) -SELECT *\nFROM t1 AS x \nALL INNER JOIN t1 AS y ON (x.a = y.a) AND (x.b = y.b) +SELECT \n a, \n b, \n y.a, \n y.b\nFROM t1 AS x \nALL INNER JOIN t1 AS y ON (a = y.a) AND (b = y.b)\nWHERE (a = y.a) AND (b = y.b) cross one table expr SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = b SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE a = b cross multiple ands SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE (a = t2.a) AND (b = t2.b) -SELECT *\nFROM t1 \nALL INNER JOIN t2 ON (t1.a = t2.a) AND (t1.b = t2.b) +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nALL INNER JOIN t2 ON (a = t2.a) AND (b = t2.b)\nWHERE (a = t2.a) AND (b = t2.b) cross and inside and SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE (a = t2.a) AND ((a = t2.a) AND ((a = t2.a) AND (b = t2.b))) -SELECT *\nFROM t1 \nALL INNER JOIN t2 ON (t1.a = t2.a) AND (t1.a = t2.a) AND (t1.a = t2.a) AND (t1.b = t2.b) +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nALL INNER JOIN t2 ON (a = t2.a) AND (a = t2.a) AND (a = t2.a) AND (b = t2.b)\nWHERE (a = t2.a) AND ((a = t2.a) AND ((a = t2.a) AND (b = t2.b))) cross split conjunction SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nCROSS JOIN t2 \nWHERE (a = t2.a) AND (b = t2.b) AND (a >= 1) AND (t2.b > 0) -SELECT *\nFROM t1 \nALL INNER JOIN t2 ON (t1.a = t2.a) AND (t1.b = t2.b)\nWHERE (t1.a = t2.a) AND (t1.b = t2.b) AND (t1.a >= 1) AND (t2.b > 0) +SELECT \n a, \n b, \n t2.a, \n t2.b\nFROM t1 \nALL INNER JOIN t2 ON (a = t2.a) AND (b = t2.b)\nWHERE (a = t2.a) AND (b = t2.b) AND (a >= 1) AND (t2.b > 0) From bb9d83908f16170caef804f6c2a2adf474eeadee Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 12 Mar 2019 16:18:11 +0300 Subject: [PATCH 258/297] Revert reverted submodules in b9c4908edb065f5537056ba60c2872a7d27e16d7 --- contrib/cppkafka | 2 +- contrib/librdkafka | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/cppkafka b/contrib/cppkafka index 860c90e92ee..9b184d881c1 160000 --- a/contrib/cppkafka +++ b/contrib/cppkafka @@ -1 +1 @@ -Subproject commit 860c90e92eee6690aa74a2ca7b7c5c6930dffecd +Subproject commit 9b184d881c15cc50784b28688c7c99d3d764db24 diff --git a/contrib/librdkafka b/contrib/librdkafka index 363dcad5a23..51ae5f5fd8b 160000 --- a/contrib/librdkafka +++ b/contrib/librdkafka @@ -1 +1 @@ -Subproject commit 363dcad5a23dc29381cc626620e68ae418b3af19 +Subproject commit 51ae5f5fd8b742e56f47a8bb0136344868818285 From 9d86f3ce1782c7f088d8278908efb2f397aa69f7 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 12 Mar 2019 16:29:35 +0300 Subject: [PATCH 259/297] clickhouse-split-helper --- dbms/programs/CMakeLists.txt | 2 +- dbms/programs/clickhouse-split-helper | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 dbms/programs/clickhouse-split-helper diff --git a/dbms/programs/CMakeLists.txt b/dbms/programs/CMakeLists.txt index 94953a49226..08d90e3e5d6 100644 --- a/dbms/programs/CMakeLists.txt +++ b/dbms/programs/CMakeLists.txt @@ -112,7 +112,7 @@ if (CLICKHOUSE_SPLIT_BINARY) add_custom_target (clickhouse-bundle ALL DEPENDS ${CLICKHOUSE_ALL_TARGETS}) add_custom_target (clickhouse ALL DEPENDS clickhouse-bundle) - install (PROGRAMS clickhouse DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse) + install(PROGRAMS clickhouse-split-helper DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME clickhouse COMPONENT clickhouse) else () if (USE_EMBEDDED_COMPILER) # before add_executable ! diff --git a/dbms/programs/clickhouse-split-helper b/dbms/programs/clickhouse-split-helper new file mode 100755 index 00000000000..2495160e02a --- /dev/null +++ b/dbms/programs/clickhouse-split-helper @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e +CMD=$1 +shift +clickhouse-$CMD $* From 2043304d3510e1dd63221da76d96566a5ec0f131 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 12 Mar 2019 19:52:16 +0300 Subject: [PATCH 260/297] Added a test for JOIN with duplicate columns --- .../00916_join_using_duplicate_columns.reference | 5 +++++ .../0_stateless/00916_join_using_duplicate_columns.sql | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.reference create mode 100644 dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql diff --git a/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.reference b/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.reference new file mode 100644 index 00000000000..be9a5a74a14 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.reference @@ -0,0 +1,5 @@ +1 +1 +1 +1 +1 1 diff --git a/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql b/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql new file mode 100644 index 00000000000..97cd1e8cac8 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00916_join_using_duplicate_columns.sql @@ -0,0 +1,8 @@ +SELECT * FROM (SELECT 1 AS x) ALL LEFT JOIN (SELECT 1 AS x) USING x; +SELECT * FROM (SELECT 1 AS x) ALL LEFT JOIN (SELECT 2 AS x) USING x; + +SELECT * FROM (SELECT 1 AS x) AS t1 ALL LEFT JOIN (SELECT 1 AS x) AS t2 USING x; +SELECT * FROM (SELECT 1 AS x) AS t1 ALL LEFT JOIN (SELECT 2 AS x) AS t2 USING x; + +SELECT * FROM (SELECT 1 AS x) AS t1 ALL LEFT JOIN (SELECT 1 AS x) AS t2 ON t1.x = t2.x; +-- (bug) SELECT * FROM (SELECT 1 AS x) AS t1 ALL LEFT JOIN (SELECT 2 AS x) AS t2 ON t1.x = t2.x; From 9d026ef7333160d2aaf3be61e629dcc868586ec0 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 12 Mar 2019 22:30:01 +0300 Subject: [PATCH 261/297] Avoid deadlock on exit if exception was thrown in loadMetadata due to cyclic references in ContextShared that holds BackgroundProcessingPool --- dbms/programs/server/Server.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/dbms/programs/server/Server.cpp b/dbms/programs/server/Server.cpp index 213a6e126df..2b10c9e3c98 100644 --- a/dbms/programs/server/Server.cpp +++ b/dbms/programs/server/Server.cpp @@ -260,6 +260,15 @@ int Server::main(const std::vector & /*args*/) StatusFile status{path + "status"}; SCOPE_EXIT({ + /** Ask to cancel background jobs all table engines, + * and also query_log. + * It is important to do early, not in destructor of Context, because + * table engines could use Context on destroy. + */ + LOG_INFO(log, "Shutting down storages."); + global_context->shutdown(); + LOG_DEBUG(log, "Shutted down storages."); + /** Explicitly destroy Context. It is more convenient than in destructor of Server, because logger is still available. * At this moment, no one could own shared part of Context. */ @@ -498,17 +507,6 @@ int Server::main(const std::vector & /*args*/) global_context->setCurrentDatabase(default_database); - SCOPE_EXIT({ - /** Ask to cancel background jobs all table engines, - * and also query_log. - * It is important to do early, not in destructor of Context, because - * table engines could use Context on destroy. - */ - LOG_INFO(log, "Shutting down storages."); - global_context->shutdown(); - LOG_DEBUG(log, "Shutted down storages."); - }); - if (has_zookeeper && config().has("distributed_ddl")) { /// DDL worker should be started after all tables were loaded From 1ca16d788236c058ea592ef8bb28714873952db1 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 12 Mar 2019 22:30:59 +0300 Subject: [PATCH 262/297] Fix "bad_alloc" handler clobbering by LLVM library --- dbms/programs/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbms/programs/main.cpp b/dbms/programs/main.cpp index 34b04a0d7fe..15f1673985b 100644 --- a/dbms/programs/main.cpp +++ b/dbms/programs/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -139,6 +140,10 @@ bool isClickhouseApp(const std::string & app_suffix, std::vector & argv) int main(int argc_, char ** argv_) { + /// Reset new handler to default (that throws std::bad_alloc) + /// It is needed because LLVM library clobbers it. + std::set_new_handler(nullptr); + #if USE_EMBEDDED_COMPILER if (argc_ >= 2 && 0 == strcmp(argv_[1], "-cc1")) return mainEntryClickHouseClang(argc_, argv_); From c855cc2a6ee5f9814631e7f84d80c6033e347af7 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 13 Mar 2019 10:32:00 +0300 Subject: [PATCH 263/297] Remove past event --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 61392a4136b..3e840d2cf10 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,4 @@ ClickHouse is an open-source column-oriented database management system that all ## Upcoming Events -* [ClickHouse Community Meetup](https://www.eventbrite.com/e/meetup-clickhouse-in-the-wild-deployment-success-stories-registration-55305051899) in San Francisco on February 19. * [ClickHouse Community Meetup](https://www.eventbrite.com/e/clickhouse-meetup-in-madrid-registration-55376746339) in Madrid on April 2. From e92c94ed78ef225e69f85e34c1e7e43119ae6fb8 Mon Sep 17 00:00:00 2001 From: Silviu Caragea Date: Wed, 13 Mar 2019 09:37:16 +0200 Subject: [PATCH 264/297] Add support for disabling brotli, parquet and protobuf --- cmake/find_brotli.cmake | 6 ++++++ cmake/find_parquet.cmake | 6 ++++++ cmake/find_protobuf.cmake | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/cmake/find_brotli.cmake b/cmake/find_brotli.cmake index 6e93e88df9c..55350e21eed 100644 --- a/cmake/find_brotli.cmake +++ b/cmake/find_brotli.cmake @@ -1,3 +1,7 @@ +option (ENABLE_BROTLI "Enable brotli" ON) + +if (ENABLE_BROTLI) + option (USE_INTERNAL_BROTLI_LIBRARY "Set to FALSE to use system libbrotli library instead of bundled" ${NOT_UNBUNDLED}) if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/brotli/c/include/brotli/decode.h") @@ -27,4 +31,6 @@ elseif (NOT MISSING_INTERNAL_BROTLI_LIBRARY) set (USE_BROTLI 1) endif () +endif() + message (STATUS "Using brotli=${USE_BROTLI}: ${BROTLI_INCLUDE_DIR} : ${BROTLI_LIBRARY}") diff --git a/cmake/find_parquet.cmake b/cmake/find_parquet.cmake index bfaf51abb46..39af93955f4 100644 --- a/cmake/find_parquet.cmake +++ b/cmake/find_parquet.cmake @@ -1,3 +1,7 @@ +option (ENABLE_PARQUET "Enable parquet" ON) + +if (ENABLE_PARQUET) + if (NOT OS_FREEBSD) # Freebsd: ../contrib/arrow/cpp/src/arrow/util/bit-util.h:27:10: fatal error: endian.h: No such file or directory option(USE_INTERNAL_PARQUET_LIBRARY "Set to FALSE to use system parquet library instead of bundled" ${NOT_UNBUNDLED}) endif() @@ -61,6 +65,8 @@ elseif(NOT MISSING_INTERNAL_PARQUET_LIBRARY AND NOT OS_FREEBSD) endif() endif() +endif() + if(USE_PARQUET) message(STATUS "Using Parquet: ${ARROW_LIBRARY}:${ARROW_INCLUDE_DIR} ; ${PARQUET_LIBRARY}:${PARQUET_INCLUDE_DIR} ; ${THRIFT_LIBRARY}") else() diff --git a/cmake/find_protobuf.cmake b/cmake/find_protobuf.cmake index e2fe9ca2fcd..d15c1b5a947 100644 --- a/cmake/find_protobuf.cmake +++ b/cmake/find_protobuf.cmake @@ -1,3 +1,7 @@ +option (ENABLE_PROTOBUF "Enable protobuf" ON) + +if (ENABLE_PROTOBUF) + option(USE_INTERNAL_PROTOBUF_LIBRARY "Set to FALSE to use system protobuf instead of bundled" ${NOT_UNBUNDLED}) if(OS_FREEBSD AND SANITIZE STREQUAL "address") @@ -94,4 +98,6 @@ elseif(NOT MISSING_INTERNAL_PROTOBUF_LIBRARY) endfunction() endif() +endif() + message(STATUS "Using protobuf=${USE_PROTOBUF}: ${Protobuf_INCLUDE_DIR} : ${Protobuf_LIBRARY}") From 72a20d372edbabd42eec96d38ea468c6ef1c459f Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 13 Mar 2019 11:14:32 +0300 Subject: [PATCH 265/297] DOCAPI-5436 The FixedString docs update (#4667) * DOCAPI-5436: Some restructurization in FixedString EN text. * DOCAPI-5436: EN review and RU translation of FixedString description. * DOCAPI-5436: Minor fixes in the FixedString docs. * DOCAPI-5436: Markup fix. --- docs/en/data_types/fixedstring.md | 40 +++++++------ .../functions/array_functions.md | 2 +- docs/ru/data_types/fixedstring.md | 59 ++++++++++++++++--- .../functions/array_functions.md | 2 +- 4 files changed, 76 insertions(+), 27 deletions(-) diff --git a/docs/en/data_types/fixedstring.md b/docs/en/data_types/fixedstring.md index d1d956a7df3..9725c71a779 100644 --- a/docs/en/data_types/fixedstring.md +++ b/docs/en/data_types/fixedstring.md @@ -1,8 +1,8 @@ # FixedString -A fixed-length string of `N` bytes (not characters or code points). +A fixed-length string of `N` bytes (neither characters nor code points). -To declare the column of `FixedString` type use the following syntax: +To declare a column of `FixedString` type, use the following syntax: ``` FixedString(N) @@ -10,31 +10,35 @@ To declare the column of `FixedString` type use the following syntax: Where `N` is a natural number. -It is efficient to use `FixedString` in case when data has the length of `N` bytes exactly. For example: IP addresses (`FixedString(16)` for IPv6), language codes (ru_RU, en_US ... ), currency codes (USD, RUB ... ), hashes (`FixedString(16)` for MD5, `FixedString(32)` for SHA256). In all other cases, you can get the loss of efficiency. To store hashes or IP addresses use their binary representation. To store UUID values use the [UUID](uuid.md) data type. +The `FixedString` type is efficient when data has the length of precisely `N` bytes. In all other cases, it is likely to reduce efficiency. + +Examples of the values that can be efficiently stored in `FixedString`-typed columns: + +- Binary representation of IP addresses (`FixedString(16)` for IPv6). +- Language codes (ru_RU, en_US ... ). +- Currency codes (USD, RUB ... ). +- Binary representation of hashes (`FixedString(16)` for MD5, `FixedString(32)` for SHA256). + +To store UUID values, use the [UUID](uuid.md) data type. When inserting the data, ClickHouse: -- Complements a string with null bytes if the string contains fewer bytes than `N`. +- Complements a string with null bytes if the string contains fewer than `N` bytes. - Throws the `Too large value for FixedString(N)` exception if the string contains more than `N` bytes. -When selecting the data, ClickHouse does not trim off the null bytes at the end of the string. If you use the `WHERE` clause, you should add null bytes manually to match the `FixedString` value. +When selecting the data, ClickHouse does not remove the null bytes at the end of the string. If you use the `WHERE` clause, you should add null bytes manually to match the `FixedString` value. The following example illustrates how to use the `WHERE` clause with `FixedString`. -Example: +Let's consider the following table with the single `FixedString(2)` column: ``` -SELECT * FROM FixedStringTable +┌─name──┐ +│ b │ +└───────┘ +``` -┌─a──┐ -│ aa │ -│ b │ -└────┘ - -SELECT * FROM FixedStringTable WHERE a = 'b' - -Ok. - -0 rows in set. Elapsed: 0.009 sec. +The query `SELECT * FROM FixedStringTable WHERE a = 'b'` does not return any data as a result. We should complement the filter pattern with null bytes. +``` SELECT * FROM FixedStringTable WHERE a = 'b\0' @@ -47,6 +51,6 @@ WHERE a = 'b\0' This behavior differs from MySQL behavior for the `CHAR` type (where strings are padded with spaces, and the spaces are removed for output). -Note that the length of the `FixedString` value is constant even if it is filled with null bytes only. The [empty](../query_language/functions/string_functions.md#string_functions-empty) functions returns `1` if the `FixedString` value contains the null bytes only. +Note that the length of the `FixedString(N)` value is constant. The [length](../query_language/functions/array_functions.md#array_functions-length) function returns `N` even if the `FixedString(N)` value is filled only with null bytes, but the [empty](../query_language/functions/string_functions.md#string_functions-empty) function returns `1` in this case. [Original article](https://clickhouse.yandex/docs/en/data_types/fixedstring/) diff --git a/docs/en/query_language/functions/array_functions.md b/docs/en/query_language/functions/array_functions.md index fabd4dd35e5..0cbd03814ac 100644 --- a/docs/en/query_language/functions/array_functions.md +++ b/docs/en/query_language/functions/array_functions.md @@ -12,7 +12,7 @@ Returns 0 for an empty array, or 1 for a non-empty array. The result type is UInt8. The function also works for strings. -## length +## length {#array_functions-length} Returns the number of items in the array. The result type is UInt64. diff --git a/docs/ru/data_types/fixedstring.md b/docs/ru/data_types/fixedstring.md index 5c7fa19d506..1634a95bc67 100644 --- a/docs/ru/data_types/fixedstring.md +++ b/docs/ru/data_types/fixedstring.md @@ -1,11 +1,56 @@ -# FixedString(N) +# FixedString -Строка фиксированной длины N байт (не символов, не кодовых точек). N должно быть строго положительным натуральным числом. -При чтении сервером строки (например, при парсинге данных для INSERT), содержащей меньшее число байт, строка дополняется до N байт дописыванием нулевых байт справа. -При чтении сервером строки, содержащей большее число байт, выдаётся сообщение об ошибке. -При записи сервером строки (например, при выводе результата запроса SELECT), нулевые байты с конца строки не вырезаются, а выводятся. -Обратите внимание, как это поведение отличается от поведения MySQL для типа CHAR (строки дополняются пробелами, пробелы перед выводом вырезаются). +Строка фиксированной длины `N` байт (не символов, не кодовых точек). -С типом FixedString(N) умеет работать меньше функций, чем с типом String - то есть, он менее удобен в использовании. +Чтобы объявить столбец типа `FixedString`, используйте следующий синтаксис: + +``` + FixedString(N) +``` + +Где `N` — натуральное число. + +Тип `FixedString` эффективен, когда данные имеют длину ровно `N` байт. Во всех остальных случаях использование FixedString может привести к снижению эффективности. + +Примеры значений, которые можно эффективно хранить в столбцах типа `FixedString`: + +- Двоичное представление IP-адреса (`FixedString(16)` для IPv6). +- Коды языков (ru_RU, en_US ... ). +- Коды валют (USD, RUB ... ). +- Двоичное представление хэшей (`FixedString(16)` для MD5, `FixedString(32)` для SHA256). + +Для хранения значений UUID используйте тип данных [UUID](uuid.md). + +При вставке данных, ClickHouse: + +- Дополняет строку нулевыми байтами, если строка содержит меньше байтов, чем `N`. +- Генерирует исключение `Too large value for FixedString(N)`, если строка содержит более `N` байт. + +При выборе данных ClickHouse не обрезает нулевые байты в конце строки. Если вы используете секцию `WHERE`, то необходимо добавлять нулевые байты вручную, чтобы ClickHouse смог сопоставить выражение из фильтра значению `FixedString`. Следующий пример показывает, как использовать секцию `WHERE` с `FixedString`. + +Рассмотрим следующую таблицу с единственным столбцом типа `FixedString(2)`: + +``` +┌─name──┐ +│ b │ +└───────┘ +``` + +Запрос `SELECT * FROM FixedStringTable WHERE a = 'b'` не возвращает необходимых данных. Необходимо дополнить шаблон фильтра нулевыми байтами. + +``` +SELECT * FROM FixedStringTable +WHERE a = 'b\0' + +┌─a─┐ +│ b │ +└───┘ + +1 rows in set. Elapsed: 0.002 sec. +``` + +Это поведение отличается от поведения MySQL для типа `CHAR`, где строки дополняются пробелами, а пробелы перед выводом вырезаются. + +Обратите внимание, что длина значения `FixedString(N)` постоянна. Функция [length](../query_language/functions/array_functions.md#array_functions-length) возвращает `N` даже если значение `FixedString(N)` заполнено только нулевыми байтами, однако функция [empty](../query_language/functions/string_functions.md#string_functions-empty) в этом же случае возвращает `1`. [Оригинальная статья](https://clickhouse.yandex/docs/ru/data_types/fixedstring/) diff --git a/docs/ru/query_language/functions/array_functions.md b/docs/ru/query_language/functions/array_functions.md index 7cc4cb41b8e..406f8e01509 100644 --- a/docs/ru/query_language/functions/array_functions.md +++ b/docs/ru/query_language/functions/array_functions.md @@ -12,7 +12,7 @@ Тип результата - UInt8. Функция также работает для строк. -## length +## length {#array_functions-length} Возвращает количество элементов в массиве. Тип результата - UInt64. From c39c32973cab8faaca26b20495d1cc7075cc0c2d Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 13 Mar 2019 13:46:49 +0300 Subject: [PATCH 266/297] DOCAPI-5102: Description of insert_sample_with_metadata. Update of JSONEachRow docs. (#4653) --- docs/en/interfaces/formats.md | 79 ++++++++++++++++++++----- docs/en/operations/settings/settings.md | 26 +++++++- 2 files changed, 87 insertions(+), 18 deletions(-) diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index d6c569bc397..5d59815b25c 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -242,7 +242,7 @@ SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase WITH TOTA } ``` -The JSON is compatible with JavaScript. To ensure this, some characters are additionally escaped: the slash `/` is escaped as `\/`; alternative line breaks `U+2028` and `U+2029`, which break some browsers, are escaped as `\uXXXX`. ASCII control characters are escaped: backspace, form feed, line feed, carriage return, and horizontal tab are replaced with `\b`, `\f`, `\n`, `\r`, `\t` , as well as the remaining bytes in the 00-1F range using `\uXXXX` sequences. Invalid UTF-8 sequences are changed to the replacement character � so the output text will consist of valid UTF-8 sequences. For compatibility with JavaScript, Int64 and UInt64 integers are enclosed in double quotes by default. To remove the quotes, you can set the configuration parameter output_format_json_quote_64bit_integers to 0. +The JSON is compatible with JavaScript. To ensure this, some characters are additionally escaped: the slash `/` is escaped as `\/`; alternative line breaks `U+2028` and `U+2029`, which break some browsers, are escaped as `\uXXXX`. ASCII control characters are escaped: backspace, form feed, line feed, carriage return, and horizontal tab are replaced with `\b`, `\f`, `\n`, `\r`, `\t` , as well as the remaining bytes in the 00-1F range using `\uXXXX` sequences. Invalid UTF-8 sequences are changed to the replacement character � so the output text will consist of valid UTF-8 sequences. For compatibility with JavaScript, Int64 and UInt64 integers are enclosed in double quotes by default. To remove the quotes, you can set the configuration parameter [output_format_json_quote_64bit_integers](../operations/settings/settings.md#session_settings-output_format_json_quote_64bit_integers) to 0. `rows` – The total number of output rows. @@ -257,7 +257,7 @@ This format is only appropriate for outputting a query result, but not for parsi ClickHouse supports [NULL](../query_language/syntax.md), which is displayed as `null` in the JSON output. -See also the JSONEachRow format. +See also the [JSONEachRow](#jsoneachrow) format. ## JSONCompact {#jsoncompact} @@ -307,24 +307,73 @@ See also the `JSONEachRow` format. ## JSONEachRow {#jsoneachrow} -Outputs data as separate JSON objects for each row (newline delimited JSON). +When using this format, ClickHouse outputs rows as separated, newline delimited JSON objects, but the whole data is not a valid JSON. ```json -{"SearchPhrase":"","count()":"8267016"} -{"SearchPhrase": "bathroom interior design","count()": "2166"} -{"SearchPhrase":"yandex","count()":"1655"} -{"SearchPhrase":"2014 spring fashion","count()":"1549"} -{"SearchPhrase":"freeform photo","count()":"1480"} -{"SearchPhrase":"angelina jolie","count()":"1245"} -{"SearchPhrase":"omsk","count()":"1112"} -{"SearchPhrase":"photos of dog breeds","count()":"1091"} {"SearchPhrase":"curtain designs","count()":"1064"} {"SearchPhrase":"baku","count()":"1000"} +{"SearchPhrase":"","count":"8267016"} ``` -Unlike the JSON format, there is no substitution of invalid UTF-8 sequences. Any set of bytes can be output in the rows. This is necessary so that data can be formatted without losing any information. Values are escaped in the same way as for JSON. +When inserting the data, you should provide a separate JSON object for each row. -For parsing, any order is supported for the values of different columns. It is acceptable for some values to be omitted – they are treated as equal to their default values. In this case, zeros and blank rows are used as default values. Complex values that could be specified in the table are not supported as defaults, but it can be turned on by option `insert_sample_with_metadata=1`. Whitespace between elements is ignored. If a comma is placed after the objects, it is ignored. Objects don't necessarily have to be separated by new lines. +### Inserting the Data + +``` +INSERT INTO UserActivity FORMAT JSONEachRow {"PageViews":5, "UserID":"4324182021466249494", "Duration":146,"Sign":-1} {"UserID":"4324182021466249494","PageViews":6,"Duration":185,"Sign":1} +``` + +ClickHouse allows: + +- Any order of key-value pairs in the object. +- The omission of some values. + +ClickHouse ignores spaces between elements and commas after the objects. You can pass all the objects to a line. You do not have to separate them with line breaks. + +**Processing of omitted values** + +ClickHouse substitutes the omitted values with the default values of corresponding [data types](../data_types/index.md). + +In case of the `DEFAULT expr` is specified, ClickHouse uses different substitution rules depending on the [insert_sample_with_metadata](../operations/settings/settings.md#session_settings-insert_sample_with_metadata) setting. + +Let's consider the following table: + +``` +CREATE TABLE IF NOT EXISTS example_table +( + x UInt32, + a DEFAULT x * 2 +) ENGINE = Memory; +``` + +- If `insert_sample_with_metadata = 0`, then the default value for `x` and `a` equals `0` (as a default value for `UInt32` data type). +- If `insert_sample_with_metadata = 1`, then the default value for `x` equals `0`, but the default value of `a` equals `x * 2`. + +!!! note "Warning" + Use this option carefully, enabling it negatively affects the performance of the ClickHouse server. + +### Selecting the Data + +Let's consider the `UserActivity` table as an example: + +``` +┌──────────────UserID─┬─PageViews─┬─Duration─┬─Sign─┐ +│ 4324182021466249494 │ 5 │ 146 │ -1 │ +│ 4324182021466249494 │ 6 │ 185 │ 1 │ +└─────────────────────┴───────────┴──────────┴──────┘ +``` + +The query `SELECT * FROM UserActivity FORMAT JSONEachRow` returns: + +``` +{"UserID":"4324182021466249494","PageViews":5,"Duration":146,"Sign":-1} +{"UserID":"4324182021466249494","PageViews":6,"Duration":185,"Sign":1} +``` + +Unlike the [JSON](#json) format, there is no substitution of invalid UTF-8 sequences. Values are escaped in the same way as for `JSON`. + +!!! note "Note" + Any set of bytes can be output in the strings. Use the `JSONEachRow` format if you are sure that the data in the table can be formatted into JSON without losing any information. ## Native {#native} @@ -363,7 +412,7 @@ Rows are not escaped in Pretty* formats. Example is shown for the [PrettyCompact SELECT 'String with \'quotes\' and \t character' AS Escaping_test ``` -``` +``` ┌─Escaping_test────────────────────────┐ │ String with 'quotes' and character │ └──────────────────────────────────────┘ @@ -482,7 +531,7 @@ Row 1: x: 1 y: ᴺᵁᴸᴸ ``` -Rows are not escaped in Vertical format: +Rows are not escaped in Vertical format: ``` sql SELECT 'string with \'quotes\' and \t with some special \n characters' AS test FORMAT Vertical diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md index fff660999e2..2c7e68e3716 100644 --- a/docs/en/operations/settings/settings.md +++ b/docs/en/operations/settings/settings.md @@ -81,9 +81,29 @@ If an error occurred while reading rows but the error counter is still less than If `input_format_allow_errors_ratio` is exceeded, ClickHouse throws an exception. -## insert_sample_with_metadata +## insert_sample_with_metadata {#session_settings-insert_sample_with_metadata} -For INSERT queries, specifies that the server need to send metadata about column defaults to the client. This will be used to calculate default expressions. Disabled by default. +Turns on/off the extended data exchange between a ClickHouse client and a ClickHouse server. The setting is applies for `INSERT` queries. + +When executing the `INSERT` query, ClickHouse client prepares data and sends it to the server for writing. During the preparation of the data, the client gets the table structure from the server. In some cases, the client needs more information than the server sends by default. Turn on the extended data exchange with `insert_sample_with_metadata = 1`. + +When the extended data exchange is enabled, the server sends the additional metadata along with the table structure. The composition of the metadata depends on the operation. + +Operations where you may need the extended data exchange enabled: + +- Inserting the data of the [JSONEachRow](../../interfaces/formats.md#jsoneachrow) format. + +For all other operations ClickHouse doesn't apply the setting. + +!!! note "Note" + The functionality of the extended data exchange consumes additional computing resources on the server and can reduce the performance. + +**Possible values** + +- 0 — Functionality is disabled. +- 1 — Functionality is enabled. + +**Default value:** 0. ## join_default_strictness {#settings-join_default_strictness} @@ -406,7 +426,7 @@ The results of compilation are saved in the build directory in the form of .so f If the value is true, running INSERT skips input data from columns with unknown names. Otherwise, this situation will generate an exception. It works for JSONEachRow and TSKV formats. -## output_format_json_quote_64bit_integers +## output_format_json_quote_64bit_integers {#session_settings-output_format_json_quote_64bit_integers} If the value is true, integers appear in quotes when using JSON\* Int64 and UInt64 formats (for compatibility with most JavaScript implementations); otherwise, integers are output without the quotes. From 8cf09469ddba3fe5d8adae1edfb578a85eefec3f Mon Sep 17 00:00:00 2001 From: alesapin Date: Wed, 13 Mar 2019 14:03:57 +0300 Subject: [PATCH 267/297] Add ability to specify check of hung queries with --hung-check --- dbms/tests/clickhouse-test | 92 +++++++++++++++++++++++++++----------- 1 file changed, 66 insertions(+), 26 deletions(-) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 1cf4882ddc8..dac0b5ae08c 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -44,6 +44,31 @@ def remove_control_characters(s): s = re.sub(ur"[\x00-\x08\x0b\x0e-\x1f\x7f]", "", s) return s +def get_processlist(client_cmd): + try: + return subprocess.check_output("{} --query 'SHOW PROCESSLIST FORMAT Vertical'".format(client_cmd), shell=True) + except: + return "" # server seems dead + +def get_stacktraces(server_pid): + cmd = "gdb -q -ex 'set pagination off' -ex 'backtrace' -ex 'thread apply all backtrace' -ex 'detach' -ex 'quit' --pid {} 2>/dev/null".format(server_pid) + try: + return subprocess.check_output(cmd, shell=True) + except Exception as ex: + return "Error occured while receiving stack traces {}".format(str(ex)) + +def get_server_pid(server_tcp_port): + cmd = "lsof -i tcp:{port} | grep '*:{port}'".format(port=server_tcp_port) + try: + output = subprocess.check_output(cmd, shell=True) + if output: + columns = output.strip().split(' ') + return int(columns[1]) + else: + return None # server dead + except Exception as ex: + return None + def main(args): SERVER_DIED = False @@ -322,12 +347,26 @@ def main(args): failures_total = failures_total + failures + exit_code = 0 if failures_total > 0: print(colored("\nHaving {failures_total} errors! {passed_total} tests passed. {skipped_total} tests skipped.".format(passed_total = passed_total, skipped_total = skipped_total, failures_total = failures_total), "red", attrs=["bold"])) - sys.exit(1) + exit_code = 1 else: print(colored("\n{passed_total} tests passed. {skipped_total} tests skipped.".format(passed_total = passed_total, skipped_total = skipped_total), "green", attrs=["bold"])) - sys.exit(0) + + if args.hung_check: + processlist = get_processlist(args.client) + if processlist: + server_pid = get_server_pid(os.getenv("CLICKHOUSE_PORT_TCP", '9000')) + print(colored("\nFound hung queries in processlist:", "red", attrs=["bold"])) + print(processlist) + if server_pid: + print("\nStacktraces of all threads:") + print(get_stacktraces(server_pid)) + exit_code = 1 + + sys.exit(exit_code) + def find_binary(name): paths = os.environ.get("PATH").split(':') @@ -339,31 +378,32 @@ def find_binary(name): return os.access(os.path.join('/usr/bin', name), os.X_OK) if __name__ == '__main__': - parser = ArgumentParser(description = 'ClickHouse functional tests') - parser.add_argument('-q', '--queries', help = 'Path to queries dir') - parser.add_argument('--tmp', help = 'Path to tmp dir') - parser.add_argument('-b', '--binary', default = 'clickhouse', help = 'Main clickhouse binary') - parser.add_argument('-c', '--client', help = 'Client program') - parser.add_argument('--extract_from_config', help = 'extract-from-config program') - parser.add_argument('--configclient', help = 'Client config (if you use not default ports)') - parser.add_argument('--configserver', default= '/etc/clickhouse-server/config.xml', help = 'Preprocessed server config') - parser.add_argument('-o', '--output', help = 'Output xUnit compliant test report directory') - parser.add_argument('-t', '--timeout', type = int, default = 600, help = 'Timeout for each test case in seconds') - parser.add_argument('test', nargs = '?', help = 'Optional test case name regex') - parser.add_argument('-d', '--disabled', action = 'store_true', default = False, help = 'Also run disabled tests') - parser.add_argument('--stop', action = 'store_true', default = None, dest = 'stop', help = 'Stop on network errors') - parser.add_argument('--order', default = 'desc', help = 'Run order (asc, desc, random)') - parser.add_argument('--testname', action = 'store_true', default = None, dest = 'testname', help = 'Make query with test name before test run') + parser=ArgumentParser(description='ClickHouse functional tests') + parser.add_argument('-q', '--queries', help='Path to queries dir') + parser.add_argument('--tmp', help='Path to tmp dir') + parser.add_argument('-b', '--binary', default='clickhouse', help='Main clickhouse binary') + parser.add_argument('-c', '--client', help='Client program') + parser.add_argument('--extract_from_config', help='extract-from-config program') + parser.add_argument('--configclient', help='Client config (if you use not default ports)') + parser.add_argument('--configserver', default= '/etc/clickhouse-server/config.xml', help='Preprocessed server config') + parser.add_argument('-o', '--output', help='Output xUnit compliant test report directory') + parser.add_argument('-t', '--timeout', type=int, default=600, help='Timeout for each test case in seconds') + parser.add_argument('test', nargs='?', help='Optional test case name regex') + parser.add_argument('-d', '--disabled', action='store_true', default=False, help='Also run disabled tests') + parser.add_argument('--stop', action='store_true', default=None, dest='stop', help='Stop on network errors') + parser.add_argument('--order', default='desc', help='Run order (asc, desc, random)') + parser.add_argument('--testname', action='store_true', default=None, dest='testname', help='Make query with test name before test run') + parser.add_argument('--hung-check', action='store_true', default=False) - parser.add_argument('--no-stateless', action = 'store_true', help = 'Disable all stateless tests') - parser.add_argument('--skip', nargs='+', help = "Skip these tests") - parser.add_argument('--no-long', action = 'store_false', dest = 'no_long', help = 'Do not run long tests') - group = parser.add_mutually_exclusive_group(required = False) - group.add_argument('--zookeeper', action = 'store_true', default = None, dest = 'zookeeper', help = 'Run zookeeper related tests') - group.add_argument('--no-zookeeper', action = 'store_false', default = None, dest = 'zookeeper', help = 'Do not run zookeeper related tests') - group = parser.add_mutually_exclusive_group(required = False) - group.add_argument('--shard', action = 'store_true', default = None, dest = 'shard', help = 'Run sharding related tests (required to clickhouse-server listen 127.0.0.2 127.0.0.3)') - group.add_argument('--no-shard', action = 'store_false', default = None, dest = 'shard', help = 'Do not run shard related tests') + parser.add_argument('--no-stateless', action='store_true', help='Disable all stateless tests') + parser.add_argument('--skip', nargs='+', help="Skip these tests") + parser.add_argument('--no-long', action='store_false', dest='no_long', help='Do not run long tests') + group=parser.add_mutually_exclusive_group(required=False) + group.add_argument('--zookeeper', action='store_true', default=None, dest='zookeeper', help='Run zookeeper related tests') + group.add_argument('--no-zookeeper', action='store_false', default=None, dest='zookeeper', help='Do not run zookeeper related tests') + group=parser.add_mutually_exclusive_group(required=False) + group.add_argument('--shard', action='store_true', default=None, dest='shard', help='Run sharding related tests (required to clickhouse-server listen 127.0.0.2 127.0.0.3)') + group.add_argument('--no-shard', action='store_false', default=None, dest='shard', help='Do not run shard related tests') args = parser.parse_args() From b942b9c90f6dc32c178a9f492a7c76347d4dc91d Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Wed, 13 Mar 2019 14:13:40 +0100 Subject: [PATCH 268/297] Upgrade librdkafka to RC8 --- contrib/librdkafka | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/librdkafka b/contrib/librdkafka index 51ae5f5fd8b..73295a702cd 160000 --- a/contrib/librdkafka +++ b/contrib/librdkafka @@ -1 +1 @@ -Subproject commit 51ae5f5fd8b742e56f47a8bb0136344868818285 +Subproject commit 73295a702cd1c85c11749ade500d713db7099cca From 340f0935aca073382a2d8045bfd877215eace444 Mon Sep 17 00:00:00 2001 From: alesapin Date: Wed, 13 Mar 2019 16:52:23 +0300 Subject: [PATCH 269/297] Update docker image, and more verbosity --- dbms/tests/clickhouse-test | 2 ++ docker/test/stateless/Dockerfile | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index dac0b5ae08c..ceccf9633dc 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -364,6 +364,8 @@ def main(args): print("\nStacktraces of all threads:") print(get_stacktraces(server_pid)) exit_code = 1 + else: + print(colored("\nNo queries hung.", "green", attrs=["bold"])) sys.exit(exit_code) diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index 34a64a24b1a..dcd7a0bcad0 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -20,7 +20,9 @@ RUN apt-get update -y \ netcat-openbsd \ telnet \ moreutils \ - brotli + brotli \ + gdb \ + lsof ENV TZ=Europe/Moscow @@ -42,4 +44,4 @@ CMD dpkg -i package_folder/clickhouse-common-static_*.deb; \ echo "UBSAN_SYMBOLIZER_PATH=/usr/lib/llvm-6.0/bin/llvm-symbolizer" >> /etc/environment; \ echo "LLVM_SYMBOLIZER_PATH=/usr/lib/llvm-6.0/bin/llvm-symbolizer" >> /etc/environment; \ service zookeeper start; sleep 5; \ - service clickhouse-server start && sleep 5 && clickhouse-test --shard --zookeeper $SKIP_TESTS_OPTION 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee test_output/test_result.txt + service clickhouse-server start && sleep 5 && clickhouse-test --shard --zookeeper $ADDITIONAL_OPTIONS $SKIP_TESTS_OPTION 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee test_output/test_result.txt From cf8001b6a9eff3d383f5c302d3a1af3750265af0 Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 13 Mar 2019 16:58:04 +0300 Subject: [PATCH 270/297] Fix includes (#4673) --- .../AggregateFunctions/AggregateFunctionGroupBitmapData.h | 1 + dbms/src/Core/AccurateComparison.h | 4 ++-- dbms/src/Functions/FunctionsRound.h | 2 +- dbms/src/IO/WriteIntText.h | 1 + dbms/src/Interpreters/Aliases.h | 2 +- dbms/src/Interpreters/PredicateExpressionsOptimizer.h | 4 ++-- libs/libcommon/include/common/constexpr_helpers.h | 1 + libs/libcommon/include/common/itoa.h | 1 + libs/libglibc-compatibility/musl/atomic_arch.h | 2 ++ utils/check-style/check-include | 6 +++++- 10 files changed, 17 insertions(+), 7 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionGroupBitmapData.h b/dbms/src/AggregateFunctions/AggregateFunctionGroupBitmapData.h index ea7907b4d60..7f41e3f4fcf 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionGroupBitmapData.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionGroupBitmapData.h @@ -6,6 +6,7 @@ #include #include #include +#include namespace DB { diff --git a/dbms/src/Core/AccurateComparison.h b/dbms/src/Core/AccurateComparison.h index 62402c339f7..4fa33c7d099 100644 --- a/dbms/src/Core/AccurateComparison.h +++ b/dbms/src/Core/AccurateComparison.h @@ -2,9 +2,9 @@ #include #include - +#include "Defines.h" +#include "Types.h" #include -#include #include /** Preceptually-correct number comparisons. diff --git a/dbms/src/Functions/FunctionsRound.h b/dbms/src/Functions/FunctionsRound.h index 9e93e16e7bb..bff8248b3ea 100644 --- a/dbms/src/Functions/FunctionsRound.h +++ b/dbms/src/Functions/FunctionsRound.h @@ -8,7 +8,7 @@ #include #include #include - +#include "IFunction.h" #include #include #include diff --git a/dbms/src/IO/WriteIntText.h b/dbms/src/IO/WriteIntText.h index 15276bba63f..4e18826600e 100644 --- a/dbms/src/IO/WriteIntText.h +++ b/dbms/src/IO/WriteIntText.h @@ -3,6 +3,7 @@ #include #include #include +#include /// 40 digits or 39 digits and a sign #define WRITE_HELPERS_MAX_INT_WIDTH 40U diff --git a/dbms/src/Interpreters/Aliases.h b/dbms/src/Interpreters/Aliases.h index 80976c7551f..b51dc80ae5f 100644 --- a/dbms/src/Interpreters/Aliases.h +++ b/dbms/src/Interpreters/Aliases.h @@ -1,7 +1,7 @@ #pragma once #include - +#include #include namespace DB diff --git a/dbms/src/Interpreters/PredicateExpressionsOptimizer.h b/dbms/src/Interpreters/PredicateExpressionsOptimizer.h index 9281247dd4e..0492600ca85 100644 --- a/dbms/src/Interpreters/PredicateExpressionsOptimizer.h +++ b/dbms/src/Interpreters/PredicateExpressionsOptimizer.h @@ -1,7 +1,7 @@ #pragma once -#include - +#include "DatabaseAndTableWithAlias.h" +#include "ExpressionAnalyzer.h" #include namespace DB diff --git a/libs/libcommon/include/common/constexpr_helpers.h b/libs/libcommon/include/common/constexpr_helpers.h index c6fcb0bb4db..2dad106a7a3 100644 --- a/libs/libcommon/include/common/constexpr_helpers.h +++ b/libs/libcommon/include/common/constexpr_helpers.h @@ -1,6 +1,7 @@ #pragma once #include +#include template inline constexpr bool static_in_v = std::disjunction_v...>; diff --git a/libs/libcommon/include/common/itoa.h b/libs/libcommon/include/common/itoa.h index bd49156f4b4..19575c1fbcc 100644 --- a/libs/libcommon/include/common/itoa.h +++ b/libs/libcommon/include/common/itoa.h @@ -30,6 +30,7 @@ #include #include #include +#include "likely.h" using int128_t = __int128; using uint128_t = unsigned __int128; diff --git a/libs/libglibc-compatibility/musl/atomic_arch.h b/libs/libglibc-compatibility/musl/atomic_arch.h index da4e2037548..cb3bf8da7fd 100644 --- a/libs/libglibc-compatibility/musl/atomic_arch.h +++ b/libs/libglibc-compatibility/musl/atomic_arch.h @@ -1,3 +1,5 @@ +#include + #define a_cas a_cas static inline int a_cas(volatile int *p, int t, int s) { diff --git a/utils/check-style/check-include b/utils/check-style/check-include index 4a02f488278..4c0e0c69e83 100755 --- a/utils/check-style/check-include +++ b/utils/check-style/check-include @@ -18,6 +18,7 @@ inc="-I. \ -I./contrib/libmetrohash/src \ -I./contrib/double-conversion \ -I./contrib/cityhash102/include \ +-I./contrib/croaring \ -I./contrib/murmurhash/include \ -I./contrib/zookeeper/src/c/include \ -I./contrib/zookeeper/src/c/generated \ @@ -54,6 +55,9 @@ inc="-I. \ -I./libs/consistent-hashing-sumbur \ -I./contrib/libhdfs3/include \ -I./contrib/base64/include \ +-I./contrib/protobuf/src \ +-I./contrib/cppkafka/include \ +-I./contrib/librdkafka-cmake/include \ -I./contrib/lz4/lib \ -I./dbms/src \ -I${BUILD_DIR}/dbms/src" @@ -64,5 +68,5 @@ if [ -z $1 ]; then else echo -n "$1 " echo -n `grep "#include" $1| wc -l` " " - echo "#include <$1> \n int main() {return 0;}" | time --format "%e %M" ${CXX:=g++-7} -c -std=c++1z $inc -x c++ - + echo "#include <$1>\nint main() {return 0;}" | time --format "%e %M" ${CXX:=g++-7} -c -std=c++1z $inc -x c++ - fi From 49448b4a00fe22df61e8a45fce91b669e1fc70ff Mon Sep 17 00:00:00 2001 From: alesapin Date: Wed, 13 Mar 2019 19:47:02 +0300 Subject: [PATCH 271/297] Retry on Exception connection loss --- dbms/tests/clickhouse-test | 47 ++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 1cf4882ddc8..e69594cdc7c 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -30,6 +30,10 @@ MSG_UNKNOWN = OP_SQUARE_BRACKET + colored(" UNKNOWN ", "yellow", attrs=['bold']) MSG_OK = OP_SQUARE_BRACKET + colored(" OK ", "green", attrs=['bold']) + CL_SQUARE_BRACKET MSG_SKIPPED = OP_SQUARE_BRACKET + colored(" SKIPPED ", "cyan", attrs=['bold']) + CL_SQUARE_BRACKET +MESSAGES_TO_RETRY = [ + "Coordination::Exception: Connection loss", +] + def remove_control_characters(s): """ @@ -44,6 +48,28 @@ def remove_control_characters(s): s = re.sub(ur"[\x00-\x08\x0b\x0e-\x1f\x7f]", "", s) return s + +def run_single_test(args, ext, server_logs_level, case_file, stdout_file, stderr_file): + if ext == '.sql': + command = "{0} --send_logs_level={1} --testmode --multiquery < {2} > {3} 2> {4}".format(args.client, server_logs_level, case_file, stdout_file, stderr_file) + else: + command = "{} > {} 2> {}".format(case_file, stdout_file, stderr_file) + + proc = Popen(command, shell = True) + start_time = datetime.now() + while (datetime.now() - start_time).total_seconds() < args.timeout and proc.poll() is None: + sleep(0.01) + + stdout = open(stdout_file, 'r').read() if os.path.exists(stdout_file) else '' + stdout = unicode(stdout, errors='replace', encoding='utf-8') + stderr = open(stderr_file, 'r').read() if os.path.exists(stderr_file) else '' + stderr = unicode(stderr, errors='replace', encoding='utf-8') + + return proc, stdout, stderr + +def need_retry(stderr): + return any(msg in stderr for msg in MESSAGES_TO_RETRY) + def main(args): SERVER_DIED = False @@ -201,16 +227,7 @@ def main(args): stdout_file = os.path.join(suite_tmp_dir, name) + '.stdout' stderr_file = os.path.join(suite_tmp_dir, name) + '.stderr' - if ext == '.sql': - command = "{0} --send_logs_level={1} --testmode --multiquery < {2} > {3} 2> {4}".format(args.client, server_logs_level, case_file, stdout_file, stderr_file) - else: - command = "{} > {} 2> {}".format(case_file, stdout_file, stderr_file) - - proc = Popen(command, shell = True) - start_time = datetime.now() - while (datetime.now() - start_time).total_seconds() < args.timeout and proc.poll() is None: - sleep(0.01) - + proc, stdout, stderr = run_single_test(args, ext, server_logs_level, case_file, stdout_file, stderr_file) if proc.returncode is None: try: proc.kill() @@ -224,10 +241,12 @@ def main(args): failures += 1 print("{0} - Timeout!".format(MSG_FAIL)) else: - stdout = open(stdout_file, 'r').read() if os.path.exists(stdout_file) else '' - stdout = unicode(stdout, errors='replace', encoding='utf-8') - stderr = open(stderr_file, 'r').read() if os.path.exists(stderr_file) else '' - stderr = unicode(stderr, errors='replace', encoding='utf-8') + counter = 1 + while proc.returncode != 0 and need_retry(stderr): + proc, stdout, stderr = run_single_test(args, ext, server_logs_level, case_file, stdout_file, stderr_file) + sleep(2**counter) + if counter > 6: + break if proc.returncode != 0: failure = et.Element("failure", attrib = {"message": "return code {}".format(proc.returncode)}) From a2eaec4766f7f8f67031ea07686f52aa90da2dd7 Mon Sep 17 00:00:00 2001 From: alesapin Date: Wed, 13 Mar 2019 19:55:30 +0300 Subject: [PATCH 272/297] Fix retry loop --- dbms/tests/clickhouse-test | 1 + 1 file changed, 1 insertion(+) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 9d3bf9b535f..9b3f56847ee 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -269,6 +269,7 @@ def main(args): while proc.returncode != 0 and need_retry(stderr): proc, stdout, stderr = run_single_test(args, ext, server_logs_level, case_file, stdout_file, stderr_file) sleep(2**counter) + counter += 1 if counter > 6: break From a69fa003bb308fb64b68eb70be2e6e07f1867885 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Thu, 14 Mar 2019 01:20:48 +0800 Subject: [PATCH 273/297] Do not wait when there is not log entry. --- dbms/src/Storages/StorageReplicatedMergeTree.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index 5e479e1ebee..cc92dd4fac5 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -3080,7 +3080,8 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p } /// TODO: Bad setting name for such purpose - if (query_context.getSettingsRef().replication_alter_partitions_sync != 0) + if (merge_entry.type != ReplicatedMergeTreeLogEntryData::Type::EMPTY + && query_context.getSettingsRef().replication_alter_partitions_sync != 0) waitForAllReplicasToProcessLogEntry(merge_entry); return true; From 84420eefef7728f09c44e1e8c72202145058f638 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 14 Mar 2019 04:11:07 +0300 Subject: [PATCH 274/297] Fixed test #4654. --- .../0_stateless/00916_create_or_replace_view.reference | 2 +- .../queries/0_stateless/00916_create_or_replace_view.sql | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference index 67943761a47..c8e912a9a45 100644 --- a/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference +++ b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.reference @@ -1,2 +1,2 @@ CREATE VIEW test.t ( number UInt64) AS SELECT number FROM system.numbers -CREATE VIEW test.t ( next_number UInt64) AS SELECT number + 1 FROM system.numbers +CREATE VIEW test.t ( next_number UInt64) AS SELECT number + 1 AS next_number FROM system.numbers diff --git a/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql index a246a53cf50..af658ac96f5 100644 --- a/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql +++ b/dbms/tests/queries/0_stateless/00916_create_or_replace_view.sql @@ -2,5 +2,8 @@ DROP TABLE IF EXISTS test.t; CREATE OR REPLACE VIEW test.t (number UInt64) AS SELECT number FROM system.numbers; SHOW CREATE TABLE test.t; -CREATE OR REPLACE VIEW test.t (next_number UInt64) AS SELECT number+1 FROM system.numbers; + +CREATE OR REPLACE VIEW test.t AS SELECT number+1 AS next_number FROM system.numbers; SHOW CREATE TABLE test.t; + +DROP TABLE test.t; From b405c7456fec469bb35c9b7650148685e0085ed7 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Thu, 14 Mar 2019 01:20:48 +0800 Subject: [PATCH 275/297] Refinement --- dbms/src/Storages/StorageReplicatedMergeTree.cpp | 16 ++++++++++++---- ...eplicated_merge_tree_optimize_final.reference | 0 ...mpty_replicated_merge_tree_optimize_final.sql | 9 +++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.reference create mode 100644 dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.sql diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index cc92dd4fac5..c73af3786c7 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -3014,7 +3014,7 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p return true; } - ReplicatedMergeTreeLogEntryData merge_entry; + std::vector merge_entries; { /// We must select parts for merge under merge_selecting_mutex because other threads /// (merge_selecting_thread or OPTIMIZE queries) could assign new merges. @@ -3045,9 +3045,12 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p FutureMergedMutatedPart future_merged_part; bool selected = merger_mutator.selectAllPartsToMergeWithinPartition( future_merged_part, disk_space, can_merge, partition_id, true, nullptr); + ReplicatedMergeTreeLogEntryData merge_entry; if (selected && !createLogEntryToMergeParts(zookeeper, future_merged_part.parts, future_merged_part.name, deduplicate, &merge_entry)) return handle_noop("Can't create merge queue node in ZooKeeper"); + if (merge_entry.type != ReplicatedMergeTreeLogEntryData::Type::EMPTY) + merge_entries.push_back(std::move(merge_entry)); } } else @@ -3074,15 +3077,20 @@ bool StorageReplicatedMergeTree::optimize(const ASTPtr & query, const ASTPtr & p return handle_noop(disable_reason); } + ReplicatedMergeTreeLogEntryData merge_entry; if (!createLogEntryToMergeParts(zookeeper, future_merged_part.parts, future_merged_part.name, deduplicate, &merge_entry)) return handle_noop("Can't create merge queue node in ZooKeeper"); + if (merge_entry.type != ReplicatedMergeTreeLogEntryData::Type::EMPTY) + merge_entries.push_back(std::move(merge_entry)); } } /// TODO: Bad setting name for such purpose - if (merge_entry.type != ReplicatedMergeTreeLogEntryData::Type::EMPTY - && query_context.getSettingsRef().replication_alter_partitions_sync != 0) - waitForAllReplicasToProcessLogEntry(merge_entry); + if (query_context.getSettingsRef().replication_alter_partitions_sync != 0) + { + for (auto & merge_entry : merge_entries) + waitForAllReplicasToProcessLogEntry(merge_entry); + } return true; } diff --git a/dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.reference b/dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.sql b/dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.sql new file mode 100644 index 00000000000..6903209c5c4 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00925_empty_replicated_merge_tree_optimize_final.sql @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS test.replicated_optimize1; +DROP TABLE IF EXISTS test.replicated_optimize2; +CREATE TABLE test.replicated_optimize1 (d Date, k UInt64, i32 Int32) ENGINE=ReplicatedMergeTree('/clickhouse/tables/test/optimize', 'r1', d, k, 8192); +CREATE TABLE test.replicated_optimize2 (d Date, k UInt64, i32 Int32) ENGINE=ReplicatedMergeTree('/clickhouse/tables/test/optimize', 'r2', d, k, 8192); + +OPTIMIZE TABLE test.replicated_optimize1 FINAL; + +DROP TABLE test.replicated_optimize1; +DROP TABLE test.replicated_optimize2; From 3e8d9ec450ab34885dff84002344412e7561d465 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 14 Mar 2019 05:53:15 +0300 Subject: [PATCH 276/297] Added a test for multiple JOINs from Denny Crane #4571 --- ...00917_multiple_joins_denny_crane.reference | 2 + .../00917_multiple_joins_denny_crane.sql | 40 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference create mode 100644 dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql diff --git a/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference new file mode 100644 index 00000000000..0b1df65ee71 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference @@ -0,0 +1,2 @@ +CAT 2 +CAT 2 diff --git a/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql new file mode 100644 index 00000000000..d1e137c0f40 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql @@ -0,0 +1,40 @@ +USE test; + +DROP TABLE IF EXISTS ANIMAL; + +CREATE TABLE ANIMAL ( ANIMAL Nullable(String) ) engine = TinyLog; +INSERT INTO ANIMAL (ANIMAL) VALUES ('CAT'), ('FISH'), ('DOG'), ('HORSE'), ('BIRD'); + +set enable_optimize_predicate_expression = 0; + +select * from ( +select x.b x, count(distinct x.c) ANIMAL +from ( +select a.ANIMAL a, 'CAT' b, c.ANIMAL c, d.ANIMAL d +from ANIMAL a join ANIMAL b on a.ANIMAL = b.ANIMAL + left outer join ANIMAL c on (b.ANIMAL = c.ANIMAL) + right outer join (select * from ANIMAL union all select * from ANIMAL + union all select * from ANIMAL) d on (a.ANIMAL = d.ANIMAL) +where d.ANIMAL <> 'CAT' and c.ANIMAL <>'DOG' and b.ANIMAL <> 'FISH') as x +where x.b >= 'CAT' +group by x.b +having ANIMAL >= 0) ANIMAL +where ANIMAL.ANIMAL >= 0; + +set enable_optimize_predicate_expression = 1; + +select * from ( +select x.b x, count(distinct x.c) ANIMAL +from ( +select a.ANIMAL a, 'CAT' b, c.ANIMAL c, d.ANIMAL d +from ANIMAL a join ANIMAL b on a.ANIMAL = b.ANIMAL + left outer join ANIMAL c on (b.ANIMAL = c.ANIMAL) + right outer join (select * from ANIMAL union all select * from ANIMAL + union all select * from ANIMAL) d on (a.ANIMAL = d.ANIMAL) +where d.ANIMAL <> 'CAT' and c.ANIMAL <>'DOG' and b.ANIMAL <> 'FISH') as x +where x.b >= 'CAT' +group by x.b +having ANIMAL >= 0) ANIMAL +where ANIMAL.ANIMAL >= 0; + +DROP TABLE ANIMAL; From 4f43893a35c48aaa3973a987b81f2e831dc0f26a Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 14 Mar 2019 14:49:44 +0300 Subject: [PATCH 277/297] Add ability to start table without metadata in zookeeper --- .../Storages/StorageReplicatedMergeTree.cpp | 7 +++ .../__init__.py | 0 .../configs/remote_servers.xml | 14 +++++ .../test.py | 51 +++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 dbms/tests/integration/test_replication_without_zookeeper/__init__.py create mode 100644 dbms/tests/integration/test_replication_without_zookeeper/configs/remote_servers.xml create mode 100644 dbms/tests/integration/test_replication_without_zookeeper/test.py diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index c73af3786c7..0bc33228458 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -277,6 +277,13 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree( return; } + if (attach && !current_zookeeper->exists(zookeeper_path + "/metadata")) + { + LOG_WARNING(log, "No metadata in ZooKeeper: table will be in readonly mode."); + is_readonly = true; + return; + } + if (!attach) { if (!data.getDataParts().empty()) diff --git a/dbms/tests/integration/test_replication_without_zookeeper/__init__.py b/dbms/tests/integration/test_replication_without_zookeeper/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dbms/tests/integration/test_replication_without_zookeeper/configs/remote_servers.xml b/dbms/tests/integration/test_replication_without_zookeeper/configs/remote_servers.xml new file mode 100644 index 00000000000..538aa72d386 --- /dev/null +++ b/dbms/tests/integration/test_replication_without_zookeeper/configs/remote_servers.xml @@ -0,0 +1,14 @@ + + + + + true + + shard_0 + node1 + 9000 + + + + + diff --git a/dbms/tests/integration/test_replication_without_zookeeper/test.py b/dbms/tests/integration/test_replication_without_zookeeper/test.py new file mode 100644 index 00000000000..f340cfb6085 --- /dev/null +++ b/dbms/tests/integration/test_replication_without_zookeeper/test.py @@ -0,0 +1,51 @@ +import time +import pytest + +from helpers.cluster import ClickHouseCluster, CLICKHOUSE_START_COMMAND +from helpers.test_tools import assert_eq_with_retry + +cluster = ClickHouseCluster(__file__) +node1 = cluster.add_instance('node1', main_configs=['configs/remote_servers.xml'], with_zookeeper=True, stay_alive=True) + +@pytest.fixture(scope="module") +def start_cluster(): + try: + cluster.start() + + node1.query( + ''' + CREATE DATABASE test; + CREATE TABLE test_table(date Date, id UInt32) + ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/replicated', 'node1') ORDER BY id PARTITION BY toYYYYMM(date); + ''') + + yield cluster + + except Exception as ex: + print ex + + finally: + cluster.shutdown() + +def drop_zk(zk): + zk.delete(path="/clickhouse", recursive=True) + +def test_startup_without_zookeeper(start_cluster): + node1.query("INSERT INTO test_table VALUES ('2018-10-01', 1), ('2018-10-02', 2), ('2018-10-03', 3)") + node1.query("SELECT COUNT(*) from test_table") == "3\n" + node1.query("SELECT is_readonly from system.replicas where table='test_table'") == "0\n" + + cluster.run_kazoo_commands_with_retries(drop_zk) + + time.sleep(5) + node1.query("SELECT COUNT(*) from test_table") == "3\n" + node1.query("SELECT is_readonly from system.replicas where table='test_table'") == "1\n" + + node1.exec_in_container(["bash", "-c", "pkill clickhouse"], user='root') + time.sleep(5) + + node1.exec_in_container(["bash", "-c", "{} --daemon".format(CLICKHOUSE_START_COMMAND)], user='root') + time.sleep(5) + + node1.query("SELECT COUNT(*) from test_table") == "3\n" + node1.query("SELECT is_readonly from system.replicas where table='test_table'") == "1\n" From fb2bc1ad0ed469efd4b93793c085948c8e19d998 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Thu, 14 Mar 2019 15:28:59 +0300 Subject: [PATCH 278/297] mention the insert_sample_with_metadata setting in the changelogs --- CHANGELOG.md | 2 +- CHANGELOG_RU.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfe4ed6e768..c29255e6026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -293,7 +293,7 @@ ### New features: -* `DEFAULT` expressions are evaluated for missing fields when loading data in semi-structured input formats (`JSONEachRow`, `TSKV`). [#3555](https://github.com/yandex/ClickHouse/pull/3555) +* `DEFAULT` expressions are evaluated for missing fields when loading data in semi-structured input formats (`JSONEachRow`, `TSKV`). The feature is enabled with the `insert_sample_with_metadata` setting. [#3555](https://github.com/yandex/ClickHouse/pull/3555) * The `ALTER TABLE` query now has the `MODIFY ORDER BY` action for changing the sorting key when adding or removing a table column. This is useful for tables in the `MergeTree` family that perform additional tasks when merging based on this sorting key, such as `SummingMergeTree`, `AggregatingMergeTree`, and so on. [#3581](https://github.com/yandex/ClickHouse/pull/3581) [#3755](https://github.com/yandex/ClickHouse/pull/3755) * For tables in the `MergeTree` family, now you can specify a different sorting key (`ORDER BY`) and index (`PRIMARY KEY`). The sorting key can be longer than the index. [#3581](https://github.com/yandex/ClickHouse/pull/3581) * Added the `hdfs` table function and the `HDFS` table engine for importing and exporting data to HDFS. [chenxing-xc](https://github.com/yandex/ClickHouse/pull/3617) diff --git a/CHANGELOG_RU.md b/CHANGELOG_RU.md index d62086e78d7..3c3b425bb7f 100644 --- a/CHANGELOG_RU.md +++ b/CHANGELOG_RU.md @@ -302,7 +302,7 @@ ### Новые возможности: -* Вычисление `DEFAULT` выражений для отсутствующих полей при загрузке данных в полуструктурированных форматах (`JSONEachRow`, `TSKV`). [#3555](https://github.com/yandex/ClickHouse/pull/3555) +* Вычисление `DEFAULT` выражений для отсутствующих полей при загрузке данных в полуструктурированных форматах (`JSONEachRow`, `TSKV`) (требуется включить настройку запроса `insert_sample_with_metadata`). [#3555](https://github.com/yandex/ClickHouse/pull/3555) * Для запроса `ALTER TABLE` добавлено действие `MODIFY ORDER BY` для изменения ключа сортировки при одновременном добавлении или удалении столбца таблицы. Это полезно для таблиц семейства `MergeTree`, выполняющих дополнительную работу при слияниях, согласно этому ключу сортировки, как например, `SummingMergeTree`, `AggregatingMergeTree` и т. п. [#3581](https://github.com/yandex/ClickHouse/pull/3581) [#3755](https://github.com/yandex/ClickHouse/pull/3755) * Для таблиц семейства `MergeTree` появилась возможность указать различный ключ сортировки (`ORDER BY`) и индекс (`PRIMARY KEY`). Ключ сортировки может быть длиннее, чем индекс. [#3581](https://github.com/yandex/ClickHouse/pull/3581) * Добавлена табличная функция `hdfs` и движок таблиц `HDFS` для импорта и экспорта данных в HDFS. [chenxing-xc](https://github.com/yandex/ClickHouse/pull/3617) From 9121822e3f15b16dcb537f65ca132a5dd84e5297 Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 14 Mar 2019 16:39:47 +0300 Subject: [PATCH 279/297] Make restart_clickhouse common methond --- dbms/tests/integration/helpers/cluster.py | 7 +++++++ .../integration/test_replication_without_zookeeper/test.py | 7 ++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dbms/tests/integration/helpers/cluster.py b/dbms/tests/integration/helpers/cluster.py index 8bd930ac1b0..240cc2c8695 100644 --- a/dbms/tests/integration/helpers/cluster.py +++ b/dbms/tests/integration/helpers/cluster.py @@ -482,6 +482,13 @@ class ClickHouseInstance: def get_query_request(self, *args, **kwargs): return self.client.get_query_request(*args, **kwargs) + def restart_clickhouse(self, stop_start_wait_sec=5): + if not self.stay_alive: + raise Exception("clickhouse can be restarted only with stay_alive=True instance") + + self.exec_in_container(["bash", "-c", "pkill clickhouse"], user='root') + time.sleep(stop_start_wait_sec) + self.exec_in_container(["bash", "-c", "{} --daemon".format(CLICKHOUSE_START_COMMAND)], user='root') def exec_in_container(self, cmd, detach=False, **kwargs): container = self.get_docker_handle() diff --git a/dbms/tests/integration/test_replication_without_zookeeper/test.py b/dbms/tests/integration/test_replication_without_zookeeper/test.py index f340cfb6085..408a8f8844d 100644 --- a/dbms/tests/integration/test_replication_without_zookeeper/test.py +++ b/dbms/tests/integration/test_replication_without_zookeeper/test.py @@ -1,7 +1,7 @@ import time import pytest -from helpers.cluster import ClickHouseCluster, CLICKHOUSE_START_COMMAND +from helpers.cluster import ClickHouseCluster from helpers.test_tools import assert_eq_with_retry cluster = ClickHouseCluster(__file__) @@ -41,10 +41,7 @@ def test_startup_without_zookeeper(start_cluster): node1.query("SELECT COUNT(*) from test_table") == "3\n" node1.query("SELECT is_readonly from system.replicas where table='test_table'") == "1\n" - node1.exec_in_container(["bash", "-c", "pkill clickhouse"], user='root') - time.sleep(5) - - node1.exec_in_container(["bash", "-c", "{} --daemon".format(CLICKHOUSE_START_COMMAND)], user='root') + node1.restart_clickhouse() time.sleep(5) node1.query("SELECT COUNT(*) from test_table") == "3\n" From 28a3e78aa5707500e5e75d40c4164de040b4f577 Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 14 Mar 2019 17:46:28 +0300 Subject: [PATCH 280/297] Remove 'Adding of unexpected local part to zookeeper' logic because it's redundant. --- .../Storages/StorageReplicatedMergeTree.cpp | 74 ++++--------------- 1 file changed, 13 insertions(+), 61 deletions(-) diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index 0bc33228458..a37d871f0df 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -547,45 +547,25 @@ void StorageReplicatedMergeTree::checkParts(bool skip_sanity_checks) /// There are no PreCommitted parts at startup. auto parts = data.getDataParts({MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); - /// Local parts that are not in ZK. + /** Local parts that are not in ZK. + * In very rare cases they may cover missing parts + * and someone may think that pushing them to zookeeper is good idea. + * But actually we can't precisely determine that ALL missing parts + * covered by this unexpected part. So missing parts will be downloaded. + */ MergeTreeData::DataParts unexpected_parts; - for (const auto & part : parts) - { - if (expected_parts.count(part->name)) - expected_parts.erase(part->name); - else - unexpected_parts.insert(part); - } - - /// Which local parts to added into ZK. - MergeTreeData::DataPartsVector parts_to_add; - UInt64 parts_to_add_rows = 0; - /// Which parts should be taken from other replicas. Strings parts_to_fetch; - for (const String & missing_name : expected_parts) + for (const auto & part : parts) { - /// If locally some part is missing, but there is a part covering it, you can replace it in ZK with the covering one. - auto containing = data.getActiveContainingPart(missing_name); - if (containing) - { - LOG_ERROR(log, "Ignoring missing local part " << missing_name << " because part " << containing->name << " exists"); - if (unexpected_parts.count(containing)) - { - parts_to_add.push_back(containing); - unexpected_parts.erase(containing); - parts_to_add_rows += containing->rows_count; - } - } + if (expected_parts.count(part->name)) + parts_to_fetch.push_back(part->name); /// these parts we will fetch from other replicas else - parts_to_fetch.push_back(missing_name); + unexpected_parts.insert(part); /// this parts we will place to detached with ignored_ prefix } - for (const String & name : parts_to_fetch) - expected_parts.erase(name); - /** To check the adequacy, for the parts that are in the FS, but not in ZK, we will only consider not the most recent parts. * Because unexpected new parts usually arise only because they did not have time to enroll in ZK with a rough restart of the server. @@ -620,16 +600,10 @@ void StorageReplicatedMergeTree::checkParts(bool skip_sanity_checks) for (const String & name : parts_to_fetch) parts_to_fetch_blocks += get_blocks_count_in_data_part(name); - UInt64 expected_parts_blocks = 0; - for (const String & name : expected_parts) - expected_parts_blocks += get_blocks_count_in_data_part(name); - std::stringstream sanity_report; sanity_report << "There are " << unexpected_parts.size() << " unexpected parts with " << unexpected_parts_rows << " rows (" << unexpected_parts_nonnew << " of them is not just-written with " << unexpected_parts_rows << " rows), " - << parts_to_add.size() << " unexpectedly merged parts with " << parts_to_add_rows << " rows, " - << expected_parts.size() << " missing obsolete parts (with " << expected_parts_blocks << " blocks), " << parts_to_fetch.size() << " missing parts (with " << parts_to_fetch_blocks << " blocks)."; /** We can automatically synchronize data, @@ -645,45 +619,23 @@ void StorageReplicatedMergeTree::checkParts(bool skip_sanity_checks) for (const auto & part : parts) total_rows_on_filesystem += part->rows_count; - UInt64 total_suspicious_rows = parts_to_add_rows + unexpected_parts_rows; - UInt64 total_suspicious_rows_no_new = parts_to_add_rows + unexpected_parts_nonnew_rows; - - bool insane = total_suspicious_rows > total_rows_on_filesystem * data.settings.replicated_max_ratio_of_wrong_parts; + bool insane = unexpected_parts_rows > total_rows_on_filesystem * data.settings.replicated_max_ratio_of_wrong_parts; if (insane && !skip_sanity_checks) { std::stringstream why; why << "The local set of parts of table " << database_name << "." << table_name << " doesn't look like the set of parts " << "in ZooKeeper: " - << formatReadableQuantity(total_suspicious_rows) << " rows of " << formatReadableQuantity(total_rows_on_filesystem) + << formatReadableQuantity(unexpected_parts_rows) << " rows of " << formatReadableQuantity(total_rows_on_filesystem) << " total rows in filesystem are suspicious."; throw Exception(why.str() + " " + sanity_report.str(), ErrorCodes::TOO_MANY_UNEXPECTED_DATA_PARTS); } - if (total_suspicious_rows_no_new > 0) + if (unexpected_parts_nonnew_rows > 0) LOG_WARNING(log, sanity_report.str()); - /// Add information to the ZK about the parts that cover the missing parts. - for (const MergeTreeData::DataPartPtr & part : parts_to_add) - { - LOG_ERROR(log, "Adding unexpected local part to ZooKeeper: " << part->name); - - Coordination::Requests ops; - checkPartChecksumsAndAddCommitOps(zookeeper, part, ops); - zookeeper->multi(ops); - } - - /// Remove from ZK information about the parts covered by the newly added ones. - { - for (const String & name : expected_parts) - LOG_ERROR(log, "Removing unexpectedly merged local part from ZooKeeper: " << name); - - removePartsFromZooKeeper(zookeeper, Strings(expected_parts.begin(), expected_parts.end())); - } - /// Add to the queue jobs to pick up the missing parts from other replicas and remove from ZK the information that we have them. - std::vector> exists_futures; exists_futures.reserve(parts_to_fetch.size()); for (const String & part_name : parts_to_fetch) From 3281e91d07c1cd08bc52db9e8894704213b563c6 Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Thu, 14 Mar 2019 17:59:45 +0300 Subject: [PATCH 281/297] Disable part with predicate optimization for now --- .../00917_multiple_joins_denny_crane.reference | 1 - .../00917_multiple_joins_denny_crane.sql | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference index 0b1df65ee71..38f7ecf84a4 100644 --- a/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference +++ b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.reference @@ -1,2 +1 @@ CAT 2 -CAT 2 diff --git a/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql index d1e137c0f40..cf227ef0e8b 100644 --- a/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql +++ b/dbms/tests/queries/0_stateless/00917_multiple_joins_denny_crane.sql @@ -13,23 +13,7 @@ from ( select a.ANIMAL a, 'CAT' b, c.ANIMAL c, d.ANIMAL d from ANIMAL a join ANIMAL b on a.ANIMAL = b.ANIMAL left outer join ANIMAL c on (b.ANIMAL = c.ANIMAL) - right outer join (select * from ANIMAL union all select * from ANIMAL - union all select * from ANIMAL) d on (a.ANIMAL = d.ANIMAL) -where d.ANIMAL <> 'CAT' and c.ANIMAL <>'DOG' and b.ANIMAL <> 'FISH') as x -where x.b >= 'CAT' -group by x.b -having ANIMAL >= 0) ANIMAL -where ANIMAL.ANIMAL >= 0; - -set enable_optimize_predicate_expression = 1; - -select * from ( -select x.b x, count(distinct x.c) ANIMAL -from ( -select a.ANIMAL a, 'CAT' b, c.ANIMAL c, d.ANIMAL d -from ANIMAL a join ANIMAL b on a.ANIMAL = b.ANIMAL - left outer join ANIMAL c on (b.ANIMAL = c.ANIMAL) - right outer join (select * from ANIMAL union all select * from ANIMAL + right outer join (select * from ANIMAL union all select * from ANIMAL union all select * from ANIMAL) d on (a.ANIMAL = d.ANIMAL) where d.ANIMAL <> 'CAT' and c.ANIMAL <>'DOG' and b.ANIMAL <> 'FISH') as x where x.b >= 'CAT' From 76d118f3103ee4f8c681b0004b5652863be1ddb5 Mon Sep 17 00:00:00 2001 From: chertus Date: Thu, 14 Mar 2019 18:00:42 +0300 Subject: [PATCH 282/297] test for asterisk_left_columns_only --- .../00850_global_join_dups.reference | 2 + .../0_stateless/00850_global_join_dups.sql | 83 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00850_global_join_dups.reference create mode 100644 dbms/tests/queries/0_stateless/00850_global_join_dups.sql diff --git a/dbms/tests/queries/0_stateless/00850_global_join_dups.reference b/dbms/tests/queries/0_stateless/00850_global_join_dups.reference new file mode 100644 index 00000000000..b261da18d51 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00850_global_join_dups.reference @@ -0,0 +1,2 @@ +1 +0 diff --git a/dbms/tests/queries/0_stateless/00850_global_join_dups.sql b/dbms/tests/queries/0_stateless/00850_global_join_dups.sql new file mode 100644 index 00000000000..faf0397374a --- /dev/null +++ b/dbms/tests/queries/0_stateless/00850_global_join_dups.sql @@ -0,0 +1,83 @@ +USE test; +DROP TABLE IF EXISTS t_local; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t_local (dummy UInt8) ENGINE = Memory; +CREATE TABLE t1 (dummy UInt8) ENGINE = Distributed(test_shard_localhost, 'test', 't_local'); +CREATE TABLE t2 (dummy UInt8) ENGINE = Distributed(test_shard_localhost, 'test', 't_local'); + +INSERT INTO t_local VALUES (1); + +SET asterisk_left_columns_only = 1; + +SELECT * FROM t1 +GLOBAL INNER JOIN +( + SELECT * + FROM ( SELECT * FROM t2 ) + INNER JOIN ( SELECT * FROM t1 ) + USING dummy +) USING dummy; + +DROP TABLE t_local; +DROP TABLE t1; +DROP TABLE t2; + + +SELECT * FROM remote('127.0.0.2', system.one) +GLOBAL INNER JOIN +( + SELECT * + FROM ( SELECT dummy FROM remote('127.0.0.2', system.one) ) t1 + GLOBAL INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', system.one) ) t2 + USING dummy +) USING dummy; + + +-- SET asterisk_left_columns_only = 0; +-- +-- SELECT * FROM remote('127.0.0.2', system.one) +-- GLOBAL INNER JOIN +-- ( +-- SELECT *, dummy +-- FROM ( SELECT dummy FROM remote('127.0.0.2', system.one) ) t1 +-- GLOBAL INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', system.one) ) t2 +-- USING dummy +-- ) USING dummy; +-- +-- SELECT * FROM remote('127.0.0.2', system.one) +-- GLOBAL INNER JOIN +-- ( +-- SELECT *, t1.*, t2.* +-- FROM ( SELECT toUInt8(1) AS dummy ) t1 +-- INNER JOIN ( SELECT toUInt8(1) AS dummy ) t2 +-- USING dummy +-- ) USING dummy; +-- +-- SELECT * FROM remote('127.0.0.2', system.one) +-- GLOBAL INNER JOIN +-- ( +-- SELECT *, dummy +-- FROM ( SELECT toUInt8(1) AS dummy ) t1 +-- INNER JOIN ( SELECT toUInt8(1) AS dummy ) t2 +-- USING dummy +-- ) USING dummy; +-- +-- SELECT * FROM remote('127.0.0.2', system.one) +-- GLOBAL INNER JOIN +-- ( +-- SELECT * +-- FROM ( SELECT dummy FROM remote('127.0.0.3', system.one) ) t1 +-- GLOBAL INNER JOIN ( SELECT toUInt8(1) AS dummy ) t2 +-- USING dummy +-- ) USING dummy; +-- +-- SELECT * FROM remote('127.0.0.2', system.one) +-- GLOBAL INNER JOIN +-- ( +-- SELECT * +-- FROM ( SELECT toUInt8(1) AS dummy ) t1 +-- GLOBAL INNER JOIN ( SELECT dummy FROM remote('127.0.0.3', system.one) ) t2 +-- USING dummy +-- ) USING dummy; From 2afb4438ab7171cdaacb006b9662bda5bacbc2dd Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 19:37:23 +0300 Subject: [PATCH 283/297] clickhouse-test - also randomize stateless-statefull order (#4694) --- dbms/tests/clickhouse-test | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 9b3f56847ee..8956a687766 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -160,7 +160,21 @@ def main(args): clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE) clickhouse_proc_create.communicate("CREATE DATABASE IF NOT EXISTS test") - for suite in sorted(os.listdir(base_dir)): + def sute_key_func(item): + if args.order == 'random': + return random() + + if -1 == item.find('_'): + return 99998 + + prefix, suffix = item.split('_', 1) + + try: + return int(prefix), suffix + except ValueError: + return 99997 + + for suite in sorted(os.listdir(base_dir), key=sute_key_func): if SERVER_DIED: break From 1a33f4da403f7a7238ad85aeaf8151b8cf5067b3 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 21:03:35 +0300 Subject: [PATCH 284/297] Optional current_thread and memory_tracker (#4664) --- dbms/src/Common/CurrentThread.cpp | 18 ++++++++++--- dbms/src/Common/CurrentThread.h | 2 +- dbms/src/Common/MemoryTracker.cpp | 17 +++++++----- dbms/src/Core/BackgroundSchedulePool.cpp | 3 ++- dbms/src/Interpreters/Aggregator.cpp | 10 ++++--- dbms/src/Interpreters/ThreadStatusExt.cpp | 27 ++++++++++++++++++- .../MergeTree/BackgroundProcessingPool.cpp | 3 ++- dbms/src/Storages/MergeTree/MergeList.cpp | 2 +- 8 files changed, 62 insertions(+), 20 deletions(-) diff --git a/dbms/src/Common/CurrentThread.cpp b/dbms/src/Common/CurrentThread.cpp index b6d161af67e..3eaf8bfa81d 100644 --- a/dbms/src/Common/CurrentThread.cpp +++ b/dbms/src/Common/CurrentThread.cpp @@ -21,6 +21,8 @@ namespace ErrorCodes void CurrentThread::updatePerformanceCounters() { + if (unlikely(!current_thread)) + return; get().updatePerformanceCounters(); } @@ -37,30 +39,38 @@ ProfileEvents::Counters & CurrentThread::getProfileEvents() return current_thread ? get().performance_counters : ProfileEvents::global_counters; } -MemoryTracker & CurrentThread::getMemoryTracker() +MemoryTracker * CurrentThread::getMemoryTracker() { - return get().memory_tracker; + if (unlikely(!current_thread)) + return nullptr; + return &get().memory_tracker; } void CurrentThread::updateProgressIn(const Progress & value) { + if (unlikely(!current_thread)) + return; get().progress_in.incrementPiecewiseAtomically(value); } void CurrentThread::updateProgressOut(const Progress & value) { + if (unlikely(!current_thread)) + return; get().progress_out.incrementPiecewiseAtomically(value); } void CurrentThread::attachInternalTextLogsQueue(const std::shared_ptr & logs_queue) { + if (unlikely(!current_thread)) + return; get().attachInternalTextLogsQueue(logs_queue); } std::shared_ptr CurrentThread::getInternalTextLogsQueue() { /// NOTE: this method could be called at early server startup stage - if (!current_thread) + if (unlikely(!current_thread)) return nullptr; if (get().getCurrentState() == ThreadStatus::ThreadState::Died) @@ -71,7 +81,7 @@ std::shared_ptr CurrentThread::getInternalTextLogsQueue() ThreadGroupStatusPtr CurrentThread::getGroup() { - if (!current_thread) + if (unlikely(!current_thread)) return nullptr; return get().getThreadGroup(); diff --git a/dbms/src/Common/CurrentThread.h b/dbms/src/Common/CurrentThread.h index c30555b22e8..49b46721008 100644 --- a/dbms/src/Common/CurrentThread.h +++ b/dbms/src/Common/CurrentThread.h @@ -45,7 +45,7 @@ public: static void updatePerformanceCounters(); static ProfileEvents::Counters & getProfileEvents(); - static MemoryTracker & getMemoryTracker(); + static MemoryTracker * getMemoryTracker(); /// Update read and write rows (bytes) statistics (used in system.query_thread_log) static void updateProgressIn(const Progress & value); diff --git a/dbms/src/Common/MemoryTracker.cpp b/dbms/src/Common/MemoryTracker.cpp index 6a997e3b19a..bc324be4904 100644 --- a/dbms/src/Common/MemoryTracker.cpp +++ b/dbms/src/Common/MemoryTracker.cpp @@ -190,24 +190,27 @@ namespace CurrentMemoryTracker { void alloc(Int64 size) { - if (DB::current_thread) - DB::CurrentThread::getMemoryTracker().alloc(size); + if (auto memory_tracker = DB::CurrentThread::getMemoryTracker()) + memory_tracker->alloc(size); } void realloc(Int64 old_size, Int64 new_size) { - if (DB::current_thread) - DB::CurrentThread::getMemoryTracker().alloc(new_size - old_size); + if (auto memory_tracker = DB::CurrentThread::getMemoryTracker()) + memory_tracker->alloc(new_size - old_size); } void free(Int64 size) { - if (DB::current_thread) - DB::CurrentThread::getMemoryTracker().free(size); + if (auto memory_tracker = DB::CurrentThread::getMemoryTracker()) + memory_tracker->free(size); } } DB::SimpleActionLock getCurrentMemoryTrackerActionLock() { - return DB::CurrentThread::getMemoryTracker().blocker.cancel(); + auto memory_tracker = DB::CurrentThread::getMemoryTracker(); + if (!memory_tracker) + return {}; + return memory_tracker->blocker.cancel(); } diff --git a/dbms/src/Core/BackgroundSchedulePool.cpp b/dbms/src/Core/BackgroundSchedulePool.cpp index 0493e13b2b9..ce67c895234 100644 --- a/dbms/src/Core/BackgroundSchedulePool.cpp +++ b/dbms/src/Core/BackgroundSchedulePool.cpp @@ -250,7 +250,8 @@ void BackgroundSchedulePool::threadFunction() attachToThreadGroup(); SCOPE_EXIT({ CurrentThread::detachQueryIfNotDetached(); }); - CurrentThread::getMemoryTracker().setMetric(CurrentMetrics::MemoryTrackingInBackgroundSchedulePool); + if (auto memory_tracker = CurrentThread::getMemoryTracker()) + memory_tracker->setMetric(CurrentMetrics::MemoryTrackingInBackgroundSchedulePool); while (!shutdown) { diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index 40d06c3228b..0c6477942dd 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -145,8 +145,9 @@ Aggregator::Aggregator(const Params & params_) isCancelled([]() { return false; }) { /// Use query-level memory tracker - if (auto memory_tracker = CurrentThread::getMemoryTracker().getParent()) - memory_usage_before_aggregation = memory_tracker->get(); + if (auto memory_tracker_child = CurrentThread::getMemoryTracker()) + if (auto memory_tracker = memory_tracker_child->getParent()) + memory_usage_before_aggregation = memory_tracker->get(); aggregate_functions.resize(params.aggregates_size); for (size_t i = 0; i < params.aggregates_size; ++i) @@ -835,8 +836,9 @@ bool Aggregator::executeOnBlock(const Block & block, AggregatedDataVariants & re size_t result_size = result.sizeWithoutOverflowRow(); Int64 current_memory_usage = 0; - if (auto memory_tracker = CurrentThread::getMemoryTracker().getParent()) - current_memory_usage = memory_tracker->get(); + if (auto memory_tracker_child = CurrentThread::getMemoryTracker()) + if (auto memory_tracker = memory_tracker_child->getParent()) + current_memory_usage = memory_tracker->get(); auto result_size_bytes = current_memory_usage - memory_usage_before_aggregation; /// Here all the results in the sum are taken into account, from different threads. diff --git a/dbms/src/Interpreters/ThreadStatusExt.cpp b/dbms/src/Interpreters/ThreadStatusExt.cpp index 4917f90851e..96ab18fde04 100644 --- a/dbms/src/Interpreters/ThreadStatusExt.cpp +++ b/dbms/src/Interpreters/ThreadStatusExt.cpp @@ -37,6 +37,8 @@ const std::string & ThreadStatus::getQueryId() const void CurrentThread::defaultThreadDeleter() { + if (unlikely(!current_thread)) + return; ThreadStatus & thread = CurrentThread::get(); thread.detachQuery(true, true); } @@ -191,44 +193,63 @@ void ThreadStatus::logToQueryThreadLog(QueryThreadLog & thread_log) void CurrentThread::initializeQuery() { + if (unlikely(!current_thread)) + return; get().initializeQuery(); get().deleter = CurrentThread::defaultThreadDeleter; } void CurrentThread::attachTo(const ThreadGroupStatusPtr & thread_group) { + if (unlikely(!current_thread)) + return; get().attachQuery(thread_group, true); get().deleter = CurrentThread::defaultThreadDeleter; } void CurrentThread::attachToIfDetached(const ThreadGroupStatusPtr & thread_group) { + if (unlikely(!current_thread)) + return; get().attachQuery(thread_group, false); get().deleter = CurrentThread::defaultThreadDeleter; } const std::string & CurrentThread::getQueryId() { + if (unlikely(!current_thread)) + { + const static std::string empty; + return empty; + } return get().getQueryId(); } void CurrentThread::attachQueryContext(Context & query_context) { + if (unlikely(!current_thread)) + return; return get().attachQueryContext(query_context); } void CurrentThread::finalizePerformanceCounters() { + if (unlikely(!current_thread)) + return; get().finalizePerformanceCounters(); } void CurrentThread::detachQuery() { + if (unlikely(!current_thread)) + return; get().detachQuery(false); } void CurrentThread::detachQueryIfNotDetached() { + if (unlikely(!current_thread)) + return; get().detachQuery(true); } @@ -241,8 +262,12 @@ CurrentThread::QueryScope::QueryScope(Context & query_context) void CurrentThread::QueryScope::logPeakMemoryUsage() { + auto group = CurrentThread::getGroup(); + if (!group) + return; + log_peak_memory_usage_in_destructor = false; - CurrentThread::getGroup()->memory_tracker.logPeakMemoryUsage(); + group->memory_tracker.logPeakMemoryUsage(); } CurrentThread::QueryScope::~QueryScope() diff --git a/dbms/src/Storages/MergeTree/BackgroundProcessingPool.cpp b/dbms/src/Storages/MergeTree/BackgroundProcessingPool.cpp index b60d860ec6c..b63ffeefd5e 100644 --- a/dbms/src/Storages/MergeTree/BackgroundProcessingPool.cpp +++ b/dbms/src/Storages/MergeTree/BackgroundProcessingPool.cpp @@ -140,7 +140,8 @@ void BackgroundProcessingPool::threadFunction() } SCOPE_EXIT({ CurrentThread::detachQueryIfNotDetached(); }); - CurrentThread::getMemoryTracker().setMetric(CurrentMetrics::MemoryTrackingInBackgroundProcessingPool); + if (auto memory_tracker = CurrentThread::getMemoryTracker()) + memory_tracker->setMetric(CurrentMetrics::MemoryTrackingInBackgroundProcessingPool); pcg64 rng(randomSeed()); std::this_thread::sleep_for(std::chrono::duration(std::uniform_real_distribution(0, thread_sleep_seconds_random_part)(rng))); diff --git a/dbms/src/Storages/MergeTree/MergeList.cpp b/dbms/src/Storages/MergeTree/MergeList.cpp index b65d53d032d..9490a4f1068 100644 --- a/dbms/src/Storages/MergeTree/MergeList.cpp +++ b/dbms/src/Storages/MergeTree/MergeList.cpp @@ -38,7 +38,7 @@ MergeListElement::MergeListElement(const std::string & database, const std::stri } /// Each merge is executed into separate background processing pool thread - background_thread_memory_tracker = &CurrentThread::getMemoryTracker(); + background_thread_memory_tracker = CurrentThread::getMemoryTracker(); if (background_thread_memory_tracker) { memory_tracker.setMetric(CurrentMetrics::MemoryTrackingForMerges); From 7d409c529463c1a70c6ffa06061ca50c6551f925 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 20:42:33 +0300 Subject: [PATCH 285/297] Tests: dont use table test.visits --- .../queries/0_stateless/00819_ast_refactoring_bugs.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00819_ast_refactoring_bugs.sql b/dbms/tests/queries/0_stateless/00819_ast_refactoring_bugs.sql index 010d03920c7..780dcd7e602 100644 --- a/dbms/tests/queries/0_stateless/00819_ast_refactoring_bugs.sql +++ b/dbms/tests/queries/0_stateless/00819_ast_refactoring_bugs.sql @@ -1,5 +1,5 @@ -DROP TABLE IF EXISTS test.visits; -CREATE TABLE test.visits +DROP TABLE IF EXISTS test.visits1; +CREATE TABLE test.visits1 ( Sign Int8, Arr Array(Int8), @@ -8,10 +8,10 @@ CREATE TABLE test.visits CounterID UInt32 ) ENGINE = Memory; -SELECT arrayMap(x -> x * Sign, Arr) FROM test.visits; +SELECT arrayMap(x -> x * Sign, Arr) FROM test.visits1; SELECT PP.Key2 AS `ym:s:pl2` -FROM test.visits +FROM test.visits1 ARRAY JOIN `ParsedParams.Key2` AS `PP.Key2`, `ParsedParams.Key1` AS `PP.Key1`, @@ -19,7 +19,7 @@ ARRAY JOIN arrayEnumerateUniq(`ParsedParams.Key2`) AS _uniq_ParsedParams WHERE CounterID = 100500; -DROP TABLE test.visits; +DROP TABLE test.visits1; select u, cumSum from ( select u, min(d) mn, max(d) mx, groupArray(d) dg, groupArray(v) vg, From cb490e0015a9b4e9fef31772152727d42b6cc644 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 21:09:56 +0300 Subject: [PATCH 286/297] Build fixes (freebsd) --- cmake/find_gtest.cmake | 5 +++-- dbms/CMakeLists.txt | 4 +++- dbms/src/Columns/tests/CMakeLists.txt | 2 +- dbms/src/DataTypes/tests/CMakeLists.txt | 2 +- utils/zookeeper-cli/CMakeLists.txt | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/find_gtest.cmake b/cmake/find_gtest.cmake index c918f81f1cd..82ae0f8e229 100644 --- a/cmake/find_gtest.cmake +++ b/cmake/find_gtest.cmake @@ -20,11 +20,12 @@ if (NOT GTEST_SRC_DIR AND NOT GTEST_INCLUDE_DIRS AND NOT MISSING_INTERNAL_GTEST_ set (USE_INTERNAL_GTEST_LIBRARY 1) set (GTEST_MAIN_LIBRARIES gtest_main) set (GTEST_LIBRARIES gtest) + set (GTEST_BOTH_LIBRARIES ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES}) set (GTEST_INCLUDE_DIRS ${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest) endif () -if((GTEST_INCLUDE_DIRS AND GTEST_MAIN_LIBRARIES) OR GTEST_SRC_DIR) +if((GTEST_INCLUDE_DIRS AND GTEST_BOTH_LIBRARIES) OR GTEST_SRC_DIR) set(USE_GTEST 1) endif() -message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_LIBRARIES}, ${GTEST_MAIN_LIBRARIES} : ${GTEST_SRC_DIR}") +message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_BOTH_LIBRARIES} : ${GTEST_SRC_DIR}") diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index 900b1e0a650..a07d658c4e6 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -184,7 +184,9 @@ target_link_libraries (clickhouse_common_io string_utils widechar_width ${LINK_LIBRARIES_ONLY_ON_X86_64} + PUBLIC ${DOUBLE_CONVERSION_LIBRARIES} + PRIVATE pocoext PUBLIC ${Poco_Net_LIBRARY} @@ -351,6 +353,6 @@ if (ENABLE_TESTS AND USE_GTEST) # attach all dbms gtest sources grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources) add_executable(unit_tests_dbms ${dbms_gtest_sources}) - target_link_libraries(unit_tests_dbms PRIVATE gtest_main dbms clickhouse_common_zookeeper) + target_link_libraries(unit_tests_dbms PRIVATE ${GTEST_BOTH_LIBRARIES} dbms clickhouse_common_zookeeper) add_check(unit_tests_dbms) endif () diff --git a/dbms/src/Columns/tests/CMakeLists.txt b/dbms/src/Columns/tests/CMakeLists.txt index cc989e5f0bf..302c554a1fd 100644 --- a/dbms/src/Columns/tests/CMakeLists.txt +++ b/dbms/src/Columns/tests/CMakeLists.txt @@ -1,4 +1,4 @@ if(USE_GTEST) add_executable(column_unique column_unique.cpp) - target_link_libraries(column_unique PRIVATE dbms gtest_main) + target_link_libraries(column_unique PRIVATE dbms ${GTEST_BOTH_LIBRARIES}) endif() \ No newline at end of file diff --git a/dbms/src/DataTypes/tests/CMakeLists.txt b/dbms/src/DataTypes/tests/CMakeLists.txt index 5f699b29c59..aa4cb34620b 100644 --- a/dbms/src/DataTypes/tests/CMakeLists.txt +++ b/dbms/src/DataTypes/tests/CMakeLists.txt @@ -7,5 +7,5 @@ target_link_libraries (data_type_string PRIVATE dbms) if(USE_GTEST) add_executable(data_type_get_common_type data_type_get_common_type.cpp) - target_link_libraries(data_type_get_common_type PRIVATE dbms gtest_main) + target_link_libraries(data_type_get_common_type PRIVATE dbms ${GTEST_BOTH_LIBRARIES}) endif() diff --git a/utils/zookeeper-cli/CMakeLists.txt b/utils/zookeeper-cli/CMakeLists.txt index 89db7922edd..550d0e855d8 100644 --- a/utils/zookeeper-cli/CMakeLists.txt +++ b/utils/zookeeper-cli/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(clickhouse-zookeeper-cli zookeeper-cli.cpp) -target_link_libraries(clickhouse-zookeeper-cli PRIVATE clickhouse_common_zookeeper ${LINE_EDITING_LIBS}) +target_link_libraries(clickhouse-zookeeper-cli PRIVATE clickhouse_common_zookeeper ${Poco_Foundation_LIBRARY} ${LINE_EDITING_LIBS}) if (READLINE_INCLUDE_DIR) target_include_directories (clickhouse-zookeeper-cli SYSTEM PRIVATE ${READLINE_INCLUDE_DIR}) endif () From 47dbaca52b912e522cf285ec644369495917fe49 Mon Sep 17 00:00:00 2001 From: alesapin Date: Thu, 14 Mar 2019 21:22:04 +0300 Subject: [PATCH 287/297] Fix stupid error --- dbms/src/Storages/StorageReplicatedMergeTree.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index a37d871f0df..235e9ee1cb0 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -555,17 +555,17 @@ void StorageReplicatedMergeTree::checkParts(bool skip_sanity_checks) */ MergeTreeData::DataParts unexpected_parts; + /// Collect unexpected parts + for (const auto & part : parts) + if (!expected_parts.count(part->name)) + unexpected_parts.insert(part); /// this parts we will place to detached with ignored_ prefix + /// Which parts should be taken from other replicas. Strings parts_to_fetch; - for (const auto & part : parts) - { - if (expected_parts.count(part->name)) - parts_to_fetch.push_back(part->name); /// these parts we will fetch from other replicas - else - unexpected_parts.insert(part); /// this parts we will place to detached with ignored_ prefix - } - + for (const String & missing_name : expected_parts) + if (!data.getActiveContainingPart(missing_name)) + parts_to_fetch.push_back(missing_name); /** To check the adequacy, for the parts that are in the FS, but not in ZK, we will only consider not the most recent parts. * Because unexpected new parts usually arise only because they did not have time to enroll in ZK with a rough restart of the server. From f983282fe09244b6541d1a478fea07e2d3a0c888 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 14 Mar 2019 22:33:11 +0300 Subject: [PATCH 288/297] Updated submodule (tnx. chenxing-xc) --- contrib/libhdfs3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/libhdfs3 b/contrib/libhdfs3 index bd6505cbb0c..e2131aa752d 160000 --- a/contrib/libhdfs3 +++ b/contrib/libhdfs3 @@ -1 +1 @@ -Subproject commit bd6505cbb0c130b0db695305b9a38546fa880e5a +Subproject commit e2131aa752d7e95441e08f9a18304c1445f2576a From 8c70de3bc7d5c04662bace07f9bf7703033d689f Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 23:52:10 +0300 Subject: [PATCH 289/297] Build fixes (freebsd) (#4696) --- cmake/find_gtest.cmake | 5 +++-- dbms/CMakeLists.txt | 4 +++- dbms/src/Columns/tests/CMakeLists.txt | 2 +- dbms/src/DataTypes/tests/CMakeLists.txt | 2 +- utils/zookeeper-cli/CMakeLists.txt | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/find_gtest.cmake b/cmake/find_gtest.cmake index c918f81f1cd..82ae0f8e229 100644 --- a/cmake/find_gtest.cmake +++ b/cmake/find_gtest.cmake @@ -20,11 +20,12 @@ if (NOT GTEST_SRC_DIR AND NOT GTEST_INCLUDE_DIRS AND NOT MISSING_INTERNAL_GTEST_ set (USE_INTERNAL_GTEST_LIBRARY 1) set (GTEST_MAIN_LIBRARIES gtest_main) set (GTEST_LIBRARIES gtest) + set (GTEST_BOTH_LIBRARIES ${GTEST_MAIN_LIBRARIES} ${GTEST_LIBRARIES}) set (GTEST_INCLUDE_DIRS ${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest) endif () -if((GTEST_INCLUDE_DIRS AND GTEST_MAIN_LIBRARIES) OR GTEST_SRC_DIR) +if((GTEST_INCLUDE_DIRS AND GTEST_BOTH_LIBRARIES) OR GTEST_SRC_DIR) set(USE_GTEST 1) endif() -message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_LIBRARIES}, ${GTEST_MAIN_LIBRARIES} : ${GTEST_SRC_DIR}") +message (STATUS "Using gtest=${USE_GTEST}: ${GTEST_INCLUDE_DIRS} : ${GTEST_BOTH_LIBRARIES} : ${GTEST_SRC_DIR}") diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index 900b1e0a650..a07d658c4e6 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -184,7 +184,9 @@ target_link_libraries (clickhouse_common_io string_utils widechar_width ${LINK_LIBRARIES_ONLY_ON_X86_64} + PUBLIC ${DOUBLE_CONVERSION_LIBRARIES} + PRIVATE pocoext PUBLIC ${Poco_Net_LIBRARY} @@ -351,6 +353,6 @@ if (ENABLE_TESTS AND USE_GTEST) # attach all dbms gtest sources grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources) add_executable(unit_tests_dbms ${dbms_gtest_sources}) - target_link_libraries(unit_tests_dbms PRIVATE gtest_main dbms clickhouse_common_zookeeper) + target_link_libraries(unit_tests_dbms PRIVATE ${GTEST_BOTH_LIBRARIES} dbms clickhouse_common_zookeeper) add_check(unit_tests_dbms) endif () diff --git a/dbms/src/Columns/tests/CMakeLists.txt b/dbms/src/Columns/tests/CMakeLists.txt index cc989e5f0bf..302c554a1fd 100644 --- a/dbms/src/Columns/tests/CMakeLists.txt +++ b/dbms/src/Columns/tests/CMakeLists.txt @@ -1,4 +1,4 @@ if(USE_GTEST) add_executable(column_unique column_unique.cpp) - target_link_libraries(column_unique PRIVATE dbms gtest_main) + target_link_libraries(column_unique PRIVATE dbms ${GTEST_BOTH_LIBRARIES}) endif() \ No newline at end of file diff --git a/dbms/src/DataTypes/tests/CMakeLists.txt b/dbms/src/DataTypes/tests/CMakeLists.txt index 5f699b29c59..aa4cb34620b 100644 --- a/dbms/src/DataTypes/tests/CMakeLists.txt +++ b/dbms/src/DataTypes/tests/CMakeLists.txt @@ -7,5 +7,5 @@ target_link_libraries (data_type_string PRIVATE dbms) if(USE_GTEST) add_executable(data_type_get_common_type data_type_get_common_type.cpp) - target_link_libraries(data_type_get_common_type PRIVATE dbms gtest_main) + target_link_libraries(data_type_get_common_type PRIVATE dbms ${GTEST_BOTH_LIBRARIES}) endif() diff --git a/utils/zookeeper-cli/CMakeLists.txt b/utils/zookeeper-cli/CMakeLists.txt index 89db7922edd..550d0e855d8 100644 --- a/utils/zookeeper-cli/CMakeLists.txt +++ b/utils/zookeeper-cli/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(clickhouse-zookeeper-cli zookeeper-cli.cpp) -target_link_libraries(clickhouse-zookeeper-cli PRIVATE clickhouse_common_zookeeper ${LINE_EDITING_LIBS}) +target_link_libraries(clickhouse-zookeeper-cli PRIVATE clickhouse_common_zookeeper ${Poco_Foundation_LIBRARY} ${LINE_EDITING_LIBS}) if (READLINE_INCLUDE_DIR) target_include_directories (clickhouse-zookeeper-cli SYSTEM PRIVATE ${READLINE_INCLUDE_DIR}) endif () From 4532218456dd0c0473689c3da4e08d0b5e0314fe Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 14 Mar 2019 23:55:34 +0300 Subject: [PATCH 290/297] Fix insert(NULL) in StorageSystemGraphite --- dbms/src/Storages/System/StorageSystemGraphite.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/System/StorageSystemGraphite.cpp b/dbms/src/Storages/System/StorageSystemGraphite.cpp index fa1b768ac98..e315bc04fd1 100644 --- a/dbms/src/Storages/System/StorageSystemGraphite.cpp +++ b/dbms/src/Storages/System/StorageSystemGraphite.cpp @@ -128,8 +128,8 @@ void StorageSystemGraphite::fillData(MutableColumns & res_columns, const Context res_columns[i++]->insert(config.first); res_columns[i++]->insert(regexp); res_columns[i++]->insert(function); - res_columns[i++]->insert(NULL); - res_columns[i++]->insert(NULL); + res_columns[i++]->insertDefault(); + res_columns[i++]->insertDefault(); res_columns[i++]->insert(priority); res_columns[i++]->insert(is_default); res_columns[i++]->insert(config.second.databases); From a459b2c2984b0de51209aba7793cba1cdce1a067 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 15 Mar 2019 02:10:51 +0300 Subject: [PATCH 291/297] Fixed insufficient type checking in hasAll, hasAny functions --- .../AggregateFunctionGroupArray.cpp | 1 + dbms/src/Columns/ColumnArray.h | 16 +++++++++------- dbms/src/Columns/ColumnConst.h | 8 ++++++++ dbms/src/Columns/ColumnDecimal.h | 8 ++++++++ dbms/src/Columns/ColumnFixedString.h | 7 +++++++ dbms/src/Columns/ColumnLowCardinality.h | 9 +++++++++ dbms/src/Columns/ColumnNothing.h | 5 +++++ dbms/src/Columns/ColumnNullable.h | 9 +++++++++ dbms/src/Columns/ColumnString.h | 5 +++++ dbms/src/Columns/ColumnTuple.cpp | 18 ++++++++++++++++++ dbms/src/Columns/ColumnTuple.h | 1 + dbms/src/Columns/ColumnUnique.h | 7 +++++++ dbms/src/Columns/ColumnVector.h | 6 ++++++ dbms/src/Columns/IColumn.h | 7 +++++++ dbms/src/Functions/FunctionsCoding.h | 5 +++-- .../Functions/FunctionsEmbeddedDictionaries.h | 1 + .../Functions/FunctionsExternalDictionaries.h | 2 ++ dbms/src/Functions/FunctionsFindCluster.h | 1 + dbms/src/Functions/FunctionsHashing.h | 1 + dbms/src/Functions/FunctionsStringArray.h | 1 + dbms/src/Functions/FunctionsVisitParam.h | 5 +++++ dbms/src/Functions/GatherUtils/Algorithms.h | 6 +++--- dbms/src/Functions/GatherUtils/Sources.h | 12 +++++++++++- dbms/src/Functions/arrayEnumerateRanked.cpp | 5 +++++ dbms/src/Functions/arrayReduce.cpp | 1 + dbms/src/Functions/flatten.cpp | 5 +++++ dbms/src/Functions/hasAllAny.h | 7 ++++--- dbms/src/Functions/replicate.cpp | 5 +++++ dbms/src/Functions/timeSlots.cpp | 1 + .../MergeTree/MergedBlockOutputStream.cpp | 5 +++++ ...00918_has_unsufficient_type_check.reference | 3 +++ .../00918_has_unsufficient_type_check.sql | 3 +++ 32 files changed, 160 insertions(+), 16 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.reference create mode 100644 dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.cpp b/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.cpp index 51bc04ea39c..1efb1a82475 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionGroupArray.cpp @@ -12,6 +12,7 @@ namespace DB namespace ErrorCodes { extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; + extern const int BAD_ARGUMENTS; } namespace diff --git a/dbms/src/Columns/ColumnArray.h b/dbms/src/Columns/ColumnArray.h index d58dfba025a..41e38953cf1 100644 --- a/dbms/src/Columns/ColumnArray.h +++ b/dbms/src/Columns/ColumnArray.h @@ -3,17 +3,12 @@ #include #include #include +#include + namespace DB { -namespace ErrorCodes -{ - extern const int ILLEGAL_COLUMN; - extern const int NOT_IMPLEMENTED; - extern const int BAD_ARGUMENTS; -} - /** A column of array values. * In memory, it is represented as one column of a nested type, whose size is equal to the sum of the sizes of all arrays, * and as an array of offsets in it, which allows you to get each element. @@ -121,6 +116,13 @@ public: callback(data); } + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_concrete = typeid_cast(&rhs)) + return data->structureEquals(*rhs_concrete->data); + return false; + } + private: ColumnPtr data; ColumnPtr offsets; diff --git a/dbms/src/Columns/ColumnConst.h b/dbms/src/Columns/ColumnConst.h index 248bb04a186..53ac5b24220 100644 --- a/dbms/src/Columns/ColumnConst.h +++ b/dbms/src/Columns/ColumnConst.h @@ -3,6 +3,7 @@ #include #include #include +#include namespace DB @@ -190,6 +191,13 @@ public: callback(data); } + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_concrete = typeid_cast(&rhs)) + return data->structureEquals(*rhs_concrete->data); + return false; + } + bool onlyNull() const override { return data->isNullAt(0); } bool isColumnConst() const override { return true; } bool isNumeric() const override { return data->isNumeric(); } diff --git a/dbms/src/Columns/ColumnDecimal.h b/dbms/src/Columns/ColumnDecimal.h index 372b0c245c0..4a3c6153947 100644 --- a/dbms/src/Columns/ColumnDecimal.h +++ b/dbms/src/Columns/ColumnDecimal.h @@ -2,6 +2,7 @@ #include +#include #include #include @@ -133,6 +134,13 @@ public: void gather(ColumnGathererStream & gatherer_stream) override; + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_concrete = typeid_cast *>(&rhs)) + return scale == rhs_concrete->scale; + return false; + } + void insert(const T value) { data.push_back(value); } Container & getData() { return data; } diff --git a/dbms/src/Columns/ColumnFixedString.h b/dbms/src/Columns/ColumnFixedString.h index b773d7c8eb4..1f79594b459 100644 --- a/dbms/src/Columns/ColumnFixedString.h +++ b/dbms/src/Columns/ColumnFixedString.h @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -134,6 +135,12 @@ public: void getExtremes(Field & min, Field & max) const override; + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_concrete = typeid_cast(&rhs)) + return n == rhs_concrete->n; + return false; + } bool canBeInsideNullable() const override { return true; } diff --git a/dbms/src/Columns/ColumnLowCardinality.h b/dbms/src/Columns/ColumnLowCardinality.h index 0e9cbbadebe..3b816b2449c 100644 --- a/dbms/src/Columns/ColumnLowCardinality.h +++ b/dbms/src/Columns/ColumnLowCardinality.h @@ -5,6 +5,7 @@ #include #include "ColumnsNumber.h" + namespace DB { @@ -132,6 +133,14 @@ public: callback(dictionary.getColumnUniquePtr()); } + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_low_cardinality = typeid_cast(&rhs)) + return idx.getPositions()->structureEquals(*rhs_low_cardinality->idx.getPositions()) + && dictionary.getColumnUnique().structureEquals(rhs_low_cardinality->dictionary.getColumnUnique()); + return false; + } + bool valuesHaveFixedSize() const override { return getDictionary().valuesHaveFixedSize(); } bool isFixedAndContiguous() const override { return false; } size_t sizeOfValueIfFixed() const override { return getDictionary().sizeOfValueIfFixed(); } diff --git a/dbms/src/Columns/ColumnNothing.h b/dbms/src/Columns/ColumnNothing.h index c9cde4f26ec..0c9f843a454 100644 --- a/dbms/src/Columns/ColumnNothing.h +++ b/dbms/src/Columns/ColumnNothing.h @@ -23,6 +23,11 @@ public: MutableColumnPtr cloneDummy(size_t s_) const override { return ColumnNothing::create(s_); } bool canBeInsideNullable() const override { return true; } + + bool structureEquals(const IColumn & rhs) const override + { + return typeid(rhs) == typeid(ColumnNothing); + } }; } diff --git a/dbms/src/Columns/ColumnNullable.h b/dbms/src/Columns/ColumnNullable.h index 8012d03b0e8..8a3651b378b 100644 --- a/dbms/src/Columns/ColumnNullable.h +++ b/dbms/src/Columns/ColumnNullable.h @@ -2,6 +2,8 @@ #include #include +#include + namespace DB { @@ -89,6 +91,13 @@ public: callback(null_map); } + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_nullable = typeid_cast(&rhs)) + return nested_column->structureEquals(*rhs_nullable->nested_column); + return false; + } + bool isColumnNullable() const override { return true; } bool isFixedAndContiguous() const override { return false; } bool valuesHaveFixedSize() const override { return nested_column->valuesHaveFixedSize(); } diff --git a/dbms/src/Columns/ColumnString.h b/dbms/src/Columns/ColumnString.h index d2d9bf2fb61..9ae32c41fd9 100644 --- a/dbms/src/Columns/ColumnString.h +++ b/dbms/src/Columns/ColumnString.h @@ -231,6 +231,11 @@ public: bool canBeInsideNullable() const override { return true; } + bool structureEquals(const IColumn & rhs) const override + { + return typeid(rhs) == typeid(ColumnString); + } + Chars & getChars() { return chars; } const Chars & getChars() const { return chars; } diff --git a/dbms/src/Columns/ColumnTuple.cpp b/dbms/src/Columns/ColumnTuple.cpp index ec0bcc1f5b5..caed6c5d6f1 100644 --- a/dbms/src/Columns/ColumnTuple.cpp +++ b/dbms/src/Columns/ColumnTuple.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace DB @@ -341,6 +342,23 @@ void ColumnTuple::forEachSubcolumn(ColumnCallback callback) callback(column); } +bool ColumnTuple::structureEquals(const IColumn & rhs) const +{ + if (auto rhs_tuple = typeid_cast(&rhs)) + { + const size_t tuple_size = columns.size(); + if (tuple_size != rhs_tuple->columns.size()) + return false; + + for (const auto i : ext::range(0, tuple_size)) + if (!columns[i]->structureEquals(*rhs_tuple->columns[i])) + return false; + + return true; + } + else + return false; +} } diff --git a/dbms/src/Columns/ColumnTuple.h b/dbms/src/Columns/ColumnTuple.h index c39a92e3c8c..d0a65a03d37 100644 --- a/dbms/src/Columns/ColumnTuple.h +++ b/dbms/src/Columns/ColumnTuple.h @@ -73,6 +73,7 @@ public: size_t allocatedBytes() const override; void protect() override; void forEachSubcolumn(ColumnCallback callback) override; + bool structureEquals(const IColumn & rhs) const override; size_t tupleSize() const { return columns.size(); } diff --git a/dbms/src/Columns/ColumnUnique.h b/dbms/src/Columns/ColumnUnique.h index 5eee80dc9d8..a06863858ae 100644 --- a/dbms/src/Columns/ColumnUnique.h +++ b/dbms/src/Columns/ColumnUnique.h @@ -95,6 +95,13 @@ public: nested_column_nullable = ColumnNullable::create(column_holder, nested_null_mask); } + bool structureEquals(const IColumn & rhs) const override + { + if (auto rhs_concrete = typeid_cast(&rhs)) + return column_holder->structureEquals(*rhs_concrete->column_holder); + return false; + } + const UInt64 * tryGetSavedHash() const override { return index.tryGetSavedHash(); } UInt128 getHash() const override { return hash.getHash(*getRawColumnPtr()); } diff --git a/dbms/src/Columns/ColumnVector.h b/dbms/src/Columns/ColumnVector.h index 9de84f95b4a..43f6b0a3d52 100644 --- a/dbms/src/Columns/ColumnVector.h +++ b/dbms/src/Columns/ColumnVector.h @@ -251,6 +251,12 @@ public: size_t sizeOfValueIfFixed() const override { return sizeof(T); } StringRef getRawData() const override { return StringRef(reinterpret_cast(data.data()), data.size()); } + + bool structureEquals(const IColumn & rhs) const override + { + return typeid(rhs) == typeid(ColumnVector); + } + /** More efficient methods of manipulation - to manipulate with data directly. */ Container & getData() { diff --git a/dbms/src/Columns/IColumn.h b/dbms/src/Columns/IColumn.h index 86a1097d368..b7df53ed148 100644 --- a/dbms/src/Columns/IColumn.h +++ b/dbms/src/Columns/IColumn.h @@ -262,6 +262,13 @@ public: using ColumnCallback = std::function; virtual void forEachSubcolumn(ColumnCallback) {} + /// Columns have equal structure. + /// If true - you can use "compareAt", "insertFrom", etc. methods. + virtual bool structureEquals(const IColumn &) const + { + throw Exception("Method structureEquals is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED); + } + MutablePtr mutate() const && { diff --git a/dbms/src/Functions/FunctionsCoding.h b/dbms/src/Functions/FunctionsCoding.h index 6192102b529..1f88482aa49 100644 --- a/dbms/src/Functions/FunctionsCoding.h +++ b/dbms/src/Functions/FunctionsCoding.h @@ -33,6 +33,7 @@ namespace ErrorCodes { extern const int TOO_FEW_ARGUMENTS_FOR_FUNCTION; extern const int LOGICAL_ERROR; + extern const int ILLEGAL_COLUMN; } @@ -123,8 +124,8 @@ public: } else throw Exception("Illegal column " + block.getByPosition(arguments[0]).column->getName() - + " of argument of function " + getName(), - ErrorCodes::ILLEGAL_COLUMN); + + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_COLUMN); } }; diff --git a/dbms/src/Functions/FunctionsEmbeddedDictionaries.h b/dbms/src/Functions/FunctionsEmbeddedDictionaries.h index 7e5093d1ce8..e51b847f47d 100644 --- a/dbms/src/Functions/FunctionsEmbeddedDictionaries.h +++ b/dbms/src/Functions/FunctionsEmbeddedDictionaries.h @@ -36,6 +36,7 @@ namespace ErrorCodes { extern const int DICTIONARIES_WAS_NOT_LOADED; extern const int BAD_ARGUMENTS; + extern const int ILLEGAL_COLUMN; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; } diff --git a/dbms/src/Functions/FunctionsExternalDictionaries.h b/dbms/src/Functions/FunctionsExternalDictionaries.h index 85a5c9cc6a5..e9e0f94bb40 100644 --- a/dbms/src/Functions/FunctionsExternalDictionaries.h +++ b/dbms/src/Functions/FunctionsExternalDictionaries.h @@ -44,6 +44,8 @@ namespace ErrorCodes extern const int UNKNOWN_TYPE; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; extern const int TYPE_MISMATCH; + extern const int ILLEGAL_COLUMN; + extern const int BAD_ARGUMENTS; } /** Functions that use plug-ins (external) dictionaries. diff --git a/dbms/src/Functions/FunctionsFindCluster.h b/dbms/src/Functions/FunctionsFindCluster.h index 5b8db96d1ba..1b2bde45d29 100644 --- a/dbms/src/Functions/FunctionsFindCluster.h +++ b/dbms/src/Functions/FunctionsFindCluster.h @@ -20,6 +20,7 @@ namespace DB namespace ErrorCodes { extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; + extern const int ILLEGAL_COLUMN; } enum ClusterOperation diff --git a/dbms/src/Functions/FunctionsHashing.h b/dbms/src/Functions/FunctionsHashing.h index f14a91d422e..e756e8b79e7 100644 --- a/dbms/src/Functions/FunctionsHashing.h +++ b/dbms/src/Functions/FunctionsHashing.h @@ -48,6 +48,7 @@ namespace ErrorCodes extern const int LOGICAL_ERROR; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; extern const int NOT_IMPLEMENTED; + extern const int ILLEGAL_COLUMN; } diff --git a/dbms/src/Functions/FunctionsStringArray.h b/dbms/src/Functions/FunctionsStringArray.h index 641a23e225c..fb89dfceda2 100644 --- a/dbms/src/Functions/FunctionsStringArray.h +++ b/dbms/src/Functions/FunctionsStringArray.h @@ -21,6 +21,7 @@ namespace ErrorCodes { extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; extern const int BAD_ARGUMENTS; + extern const int ILLEGAL_COLUMN; } diff --git a/dbms/src/Functions/FunctionsVisitParam.h b/dbms/src/Functions/FunctionsVisitParam.h index 5b20a53135d..09cc3106719 100644 --- a/dbms/src/Functions/FunctionsVisitParam.h +++ b/dbms/src/Functions/FunctionsVisitParam.h @@ -38,6 +38,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int ILLEGAL_COLUMN; +} + struct HasParam { using ResultType = UInt8; diff --git a/dbms/src/Functions/GatherUtils/Algorithms.h b/dbms/src/Functions/GatherUtils/Algorithms.h index aaf1828f47d..9cc2d8ba21a 100644 --- a/dbms/src/Functions/GatherUtils/Algorithms.h +++ b/dbms/src/Functions/GatherUtils/Algorithms.h @@ -53,7 +53,7 @@ inline ALWAYS_INLINE void writeSlice(const StringSource::Slice & slice, FixedStr /// Assuming same types of underlying columns for slice and sink if (ArraySlice, ArraySink) is (GenericArraySlice, GenericArraySink). inline ALWAYS_INLINE void writeSlice(const GenericArraySlice & slice, GenericArraySink & sink) { - if (typeid(slice.elements) == typeid(static_cast(&sink.elements))) + if (slice.elements->structureEquals(sink.elements)) { sink.elements.insertRangeFrom(*slice.elements, slice.begin, slice.size); sink.current_offset += slice.size; @@ -125,7 +125,7 @@ void writeSlice(const NumericValueSlice & slice, NumericArraySink & sink) /// Assuming same types of underlying columns for slice and sink if (ArraySlice, ArraySink) is (GenericValueSlice, GenericArraySink). inline ALWAYS_INLINE void writeSlice(const GenericValueSlice & slice, GenericArraySink & sink) { - if (typeid(slice.elements) == typeid(static_cast(&sink.elements))) + if (slice.elements->structureEquals(sink.elements)) { sink.elements.insertFrom(*slice.elements, slice.position); ++sink.current_offset; @@ -457,7 +457,7 @@ template bool sliceHas(const GenericArraySlice & first, const GenericArraySlice & second) { /// Generic arrays should have the same type in order to use column.compareAt(...) - if (typeid(*first.elements) != typeid(*second.elements)) + if (!first.elements->structureEquals(*second.elements)) return false; auto impl = sliceHasImpl; diff --git a/dbms/src/Functions/GatherUtils/Sources.h b/dbms/src/Functions/GatherUtils/Sources.h index 40115a5a240..a70e06c98e2 100644 --- a/dbms/src/Functions/GatherUtils/Sources.h +++ b/dbms/src/Functions/GatherUtils/Sources.h @@ -14,7 +14,15 @@ #include #include -namespace DB::GatherUtils +namespace DB +{ + +namespace ErrorCodes +{ + extern const int ILLEGAL_COLUMN; +} + +namespace GatherUtils { template @@ -660,3 +668,5 @@ struct NullableValueSource : public ValueSource }; } + +} diff --git a/dbms/src/Functions/arrayEnumerateRanked.cpp b/dbms/src/Functions/arrayEnumerateRanked.cpp index 705d92ecd19..a559d64c9a0 100644 --- a/dbms/src/Functions/arrayEnumerateRanked.cpp +++ b/dbms/src/Functions/arrayEnumerateRanked.cpp @@ -6,6 +6,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int BAD_ARGUMENTS; +} + ArraysDepths getArraysDepths(const ColumnsWithTypeAndName & arguments) { const size_t num_arguments = arguments.size(); diff --git a/dbms/src/Functions/arrayReduce.cpp b/dbms/src/Functions/arrayReduce.cpp index 1bee774412d..ffab005e949 100644 --- a/dbms/src/Functions/arrayReduce.cpp +++ b/dbms/src/Functions/arrayReduce.cpp @@ -22,6 +22,7 @@ namespace ErrorCodes extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; extern const int ILLEGAL_COLUMN; extern const int ILLEGAL_TYPE_OF_ARGUMENT; + extern const int BAD_ARGUMENTS; } diff --git a/dbms/src/Functions/flatten.cpp b/dbms/src/Functions/flatten.cpp index eb1ff7212e6..8fe743db8ea 100644 --- a/dbms/src/Functions/flatten.cpp +++ b/dbms/src/Functions/flatten.cpp @@ -7,6 +7,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int ILLEGAL_COLUMN; +} + /// flatten([[1, 2, 3], [4, 5]]) = [1, 2, 3, 4, 5] - flatten array. class FunctionFlatten : public IFunction { diff --git a/dbms/src/Functions/hasAllAny.h b/dbms/src/Functions/hasAllAny.h index 45780d0aa3c..e5f45083b8d 100644 --- a/dbms/src/Functions/hasAllAny.h +++ b/dbms/src/Functions/hasAllAny.h @@ -53,10 +53,8 @@ public: size_t rows = input_rows_count; size_t num_args = arguments.size(); - auto result_column = ColumnUInt8::create(rows); - DataTypePtr common_type = nullptr; - auto commonType = [& common_type, & block, & arguments]() + auto commonType = [&common_type, &block, &arguments]() { if (common_type == nullptr) { @@ -92,6 +90,8 @@ public: for (auto & argument_column : preprocessed_columns) { + std::cerr << argument_column->getName() << "\n"; + bool is_const = false; if (auto argument_column_const = typeid_cast(argument_column.get())) @@ -106,6 +106,7 @@ public: throw Exception{"Arguments for function " + getName() + " must be arrays.", ErrorCodes::LOGICAL_ERROR}; } + auto result_column = ColumnUInt8::create(rows); auto result_column_ptr = typeid_cast(result_column.get()); GatherUtils::sliceHas(*sources[0], *sources[1], all, *result_column_ptr); diff --git a/dbms/src/Functions/replicate.cpp b/dbms/src/Functions/replicate.cpp index 054106cfd5a..10b82953a57 100644 --- a/dbms/src/Functions/replicate.cpp +++ b/dbms/src/Functions/replicate.cpp @@ -8,6 +8,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int ILLEGAL_COLUMN; +} + /** Creates an array, multiplying the column (the first argument) by the number of elements in the array (the second argument). */ class FunctionReplicate : public IFunction diff --git a/dbms/src/Functions/timeSlots.cpp b/dbms/src/Functions/timeSlots.cpp index 7ee0d1a1b2f..ce10d96043e 100644 --- a/dbms/src/Functions/timeSlots.cpp +++ b/dbms/src/Functions/timeSlots.cpp @@ -17,6 +17,7 @@ namespace ErrorCodes { extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; extern const int ILLEGAL_TYPE_OF_ARGUMENT; + extern const int ILLEGAL_COLUMN; } /** timeSlots(StartTime, Duration) diff --git a/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp b/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp index 18a5ee81923..49fa5da2afa 100644 --- a/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergedBlockOutputStream.cpp @@ -11,6 +11,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int BAD_ARGUMENTS; +} + namespace { diff --git a/dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.reference b/dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.reference new file mode 100644 index 00000000000..7938dcdde86 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.reference @@ -0,0 +1,3 @@ +0 +1 +0 diff --git a/dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.sql b/dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.sql new file mode 100644 index 00000000000..f76fd446a8e --- /dev/null +++ b/dbms/tests/queries/0_stateless/00918_has_unsufficient_type_check.sql @@ -0,0 +1,3 @@ +SELECT hasAny([['Hello, world']], [[[]]]); +SELECT hasAny([['Hello, world']], [['Hello', 'world'], ['Hello, world']]); +SELECT hasAll([['Hello, world']], [['Hello', 'world'], ['Hello, world']]); From f7bdc657d34a7bfca336874d5f1e076515c294f8 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Fri, 15 Mar 2019 02:12:30 +0300 Subject: [PATCH 292/297] Update hasAllAny.h --- dbms/src/Functions/hasAllAny.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/dbms/src/Functions/hasAllAny.h b/dbms/src/Functions/hasAllAny.h index e5f45083b8d..b688406fd91 100644 --- a/dbms/src/Functions/hasAllAny.h +++ b/dbms/src/Functions/hasAllAny.h @@ -90,8 +90,6 @@ public: for (auto & argument_column : preprocessed_columns) { - std::cerr << argument_column->getName() << "\n"; - bool is_const = false; if (auto argument_column_const = typeid_cast(argument_column.get())) From aea3bd2cc9dff82794fc71f62532a9452c1203f1 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 15 Mar 2019 03:29:53 +0300 Subject: [PATCH 293/297] Fixed potential deadlock in ExternalDictionaries --- dbms/src/Dictionaries/DictionaryFactory.h | 9 ++++++--- dbms/src/Interpreters/Context.cpp | 3 +++ dbms/src/Interpreters/ExternalDictionaries.cpp | 4 +++- dbms/src/Interpreters/ExternalDictionaries.h | 1 + dbms/src/Interpreters/ExternalLoader.h | 2 -- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dbms/src/Dictionaries/DictionaryFactory.h b/dbms/src/Dictionaries/DictionaryFactory.h index 2c101425f41..e0a2dd642cb 100644 --- a/dbms/src/Dictionaries/DictionaryFactory.h +++ b/dbms/src/Dictionaries/DictionaryFactory.h @@ -3,26 +3,29 @@ #include #include "IDictionary.h" + namespace Poco { + namespace Util { class AbstractConfiguration; } class Logger; + } + namespace DB { + class Context; class DictionaryFactory : public ext::singleton { public: - DictionaryPtr - create(const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, Context & context) - const; + DictionaryPtr create(const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, Context & context) const; using Creator = std::functionexternal_dictionaries_mutex); if (!shared->external_dictionaries) @@ -1214,6 +1216,7 @@ ExternalDictionaries & Context::getExternalDictionariesImpl(const bool throw_on_ shared->external_dictionaries.emplace( std::move(config_repository), + config, *this->global_context, throw_on_error); } diff --git a/dbms/src/Interpreters/ExternalDictionaries.cpp b/dbms/src/Interpreters/ExternalDictionaries.cpp index 5dcfab4b72a..719b13670fa 100644 --- a/dbms/src/Interpreters/ExternalDictionaries.cpp +++ b/dbms/src/Interpreters/ExternalDictionaries.cpp @@ -26,11 +26,13 @@ namespace } +/// Must not acquire Context lock in constructor to avoid possibility of deadlocks. ExternalDictionaries::ExternalDictionaries( std::unique_ptr config_repository, + const Poco::Util::AbstractConfiguration & config, Context & context, bool throw_on_error) - : ExternalLoader(context.getConfigRef(), + : ExternalLoader(config, externalDictionariesUpdateSettings, getExternalDictionariesConfigSettings(), std::move(config_repository), diff --git a/dbms/src/Interpreters/ExternalDictionaries.h b/dbms/src/Interpreters/ExternalDictionaries.h index 0b00ab9f632..a5581dd2237 100644 --- a/dbms/src/Interpreters/ExternalDictionaries.h +++ b/dbms/src/Interpreters/ExternalDictionaries.h @@ -20,6 +20,7 @@ public: /// Dictionaries will be loaded immediately and then will be updated in separate thread, each 'reload_period' seconds. ExternalDictionaries( std::unique_ptr config_repository, + const Poco::Util::AbstractConfiguration & config, Context & context, bool throw_on_error); diff --git a/dbms/src/Interpreters/ExternalLoader.h b/dbms/src/Interpreters/ExternalLoader.h index c2ce161f0e1..765ee1bbfdb 100644 --- a/dbms/src/Interpreters/ExternalLoader.h +++ b/dbms/src/Interpreters/ExternalLoader.h @@ -19,8 +19,6 @@ namespace DB { -class Context; - struct ExternalLoaderUpdateSettings { UInt64 check_period_sec = 5; From 549cdd5986f78b8e5ccaa1c522bbbb1df8c2923f Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 15 Mar 2019 10:08:18 +0300 Subject: [PATCH 294/297] fix mistype reported via support --- docs/ru/getting_started/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/getting_started/index.md b/docs/ru/getting_started/index.md index 9dd85e93753..f2b589550ac 100644 --- a/docs/ru/getting_started/index.md +++ b/docs/ru/getting_started/index.md @@ -96,7 +96,7 @@ $ clickhouse-server --config-file=/etc/clickhouse-server/config.xml $ clickhouse-client ``` -По умолчанию он соединяется с localhost:9000, от имени пользователя `default` без пароля. Также клиент может быть использован для соединения с удалённым сервером с помощью аргемента `--host`. +По умолчанию он соединяется с localhost:9000, от имени пользователя `default` без пароля. Также клиент может быть использован для соединения с удалённым сервером с помощью аргумента `--host`. Терминал должен использовать кодировку UTF-8. From 7a1bddecc2ca70ca367d94fe6b52e61b59eb2a05 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Fri, 15 Mar 2019 11:21:16 +0100 Subject: [PATCH 295/297] Add BUILT_WITH to librdkafka --- contrib/librdkafka-cmake/config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/librdkafka-cmake/config.h b/contrib/librdkafka-cmake/config.h index 266baae8dae..ae4e370a628 100644 --- a/contrib/librdkafka-cmake/config.h +++ b/contrib/librdkafka-cmake/config.h @@ -2,6 +2,8 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ #define ARCH "x86_64" +#define BUILT_WITH "GCC GXX PKGCONFIG OSXLD LIBDL PLUGINS ZLIB SSL SASL_CYRUS ZSTD HDRHISTOGRAM LZ4_EXT SNAPPY SOCKEM SASL_SCRAM CRC32C_HW" + #define CPU "generic" #define WITHOUT_OPTIMIZATION 0 #define ENABLE_DEVEL 0 From d243c665d13b788004f83636c305ddbe62529168 Mon Sep 17 00:00:00 2001 From: proller Date: Fri, 15 Mar 2019 14:36:59 +0300 Subject: [PATCH 296/297] libclickhouse.so : dont use debug postfix --- dbms/programs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/programs/CMakeLists.txt b/dbms/programs/CMakeLists.txt index 08d90e3e5d6..be878cce1ab 100644 --- a/dbms/programs/CMakeLists.txt +++ b/dbms/programs/CMakeLists.txt @@ -92,7 +92,7 @@ if (CLICKHOUSE_ONE_SHARED) add_library(clickhouse-lib SHARED ${CLICKHOUSE_SERVER_SOURCES} ${CLICKHOUSE_CLIENT_SOURCES} ${CLICKHOUSE_LOCAL_SOURCES} ${CLICKHOUSE_BENCHMARK_SOURCES} ${CLICKHOUSE_PERFORMANCE_TEST_SOURCES} ${CLICKHOUSE_COPIER_SOURCES} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_SOURCES} ${CLICKHOUSE_COMPRESSOR_SOURCES} ${CLICKHOUSE_FORMAT_SOURCES} ${CLICKHOUSE_OBFUSCATOR_SOURCES} ${CLICKHOUSE_COMPILER_SOURCES} ${CLICKHOUSE_ODBC_BRIDGE_SOURCES}) target_link_libraries(clickhouse-lib ${CLICKHOUSE_SERVER_LINK} ${CLICKHOUSE_CLIENT_LINK} ${CLICKHOUSE_LOCAL_LINK} ${CLICKHOUSE_BENCHMARK_LINK} ${CLICKHOUSE_PERFORMANCE_TEST_LINK} ${CLICKHOUSE_COPIER_LINK} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_LINK} ${CLICKHOUSE_COMPRESSOR_LINK} ${CLICKHOUSE_FORMAT_LINK} ${CLICKHOUSE_OBFUSCATOR_LINK} ${CLICKHOUSE_COMPILER_LINK} ${CLICKHOUSE_ODBC_BRIDGE_LINK}) target_include_directories(clickhouse-lib ${CLICKHOUSE_SERVER_INCLUDE} ${CLICKHOUSE_CLIENT_INCLUDE} ${CLICKHOUSE_LOCAL_INCLUDE} ${CLICKHOUSE_BENCHMARK_INCLUDE} ${CLICKHOUSE_PERFORMANCE_TEST_INCLUDE} ${CLICKHOUSE_COPIER_INCLUDE} ${CLICKHOUSE_EXTRACT_FROM_CONFIG_INCLUDE} ${CLICKHOUSE_COMPRESSOR_INCLUDE} ${CLICKHOUSE_FORMAT_INCLUDE} ${CLICKHOUSE_OBFUSCATOR_INCLUDE} ${CLICKHOUSE_COMPILER_INCLUDE} ${CLICKHOUSE_ODBC_BRIDGE_INCLUDE}) - set_target_properties(clickhouse-lib PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse) + set_target_properties(clickhouse-lib PROPERTIES SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR} VERSION ${VERSION_SO} OUTPUT_NAME clickhouse DEBUG_POSTFIX "") endif() if (CLICKHOUSE_SPLIT_BINARY) From 2e8f805a687702093a3cc6ab364e1157f7117f9e Mon Sep 17 00:00:00 2001 From: Alexander Ermolaev Date: Fri, 15 Mar 2019 15:54:27 +0300 Subject: [PATCH 297/297] fix typo (#4704) --- docs/ru/query_language/insert_into.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/query_language/insert_into.md b/docs/ru/query_language/insert_into.md index 6799eb71b64..631f56bde88 100644 --- a/docs/ru/query_language/insert_into.md +++ b/docs/ru/query_language/insert_into.md @@ -58,7 +58,7 @@ INSERT INTO [db.]table [(c1, c2, c3)] SELECT ... `INSERT` сортирует входящие данные по первичному ключу и разбивает их на партиции по месяцам. Если вы вставляете данные за разные месяцы вперемешку, то это может значительно снизить производительность запроса `INSERT`. Чтобы избежать этого: - Добавляйте данные достаточно большими пачками. Например, по 100 000 строк. -- Группируйте данные по месацам самостоятельно перед загрузкой в ClickHouse. +- Группируйте данные по месяцам самостоятельно перед загрузкой в ClickHouse. Снижения производительности не будет, если: