diff --git a/.gitmodules b/.gitmodules
index 32ce4983bb0..23a93ea6652 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -76,7 +76,7 @@
url = https://github.com/google/snappy
[submodule "contrib/cppkafka"]
path = contrib/cppkafka
- url = https://github.com/ClickHouse-Extras/cppkafka.git
+ url = https://github.com/mfontanini/cppkafka.git
[submodule "contrib/brotli"]
path = contrib/brotli
url = https://github.com/google/brotli.git
diff --git a/contrib/cppkafka b/contrib/cppkafka
index f555ee36aaa..b06e64ef5bf 160000
--- a/contrib/cppkafka
+++ b/contrib/cppkafka
@@ -1 +1 @@
-Subproject commit f555ee36aaa74d17ca0dab3ce472070a610b2966
+Subproject commit b06e64ef5bffd636d918a742c689f69130c1dbab
diff --git a/debian/rules b/debian/rules
index 7218e196baa..5b271a8691f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -101,7 +101,7 @@ override_dh_clean:
dh_clean # -X contrib
override_dh_strip:
-#https://www.debian.org/doc/debian-policy/ch-source.html#debian-rules-and-deb-build-options
+ #https://www.debian.org/doc/debian-policy/ch-source.html#debian-rules-and-deb-build-options
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -pclickhouse-common-static --dbg-package=clickhouse-common-static-dbg
endif
diff --git a/docker/test/fuzzer/run-fuzzer.sh b/docker/test/fuzzer/run-fuzzer.sh
index a9905d274f2..8cfe1a87408 100755
--- a/docker/test/fuzzer/run-fuzzer.sh
+++ b/docker/test/fuzzer/run-fuzzer.sh
@@ -161,7 +161,7 @@ case "$stage" in
# Lost connection to the server. This probably means that the server died
# with abort.
echo "failure" > status.txt
- if ! grep -a "Received signal \|Logical error" server.log > description.txt
+ if ! grep -ao "Received signal.*\|Logical error.*\|Assertion.*failed" server.log > description.txt
then
echo "Lost connection to server. See the logs" > description.txt
fi
diff --git a/docker/test/performance-comparison/compare.sh b/docker/test/performance-comparison/compare.sh
index 9e1780f247a..5e805b9ef0d 100755
--- a/docker/test/performance-comparison/compare.sh
+++ b/docker/test/performance-comparison/compare.sh
@@ -514,7 +514,12 @@ create table queries engine File(TSVWithNamesAndTypes, 'report/queries.tsv')
;
create table changed_perf_report engine File(TSV, 'report/changed-perf.tsv') as
- select left, right, diff, stat_threshold, changed_fail, test, query_index, query_display_name
+ select
+ left, right,
+ left > right
+ ? '- ' || toString(floor(left / right, 3)) || 'x'
+ : '+ ' || toString(floor(right / left, 3)) || 'x',
+ diff, stat_threshold, changed_fail, test, query_index, query_display_name
from queries where changed_show order by abs(diff) desc;
create table unstable_queries_report engine File(TSV, 'report/unstable-queries.tsv') as
@@ -592,9 +597,11 @@ create table test_times_report engine File(TSV, 'report/test-times.tsv') as
-- report for all queries page, only main metric
create table all_tests_report engine File(TSV, 'report/all-queries.tsv') as
select changed_fail, unstable_fail,
- left, right, diff,
- floor(left > right ? left / right : right / left, 3),
- stat_threshold, test, query_index, query_display_name
+ left, right,
+ left > right
+ ? '- ' || toString(floor(left / right, 3)) || 'x'
+ : '+ ' || toString(floor(right / left, 3)) || 'x',
+ diff, stat_threshold, test, query_index, query_display_name
from queries order by test, query_index;
-- queries for which we will build flamegraphs (see below)
diff --git a/docker/test/performance-comparison/report.py b/docker/test/performance-comparison/report.py
index 26a3cf61e7e..176cb2e90fe 100755
--- a/docker/test/performance-comparison/report.py
+++ b/docker/test/performance-comparison/report.py
@@ -63,7 +63,48 @@ p.links a {{ padding: 5px; margin: 3px; background: #FFF; line-height: 2; white-
color: inherit;
text-decoration: none;
}}
+
tr:nth-child(odd) td {{filter: brightness(95%);}}
+
+.all-query-times tr td:nth-child(1),
+.all-query-times tr td:nth-child(2),
+.all-query-times tr td:nth-child(3),
+.all-query-times tr td:nth-child(4),
+.all-query-times tr td:nth-child(5),
+.all-query-times tr td:nth-child(7),
+.changes-in-performance tr td:nth-child(1),
+.changes-in-performance tr td:nth-child(2),
+.changes-in-performance tr td:nth-child(3),
+.changes-in-performance tr td:nth-child(4),
+.changes-in-performance tr td:nth-child(5),
+.changes-in-performance tr td:nth-child(7),
+.unstable-queries tr td:nth-child(1),
+.unstable-queries tr td:nth-child(2),
+.unstable-queries tr td:nth-child(3),
+.unstable-queries tr td:nth-child(4),
+.unstable-queries tr td:nth-child(6),
+.test-performance-changes tr td:nth-child(2),
+.test-performance-changes tr td:nth-child(3),
+.test-performance-changes tr td:nth-child(4),
+.test-performance-changes tr td:nth-child(5),
+.test-performance-changes tr td:nth-child(6),
+.test-times tr td:nth-child(2),
+.test-times tr td:nth-child(3),
+.test-times tr td:nth-child(4),
+.test-times tr td:nth-child(5),
+.test-times tr td:nth-child(6),
+.test-times tr td:nth-child(7),
+.test-times tr td:nth-child(8),
+.concurrent-benchmarks tr td:nth-child(2),
+.concurrent-benchmarks tr td:nth-child(3),
+.concurrent-benchmarks tr td:nth-child(4),
+.concurrent-benchmarks tr td:nth-child(5),
+.metric-changes tr td:nth-child(2),
+.metric-changes tr td:nth-child(3),
+.metric-changes tr td:nth-child(4),
+.metric-changes tr td:nth-child(5)
+{{ text-align: right; }}
+
Clickhouse performance comparison
@@ -111,11 +152,14 @@ def tableHeader(r):
return tr(''.join([th(f) for f in r]))
def tableStart(title):
- return """
-
-""".format(
- anchor = nextTableAnchor(),
- title = title)
+ anchor = nextTableAnchor();
+ cls = '-'.join(title.lower().split(' ')[:3]);
+ return f"""
+
+
+ """
def tableEnd():
return '
'
@@ -238,12 +282,13 @@ if args.report == 'main':
columns = [
'Old, s', # 0
'New, s', # 1
- 'Relative difference (new − old) / old', # 2
- 'p < 0.001 threshold', # 3
- # Failed # 4
- 'Test', # 5
- '#', # 6
- 'Query', # 7
+ 'Times speedup / slowdown', # 2
+ 'Relative difference (new − old) / old', # 3
+ 'p < 0.001 threshold', # 4
+ # Failed # 5
+ 'Test', # 6
+ '#', # 7
+ 'Query', # 8
]
print(tableHeader(columns))
@@ -251,15 +296,15 @@ if args.report == 'main':
attrs = ['' for c in columns]
attrs[4] = None
for row in rows:
- if int(row[4]):
- if float(row[2]) < 0.:
+ if int(row[5]):
+ if float(row[3]) < 0.:
faster_queries += 1
- attrs[2] = f'style="background: {color_good}"'
+ attrs[2] = attrs[3] = f'style="background: {color_good}"'
else:
slower_queries += 1
- attrs[2] = f'style="background: {color_bad}"'
+ attrs[2] = attrs[3] = f'style="background: {color_bad}"'
else:
- attrs[2] = ''
+ attrs[2] = attrs[3] = ''
print(tableRow(row, attrs))
@@ -281,7 +326,7 @@ if args.report == 'main':
'Old, s', #0
'New, s', #1
'Relative difference (new - old)/old', #2
- 'p < 0.001 threshold', #3
+ 'p < 0.001 threshold', #3
# Failed #4
'Test', #5
'#', #6
@@ -498,9 +543,9 @@ elif args.report == 'all-queries':
# Unstable #1
'Old, s', #2
'New, s', #3
- 'Relative difference (new − old) / old', #4
- 'Times speedup / slowdown', #5
- 'p < 0.001 threshold', #6
+ 'Times speedup / slowdown', #4
+ 'Relative difference (new − old) / old', #5
+ 'p < 0.001 threshold', #6
'Test', #7
'#', #8
'Query', #9
@@ -519,12 +564,12 @@ elif args.report == 'all-queries':
attrs[6] = ''
if int(r[0]):
- if float(r[4]) > 0.:
- attrs[4] = f'style="background: {color_bad}"'
+ if float(r[5]) > 0.:
+ attrs[4] = attrs[5] = f'style="background: {color_bad}"'
else:
- attrs[4] = f'style="background: {color_good}"'
+ attrs[4] = attrs[5] = f'style="background: {color_good}"'
else:
- attrs[4] = ''
+ attrs[4] = attrs[5] = ''
if (float(r[2]) + float(r[3])) / 2 > allowed_single_run_time:
attrs[2] = f'style="background: {color_bad}"'
diff --git a/docker/test/test_runner.sh b/docker/test/test_runner.sh
index 561117492b0..d9bca8f0037 100755
--- a/docker/test/test_runner.sh
+++ b/docker/test/test_runner.sh
@@ -16,7 +16,7 @@ if [ ${CLICKHOUSE_PACKAGES_ARG} != ${NO_REBUILD_FLAG} ]; then
fi
-# In order to allow packages directory to be anywhere, and to reduce amoun of context sent to the docker daemon,
+# In order to allow packages directory to be anywhere, and to reduce amount of context sent to the docker daemon,
# all images are built in multiple stages:
# 1. build base image, install dependencies
# 2. run image with volume mounted, install what needed from those volumes
@@ -26,14 +26,14 @@ fi
# TODO: optionally mount most recent clickhouse-test and queries directory from local machine
if [ ${CLICKHOUSE_PACKAGES_ARG} != ${NO_REBUILD_FLAG} ]; then
- docker build \
+ docker build --network=host \
-f "${CLICKHOUSE_DOCKER_DIR}/test/stateless/clickhouse-statelest-test-runner.Dockerfile" \
--target clickhouse-test-runner-base \
-t clickhouse-test-runner-base:preinstall \
"${CLICKHOUSE_DOCKER_DIR}/test/stateless"
docker rm -f clickhouse-test-runner-installing-packages || true
- docker run \
+ docker run --network=host \
-v "${CLICKHOUSE_PACKAGES_DIR}:/packages" \
--name clickhouse-test-runner-installing-packages \
clickhouse-test-runner-base:preinstall
@@ -50,19 +50,19 @@ if [ -z "${CLICKHOUSE_SERVER_IMAGE}" ]; then
CLICKHOUSE_SERVER_IMAGE="yandex/clickhouse-server:local"
if [ ${CLICKHOUSE_PACKAGES_ARG} != ${NO_REBUILD_FLAG} ]; then
- docker build \
+ docker build --network=host \
-f "${CLICKHOUSE_DOCKER_DIR}/server/local.Dockerfile" \
--target clickhouse-server-base \
-t clickhouse-server-base:preinstall \
"${CLICKHOUSE_DOCKER_DIR}/server"
docker rm -f clickhouse_server_base_installing_server || true
- docker run -v "${CLICKHOUSE_PACKAGES_DIR}:/packages" \
+ docker run --network=host -v "${CLICKHOUSE_PACKAGES_DIR}:/packages" \
--name clickhouse_server_base_installing_server \
clickhouse-server-base:preinstall
docker commit clickhouse_server_base_installing_server clickhouse-server-base:postinstall
- docker build \
+ docker build --network=host \
-f "${CLICKHOUSE_DOCKER_DIR}/server/local.Dockerfile" \
--target clickhouse-server \
-t "${CLICKHOUSE_SERVER_IMAGE}" \
diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md
index 5abf2bf9ff8..d22a52f1f1f 100644
--- a/docs/en/interfaces/formats.md
+++ b/docs/en/interfaces/formats.md
@@ -1015,7 +1015,7 @@ The table below shows supported data types and how they match ClickHouse [data t
Unsupported Avro data types: `record` (non-root), `map`
-Unsupported Avro logical data types: `uuid`, `time-millis`, `time-micros`, `duration`
+Unsupported Avro logical data types: `time-millis`, `time-micros`, `duration`
### Inserting Data {#inserting-data-1}
diff --git a/docs/en/interfaces/http.md b/docs/en/interfaces/http.md
index ab1cb4b4d7d..a5e7ef22558 100644
--- a/docs/en/interfaces/http.md
+++ b/docs/en/interfaces/http.md
@@ -76,8 +76,11 @@ ECT 1
```
By default, data is returned in TabSeparated format (for more information, see the “Formats” section).
+
You use the FORMAT clause of the query to request any other format.
+Also, you can use the ‘default_format’ URL parameter or ‘X-ClickHouse-Format’ header to specify a default format other than TabSeparated.
+
``` bash
$ echo 'SELECT 1 FORMAT Pretty' | curl 'http://localhost:8123/?' --data-binary @-
┏━━━┓
@@ -167,7 +170,7 @@ $ echo "SELECT 1" | gzip -c | curl -sS --data-binary @- -H 'Content-Encoding: gz
!!! note "Note"
Some HTTP clients might decompress data from the server by default (with `gzip` and `deflate`) and you might get decompressed data even if you use the compression settings correctly.
-You can use the ‘database’ URL parameter to specify the default database.
+You can use the ‘database’ URL parameter or ‘X-ClickHouse-Database’ header to specify the default database.
``` bash
$ echo 'SELECT number FROM numbers LIMIT 10' | curl 'http://localhost:8123/?database=system' --data-binary @-
diff --git a/docs/en/operations/system-tables/stack_trace.md b/docs/en/operations/system-tables/stack_trace.md
new file mode 100644
index 00000000000..b1714a93a20
--- /dev/null
+++ b/docs/en/operations/system-tables/stack_trace.md
@@ -0,0 +1,89 @@
+# system.stack_trace {#system-tables_stack_trace}
+
+Contains stack traces of all server threads. Allows developers to introspect the server state.
+
+To analyze stack frames, use the `addressToLine`, `addressToSymbol` and `demangle` [introspection functions](../../sql-reference/functions/introspection.md).
+
+Columns:
+
+- `thread_id` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Thread identifier.
+- `query_id` ([String](../../sql-reference/data-types/string.md)) — Query identifier that can be used to get details about a query that was running from the [query_log](../system-tables/query_log.md) system table.
+- `trace` ([Array(UInt64)](../../sql-reference/data-types/array.md)) — A [stack trace](https://en.wikipedia.org/wiki/Stack_trace) which represents a list of physical addresses where the called methods are stored.
+
+**Example**
+
+Enabling introspection functions:
+
+``` sql
+SET allow_introspection_functions = 1;
+```
+
+Getting symbols from ClickHouse object files:
+
+``` sql
+WITH arrayMap(x -> demangle(addressToSymbol(x)), trace) AS all SELECT thread_id, query_id, arrayStringConcat(all, '\n') AS res FROM system.stack_trace LIMIT 1 \G
+```
+
+``` text
+Row 1:
+──────
+thread_id: 686
+query_id: 1a11f70b-626d-47c1-b948-f9c7b206395d
+res: sigqueue
+DB::StorageSystemStackTrace::fillData(std::__1::vector::mutable_ptr, std::__1::allocator::mutable_ptr > >&, DB::Context const&, DB::SelectQueryInfo const&) const
+DB::IStorageSystemOneBlock::read(std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, DB::SelectQueryInfo const&, DB::Context const&, DB::QueryProcessingStage::Enum, unsigned long, unsigned int)
+DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPipeline&, std::__1::shared_ptr const&, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&)
+DB::InterpreterSelectQuery::executeImpl(DB::QueryPipeline&, std::__1::shared_ptr const&, std::__1::optional)
+DB::InterpreterSelectQuery::execute()
+DB::InterpreterSelectWithUnionQuery::execute()
+DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*)
+DB::executeQuery(std::__1::basic_string, std::__1::allocator > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)
+DB::TCPHandler::runImpl()
+DB::TCPHandler::run()
+Poco::Net::TCPServerConnection::start()
+Poco::Net::TCPServerDispatcher::run()
+Poco::PooledThread::run()
+Poco::ThreadImpl::runnableEntry(void*)
+start_thread
+__clone
+```
+
+Getting filenames and line numbers in ClickHouse source code:
+
+``` sql
+WITH arrayMap(x -> addressToLine(x), trace) AS all, arrayFilter(x -> x LIKE '%/dbms/%', all) AS dbms SELECT thread_id, query_id, arrayStringConcat(notEmpty(dbms) ? dbms : all, '\n') AS res FROM system.stack_trace LIMIT 1 \G
+```
+
+``` text
+Row 1:
+──────
+thread_id: 686
+query_id: cad353e7-1c29-4b2e-949f-93e597ab7a54
+res: /lib/x86_64-linux-gnu/libc-2.27.so
+/build/obj-x86_64-linux-gnu/../src/Storages/System/StorageSystemStackTrace.cpp:182
+/build/obj-x86_64-linux-gnu/../contrib/libcxx/include/vector:656
+/build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:1338
+/build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:751
+/build/obj-x86_64-linux-gnu/../contrib/libcxx/include/optional:224
+/build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:192
+/build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:384
+/build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:643
+/build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:251
+/build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:1197
+/build/obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerConnection.cpp:57
+/build/obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:856
+/build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/include/Poco/Mutex_POSIX.h:59
+/build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/include/Poco/AutoPtr.h:223
+/lib/x86_64-linux-gnu/libpthread-2.27.so
+/lib/x86_64-linux-gnu/libc-2.27.so
+```
+
+**See Also**
+
+- [Introspection Functions](../../sql-reference/functions/introspection.md) — Which introspection functions are available and how to use them.
+- [system.trace_log](../system-tables/trace_log.md) — Contains stack traces collected by the sampling query profiler.
+- [arrayMap](../../sql-reference/functions/higher-order-functions.md#higher_order_functions-array-map) — Description and usage example of the `arrayMap` function.
+- [arrayFilter](../../sql-reference/functions/higher-order-functions.md#higher_order_functions-array-filter) — Description and usage example of the `arrayFilter` function.
+
+
+[Original article](https://clickhouse.tech/docs/en/operations/system-tables/stack_trace)
diff --git a/docs/ru/operations/system-tables.md b/docs/ru/operations/system-tables.md
index b6b1dc3e35a..3eeee1e6621 100644
--- a/docs/ru/operations/system-tables.md
+++ b/docs/ru/operations/system-tables.md
@@ -983,7 +983,8 @@ ProfileEvents.Values: [1,97,81,5,81]
- [system.query_log](#system_tables-query_log) — описание системной таблицы `query_log`, которая содержит общую информацию о выполненных запросах.
-## system.trace\_log {#system_tables-trace_log}
+
+## system.trace_log {#system_tables-trace_log}
Contains stack traces collected by the sampling query profiler.
@@ -1029,6 +1030,93 @@ thread_number: 48
query_id: acc4d61f-5bd1-4a3e-bc91-2180be37c915
trace: [94222141367858,94222152240175,94222152325351,94222152329944,94222152330796,94222151449980,94222144088167,94222151682763,94222144088167,94222151682763,94222144088167,94222144058283,94222144059248,94222091840750,94222091842302,94222091831228,94222189631488,140509950166747,140509942945935]
```
+## system.stack_trace {#system-tables_stack_trace}
+
+Содержит трассировки стека всех серверных потоков. Позволяет разработчикам анализировать состояние сервера.
+
+Для анализа логов используйте [функции интроспекции](../sql-reference/functions/introspection.md): `addressToLine`, `addressToSymbol` и `demangle`.
+
+Столбцы:
+
+- `thread_id` ([UInt64](../sql-reference/data-types/int-uint.md)) — Идентификатор потока.
+- `query_id` ([String](../sql-reference/data-types/string.md)) — Идентификатор запроса. Может быть использован для получения подробной информации о выполненном запросе из системной таблицы [query_log](#system_tables-query_log).
+- `trace` ([Array(UInt64)](../sql-reference/data-types/array.md)) — [Трассировка стека](https://en.wikipedia.org/wiki/Stack_trace). Представляет собой список физических адресов, по которым расположены вызываемые методы.
+
+**Пример**
+
+Включение функций интроспекции:
+
+``` sql
+SET allow_introspection_functions = 1;
+```
+
+Получение символов из объектных файлов ClickHouse:
+
+``` sql
+WITH arrayMap(x -> demangle(addressToSymbol(x)), trace) AS all SELECT thread_id, query_id, arrayStringConcat(all, '\n') AS res FROM system.stack_trace LIMIT 1 \G
+```
+
+``` text
+Row 1:
+──────
+thread_id: 686
+query_id: 1a11f70b-626d-47c1-b948-f9c7b206395d
+res: sigqueue
+DB::StorageSystemStackTrace::fillData(std::__1::vector::mutable_ptr, std::__1::allocator::mutable_ptr > >&, DB::Context const&, DB::SelectQueryInfo const&) const
+DB::IStorageSystemOneBlock::read(std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, DB::SelectQueryInfo const&, DB::Context const&, DB::QueryProcessingStage::Enum, unsigned long, unsigned int)
+DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPipeline&, std::__1::shared_ptr const&, std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&)
+DB::InterpreterSelectQuery::executeImpl(DB::QueryPipeline&, std::__1::shared_ptr const&, std::__1::optional)
+DB::InterpreterSelectQuery::execute()
+DB::InterpreterSelectWithUnionQuery::execute()
+DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*)
+DB::executeQuery(std::__1::basic_string, std::__1::allocator > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)
+DB::TCPHandler::runImpl()
+DB::TCPHandler::run()
+Poco::Net::TCPServerConnection::start()
+Poco::Net::TCPServerDispatcher::run()
+Poco::PooledThread::run()
+Poco::ThreadImpl::runnableEntry(void*)
+start_thread
+__clone
+```
+
+Получение имен файлов и номеров строк в исходном коде ClickHouse:
+
+``` sql
+WITH arrayMap(x -> addressToLine(x), trace) AS all, arrayFilter(x -> x LIKE '%/dbms/%', all) AS dbms SELECT thread_id, query_id, arrayStringConcat(notEmpty(dbms) ? dbms : all, '\n') AS res FROM system.stack_trace LIMIT 1 \G
+```
+
+``` text
+Row 1:
+──────
+thread_id: 686
+query_id: cad353e7-1c29-4b2e-949f-93e597ab7a54
+res: /lib/x86_64-linux-gnu/libc-2.27.so
+/build/obj-x86_64-linux-gnu/../src/Storages/System/StorageSystemStackTrace.cpp:182
+/build/obj-x86_64-linux-gnu/../contrib/libcxx/include/vector:656
+/build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:1338
+/build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:751
+/build/obj-x86_64-linux-gnu/../contrib/libcxx/include/optional:224
+/build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:192
+/build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:384
+/build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:643
+/build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:251
+/build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:1197
+/build/obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerConnection.cpp:57
+/build/obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:856
+/build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/include/Poco/Mutex_POSIX.h:59
+/build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/include/Poco/AutoPtr.h:223
+/lib/x86_64-linux-gnu/libpthread-2.27.so
+/lib/x86_64-linux-gnu/libc-2.27.so
+```
+
+**См. также**
+
+- [Функции интроспекции](../sql-reference/functions/introspection.md) — Что такое функции интроспекции и как их использовать.
+- [system.trace_log](system-tables.md#system_tables-trace_log) — Содержит трассировки стека, собранные профилировщиком выборочных запросов.
+- [arrayMap](../sql-reference/functions/higher-order-functions.md#higher_order_functions-array-map) — Описание и пример использования функции `arrayMap`.
+- [arrayFilter](../sql-reference/functions/higher-order-functions.md#higher_order_functions-array-filter) — Описание и пример использования функции `arrayFilter`.
+
## system.replicas {#system_tables-replicas}
diff --git a/docs/ru/sql-reference/functions/geo/index.md b/docs/ru/sql-reference/functions/geo/index.md
index 5e2ebd44718..bfea32a245b 100644
--- a/docs/ru/sql-reference/functions/geo/index.md
+++ b/docs/ru/sql-reference/functions/geo/index.md
@@ -1,7 +1,7 @@
---
toc_priority: 62
-toc_folder_title: hidden
-toc_title: Функции для работы с географическими координатами
+toc_folder_title: Гео-данные
+toc_title: hidden
---
diff --git a/docs/ru/sql-reference/statements/grant.md b/docs/ru/sql-reference/statements/grant.md
index ffc58d09d95..279b094247b 100644
--- a/docs/ru/sql-reference/statements/grant.md
+++ b/docs/ru/sql-reference/statements/grant.md
@@ -1,474 +1,479 @@
----
-toc_priority: 39
-toc_title: GRANT
----
+# GRANT
-# GRANT {#grant}
+- Присваивает [привилегии](#grant-privileges) пользователям или ролям ClickHouse.
+- Назначает роли пользователям или другим ролям.
-- Grants [privileges](#grant-privileges) to ClickHouse user accounts or roles.
-- Assigns roles to user accounts or to the other roles.
+Отозвать привилегию можно с помощью выражения [REVOKE](revoke.md). Чтобы вывести список присвоенных привилегий, воспользуйтесь выражением [SHOW GRANTS](show.md#show-grants-statement).
-To revoke privileges, use the [REVOKE](../../sql-reference/statements/revoke.md) statement. Also you can list granted privileges with the [SHOW GRANTS](../../sql-reference/statements/show.md#show-grants-statement) statement.
+## Синтаксис присвоения привилегий {#grant-privigele-syntax}
-## Granting Privilege Syntax {#grant-privigele-syntax}
-
-``` sql
+```sql
GRANT [ON CLUSTER cluster_name] privilege[(column_name [,...])] [,...] ON {db.table|db.*|*.*|table|*} TO {user | role | CURRENT_USER} [,...] [WITH GRANT OPTION]
```
-- `privilege` — Type of privilege.
-- `role` — ClickHouse user role.
-- `user` — ClickHouse user account.
+- `privilege` — Тип привилегии
+- `role` — Роль пользователя ClickHouse.
+- `user` — Пользователь ClickHouse.
-The `WITH GRANT OPTION` clause grants `user` or `role` with permission to execute the `GRANT` query. Users can grant privileges of the same scope they have and less.
+`WITH GRANT OPTION` разрешает пользователю или роли выполнять запрос `GRANT`. Пользователь может выдавать только те привилегии, которые есть у него, той же или меньшей области действий.
-## Assigning Role Syntax {#assign-role-syntax}
-``` sql
+## Синтаксис назначения ролей {#assign-role-syntax}
+
+```sql
GRANT [ON CLUSTER cluster_name] role [,...] TO {user | another_role | CURRENT_USER} [,...] [WITH ADMIN OPTION]
```
-- `role` — ClickHouse user role.
-- `user` — ClickHouse user account.
+- `role` — Роль пользователя ClickHouse.
+- `user` — Пользователь ClickHouse.
-The `WITH ADMIN OPTION` clause grants [ADMIN OPTION](#admin-option-privilege) privilege to `user` or `role`.
+`WITH ADMIN OPTION` присваивает привилегию [ADMIN OPTION](#admin-option-privilege) пользователю или роли.
-## Usage {#grant-usage}
+## Использование {#grant-usage}
-To use `GRANT`, your account must have the `GRANT OPTION` privilege. You can grant privileges only inside the scope of your account privileges.
+Для использования `GRANT` пользователь должен иметь привилегию `GRANT OPTION`. Пользователь может выдавать привилегии только внутри области действий назначенных ему самому привилегий.
-For example, administrator has granted privileges to the `john` account by the query:
+Например, администратор выдал привилегию пользователю `john`:
-``` sql
+```sql
GRANT SELECT(x,y) ON db.table TO john WITH GRANT OPTION
```
-It means that `john` has the permission to execute:
+Это означает, что пользователю `john` разрешено выполнять:
-- `SELECT x,y FROM db.table`.
-- `SELECT x FROM db.table`.
-- `SELECT y FROM db.table`.
+- `SELECT x,y FROM db.table`.
+- `SELECT x FROM db.table`.
+- `SELECT y FROM db.table`.
-`john` can’t execute `SELECT z FROM db.table`. The `SELECT * FROM db.table` also is not available. Processing this query, ClickHouse doesn’t return any data, even `x` and `y`. The only exception is if a table contains only `x` and `y` columns. In this case ClickHouse returns all the data.
+`john` не может выполнить `SELECT z FROM db.table` или `SELECT * FROM db.table`. После обработки данных запросов ClickHouse ничего не вернет — даже `x` или `y`. Единственное исключение — если таблица содержит только столбцы `x` и `y`. В таком случае ClickHouse вернет все данные.
-Also `john` has the `GRANT OPTION` privilege, so it can grant other users with privileges of the same or smaller scope.
+Также у `john` есть привилегия `GRANT OPTION`. `john` может выдать другим пользователям привилегии той же или меньшей области действий из тех, которые есть у него.
-Specifying privileges you can use asterisk (`*`) instead of a table or a database name. For example, the `GRANT SELECT ON db.* TO john` query allows `john` to execute the `SELECT` query over all the tables in `db` database. Also, you can omit database name. In this case privileges are granted for current database. For example, `GRANT SELECT ON * TO john` grants the privilege on all the tables in the current database, `GRANT SELECT ON mytable TO john` grants the privilege on the `mytable` table in the current database.
+При присвоении привилегий допускается использовать астериск (`*`) вместо имени таблицы или базы данных. Например, запрос `GRANT SELECT ON db.* TO john` позволит пользователю `john` выполнять `SELECT` над всеми таблицам в базе данных `db`. Также вы можете опускать имя базы данных. В таком случае привилегии позволят совершать операции над текущей базой данных. Например, запрос `GRANT SELECT ON * TO john` выдаст привилегию на выполнение `SELECT` над всеми таблицами в текущей базе данных; `GRANT SELECT ON mytable TO john` — только над таблицей `mytable` в текущей базе данных.
-Access to the `system` database is always allowed (since this database is used for processing queries).
+Доступ к базе данных `system` разрешен всегда (данная база данных используется при обработке запросов).
-You can grant multiple privileges to multiple accounts in one query. The query `GRANT SELECT, INSERT ON *.* TO john, robin` allows accounts `john` and `robin` to execute the `INSERT` and `SELECT` queries over all the tables in all the databases on the server.
+Вы можете присвоить несколько привилегий нескольким пользователям в одном запросе. Запрос `GRANT SELECT, INSERT ON *.* TO john, robin` позволит пользователям `john` и `robin` выполнять `INSERT` и `SELECT` над всеми таблицами всех баз данных на сервере.
-## Privileges {#grant-privileges}
-Privilege is a permission to execute specific kind of queries.
+## Привилегии {#grant-privileges}
-Privileges have a hierarchical structure. A set of permitted queries depends on the privilege scope.
+Привилегия — это разрешение на выполнение определенного типа запросов.
-Hierarchy of privileges:
+Привилегии имеют иерархическую структуру. Набор разрешенных запросов зависит от области действия привилегии.
-- [SELECT](#grant-select)
-- [INSERT](#grant-insert)
-- [ALTER](#grant-alter)
- - `ALTER TABLE`
- - `ALTER UPDATE`
- - `ALTER DELETE`
- - `ALTER COLUMN`
- - `ALTER ADD COLUMN`
- - `ALTER DROP COLUMN`
- - `ALTER MODIFY COLUMN`
- - `ALTER COMMENT COLUMN`
- - `ALTER CLEAR COLUMN`
- - `ALTER RENAME COLUMN`
- - `ALTER INDEX`
- - `ALTER ORDER BY`
- - `ALTER ADD INDEX`
- - `ALTER DROP INDEX`
- - `ALTER MATERIALIZE INDEX`
- - `ALTER CLEAR INDEX`
- - `ALTER CONSTRAINT`
- - `ALTER ADD CONSTRAINT`
- - `ALTER DROP CONSTRAINT`
- - `ALTER TTL`
- - `ALTER MATERIALIZE TTL`
- - `ALTER SETTINGS`
- - `ALTER MOVE PARTITION`
- - `ALTER FETCH PARTITION`
- - `ALTER FREEZE PARTITION`
- - `ALTER VIEW`
- - `ALTER VIEW REFRESH`
- - `ALTER VIEW MODIFY QUERY`
-- [CREATE](#grant-create)
- - `CREATE DATABASE`
- - `CREATE TABLE`
- - `CREATE VIEW`
- - `CREATE DICTIONARY`
- - `CREATE TEMPORARY TABLE`
-- [DROP](#grant-drop)
- - `DROP DATABASE`
- - `DROP TABLE`
- - `DROP VIEW`
- - `DROP DICTIONARY`
-- [TRUNCATE](#grant-truncate)
-- [OPTIMIZE](#grant-optimize)
-- [SHOW](#grant-show)
- - `SHOW DATABASES`
- - `SHOW TABLES`
- - `SHOW COLUMNS`
- - `SHOW DICTIONARIES`
-- [KILL QUERY](#grant-kill-query)
-- [ACCESS MANAGEMENT](#grant-access-management)
- - `CREATE USER`
- - `ALTER USER`
- - `DROP USER`
- - `CREATE ROLE`
- - `ALTER ROLE`
- - `DROP ROLE`
- - `CREATE ROW POLICY`
- - `ALTER ROW POLICY`
- - `DROP ROW POLICY`
- - `CREATE QUOTA`
- - `ALTER QUOTA`
- - `DROP QUOTA`
- - `CREATE SETTINGS PROFILE`
- - `ALTER SETTINGS PROFILE`
- - `DROP SETTINGS PROFILE`
- - `SHOW ACCESS`
- - `SHOW_USERS`
- - `SHOW_ROLES`
- - `SHOW_ROW_POLICIES`
- - `SHOW_QUOTAS`
- - `SHOW_SETTINGS_PROFILES`
- - `ROLE ADMIN`
-- [SYSTEM](#grant-system)
- - `SYSTEM SHUTDOWN`
- - `SYSTEM DROP CACHE`
- - `SYSTEM DROP DNS CACHE`
- - `SYSTEM DROP MARK CACHE`
- - `SYSTEM DROP UNCOMPRESSED CACHE`
- - `SYSTEM RELOAD`
- - `SYSTEM RELOAD CONFIG`
- - `SYSTEM RELOAD DICTIONARY`
- - `SYSTEM RELOAD EMBEDDED DICTIONARIES`
- - `SYSTEM MERGES`
- - `SYSTEM TTL MERGES`
- - `SYSTEM FETCHES`
- - `SYSTEM MOVES`
- - `SYSTEM SENDS`
- - `SYSTEM DISTRIBUTED SENDS`
- - `SYSTEM REPLICATED SENDS`
- - `SYSTEM REPLICATION QUEUES`
- - `SYSTEM SYNC REPLICA`
- - `SYSTEM RESTART REPLICA`
- - `SYSTEM FLUSH`
- - `SYSTEM FLUSH DISTRIBUTED`
- - `SYSTEM FLUSH LOGS`
-- [INTROSPECTION](#grant-introspection)
- - `addressToLine`
- - `addressToSymbol`
- - `demangle`
-- [SOURCES](#grant-sources)
- - `FILE`
- - `URL`
- - `REMOTE`
- - `YSQL`
- - `ODBC`
- - `JDBC`
- - `HDFS`
- - `S3`
-- [dictGet](#grant-dictget)
+Иерархия привилегий:
-Examples of how this hierarchy is treated:
+- [SELECT](#grant-select)
+- [INSERT](#grant-insert)
+- [ALTER](#grant-alter)
+ - `ALTER TABLE`
+ - `ALTER UPDATE`
+ - `ALTER DELETE`
+ - `ALTER COLUMN`
+ - `ALTER ADD COLUMN`
+ - `ALTER DROP COLUMN`
+ - `ALTER MODIFY COLUMN`
+ - `ALTER COMMENT COLUMN`
+ - `ALTER CLEAR COLUMN`
+ - `ALTER RENAME COLUMN`
+ - `ALTER INDEX`
+ - `ALTER ORDER BY`
+ - `ALTER ADD INDEX`
+ - `ALTER DROP INDEX`
+ - `ALTER MATERIALIZE INDEX`
+ - `ALTER CLEAR INDEX`
+ - `ALTER CONSTRAINT`
+ - `ALTER ADD CONSTRAINT`
+ - `ALTER DROP CONSTRAINT`
+ - `ALTER TTL`
+ - `ALTER MATERIALIZE TTL`
+ - `ALTER SETTINGS`
+ - `ALTER MOVE PARTITION`
+ - `ALTER FETCH PARTITION`
+ - `ALTER FREEZE PARTITION`
+ - `ALTER VIEW`
+ - `ALTER VIEW REFRESH `
+ - `ALTER VIEW MODIFY QUERY`
+- [CREATE](#grant-create)
+ - `CREATE DATABASE`
+ - `CREATE TABLE`
+ - `CREATE VIEW`
+ - `CREATE DICTIONARY`
+ - `CREATE TEMPORARY TABLE`
+- [DROP](#grant-drop)
+ - `DROP DATABASE`
+ - `DROP TABLE`
+ - `DROP VIEW`
+ - `DROP DICTIONARY`
+- [TRUNCATE](#grant-truncate)
+- [OPTIMIZE](#grant-optimize)
+- [SHOW](#grant-show)
+ - `SHOW DATABASES`
+ - `SHOW TABLES`
+ - `SHOW COLUMNS`
+ - `SHOW DICTIONARIES`
+- [KILL QUERY](#grant-kill-query)
+- [ACCESS MANAGEMENT](#grant-access-management)
+ - `CREATE USER`
+ - `ALTER USER`
+ - `DROP USER`
+ - `CREATE ROLE`
+ - `ALTER ROLE`
+ - `DROP ROLE`
+ - `CREATE ROW POLICY`
+ - `ALTER ROW POLICY`
+ - `DROP ROW POLICY`
+ - `CREATE QUOTA`
+ - `ALTER QUOTA`
+ - `DROP QUOTA`
+ - `CREATE SETTINGS PROFILE`
+ - `ALTER SETTINGS PROFILE`
+ - `DROP SETTINGS PROFILE`
+ - `SHOW ACCESS`
+ - `SHOW_USERS`
+ - `SHOW_ROLES`
+ - `SHOW_ROW_POLICIES`
+ - `SHOW_QUOTAS`
+ - `SHOW_SETTINGS_PROFILES`
+ - `ROLE ADMIN`
+- [SYSTEM](#grant-system)
+ - `SYSTEM SHUTDOWN`
+ - `SYSTEM DROP CACHE`
+ - `SYSTEM DROP DNS CACHE`
+ - `SYSTEM DROP MARK CACHE`
+ - `SYSTEM DROP UNCOMPRESSED CACHE`
+ - `SYSTEM RELOAD`
+ - `SYSTEM RELOAD CONFIG`
+ - `SYSTEM RELOAD DICTIONARY`
+ - `SYSTEM RELOAD EMBEDDED DICTIONARIES`
+ - `SYSTEM MERGES`
+ - `SYSTEM TTL MERGES`
+ - `SYSTEM FETCHES`
+ - `SYSTEM MOVES`
+ - `SYSTEM SENDS`
+ - `SYSTEM DISTRIBUTED SENDS`
+ - `SYSTEM REPLICATED SENDS`
+ - `SYSTEM REPLICATION QUEUES`
+ - `SYSTEM SYNC REPLICA`
+ - `SYSTEM RESTART REPLICA`
+ - `SYSTEM FLUSH`
+ - `SYSTEM FLUSH DISTRIBUTED`
+ - `SYSTEM FLUSH LOGS`
+- [INTROSPECTION](#grant-introspection)
+ - `addressToLine`
+ - `addressToSymbol`
+ - `demangle`
+- [SOURCES](#grant-sources)
+ - `FILE`
+ - `URL`
+ - `REMOTE`
+ - `MYSQL`
+ - `ODBC`
+ - `JDBC`
+ - `HDFS`
+ - `S3`
+- [dictGet](#grant-dictget)
-- The `ALTER` privilege includes all other `ALTER*` privileges.
-- `ALTER CONSTRAINT` includes `ALTER ADD CONSTRAINT` and `ALTER DROP CONSTRAINT` privileges.
+Примеры того, как трактуется данная иерархия:
-Privileges are applied at different levels. Knowing of a level suggests syntax available for privilege.
+- Привилегия `ALTER` включает все остальные `ALTER*` привилегии.
+- `ALTER CONSTRAINT` включает `ALTER ADD CONSTRAINT` и `ALTER DROP CONSTRAINT`.
-Levels (from lower to higher):
+Привилегии применяются на разных уровнях. Уровень определяет синтаксис присваивания привилегии.
-- `COLUMN` — Privilege can be granted for column, table, database, or globally.
-- `TABLE` — Privilege can be granted for table, database, or globally.
-- `VIEW` — Privilege can be granted for view, database, or globally.
-- `DICTIONARY` — Privilege can be granted for dictionary, database, or globally.
-- `DATABASE` — Privilege can be granted for database or globally.
-- `GLOBAL` — Privilege can be granted only globally.
-- `GROUP` — Groups privileges of different levels. When `GROUP`-level privilege is granted, only that privileges from the group are granted which correspond to the used syntax.
+Уровни (от низшего к высшему):
-Examples of allowed syntax:
+- `COLUMN` — Привилегия присваивается для столбца, таблицы, базы данных или глобально.
+- `TABLE` — Привилегия присваивается для таблицы, базы данных или глобально.
+- `VIEW` — Привилегия присваивается для представления, базы данных или глобально.
+- `DICTIONARY` — Привилегия присваивается для словаря, базы данных или глобально.
+- `DATABASE` — Привилегия присваивается для базы данных или глобально.
+- `GLOBAL` — Привилегия присваивается только глобально.
+- `GROUP` — Группирует привилегии разных уровней. При присвоении привилегии уровня `GROUP` присваиваются только привилегии из группы в соответствии с используемым синтаксисом.
-- `GRANT SELECT(x) ON db.table TO user`
-- `GRANT SELECT ON db.* TO user`
+Примеры допустимого синтаксиса:
-Examples of disallowed syntax:
+- `GRANT SELECT(x) ON db.table TO user`
+- `GRANT SELECT ON db.* TO user`
-- `GRANT CREATE USER(x) ON db.table TO user`
-- `GRANT CREATE USER ON db.* TO user`
+Примеры недопустимого синтаксиса:
-The special privilege [ALL](#grant-all) grants all the privileges to a user account or a role.
+- `GRANT CREATE USER(x) ON db.table TO user`
+- `GRANT CREATE USER ON db.* TO user`
-By default, a user account or a role has no privileges.
+Специальная привилегия [ALL](#grant-all) присваивает все привилегии пользователю или роли.
-If a user or a role has no privileges, it is displayed as [NONE](#grant-none) privilege.
+По умолчанию пользователь или роль не имеют привилегий.
+
+Отсутствие привилегий у пользователя или роли отображается как привилегия [NONE](#grant-none).
+
+Выполнение некоторых запросов требует определенного набора привилегий. Например, чтобы выполнить запрос [RENAME](misc.md#misc_operations-rename), нужны следующие привилегии: `SELECT`, `CREATE TABLE`, `INSERT` и `DROP TABLE`.
-Some queries by their implementation require a set of privileges. For example, to execute the [RENAME](../../sql-reference/statements/misc.md#misc_operations-rename) query you need the following privileges: `SELECT`, `CREATE TABLE`, `INSERT` and `DROP TABLE`.
### SELECT {#grant-select}
-Allows executing [SELECT](../../sql-reference/statements/select/index.md) queries.
+Разрешает выполнять запросы [SELECT](select/index.md).
-Privilege level: `COLUMN`.
+Уровень: `COLUMN`.
-**Description**
+**Описание**
-User granted with this privilege can execute `SELECT` queries over a specified list of columns in the specified table and database. If user includes other columns then specified a query returns no data.
+Пользователь с данной привилегией может выполнять запросы `SELECT` над определенными столбцами из определенной таблицы и базы данных. При включении в запрос других столбцов запрос ничего не вернет.
-Consider the following privilege:
+Рассмотрим следующую привилегию:
-``` sql
+```sql
GRANT SELECT(x,y) ON db.table TO john
```
-This privilege allows `john` to execute any `SELECT` query that involves data from the `x` and/or `y` columns in `db.table`, for example, `SELECT x FROM db.table`. `john` can’t execute `SELECT z FROM db.table`. The `SELECT * FROM db.table` also is not available. Processing this query, ClickHouse doesn’t return any data, even `x` and `y`. The only exception is if a table contains only `x` and `y` columns, in this case ClickHouse returns all the data.
+Данная привилегия позволяет пользователю `john` выполнять выборку данных из столбцов `x` и/или `y` в `db.table`, например, `SELECT x FROM db.table`. `john` не может выполнить `SELECT z FROM db.table` или `SELECT * FROM db.table`. После обработки данных запросов ClickHouse ничего не вернет — даже `x` или `y`. Единственное исключение — если таблица содержит только столбцы `x` и `y`. В таком случае ClickHouse вернет все данные.
### INSERT {#grant-insert}
-Allows executing [INSERT](../../sql-reference/statements/insert-into.md) queries.
+Разрешает выполнять запросы [INSERT](insert-into.md).
-Privilege level: `COLUMN`.
+Уровень: `COLUMN`.
-**Description**
+**Описание**
-User granted with this privilege can execute `INSERT` queries over a specified list of columns in the specified table and database. If user includes other columns then specified a query doesn’t insert any data.
+Пользователь с данной привилегией может выполнять запросы `INSERT` над определенными столбцами из определенной таблицы и базы данных. При включении в запрос других столбцов запрос не добавит никаких данных.
-**Example**
+**Пример**
-``` sql
+```sql
GRANT INSERT(x,y) ON db.table TO john
```
-The granted privilege allows `john` to insert data to the `x` and/or `y` columns in `db.table`.
+Присвоенная привилегия позволит пользователю `john` вставить данные в столбцы `x` и/или `y` в `db.table`.
### ALTER {#grant-alter}
-Allows executing [ALTER](../../sql-reference/statements/alter.md) queries according to the following hierarchy of privileges:
+Разрешает выполнять запросы [ALTER](alter.md) в соответствии со следующей иерархией привилегий:
-- `ALTER`. Level: `COLUMN`.
- - `ALTER TABLE`. Level: `GROUP`
- - `ALTER UPDATE`. Level: `COLUMN`. Aliases: `UPDATE`
- - `ALTER DELETE`. Level: `COLUMN`. Aliases: `DELETE`
- - `ALTER COLUMN`. Level: `GROUP`
- - `ALTER ADD COLUMN`. Level: `COLUMN`. Aliases: `ADD COLUMN`
- - `ALTER DROP COLUMN`. Level: `COLUMN`. Aliases: `DROP COLUMN`
- - `ALTER MODIFY COLUMN`. Level: `COLUMN`. Aliases: `MODIFY COLUMN`
- - `ALTER COMMENT COLUMN`. Level: `COLUMN`. Aliases: `COMMENT COLUMN`
- - `ALTER CLEAR COLUMN`. Level: `COLUMN`. Aliases: `CLEAR COLUMN`
- - `ALTER RENAME COLUMN`. Level: `COLUMN`. Aliases: `RENAME COLUMN`
- - `ALTER INDEX`. Level: `GROUP`. Aliases: `INDEX`
- - `ALTER ORDER BY`. Level: `TABLE`. Aliases: `ALTER MODIFY ORDER BY`, `MODIFY ORDER BY`
- - `ALTER ADD INDEX`. Level: `TABLE`. Aliases: `ADD INDEX`
- - `ALTER DROP INDEX`. Level: `TABLE`. Aliases: `DROP INDEX`
- - `ALTER MATERIALIZE INDEX`. Level: `TABLE`. Aliases: `MATERIALIZE INDEX`
- - `ALTER CLEAR INDEX`. Level: `TABLE`. Aliases: `CLEAR INDEX`
- - `ALTER CONSTRAINT`. Level: `GROUP`. Aliases: `CONSTRAINT`
- - `ALTER ADD CONSTRAINT`. Level: `TABLE`. Aliases: `ADD CONSTRAINT`
- - `ALTER DROP CONSTRAINT`. Level: `TABLE`. Aliases: `DROP CONSTRAINT`
- - `ALTER TTL`. Level: `TABLE`. Aliases: `ALTER MODIFY TTL`, `MODIFY TTL`
- - `ALTER MATERIALIZE TTL`. Level: `TABLE`. Aliases: `MATERIALIZE TTL`
- - `ALTER SETTINGS`. Level: `TABLE`. Aliases: `ALTER SETTING`, `ALTER MODIFY SETTING`, `MODIFY SETTING`
- - `ALTER MOVE PARTITION`. Level: `TABLE`. Aliases: `ALTER MOVE PART`, `MOVE PARTITION`, `MOVE PART`
- - `ALTER FETCH PARTITION`. Level: `TABLE`. Aliases: `FETCH PARTITION`
- - `ALTER FREEZE PARTITION`. Level: `TABLE`. Aliases: `FREEZE PARTITION`
- - `ALTER VIEW` Level: `GROUP`
- - `ALTER VIEW REFRESH`. Level: `VIEW`. Aliases: `ALTER LIVE VIEW REFRESH`, `REFRESH VIEW`
- - `ALTER VIEW MODIFY QUERY`. Level: `VIEW`. Aliases: `ALTER TABLE MODIFY QUERY`
+- `ALTER`. Уровень: `COLUMN`.
+ - `ALTER TABLE`. Уровень: `GROUP`
+ - `ALTER UPDATE`. Уровень: `COLUMN`. Алиасы: `UPDATE`
+ - `ALTER DELETE`. Уровень: `COLUMN`. Алиасы: `DELETE`
+ - `ALTER COLUMN`. Уровень: `GROUP`
+ - `ALTER ADD COLUMN`. Уровень: `COLUMN`. Алиасы: `ADD COLUMN`
+ - `ALTER DROP COLUMN`. Уровень: `COLUMN`. Алиасы: `DROP COLUMN`
+ - `ALTER MODIFY COLUMN`. Уровень: `COLUMN`. Алиасы: `MODIFY COLUMN`
+ - `ALTER COMMENT COLUMN`. Уровень: `COLUMN`. Алиасы: `COMMENT COLUMN`
+ - `ALTER CLEAR COLUMN`. Уровень: `COLUMN`. Алиасы: `CLEAR COLUMN`
+ - `ALTER RENAME COLUMN`. Уровень: `COLUMN`. Алиасы: `RENAME COLUMN`
+ - `ALTER INDEX`. Уровень: `GROUP`. Алиасы: `INDEX`
+ - `ALTER ORDER BY`. Уровень: `TABLE`. Алиасы: `ALTER MODIFY ORDER BY`, `MODIFY ORDER BY`
+ - `ALTER ADD INDEX`. Уровень: `TABLE`. Алиасы: `ADD INDEX`
+ - `ALTER DROP INDEX`. Уровень: `TABLE`. Алиасы: `DROP INDEX`
+ - `ALTER MATERIALIZE INDEX`. Уровень: `TABLE`. Алиасы: `MATERIALIZE INDEX`
+ - `ALTER CLEAR INDEX`. Уровень: `TABLE`. Алиасы: `CLEAR INDEX`
+ - `ALTER CONSTRAINT`. Уровень: `GROUP`. Алиасы: `CONSTRAINT`
+ - `ALTER ADD CONSTRAINT`. Уровень: `TABLE`. Алиасы: `ADD CONSTRAINT`
+ - `ALTER DROP CONSTRAINT`. Уровень: `TABLE`. Алиасы: `DROP CONSTRAINT`
+ - `ALTER TTL`. Уровень: `TABLE`. Алиасы: `ALTER MODIFY TTL`, `MODIFY TTL`
+ - `ALTER MATERIALIZE TTL`. Уровень: `TABLE`. Алиасы: `MATERIALIZE TTL`
+ - `ALTER SETTINGS`. Уровень: `TABLE`. Алиасы: `ALTER SETTING`, `ALTER MODIFY SETTING`, `MODIFY SETTING`
+ - `ALTER MOVE PARTITION`. Уровень: `TABLE`. Алиасы: `ALTER MOVE PART`, `MOVE PARTITION`, `MOVE PART`
+ - `ALTER FETCH PARTITION`. Уровень: `TABLE`. Алиасы: `FETCH PARTITION`
+ - `ALTER FREEZE PARTITION`. Уровень: `TABLE`. Алиасы: `FREEZE PARTITION`
+ - `ALTER VIEW` Уровень: `GROUP`
+ - `ALTER VIEW REFRESH `. Уровень: `VIEW`. Алиасы: `ALTER LIVE VIEW REFRESH`, `REFRESH VIEW`
+ - `ALTER VIEW MODIFY QUERY`. Уровень: `VIEW`. Алиасы: `ALTER TABLE MODIFY QUERY`
-Examples of how this hierarchy is treated:
+Примеры того, как трактуется данная иерархия:
-- The `ALTER` privilege includes all other `ALTER*` privileges.
-- `ALTER CONSTRAINT` includes `ALTER ADD CONSTRAINT` and `ALTER DROP CONSTRAINT` privileges.
+- Привилегия `ALTER` включает все остальные `ALTER*` привилегии.
+- `ALTER CONSTRAINT` включает `ALTER ADD CONSTRAINT` и `ALTER DROP CONSTRAINT`.
-**Notes**
+**Дополнительно**
-- The `MODIFY SETTING` privilege allows modifying table engine settings. It doesn’t affect settings or server configuration parameters.
-- The `ATTACH` operation needs the [CREATE](#grant-create) privilege.
-- The `DETACH` operation needs the [DROP](#grant-drop) privilege.
-- To stop mutation by the [KILL MUTATION](../../sql-reference/statements/misc.md#kill-mutation-statement) query, you need to have a privilege to start this mutation. For example, if you want to stop the `ALTER UPDATE` query, you need the `ALTER UPDATE`, `ALTER TABLE`, or `ALTER` privilege.
+- Привилегия `MODIFY SETTING` позволяет изменять настройки движков таблиц. Не влияет на настройки или конфигурационные параметры сервера.
+- Операция `ATTACH` требует наличие привилегии [CREATE](#grant-create).
+- Операция `DETACH` требует наличие привилегии [DROP](#grant-drop).
+- Для остановки мутации с помощью [KILL MUTATION](misc.md#kill-mutation-statement), необходима привилегия на выполнение данной мутации. Например, чтобы остановить запрос `ALTER UPDATE`, необходима одна из привилегий: `ALTER UPDATE`, `ALTER TABLE` или `ALTER`.
### CREATE {#grant-create}
-Allows executing [CREATE](../../sql-reference/statements/create.md) and [ATTACH](../../sql-reference/statements/misc.md#attach) DDL-queries according to the following hierarchy of privileges:
+Разрешает выполнять DDL-запросы [CREATE](create.md) и [ATTACH](misc.md#attach) в соответствии со следующей иерархией привилегий:
-- `CREATE`. Level: `GROUP`
- - `CREATE DATABASE`. Level: `DATABASE`
- - `CREATE TABLE`. Level: `TABLE`
- - `CREATE VIEW`. Level: `VIEW`
- - `CREATE DICTIONARY`. Level: `DICTIONARY`
- - `CREATE TEMPORARY TABLE`. Level: `GLOBAL`
+- `CREATE`. Уровень: `GROUP`
+ - `CREATE DATABASE`. Уровень: `DATABASE`
+ - `CREATE TABLE`. Уровень: `TABLE`
+ - `CREATE VIEW`. Уровень: `VIEW`
+ - `CREATE DICTIONARY`. Уровень: `DICTIONARY`
+ - `CREATE TEMPORARY TABLE`. Уровень: `GLOBAL`
-**Notes**
+**Дополнительно**
-- To delete the created table, a user needs [DROP](#grant-drop).
+- Для удаления созданной таблицы пользователю необходима привилегия [DROP](#grant-drop).
### DROP {#grant-drop}
-Allows executing [DROP](../../sql-reference/statements/misc.md#drop) and [DETACH](../../sql-reference/statements/misc.md#detach-statement) queries according to the following hierarchy of privileges:
+Разрешает выполнять запросы [DROP](misc.md#drop) и [DETACH](misc.md#detach-statement) в соответствии со следующей иерархией привилегий:
+
+- `DROP`. Уровень:
+ - `DROP DATABASE`. Уровень: `DATABASE`
+ - `DROP TABLE`. Уровень: `TABLE`
+ - `DROP VIEW`. Уровень: `VIEW`
+ - `DROP DICTIONARY`. Уровень: `DICTIONARY`
-- `DROP`. Level:
- - `DROP DATABASE`. Level: `DATABASE`
- - `DROP TABLE`. Level: `TABLE`
- - `DROP VIEW`. Level: `VIEW`
- - `DROP DICTIONARY`. Level: `DICTIONARY`
### TRUNCATE {#grant-truncate}
-Allows executing [TRUNCATE](../../sql-reference/statements/misc.md#truncate-statement) queries.
+Разрешает выполнять запросы [TRUNCATE](misc.md#truncate-statement).
-Privilege level: `TABLE`.
+Уровень: `TABLE`.
### OPTIMIZE {#grant-optimize}
-Allows executing [OPTIMIZE TABLE](../../sql-reference/statements/misc.md#misc_operations-optimize) queries.
+Разрешает выполнять запросы [OPTIMIZE TABLE](misc.md#misc_operations-optimize).
-Privilege level: `TABLE`.
+Уровень: `TABLE`.
### SHOW {#grant-show}
-Allows executing `SHOW`, `DESCRIBE`, `USE`, and `EXISTS` queries according to the following hierarchy of privileges:
+Разрешает выполнять запросы `SHOW`, `DESCRIBE`, `USE` и `EXISTS` в соответствии со следующей иерархией привилегий:
-- `SHOW`. Level: `GROUP`
- - `SHOW DATABASES`. Level: `DATABASE`. Allows to execute `SHOW DATABASES`, `SHOW CREATE DATABASE`, `USE ` queries.
- - `SHOW TABLES`. Level: `TABLE`. Allows to execute `SHOW TABLES`, `EXISTS `, `CHECK ` queries.
- - `SHOW COLUMNS`. Level: `COLUMN`. Allows to execute `SHOW CREATE TABLE`, `DESCRIBE` queries.
- - `SHOW DICTIONARIES`. Level: `DICTIONARY`. Allows to execute `SHOW DICTIONARIES`, `SHOW CREATE DICTIONARY`, `EXISTS ` queries.
+- `SHOW`. Уровень: `GROUP`
+ - `SHOW DATABASES`. Уровень: `DATABASE`. Разрешает выполнять запросы `SHOW DATABASES`, `SHOW CREATE DATABASE`, `USE `.
+ - `SHOW TABLES`. Уровень: `TABLE`. Разрешает выполнять запросы `SHOW TABLES`, `EXISTS `, `CHECK `.
+ - `SHOW COLUMNS`. Уровень: `COLUMN`. Разрешает выполнять запросы `SHOW CREATE TABLE`, `DESCRIBE`.
+ - `SHOW DICTIONARIES`. Уровень: `DICTIONARY`. Разрешает выполнять запросы `SHOW DICTIONARIES`, `SHOW CREATE DICTIONARY`, `EXISTS `.
-**Notes**
+**Дополнительно**
+
+У пользователя есть привилегия `SHOW`, если ему присвоена любая другая привилегия по отношению к определенной таблице, словарю или базе данных.
-A user has the `SHOW` privilege if it has any other privilege concerning the specified table, dictionary or database.
### KILL QUERY {#grant-kill-query}
-Allows executing [KILL](../../sql-reference/statements/misc.md#kill-query-statement) queries according to the following hierarchy of privileges:
+Разрешает выполнять запросы [KILL](misc.md#kill-query-statement) в соответствии со следующей иерархией привилегий:
-Privilege level: `GLOBAL`.
+Уровень: `GLOBAL`.
-**Notes**
+**Дополнительно**
+
+`KILL QUERY` позволяет пользователю останавливать запросы других пользователей.
-`KILL QUERY` privilege allows one user to kill queries of other users.
### ACCESS MANAGEMENT {#grant-access-management}
-Allows a user to execute queries that manage users, roles and row policies.
+Разрешает пользователю выполнять запросы на управление пользователями, ролями и политиками доступа к строкам.
-- `ACCESS MANAGEMENT`. Level: `GROUP`
- - `CREATE USER`. Level: `GLOBAL`
- - `ALTER USER`. Level: `GLOBAL`
- - `DROP USER`. Level: `GLOBAL`
- - `CREATE ROLE`. Level: `GLOBAL`
- - `ALTER ROLE`. Level: `GLOBAL`
- - `DROP ROLE`. Level: `GLOBAL`
- - `ROLE ADMIN`. Level: `GLOBAL`
- - `CREATE ROW POLICY`. Level: `GLOBAL`. Aliases: `CREATE POLICY`
- - `ALTER ROW POLICY`. Level: `GLOBAL`. Aliases: `ALTER POLICY`
- - `DROP ROW POLICY`. Level: `GLOBAL`. Aliases: `DROP POLICY`
- - `CREATE QUOTA`. Level: `GLOBAL`
- - `ALTER QUOTA`. Level: `GLOBAL`
- - `DROP QUOTA`. Level: `GLOBAL`
- - `CREATE SETTINGS PROFILE`. Level: `GLOBAL`. Aliases: `CREATE PROFILE`
- - `ALTER SETTINGS PROFILE`. Level: `GLOBAL`. Aliases: `ALTER PROFILE`
- - `DROP SETTINGS PROFILE`. Level: `GLOBAL`. Aliases: `DROP PROFILE`
- - `SHOW ACCESS`. Level: `GROUP`
- - `SHOW_USERS`. Level: `GLOBAL`. Aliases: `SHOW CREATE USER`
- - `SHOW_ROLES`. Level: `GLOBAL`. Aliases: `SHOW CREATE ROLE`
- - `SHOW_ROW_POLICIES`. Level: `GLOBAL`. Aliases: `SHOW POLICIES`, `SHOW CREATE ROW POLICY`, `SHOW CREATE POLICY`
- - `SHOW_QUOTAS`. Level: `GLOBAL`. Aliases: `SHOW CREATE QUOTA`
- - `SHOW_SETTINGS_PROFILES`. Level: `GLOBAL`. Aliases: `SHOW PROFILES`, `SHOW CREATE SETTINGS PROFILE`, `SHOW CREATE PROFILE`
+- `ACCESS MANAGEMENT`. Уровень: `GROUP`
+ - `CREATE USER`. Уровень: `GLOBAL`
+ - `ALTER USER`. Уровень: `GLOBAL`
+ - `DROP USER`. Уровень: `GLOBAL`
+ - `CREATE ROLE`. Уровень: `GLOBAL`
+ - `ALTER ROLE`. Уровень: `GLOBAL`
+ - `DROP ROLE`. Уровень: `GLOBAL`
+ - `ROLE ADMIN`. Уровень: `GLOBAL`
+ - `CREATE ROW POLICY`. Уровень: `GLOBAL`. Алиасы: `CREATE POLICY`
+ - `ALTER ROW POLICY`. Уровень: `GLOBAL`. Алиасы: `ALTER POLICY`
+ - `DROP ROW POLICY`. Уровень: `GLOBAL`. Алиасы: `DROP POLICY`
+ - `CREATE QUOTA`. Уровень: `GLOBAL`
+ - `ALTER QUOTA`. Уровень: `GLOBAL`
+ - `DROP QUOTA`. Уровень: `GLOBAL`
+ - `CREATE SETTINGS PROFILE`. Уровень: `GLOBAL`. Алиасы: `CREATE PROFILE`
+ - `ALTER SETTINGS PROFILE`. Уровень: `GLOBAL`. Алиасы: `ALTER PROFILE`
+ - `DROP SETTINGS PROFILE`. Уровень: `GLOBAL`. Алиасы: `DROP PROFILE`
+ - `SHOW ACCESS`. Уровень: `GROUP`
+ - `SHOW_USERS`. Уровень: `GLOBAL`. Алиасы: `SHOW CREATE USER`
+ - `SHOW_ROLES`. Уровень: `GLOBAL`. Алиасы: `SHOW CREATE ROLE`
+ - `SHOW_ROW_POLICIES`. Уровень: `GLOBAL`. Алиасы: `SHOW POLICIES`, `SHOW CREATE ROW POLICY`, `SHOW CREATE POLICY`
+ - `SHOW_QUOTAS`. Уровень: `GLOBAL`. Алиасы: `SHOW CREATE QUOTA`
+ - `SHOW_SETTINGS_PROFILES`. Уровень: `GLOBAL`. Алиасы: `SHOW PROFILES`, `SHOW CREATE SETTINGS PROFILE`, `SHOW CREATE PROFILE`
-The `ROLE ADMIN` privilege allows a user to assign and revoke any roles including those which are not assigned to the user with the admin option.
+Привилегия `ROLE ADMIN` разрешает пользователю назначать и отзывать любые роли, включая те, которые не назначены пользователю с опцией администратора.
### SYSTEM {#grant-system}
-Allows a user to execute [SYSTEM](../../sql-reference/statements/system.md) queries according to the following hierarchy of privileges.
+Разрешает выполнять запросы [SYSTEM](system.md) в соответствии со следующей иерархией привилегий:
-- `SYSTEM`. Level: `GROUP`
- - `SYSTEM SHUTDOWN`. Level: `GLOBAL`. Aliases: `SYSTEM KILL`, `SHUTDOWN`
- - `SYSTEM DROP CACHE`. Aliases: `DROP CACHE`
- - `SYSTEM DROP DNS CACHE`. Level: `GLOBAL`. Aliases: `SYSTEM DROP DNS`, `DROP DNS CACHE`, `DROP DNS`
- - `SYSTEM DROP MARK CACHE`. Level: `GLOBAL`. Aliases: `SYSTEM DROP MARK`, `DROP MARK CACHE`, `DROP MARKS`
- - `SYSTEM DROP UNCOMPRESSED CACHE`. Level: `GLOBAL`. Aliases: `SYSTEM DROP UNCOMPRESSED`, `DROP UNCOMPRESSED CACHE`, `DROP UNCOMPRESSED`
- - `SYSTEM RELOAD`. Level: `GROUP`
- - `SYSTEM RELOAD CONFIG`. Level: `GLOBAL`. Aliases: `RELOAD CONFIG`
- - `SYSTEM RELOAD DICTIONARY`. Level: `GLOBAL`. Aliases: `SYSTEM RELOAD DICTIONARIES`, `RELOAD DICTIONARY`, `RELOAD DICTIONARIES`
- - `SYSTEM RELOAD EMBEDDED DICTIONARIES`. Level: `GLOBAL`. Aliases: R`ELOAD EMBEDDED DICTIONARIES`
- - `SYSTEM MERGES`. Level: `TABLE`. Aliases: `SYSTEM STOP MERGES`, `SYSTEM START MERGES`, `STOP MERGES`, `START MERGES`
- - `SYSTEM TTL MERGES`. Level: `TABLE`. Aliases: `SYSTEM STOP TTL MERGES`, `SYSTEM START TTL MERGES`, `STOP TTL MERGES`, `START TTL MERGES`
- - `SYSTEM FETCHES`. Level: `TABLE`. Aliases: `SYSTEM STOP FETCHES`, `SYSTEM START FETCHES`, `STOP FETCHES`, `START FETCHES`
- - `SYSTEM MOVES`. Level: `TABLE`. Aliases: `SYSTEM STOP MOVES`, `SYSTEM START MOVES`, `STOP MOVES`, `START MOVES`
- - `SYSTEM SENDS`. Level: `GROUP`. Aliases: `SYSTEM STOP SENDS`, `SYSTEM START SENDS`, `STOP SENDS`, `START SENDS`
- - `SYSTEM DISTRIBUTED SENDS`. Level: `TABLE`. Aliases: `SYSTEM STOP DISTRIBUTED SENDS`, `SYSTEM START DISTRIBUTED SENDS`, `STOP DISTRIBUTED SENDS`, `START DISTRIBUTED SENDS`
- - `SYSTEM REPLICATED SENDS`. Level: `TABLE`. Aliases: `SYSTEM STOP REPLICATED SENDS`, `SYSTEM START REPLICATED SENDS`, `STOP REPLICATED SENDS`, `START REPLICATED SENDS`
- - `SYSTEM REPLICATION QUEUES`. Level: `TABLE`. Aliases: `SYSTEM STOP REPLICATION QUEUES`, `SYSTEM START REPLICATION QUEUES`, `STOP REPLICATION QUEUES`, `START REPLICATION QUEUES`
- - `SYSTEM SYNC REPLICA`. Level: `TABLE`. Aliases: `SYNC REPLICA`
- - `SYSTEM RESTART REPLICA`. Level: `TABLE`. Aliases: `RESTART REPLICA`
- - `SYSTEM FLUSH`. Level: `GROUP`
- - `SYSTEM FLUSH DISTRIBUTED`. Level: `TABLE`. Aliases: `FLUSH DISTRIBUTED`
- - `SYSTEM FLUSH LOGS`. Level: `GLOBAL`. Aliases: `FLUSH LOGS`
+- `SYSTEM`. Уровень: `GROUP`
+ - `SYSTEM SHUTDOWN`. Уровень: `GLOBAL`. Алиасы: `SYSTEM KILL`, `SHUTDOWN`
+ - `SYSTEM DROP CACHE`. Алиасы: `DROP CACHE`
+ - `SYSTEM DROP DNS CACHE`. Уровень: `GLOBAL`. Алиасы: `SYSTEM DROP DNS`, `DROP DNS CACHE`, `DROP DNS`
+ - `SYSTEM DROP MARK CACHE`. Уровень: `GLOBAL`. Алиасы: `SYSTEM DROP MARK`, `DROP MARK CACHE`, `DROP MARKS`
+ - `SYSTEM DROP UNCOMPRESSED CACHE`. Уровень: `GLOBAL`. Алиасы: `SYSTEM DROP UNCOMPRESSED`, `DROP UNCOMPRESSED CACHE`, `DROP UNCOMPRESSED`
+ - `SYSTEM RELOAD`. Уровень: `GROUP`
+ - `SYSTEM RELOAD CONFIG`. Уровень: `GLOBAL`. Алиасы: `RELOAD CONFIG`
+ - `SYSTEM RELOAD DICTIONARY`. Уровень: `GLOBAL`. Алиасы: `SYSTEM RELOAD DICTIONARIES`, `RELOAD DICTIONARY`, `RELOAD DICTIONARIES`
+ - `SYSTEM RELOAD EMBEDDED DICTIONARIES`. Уровень: `GLOBAL`. Алиасы: `RELOAD EMBEDDED DICTIONARIES`
+ - `SYSTEM MERGES`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP MERGES`, `SYSTEM START MERGES`, `STOP MERGES`, `START MERGES`
+ - `SYSTEM TTL MERGES`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP TTL MERGES`, `SYSTEM START TTL MERGES`, `STOP TTL MERGES`, `START TTL MERGES`
+ - `SYSTEM FETCHES`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP FETCHES`, `SYSTEM START FETCHES`, `STOP FETCHES`, `START FETCHES`
+ - `SYSTEM MOVES`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP MOVES`, `SYSTEM START MOVES`, `STOP MOVES`, `START MOVES`
+ - `SYSTEM SENDS`. Уровень: `GROUP`. Алиасы: `SYSTEM STOP SENDS`, `SYSTEM START SENDS`, `STOP SENDS`, `START SENDS`
+ - `SYSTEM DISTRIBUTED SENDS`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP DISTRIBUTED SENDS`, `SYSTEM START DISTRIBUTED SENDS`, `STOP DISTRIBUTED SENDS`, `START DISTRIBUTED SENDS`
+ - `SYSTEM REPLICATED SENDS`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP REPLICATED SENDS`, `SYSTEM START REPLICATED SENDS`, `STOP REPLICATED SENDS`, `START REPLICATED SENDS`
+ - `SYSTEM REPLICATION QUEUES`. Уровень: `TABLE`. Алиасы: `SYSTEM STOP REPLICATION QUEUES`, `SYSTEM START REPLICATION QUEUES`, `STOP REPLICATION QUEUES`, `START REPLICATION QUEUES`
+ - `SYSTEM SYNC REPLICA`. Уровень: `TABLE`. Алиасы: `SYNC REPLICA`
+ - `SYSTEM RESTART REPLICA`. Уровень: `TABLE`. Алиасы: `RESTART REPLICA`
+ - `SYSTEM FLUSH`. Уровень: `GROUP`
+ - `SYSTEM FLUSH DISTRIBUTED`. Уровень: `TABLE`. Алиасы: `FLUSH DISTRIBUTED`
+ - `SYSTEM FLUSH LOGS`. Уровень: `GLOBAL`. Алиасы: `FLUSH LOGS`
+
+Привилегия `SYSTEM RELOAD EMBEDDED DICTIONARIES` имплицитно присваивается привилегией `SYSTEM RELOAD DICTIONARY ON *.*`.
-The `SYSTEM RELOAD EMBEDDED DICTIONARIES` privilege implicitly granted by the `SYSTEM RELOAD DICTIONARY ON *.*` privilege.
### INTROSPECTION {#grant-introspection}
-Allows using [introspection](../../operations/optimizing-performance/sampling-query-profiler.md) functions.
+Разрешает использовать функции [интроспекции](../../operations/optimizing-performance/sampling-query-profiler.md).
+
+- `INTROSPECTION`. Уровень: `GROUP`. Алиасы: `INTROSPECTION FUNCTIONS`
+ - `addressToLine`. Уровень: `GLOBAL`
+ - `addressToSymbol`. Уровень: `GLOBAL`
+ - `demangle`. Уровень: `GLOBAL`
-- `INTROSPECTION`. Level: `GROUP`. Aliases: `INTROSPECTION FUNCTIONS`
- - `addressToLine`. Level: `GLOBAL`
- - `addressToSymbol`. Level: `GLOBAL`
- - `demangle`. Level: `GLOBAL`
### SOURCES {#grant-sources}
-Allows using external data sources. Applies to [table engines](../../engines/table-engines/index.md) and [table functions](../../sql-reference/table-functions/index.md#table-functions).
+Разрешает использовать внешние источники данных. Применяется к [движкам таблиц](../../engines/table-engines/index.md) и [табличным функциям](../table-functions/index.md#table-functions).
-- `SOURCES`. Level: `GROUP`
- - `FILE`. Level: `GLOBAL`
- - `URL`. Level: `GLOBAL`
- - `REMOTE`. Level: `GLOBAL`
- - `MYSQL`. Level: `GLOBAL`
- - `ODBC`. Level: `GLOBAL`
- - `JDBC`. Level: `GLOBAL`
- - `HDFS`. Level: `GLOBAL`
- - `S3`. Level: `GLOBAL`
+- `SOURCES`. Уровень: `GROUP`
+ - `FILE`. Уровень: `GLOBAL`
+ - `URL`. Уровень: `GLOBAL`
+ - `REMOTE`. Уровень: `GLOBAL`
+ - `YSQL`. Уровень: `GLOBAL`
+ - `ODBC`. Уровень: `GLOBAL`
+ - `JDBC`. Уровень: `GLOBAL`
+ - `HDFS`. Уровень: `GLOBAL`
+ - `S3`. Уровень: `GLOBAL`
-The `SOURCES` privilege enables use of all the sources. Also you can grant a privilege for each source individually. To use sources, you need additional privileges.
+Привилегия `SOURCES` разрешает использование всех источников. Также вы можете присвоить привилегию для каждого источника отдельно. Для использования источников необходимы дополнительные привилегии.
-Examples:
+Примеры:
-- To create a table with the [MySQL table engine](../../engines/table-engines/integrations/mysql.md), you need `CREATE TABLE (ON db.table_name)` and `MYSQL` privileges.
-- To use the [mysql table function](../../sql-reference/table-functions/mysql.md), you need `CREATE TEMPORARY TABLE` and `MYSQL` privileges.
+- Чтобы создать таблицу с [движком MySQL](../../engines/table-engines/integrations/mysql.md), необходимы привилегии `CREATE TABLE (ON db.table_name)` и `MYSQL`.
+- Чтобы использовать [табличную функцию mysql](../table-functions/mysql.md), необходимы привилегии `CREATE TEMPORARY TABLE` и `MYSQL`.
### dictGet {#grant-dictget}
-- `dictGet`. Aliases: `dictHas`, `dictGetHierarchy`, `dictIsIn`
+- `dictGet`. Алиасы: `dictHas`, `dictGetHierarchy`, `dictIsIn`
-Allows a user to execute [dictGet](../../sql-reference/functions/ext-dict-functions.md#dictget), [dictHas](../../sql-reference/functions/ext-dict-functions.md#dicthas), [dictGetHierarchy](../../sql-reference/functions/ext-dict-functions.md#dictgethierarchy), [dictIsIn](../../sql-reference/functions/ext-dict-functions.md#dictisin) functions.
+Разрешает вызывать функции [dictGet](../functions/ext-dict-functions.md#dictget), [dictHas](../functions/ext-dict-functions.md#dicthas), [dictGetHierarchy](../functions/ext-dict-functions.md#dictgethierarchy), [dictIsIn](../functions/ext-dict-functions.md#dictisin).
-Privilege level: `DICTIONARY`.
+Уровень: `DICTIONARY`.
-**Examples**
+**Примеры**
-- `GRANT dictGet ON mydb.mydictionary TO john`
-- `GRANT dictGet ON mydictionary TO john`
+- `GRANT dictGet ON mydb.mydictionary TO john`
+- `GRANT dictGet ON mydictionary TO john`
### ALL {#grant-all}
-Grants all the privileges on regulated entity to a user account or a role.
+Присваивает пользователю или роли все привилегии на объект с регулируемым доступом.
+
### NONE {#grant-none}
-Doesn’t grant any privileges.
+Не присваивает никаких привилегий.
+
### ADMIN OPTION {#admin-option-privilege}
-The `ADMIN OPTION` privilege allows a user to grant their role to another user.
+Привилегия `ADMIN OPTION` разрешает пользователю назначать свои роли другому пользователю.
-[Original article](https://clickhouse.tech/docs/en/query_language/grant/)
+[Оригинальная статья](https://clickhouse.tech/docs/ru/sql-reference/statements/grant/)
diff --git a/docs/tools/purge_cache_for_changed_files.py b/docs/tools/purge_cache_for_changed_files.py
new file mode 100644
index 00000000000..761697770b7
--- /dev/null
+++ b/docs/tools/purge_cache_for_changed_files.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+
+import subprocess
+import requests
+import os
+import time
+
+FNAME_START = "+++"
+
+CLOUDFLARE_URL = "https://api.cloudflare.com/client/v4/zones/4fc6fb1d46e87851605aa7fa69ca6fe0/purge_cache"
+
+# we have changes in revision and commit sha on all pages
+# so such changes have to be ignored
+MIN_CHANGED_WORDS = 4
+
+
+def collect_changed_files():
+ proc = subprocess.Popen("git diff HEAD~1 --word-diff=porcelain | grep -e '^+[^+]\|^\-[^\-]\|^\+\+\+'", stdout=subprocess.PIPE, shell=True)
+ changed_files = []
+ current_file_name = ""
+ changed_words = []
+ while True:
+ line = proc.stdout.readline().decode("utf-8").strip()
+ if not line:
+ break
+ if FNAME_START in line:
+ if changed_words:
+ if len(changed_words) > MIN_CHANGED_WORDS:
+ changed_files.append(current_file_name)
+ changed_words = []
+ current_file_name = line[6:]
+ else:
+ changed_words.append(line)
+ return changed_files
+
+
+def filter_and_transform_changed_files(changed_files, base_domain):
+ result = []
+ for f in changed_files:
+ if f.endswith(".html"):
+ result.append(base_domain + f.replace("index.html", ""))
+ return result
+
+
+def convert_to_dicts(changed_files, batch_size):
+ result = []
+ current_batch = {"files": []}
+ for f in changed_files:
+ if len(current_batch["files"]) >= batch_size:
+ result.append(current_batch)
+ current_batch = {"files": []}
+ current_batch["files"].append(f)
+
+ if current_batch["files"]:
+ result.append(current_batch)
+ return result
+
+
+def post_data(prepared_batches, token):
+ headers = {"Authorization": "Bearer {}".format(token)}
+ for batch in prepared_batches:
+ print("Pugring cache for", ", ".join(batch["files"]))
+ response = requests.post(CLOUDFLARE_URL, json=batch, headers=headers)
+ response.raise_for_status()
+ time.sleep(3)
+
+
+if __name__ == "__main__":
+ token = os.getenv("CLOUDFLARE_TOKEN")
+ if not token:
+ raise Exception("Env variable CLOUDFLARE_TOKEN is empty")
+ base_domain = os.getenv("BASE_DOMAIN", "https://content.clickhouse.tech/")
+ changed_files = collect_changed_files()
+ print("Found", len(changed_files), "changed files")
+ filtered_files = filter_and_transform_changed_files(changed_files, base_domain)
+ print("Files rest after filtering", len(filtered_files))
+ prepared_batches = convert_to_dicts(filtered_files, 25)
+ post_data(prepared_batches, token)
diff --git a/docs/tools/release.sh b/docs/tools/release.sh
index c3fb0615677..e539e01e808 100755
--- a/docs/tools/release.sh
+++ b/docs/tools/release.sh
@@ -10,13 +10,6 @@ GIT_PROD_URI="git@github.com:ClickHouse/clickhouse-website-content.git"
EXTRA_BUILD_ARGS="${EXTRA_BUILD_ARGS:---enable-stable-releases --minify --verbose}"
HISTORY_SIZE="${HISTORY_SIZE:-5}"
-if [[ -z "$1" ]]
-then
- TAG=$(head -c 8 /dev/urandom | xxd -p)
-else
- TAG="$1"
-fi
-DOCKER_HASH="$2"
if [[ -z "$1" ]]
then
source "${BASE_DIR}/venv/bin/activate"
@@ -44,27 +37,6 @@ then
if [[ ! -z "${CLOUDFLARE_TOKEN}" ]]
then
sleep 1m
- git diff --stat="9999,9999" --diff-filter=M HEAD~1 | grep '|' | awk '$1 ~ /\.html$/ { if ($3>6) { url="https://content.clickhouse.tech/"$1; sub(/index.html/, "", url); print "\""url"\""; }}' | split -l 25 /dev/stdin PURGE
- for FILENAME in $(ls PURGE*)
- do
- POST_DATA=$(cat "${FILENAME}" | sed -n -e 'H;${x;s/\n/,/g;s/^,//;p;}' | awk '{print "{\"files\":["$0"]}";}')
- sleep 3s
- set +x
- curl -X POST "https://api.cloudflare.com/client/v4/zones/4fc6fb1d46e87851605aa7fa69ca6fe0/purge_cache" -H "Authorization: Bearer ${CLOUDFLARE_TOKEN}" -H "Content-Type:application/json" --data "${POST_DATA}"
- set -x
- rm "${FILENAME}"
- done
+ python3 "${BASE_DIR}/purge_cache_for_changed_files.py"
fi
- cd "${BUILD_DIR}"
- DOCKER_HASH=$(head -c 16 < /dev/urandom | xxd -p)
fi
-
-QLOUD_ENDPOINT="https://platform.yandex-team.ru/api/v1"
-QLOUD_PROJECT="clickhouse.clickhouse-website"
-if [[ -z "$1" ]]
-then
- QLOUD_ENV="${QLOUD_PROJECT}.test"
-else
- QLOUD_ENV="${QLOUD_PROJECT}.prod"
-fi
-echo ">>> Successfully deployed ${TAG} ${DOCKER_HASH} to ${QLOUD_ENV} <<<"
diff --git a/programs/copier/ClusterCopierApp.cpp b/programs/copier/ClusterCopierApp.cpp
index e702d2f6353..d6ec5a7e8ad 100644
--- a/programs/copier/ClusterCopierApp.cpp
+++ b/programs/copier/ClusterCopierApp.cpp
@@ -106,7 +106,7 @@ void ClusterCopierApp::mainImpl()
context->setConfig(loaded_config.configuration);
context->setApplicationType(Context::ApplicationType::LOCAL);
- context->setPath(process_path);
+ context->setPath(process_path + "/");
registerFunctions();
registerAggregateFunctions();
diff --git a/src/Client/Connection.cpp b/src/Client/Connection.cpp
index 367d4bab1dc..3bb8af72516 100644
--- a/src/Client/Connection.cpp
+++ b/src/Client/Connection.cpp
@@ -1,5 +1,3 @@
-#include
-
#include
#include
#include
diff --git a/src/Columns/Collator.cpp b/src/Columns/Collator.cpp
index 77735564077..d33f65e3836 100644
--- a/src/Columns/Collator.cpp
+++ b/src/Columns/Collator.cpp
@@ -17,7 +17,6 @@
#endif
#include
-#include
#include
#include
diff --git a/src/Columns/ColumnAggregateFunction.cpp b/src/Columns/ColumnAggregateFunction.cpp
index 4b9dcc8d04e..b9200ffe910 100644
--- a/src/Columns/ColumnAggregateFunction.cpp
+++ b/src/Columns/ColumnAggregateFunction.cpp
@@ -1,7 +1,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Columns/ColumnConst.cpp b/src/Columns/ColumnConst.cpp
index 2fa1fbce32d..b7fb22aeb0e 100644
--- a/src/Columns/ColumnConst.cpp
+++ b/src/Columns/ColumnConst.cpp
@@ -2,11 +2,9 @@
#include
#include
-#include
#include
#include
#include
-#include
#if defined(MEMORY_SANITIZER)
#include
diff --git a/src/Columns/ColumnString.cpp b/src/Columns/ColumnString.cpp
index 99c99e2ea90..467a8681868 100644
--- a/src/Columns/ColumnString.cpp
+++ b/src/Columns/ColumnString.cpp
@@ -1,4 +1,3 @@
-#include
#include
#include
#include
diff --git a/src/Columns/ColumnVector.cpp b/src/Columns/ColumnVector.cpp
index 8c6768b92e8..0fea73d2bce 100644
--- a/src/Columns/ColumnVector.cpp
+++ b/src/Columns/ColumnVector.cpp
@@ -11,7 +11,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Common/Config/ConfigProcessor.cpp b/src/Common/Config/ConfigProcessor.cpp
index bf65b7028cc..0e36c6ee660 100644
--- a/src/Common/Config/ConfigProcessor.cpp
+++ b/src/Common/Config/ConfigProcessor.cpp
@@ -6,7 +6,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Common/Config/configReadClient.cpp b/src/Common/Config/configReadClient.cpp
index 01ad421cc2b..61d8e507c05 100644
--- a/src/Common/Config/configReadClient.cpp
+++ b/src/Common/Config/configReadClient.cpp
@@ -1,6 +1,5 @@
#include "configReadClient.h"
-#include
#include
#include
#include "ConfigProcessor.h"
diff --git a/src/Common/ErrorCodes.cpp b/src/Common/ErrorCodes.cpp
index 59c99a61371..a4abaf91231 100644
--- a/src/Common/ErrorCodes.cpp
+++ b/src/Common/ErrorCodes.cpp
@@ -497,6 +497,9 @@ namespace ErrorCodes
extern const int CANNOT_CONNECT_RABBITMQ = 530;
extern const int CANNOT_FSTAT = 531;
extern const int LDAP_ERROR = 532;
+ extern const int INCONSISTENT_RESERVATIONS = 533;
+ extern const int NO_RESERVATIONS_PROVIDED = 534;
+ extern const int UNKNOWN_RAID_TYPE = 535;
extern const int KEEPER_EXCEPTION = 999;
extern const int POCO_EXCEPTION = 1000;
diff --git a/src/Common/FieldVisitors.cpp b/src/Common/FieldVisitors.cpp
index 8b0bfacbd48..4ac87dfdd24 100644
--- a/src/Common/FieldVisitors.cpp
+++ b/src/Common/FieldVisitors.cpp
@@ -1,9 +1,7 @@
#include
#include
#include
-#include
#include
-#include
#include
#include
#include
diff --git a/src/Common/ProfileEvents.cpp b/src/Common/ProfileEvents.cpp
index eceb082f524..908adbe1d12 100644
--- a/src/Common/ProfileEvents.cpp
+++ b/src/Common/ProfileEvents.cpp
@@ -117,6 +117,8 @@
M(SelectedParts, "Number of data parts selected to read from a MergeTree table.") \
M(SelectedRanges, "Number of (non-adjacent) ranges in all data parts selected to read from a MergeTree table.") \
M(SelectedMarks, "Number of marks (index granules) selected to read from a MergeTree table.") \
+ M(SelectedRows, "Number of rows SELECTed from all tables.") \
+ M(SelectedBytes, "Number of bytes (uncompressed; for columns as they stored in memory) SELECTed from all tables.") \
\
M(Merge, "Number of launched background merges.") \
M(MergedRows, "Rows read for background merges. This is the number of rows before merge.") \
diff --git a/src/Common/QueryProfiler.cpp b/src/Common/QueryProfiler.cpp
index c4c7d21314d..07e145359d8 100644
--- a/src/Common/QueryProfiler.cpp
+++ b/src/Common/QueryProfiler.cpp
@@ -5,7 +5,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Common/StatusFile.cpp b/src/Common/StatusFile.cpp
index 3766908f9cd..7c6bbf814a0 100644
--- a/src/Common/StatusFile.cpp
+++ b/src/Common/StatusFile.cpp
@@ -1,7 +1,5 @@
#include "StatusFile.h"
-#include
-#include
#include
#include
#include
diff --git a/src/Common/ThreadFuzzer.cpp b/src/Common/ThreadFuzzer.cpp
index 0e7c5429ade..a32e50c44b2 100644
--- a/src/Common/ThreadFuzzer.cpp
+++ b/src/Common/ThreadFuzzer.cpp
@@ -1,5 +1,4 @@
#include
-#include
#include
#if defined(OS_LINUX)
# include
@@ -8,9 +7,7 @@
#include
-#include
#include
-#include
#include
diff --git a/src/Common/TraceCollector.cpp b/src/Common/TraceCollector.cpp
index f5bdfd2b826..eb87f95bd7b 100644
--- a/src/Common/TraceCollector.cpp
+++ b/src/Common/TraceCollector.cpp
@@ -13,9 +13,6 @@
#include
#include
-#include
-#include
-
namespace DB
{
diff --git a/src/Common/ZooKeeper/IKeeper.cpp b/src/Common/ZooKeeper/IKeeper.cpp
index cb378ba1e13..ad18fdd992a 100644
--- a/src/Common/ZooKeeper/IKeeper.cpp
+++ b/src/Common/ZooKeeper/IKeeper.cpp
@@ -1,5 +1,3 @@
-#include
-
#include
#include
diff --git a/src/Common/ZooKeeper/ZooKeeper.cpp b/src/Common/ZooKeeper/ZooKeeper.cpp
index 476e88d7e72..e50aa8f1700 100644
--- a/src/Common/ZooKeeper/ZooKeeper.cpp
+++ b/src/Common/ZooKeeper/ZooKeeper.cpp
@@ -3,7 +3,6 @@
#include "KeeperException.h"
#include "TestKeeper.h"
-#include
#include
#include
@@ -11,8 +10,6 @@
#include
#include
#include
-#include
-#include
#include
#include
diff --git a/src/Common/ZooKeeper/ZooKeeperImpl.cpp b/src/Common/ZooKeeper/ZooKeeperImpl.cpp
index 61a64f2c51f..85fc1cd9f79 100644
--- a/src/Common/ZooKeeper/ZooKeeperImpl.cpp
+++ b/src/Common/ZooKeeper/ZooKeeperImpl.cpp
@@ -8,9 +8,6 @@
#include
#include
-#include
-#include
-
#if !defined(ARCADIA_BUILD)
# include
#endif
diff --git a/src/Common/ZooKeeper/tests/gtest_zkutil_test_multi_exception.cpp b/src/Common/ZooKeeper/tests/gtest_zkutil_test_multi_exception.cpp
index 19104e02e24..de60d382301 100644
--- a/src/Common/ZooKeeper/tests/gtest_zkutil_test_multi_exception.cpp
+++ b/src/Common/ZooKeeper/tests/gtest_zkutil_test_multi_exception.cpp
@@ -12,7 +12,9 @@
using namespace DB;
-TEST(zkutil, ZookeeperConnected)
+
+template
+auto getZooKeeper(Args &&... args)
{
/// In our CI infrastructure it is typical that ZooKeeper is unavailable for some amount of time.
size_t i;
@@ -20,9 +22,10 @@ TEST(zkutil, ZookeeperConnected)
{
try
{
- auto zookeeper = std::make_unique("localhost:2181");
+ auto zookeeper = std::make_unique("localhost:2181", std::forward(args)...);
zookeeper->exists("/");
zookeeper->createIfNotExists("/clickhouse_test", "Unit tests of ClickHouse");
+ return zookeeper;
}
catch (...)
{
@@ -30,18 +33,16 @@ TEST(zkutil, ZookeeperConnected)
sleep(1);
continue;
}
- break;
- }
- if (i == 100)
- {
- std::cerr << "No zookeeper after " << i << " tries. skip tests." << std::endl;
- exit(0);
}
+
+ std::cerr << "No zookeeper after " << i << " tries. skip tests." << std::endl;
+ exit(0);
}
+
TEST(zkutil, MultiNiceExceptionMsg)
{
- auto zookeeper = std::make_unique("localhost:2181");
+ auto zookeeper = getZooKeeper();
Coordination::Requests ops;
@@ -79,13 +80,13 @@ TEST(zkutil, MultiNiceExceptionMsg)
TEST(zkutil, MultiAsync)
{
- auto zookeeper = std::make_unique("localhost:2181");
Coordination::Requests ops;
- zookeeper->tryRemoveRecursive("/clickhouse_test/zkutil_multi");
+ getZooKeeper()->tryRemoveRecursive("/clickhouse_test/zkutil_multi");
{
ops.clear();
+ auto zookeeper = getZooKeeper();
auto fut = zookeeper->asyncMulti(ops);
}
@@ -94,6 +95,7 @@ TEST(zkutil, MultiAsync)
ops.emplace_back(zkutil::makeCreateRequest("/clickhouse_test/zkutil_multi", "", zkutil::CreateMode::Persistent));
ops.emplace_back(zkutil::makeCreateRequest("/clickhouse_test/zkutil_multi/a", "", zkutil::CreateMode::Persistent));
+ auto zookeeper = getZooKeeper();
auto fut = zookeeper->tryAsyncMulti(ops);
ops.clear();
@@ -104,6 +106,7 @@ TEST(zkutil, MultiAsync)
EXPECT_ANY_THROW
(
+ auto zookeeper = getZooKeeper();
std::vector> futures;
for (size_t i = 0; i < 10000; ++i)
@@ -131,6 +134,7 @@ TEST(zkutil, MultiAsync)
ops.emplace_back(zkutil::makeCreateRequest("/clickhouse_test/zkutil_multi", "_", zkutil::CreateMode::Persistent));
ops.emplace_back(zkutil::makeCreateRequest("/clickhouse_test/zkutil_multi/a", "_", zkutil::CreateMode::Persistent));
+ auto zookeeper = getZooKeeper();
auto fut = zookeeper->tryAsyncMulti(ops);
ops.clear();
@@ -155,16 +159,15 @@ TEST(zkutil, WatchGetChildrenWithChroot)
{
try
{
- const String zk_server = "localhost:2181";
const String prefix = "/clickhouse_test/zkutil/watch_get_children_with_chroot";
/// Create chroot node firstly
- auto zookeeper = std::make_unique(zk_server);
+ auto zookeeper = getZooKeeper();
zookeeper->createAncestors(prefix + "/");
- zookeeper = std::make_unique(zk_server, "",
- zkutil::DEFAULT_SESSION_TIMEOUT,
- zkutil::DEFAULT_OPERATION_TIMEOUT,
- prefix);
+ zookeeper = getZooKeeper("",
+ zkutil::DEFAULT_SESSION_TIMEOUT,
+ zkutil::DEFAULT_OPERATION_TIMEOUT,
+ prefix);
String queue_path = "/queue";
zookeeper->tryRemoveRecursive(queue_path);
@@ -173,10 +176,10 @@ TEST(zkutil, WatchGetChildrenWithChroot)
zkutil::EventPtr event = std::make_shared();
zookeeper->getChildren(queue_path, nullptr, event);
{
- auto zookeeper2 = std::make_unique(zk_server, "",
- zkutil::DEFAULT_SESSION_TIMEOUT,
- zkutil::DEFAULT_OPERATION_TIMEOUT,
- prefix);
+ auto zookeeper2 = getZooKeeper("",
+ zkutil::DEFAULT_SESSION_TIMEOUT,
+ zkutil::DEFAULT_OPERATION_TIMEOUT,
+ prefix);
zookeeper2->create(queue_path + "/children-", "", zkutil::CreateMode::PersistentSequential);
}
event->wait();
@@ -192,16 +195,15 @@ TEST(zkutil, MultiCreateSequential)
{
try
{
- const String zk_server = "localhost:2181";
const String prefix = "/clickhouse_test/zkutil";
/// Create chroot node firstly
- auto zookeeper = std::make_unique(zk_server);
+ auto zookeeper = getZooKeeper();
zookeeper->createAncestors(prefix + "/");
- zookeeper = std::make_unique(zk_server, "",
- zkutil::DEFAULT_SESSION_TIMEOUT,
- zkutil::DEFAULT_OPERATION_TIMEOUT,
- "/clickhouse_test");
+ zookeeper = getZooKeeper("",
+ zkutil::DEFAULT_SESSION_TIMEOUT,
+ zkutil::DEFAULT_OPERATION_TIMEOUT,
+ "/clickhouse_test");
String base_path = "/multi_create_sequential";
zookeeper->tryRemoveRecursive(base_path);
diff --git a/src/Common/hasLinuxCapability.cpp b/src/Common/hasLinuxCapability.cpp
index 94793050dbe..c71a5f6c9d6 100644
--- a/src/Common/hasLinuxCapability.cpp
+++ b/src/Common/hasLinuxCapability.cpp
@@ -5,7 +5,6 @@
#include
#include
#include
-#include
#include
diff --git a/src/Compression/CompressedReadBuffer.cpp b/src/Compression/CompressedReadBuffer.cpp
index a5eb59e1f59..043fbdcdc1b 100644
--- a/src/Compression/CompressedReadBuffer.cpp
+++ b/src/Compression/CompressedReadBuffer.cpp
@@ -1,5 +1,4 @@
#include "CompressedReadBuffer.h"
-#include
#include
diff --git a/src/Compression/CompressedReadBufferBase.cpp b/src/Compression/CompressedReadBufferBase.cpp
index 60689b81dac..faee8f67a2c 100644
--- a/src/Compression/CompressedReadBufferBase.cpp
+++ b/src/Compression/CompressedReadBufferBase.cpp
@@ -1,14 +1,11 @@
#include "CompressedReadBufferBase.h"
-#include
#include
#include
#include
-#include
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Compression/CompressedReadBufferFromFile.cpp b/src/Compression/CompressedReadBufferFromFile.cpp
index ddd8bba686f..8d6a42eacd3 100644
--- a/src/Compression/CompressedReadBufferFromFile.cpp
+++ b/src/Compression/CompressedReadBufferFromFile.cpp
@@ -2,7 +2,6 @@
#include "CompressedReadBufferFromFile.h"
-#include
#include
#include
#include
diff --git a/src/Compression/CompressedWriteBuffer.cpp b/src/Compression/CompressedWriteBuffer.cpp
index 993b2d179db..092da9e4364 100644
--- a/src/Compression/CompressedWriteBuffer.cpp
+++ b/src/Compression/CompressedWriteBuffer.cpp
@@ -1,4 +1,3 @@
-#include
#include
#include
diff --git a/src/Compression/CompressionCodecDelta.cpp b/src/Compression/CompressionCodecDelta.cpp
index 50f449bef51..c12d7753ddf 100644
--- a/src/Compression/CompressionCodecDelta.cpp
+++ b/src/Compression/CompressionCodecDelta.cpp
@@ -5,7 +5,6 @@
#include
#include
#include
-#include
namespace DB
diff --git a/src/Compression/CompressionCodecGorilla.cpp b/src/Compression/CompressionCodecGorilla.cpp
index 9038482c950..4a09d16963f 100644
--- a/src/Compression/CompressionCodecGorilla.cpp
+++ b/src/Compression/CompressionCodecGorilla.cpp
@@ -9,7 +9,6 @@
#include
#include
-#include
#include
#include
diff --git a/src/Compression/CompressionCodecMultiple.cpp b/src/Compression/CompressionCodecMultiple.cpp
index e5adacb6173..6f4ebca90b8 100644
--- a/src/Compression/CompressionCodecMultiple.cpp
+++ b/src/Compression/CompressionCodecMultiple.cpp
@@ -3,12 +3,10 @@
#include
#include
#include
-#include
#include
#include
#include
#include
-#include
namespace DB
diff --git a/src/Compression/CompressionCodecZSTD.cpp b/src/Compression/CompressionCodecZSTD.cpp
index f1030d87ddd..7abf0303095 100644
--- a/src/Compression/CompressionCodecZSTD.cpp
+++ b/src/Compression/CompressionCodecZSTD.cpp
@@ -1,9 +1,7 @@
#include
#include
-#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Compression/CompressionFactory.cpp b/src/Compression/CompressionFactory.cpp
index e9dee053c2c..1df4c443699 100644
--- a/src/Compression/CompressionFactory.cpp
+++ b/src/Compression/CompressionFactory.cpp
@@ -1,10 +1,7 @@
#include
-#include
-#include
#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Compression/LZ4_decompress_faster.cpp b/src/Compression/LZ4_decompress_faster.cpp
index 801b4925013..dc293941310 100644
--- a/src/Compression/LZ4_decompress_faster.cpp
+++ b/src/Compression/LZ4_decompress_faster.cpp
@@ -2,8 +2,6 @@
#include
#include
-#include
-#include
#include
#include
#include
diff --git a/src/Compression/tests/compressed_buffer.cpp b/src/Compression/tests/compressed_buffer.cpp
index 346a4068a6c..89bfe0d0cce 100644
--- a/src/Compression/tests/compressed_buffer.cpp
+++ b/src/Compression/tests/compressed_buffer.cpp
@@ -1,11 +1,9 @@
#include
#include
-#include
#include
#include
-#include
#include
#include
#include
diff --git a/src/Compression/tests/gtest_compressionCodec.cpp b/src/Compression/tests/gtest_compressionCodec.cpp
index edcb6050abb..b9c7a769345 100644
--- a/src/Compression/tests/gtest_compressionCodec.cpp
+++ b/src/Compression/tests/gtest_compressionCodec.cpp
@@ -11,8 +11,6 @@
#include
#include
-#include
-
#include
#include
#include
diff --git a/src/Core/Block.cpp b/src/Core/Block.cpp
index 453d4b7e4ce..07ec0810f96 100644
--- a/src/Core/Block.cpp
+++ b/src/Core/Block.cpp
@@ -6,13 +6,11 @@
#include
#include
-#include
#include
#include
#include
-#include
namespace DB
diff --git a/src/Core/ColumnWithTypeAndName.cpp b/src/Core/ColumnWithTypeAndName.cpp
index 9acc2d56408..29da8e86439 100644
--- a/src/Core/ColumnWithTypeAndName.cpp
+++ b/src/Core/ColumnWithTypeAndName.cpp
@@ -1,6 +1,5 @@
#include
#include
-#include
#include
diff --git a/src/Core/ExternalResultDescription.cpp b/src/Core/ExternalResultDescription.cpp
index 456cce74ef1..5ed34764909 100644
--- a/src/Core/ExternalResultDescription.cpp
+++ b/src/Core/ExternalResultDescription.cpp
@@ -7,7 +7,6 @@
#include
#include
#include
-#include