Merge branch 'master' into refactor-pipeline-executor

This commit is contained in:
Nikolai Kochetov 2020-07-31 14:02:58 +03:00
commit a337d2e2bc
320 changed files with 16015 additions and 629 deletions

View File

@ -16,6 +16,19 @@ void trim(String & s)
s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { return !std::isspace(ch); }).base(), s.end());
}
// Uses separate replxx::Replxx instance to avoid loading them again in the
// current context (replxx::Replxx::history_load() will re-load the history
// from the file), since then they will overlaps with history from the current
// session (this will make behavior compatible with other interpreters, i.e.
// bash).
void history_save(const String & history_file_path, const String & line)
{
replxx::Replxx rx_no_overlap;
rx_no_overlap.history_load(history_file_path);
rx_no_overlap.history_add(line);
rx_no_overlap.history_save(history_file_path);
}
}
ReplxxLineReader::ReplxxLineReader(
@ -101,6 +114,10 @@ LineReader::InputStatus ReplxxLineReader::readOneLine(const String & prompt)
void ReplxxLineReader::addToHistory(const String & line)
{
// locking history file to prevent from inconsistent concurrent changes
//
// replxx::Replxx::history_save() already has lockf(),
// but replxx::Replxx::history_load() does not
// and that is why flock() is added here.
bool locked = false;
if (flock(history_file_fd, LOCK_EX))
rx.print("Lock of history file failed: %s\n", strerror(errno));
@ -110,7 +127,7 @@ void ReplxxLineReader::addToHistory(const String & line)
rx.history_add(line);
// flush changes to the disk
rx.history_save(history_file_path);
history_save(history_file_path, line);
if (locked && 0 != flock(history_file_fd, LOCK_UN))
rx.print("Unlock of history file failed: %s\n", strerror(errno));

View File

@ -29,7 +29,9 @@ RUN apt-get update \
COPY * /
CMD cd /workspace \
SHELL ["/bin/bash", "-c"]
CMD set -o pipefail \
&& cd /workspace \
&& /run-fuzzer.sh 2>&1 | ts "$(printf '%%Y-%%m-%%d %%H:%%M:%%S\t')" | tee main.log
# docker run --network=host --volume <workspace>:/workspace -e PR_TO_TEST=<> -e SHA_TO_TEST=<> yandex/clickhouse-fuzzer

View File

@ -100,12 +100,6 @@ function fuzz
sleep 1
done
killall -9 clickhouse-server ||:
if [ "$fuzzer_exit_code" == "143" ]
then
# Killed by watchdog, meaning, no errors.
fuzzer_exit_code=0
fi
}
case "$stage" in
@ -122,8 +116,9 @@ case "$stage" in
# Run the testing script from the repository
echo Using the testing script from the repository
export stage=download
time ch/docker/test/fuzzer/run-fuzzer.sh
# Keep the error code
time ch/docker/test/fuzzer/run-fuzzer.sh || exit $?
exit $?
fi
;&
"download")
@ -154,19 +149,31 @@ case "$stage" in
pstree -aspgT
# Make files with status and description we'll show for this check on Github
if [ "$fuzzer_exit_code" == 0 ]
task_exit_code=$fuzzer_exit_code
if [ "$fuzzer_exit_code" == 143 ]
then
echo "OK" > description.txt
# SIGTERM -- the fuzzer was killed by timeout, which means a normal run.
echo "success" > status.txt
else
echo "OK" > description.txt
task_exit_code=0
elif [ "$fuzzer_exit_code" == 210 ]
then
# 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
then
echo "Fuzzer exit code $fuzzer_exit_code. See the logs" > description.txt
echo "Lost connection to server. See the logs" > description.txt
fi
else
# Something different -- maybe the fuzzer itself died? Don't grep the
# server log in this case, because we will find a message about normal
# server termination (Received signal 15), which is confusing.
echo "failure" > status.txt
echo "Fuzzer failed ($fuzzer_exit_code). See the logs" > description.txt
fi
exit $fuzzer_exit_code
exit $task_exit_code
;&
esac

View File

@ -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)

View File

@ -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; }}
</style>
<title>Clickhouse performance comparison</title>
</head>
@ -111,11 +152,14 @@ def tableHeader(r):
return tr(''.join([th(f) for f in r]))
def tableStart(title):
return """
<h2 id="{anchor}"><a class="cancela" href="#{anchor}">{title}</a></h2>
<table>""".format(
anchor = nextTableAnchor(),
title = title)
anchor = nextTableAnchor();
cls = '-'.join(title.lower().split(' ')[:3]);
return f"""
<h2 id="{anchor}">
<a class="cancela" href="#{anchor}">{title}</a>
</h2>
<table class="{cls}">
"""
def tableEnd():
return '</table>'
@ -238,12 +282,13 @@ if args.report == 'main':
columns = [
'Old,&nbsp;s', # 0
'New,&nbsp;s', # 1
'Relative difference (new&nbsp;&minus;&nbsp;old) / old', # 2
'p&nbsp;<&nbsp;0.001 threshold', # 3
# Failed # 4
'Test', # 5
'#', # 6
'Query', # 7
'Times speedup / slowdown', # 2
'Relative difference (new&nbsp;&minus;&nbsp;old) / old', # 3
'p&nbsp;<&nbsp;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,&nbsp;s', #0
'New,&nbsp;s', #1
'Relative difference (new&nbsp;-&nbsp;old)/old', #2
'p&nbsp;<&nbsp;0.001 threshold', #3
'p&nbsp;&lt;&nbsp;0.001 threshold', #3
# Failed #4
'Test', #5
'#', #6
@ -498,9 +543,9 @@ elif args.report == 'all-queries':
# Unstable #1
'Old,&nbsp;s', #2
'New,&nbsp;s', #3
'Relative difference (new&nbsp;&minus;&nbsp;old) / old', #4
'Times speedup / slowdown', #5
'p&nbsp;<&nbsp;0.001 threshold', #6
'Times speedup / slowdown', #4
'Relative difference (new&nbsp;&minus;&nbsp;old) / old', #5
'p&nbsp;&lt;&nbsp;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}"'

View File

@ -13,6 +13,7 @@ ClickHouse also supports:
- [Parametric aggregate functions](../../sql-reference/aggregate-functions/parametric-functions.md#aggregate_functions_parametric), which accept other parameters in addition to columns.
- [Combinators](../../sql-reference/aggregate-functions/combinators.md#aggregate_functions_combinators), which change the behavior of aggregate functions.
## NULL Processing {#null-processing}
During aggregation, all `NULL`s are skipped.
@ -37,9 +38,11 @@ Lets say you need to total the values in the `y` column:
SELECT sum(y) FROM t_null_big
```
┌─sum(y)─┐
│ 7 │
└────────┘
```text
┌─sum(y)─┐
│ 7 │
└────────┘
```
The `sum` function interprets `NULL` as `0`. In particular, this means that if the function receives input of a selection where all the values are `NULL`, then the result will be `0`, not `NULL`.
@ -57,4 +60,5 @@ SELECT groupArray(y) FROM t_null_big
`groupArray` does not include `NULL` in the resulting array.
[Original article](https://clickhouse.tech/docs/en/query_language/agg_functions/) <!--hide-->

View File

@ -1,10 +1,10 @@
---
toc_folder_title: Reference
toc_priority: 36
toc_title: Reference
toc_hidden: true
---
# Aggregate Function Reference {#aggregate-functions-reference}
# List of Aggregate Functions {#aggregate-functions-reference}
Standard aggregate functions:
@ -24,97 +24,51 @@ Standard aggregate functions:
ClickHouse-specific aggregate functions:
- [anyHeavy](../../../sql-reference/aggregate-functions/reference/anyheavy.md)
- [anyLast](../../../sql-reference/aggregate-functions/reference/anylast.md)
- [argMin](../../../sql-reference/aggregate-functions/reference/argmin.md)
- [argMax](../../../sql-reference/aggregate-functions/reference/argmax.md)
- [avgWeighted](../../../sql-reference/aggregate-functions/reference/avgweighted.md)
- [topK](../../../sql-reference/aggregate-functions/reference/topkweighted.md)
- [topKWeighted](../../../sql-reference/aggregate-functions/reference/topkweighted.md)
- [groupArray](../../../sql-reference/aggregate-functions/reference/grouparray.md)
- [groupUniqArray](../../../sql-reference/aggregate-functions/reference/groupuniqarray.md)
- [groupArrayInsertAt](../../../sql-reference/aggregate-functions/reference/grouparrayinsertat.md)
- [groupArrayMovingAvg](../../../sql-reference/aggregate-functions/reference/grouparraymovingavg.md)
- [groupArrayMovingSum](../../../sql-reference/aggregate-functions/reference/grouparraymovingsum.md)
- [groupBitAnd](../../../sql-reference/aggregate-functions/reference/groupbitand.md)
- [groupBitOr](../../../sql-reference/aggregate-functions/reference/groupbitor.md)
- [groupBitXor](../../../sql-reference/aggregate-functions/reference/groupbitxor.md)
- [groupBitmap](../../../sql-reference/aggregate-functions/reference/groupbitmap.md)
- [groupBitmapAnd](../../../sql-reference/aggregate-functions/reference/groupbitmapand.md)
- [groupBitmapOr](../../../sql-reference/aggregate-functions/reference/groupbitmapor.md)
- [groupBitmapXor](../../../sql-reference/aggregate-functions/reference/groupbitmapxor.md)
- [sumWithOverflow](../../../sql-reference/aggregate-functions/reference/sumwithoverflow.md)
- [sumMap](../../../sql-reference/aggregate-functions/reference/summap.md)
- [minMap](../../../sql-reference/aggregate-functions/reference/minmap.md)
- [maxMap](../../../sql-reference/aggregate-functions/reference/maxmap.md)
- [skewSamp](../../../sql-reference/aggregate-functions/reference/skewsamp.md)
- [skewPop](../../../sql-reference/aggregate-functions/reference/skewpop.md)
- [kurtSamp](../../../sql-reference/aggregate-functions/reference/kurtsamp.md)
- [kurtPop](../../../sql-reference/aggregate-functions/reference/kurtpop.md)
- [timeSeriesGroupSum](../../../sql-reference/aggregate-functions/reference/timeseriesgroupsum.md)
- [timeSeriesGroupRateSum](../../../sql-reference/aggregate-functions/reference/timeseriesgroupratesum.md)
- [uniq](../../../sql-reference/aggregate-functions/reference/uniq.md)
- [uniqExact](../../../sql-reference/aggregate-functions/reference/uniqexact.md)
- [uniqCombined](../../../sql-reference/aggregate-functions/reference/uniqcombined.md)
- [uniqCombined64](../../../sql-reference/aggregate-functions/reference/uniqcombined64.md)
- [uniqHLL12](../../../sql-reference/aggregate-functions/reference/uniqhll12.md)
- [quantile](../../../sql-reference/aggregate-functions/reference/quantile.md)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md)
- [quantileExact](../../../sql-reference/aggregate-functions/reference/quantileexact.md)
- [quantileExactWeighted](../../../sql-reference/aggregate-functions/reference/quantileexactweighted.md)
- [quantileTiming](../../../sql-reference/aggregate-functions/reference/quantiletiming.md)
- [quantileTimingWeighted](../../../sql-reference/aggregate-functions/reference/quantiletimingweighted.md)
- [quantileDeterministic](../../../sql-reference/aggregate-functions/reference/quantiledeterministic.md)
- [quantileTDigest](../../../sql-reference/aggregate-functions/reference/quantiletdigest.md)
- [quantileTDigestWeighted](../../../sql-reference/aggregate-functions/reference/quantiletdigestweighted.md)
- [simpleLinearRegression](../../../sql-reference/aggregate-functions/reference/simplelinearregression.md)
- [stochasticLinearRegression](../../../sql-reference/aggregate-functions/reference/stochasticlinearregression.md)
- [stochasticLogisticRegression](../../../sql-reference/aggregate-functions/reference/stochasticlogisticregression.md)
- [categoricalInformationValue](../../../sql-reference/aggregate-functions/reference/categoricalinformationvalue.md)
[Original article](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/) <!--hide-->

View File

@ -26,7 +26,7 @@ toc_priority: 29
Во время запросов `INSERT` таблица блокируется, а другие запросы на чтение и запись ожидают разблокировки таблицы. Если запросов на запись данных нет, то можно выполнять любое количество конкуретных запросов на чтение.
- Не поддерживают операции [мутации](../../../engines/table-engines/log-family/index.md#alter-mutations).
- Не поддерживают операции [мутации](../../../sql-reference/statements/alter.md#mutations).
- Не поддерживают индексы.

View File

@ -601,7 +601,7 @@ SETTINGS storage_policy = 'moving_from_ssd_to_hdd'
В таблицах `MergeTree` данные попадают на диск несколькими способами:
- В результате вставки (запрос `INSERT`).
- В фоновых операциях слияний и [мутаций](../../../engines/table-engines/mergetree-family/mergetree.md#alter-mutations).
- В фоновых операциях слияний и [мутаций](../../../sql-reference/statements/alter.md#mutations).
- При скачивании данных с другой реплики.
- В результате заморозки партиций [ALTER TABLE … FREEZE PARTITION](../../../engines/table-engines/mergetree-family/mergetree.md#alter_freeze-partition).

View File

@ -1359,7 +1359,7 @@ path: /clickhouse/tables/01-08/visits/replicas
## system.mutations {#system_tables-mutations}
Таблица содержит информацию о ходе выполнения [мутаций](../sql-reference/statements/alter.md#alter-mutations) таблиц семейства MergeTree. Каждой команде мутации соответствует одна строка таблицы.
Таблица содержит информацию о ходе выполнения [мутаций](../sql-reference/statements/alter.md#mutations) таблиц семейства MergeTree. Каждой команде мутации соответствует одна строка таблицы.
Столбцы:
@ -1400,7 +1400,7 @@ path: /clickhouse/tables/01-08/visits/replicas
**См. также**
- [Мутации](../sql-reference/statements/alter.md#alter-mutations)
- [Мутации](../sql-reference/statements/alter.md#mutations)
- [Движок MergeTree](../engines/table-engines/mergetree-family/mergetree.md)
- [Репликация данных](../engines/table-engines/mergetree-family/replication.md) (семейство ReplicatedMergeTree)

View File

@ -60,4 +60,4 @@ SELECT groupArray(y) FROM t_null_big
`groupArray` не включает `NULL` в результирующий массив.
[Оригинальная статья](https://clickhouse.tech/docs/ru/query_language/agg_functions/) <!--hide-->
[Оригинальная статья](https://clickhouse.tech/docs/ru/sql-reference/aggregate-functions/) <!--hide-->

View File

@ -11,3 +11,5 @@ toc_priority: 6
В некоторых случаях, вы всё-таки можете рассчитывать на порядок выполнения запроса. Это - случаи, когда SELECT идёт из подзапроса, в котором используется ORDER BY.
При наличии в запросе `SELECT` секции `GROUP BY` или хотя бы одной агрегатной функции, ClickHouse (в отличие от, например, MySQL) требует, чтобы все выражения в секциях `SELECT`, `HAVING`, `ORDER BY` вычислялись из ключей или из агрегатных функций. То есть, каждый выбираемый из таблицы столбец, должен использоваться либо в ключах, либо внутри агрегатных функций. Чтобы получить поведение, как в MySQL, вы можете поместить остальные столбцы в агрегатную функцию `any`.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/any/) <!--hide-->

View File

@ -28,3 +28,5 @@ FROM ontime
│ 19690 │
└───────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/anyheavy/) <!--hide-->

View File

@ -6,3 +6,5 @@ toc_priority: 104
Выбирает последнее попавшееся значение.
Результат так же недетерминирован, как и для функции [any](../../../sql-reference/aggregate-functions/reference/any.md).
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/anylast/) <!--hide-->

View File

@ -7,3 +7,5 @@ toc_priority: 106
Синтаксис: `argMax(arg, val)`
Вычисляет значение arg при максимальном значении val. Если есть несколько разных значений arg для максимальных значений val, то выдаётся первое попавшееся из таких значений.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/argmax/) <!--hide-->

View File

@ -27,3 +27,5 @@ SELECT argMin(user, salary) FROM salary
│ worker │
└──────────────────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/argmin/) <!--hide-->

View File

@ -7,3 +7,5 @@ toc_priority: 5
Вычисляет среднее.
Работает только для чисел.
Результат всегда Float64.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/avg/) <!--hide-->

View File

@ -42,3 +42,5 @@ FROM values('x Int8, w Int8', (4, 1), (1, 0), (10, 2))
│ 8 │
└────────────────────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/avgweighted/) <!--hide-->

View File

@ -9,4 +9,6 @@ toc_priority: 107
Вычисляет коэффициент корреляции Пирсона: `Σ((x - x̅)(y - y̅)) / sqrt(Σ((x - x̅)^2) * Σ((y - y̅)^2))`.
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `corrStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `corrStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/corr/) <!--hide-->

View File

@ -67,4 +67,6 @@ SELECT count(DISTINCT num) FROM t
└────────────────┘
```
Этот пример показывает, что `count(DISTINCT num)` выполняется с помощью функции `uniqExact` в соответствии со значением настройки `count_distinct_implementation`.
Этот пример показывает, что `count(DISTINCT num)` выполняется с помощью функции `uniqExact` в соответствии со значением настройки `count_distinct_implementation`.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/count/) <!--hide-->

View File

@ -10,3 +10,5 @@ toc_priority: 36
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `covarPopStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/covarpop/) <!--hide-->

View File

@ -12,3 +12,5 @@ toc_priority: 37
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `covarSampStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/covarsamp/) <!--hide-->

View File

@ -13,3 +13,5 @@ toc_priority: 110
Например, `groupArray(1)(x)` эквивалентно `[any(x)]`.
В некоторых случаях, вы всё же можете рассчитывать на порядок выполнения запроса. Это — случаи, когда `SELECT` идёт из подзапроса, в котором используется `ORDER BY`.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/grouparray/) <!--hide-->

View File

@ -88,4 +88,6 @@ SELECT groupArrayInsertAt(number, 0) FROM numbers_mt(10) SETTINGS max_block_size
┌─groupArrayInsertAt(number, 0)─┐
│ [7] │
└───────────────────────────────┘
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/grouparrayinsertat/) <!--hide-->

View File

@ -73,4 +73,6 @@ FROM t
┌─I─────────┬─F────────────────────────────────┬─D─────────────────────┐
│ [0,1,3,5] │ [0.55,1.6500001,3.3000002,6.085] │ [0.55,1.65,3.30,6.08] │
└───────────┴──────────────────────────────────┴───────────────────────┘
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/grouparraymovingavg/) <!--hide-->

View File

@ -74,3 +74,5 @@ FROM t
│ [1,3,6,11] │ [1.1,3.3000002,6.6000004,12.17] │ [1.10,3.30,6.60,12.17] │
└────────────┴─────────────────────────────────┴────────────────────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/grouparraymovingsum/) <!--hide-->

View File

@ -44,3 +44,5 @@ SELECT groupBitAnd(num) FROM t
binary decimal
00000100 = 4
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/groupbitand/) <!--hide-->

View File

@ -41,4 +41,6 @@ SELECT groupBitmap(UserID) as num FROM t
``` text
num
3
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/groupbitmap/) <!--hide-->

View File

@ -44,3 +44,5 @@ SELECT groupBitOr(num) FROM t
binary decimal
01111101 = 125
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/groupbitor/) <!--hide-->

View File

@ -43,4 +43,6 @@ SELECT groupBitXor(num) FROM t
``` text
binary decimal
01101000 = 104
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/groupbitxor/) <!--hide-->

View File

@ -10,3 +10,4 @@ toc_priority: 111
Функция `groupUniqArray(max_size)(x)` ограничивает размер результирующего массива до `max_size` элементов. Например, `groupUniqArray(1)(x)` равнозначно `[any(x)]`.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/groupuniqarray/) <!--hide-->

View File

@ -1,10 +1,10 @@
---
toc_folder_title: Reference
toc_folder_title: "\u0421\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a"
toc_priority: 36
toc_title: Reference
toc_hidden: true
---
# Aggregate Function Reference {#aggregate-functions-reference}
# Перечень агрегатных функций {#aggregate-functions-list}
Стандартные агрегатные функции:
@ -24,85 +24,45 @@ toc_title: Reference
Агрегатные функции, специфичные для ClickHouse:
- [anyHeavy](../../../sql-reference/aggregate-functions/reference/anyheavy.md)
- [anyLast](../../../sql-reference/aggregate-functions/reference/anylast.md)
- [argMin](../../../sql-reference/aggregate-functions/reference/argmin.md)
- [argMax](../../../sql-reference/aggregate-functions/reference/argmax.md)
- [avgWeighted](../../../sql-reference/aggregate-functions/reference/avgweighted.md)
- [topK](../../../sql-reference/aggregate-functions/reference/topkweighted.md)
- [topK](../../../sql-reference/aggregate-functions/reference/topk.md)
- [topKWeighted](../../../sql-reference/aggregate-functions/reference/topkweighted.md)
- [groupArray](../../../sql-reference/aggregate-functions/reference/grouparray.md)
- [groupUniqArray](../../../sql-reference/aggregate-functions/reference/groupuniqarray.md)
- [groupArrayInsertAt](../../../sql-reference/aggregate-functions/reference/grouparrayinsertat.md)
- [groupArrayMovingAvg](../../../sql-reference/aggregate-functions/reference/grouparraymovingavg.md)
- [groupArrayMovingSum](../../../sql-reference/aggregate-functions/reference/grouparraymovingsum.md)
- [groupBitAnd](../../../sql-reference/aggregate-functions/reference/groupbitand.md)
- [groupBitOr](../../../sql-reference/aggregate-functions/reference/groupbitor.md)
- [groupBitXor](../../../sql-reference/aggregate-functions/reference/groupbitxor.md)
- [groupBitmap](../../../sql-reference/aggregate-functions/reference/groupbitmap.md)
- [sumWithOverflow](../../../sql-reference/aggregate-functions/reference/sumwithoverflow.md)
- [sumMap](../../../sql-reference/aggregate-functions/reference/summap.md)
- [skewSamp](../../../sql-reference/aggregate-functions/reference/skewsamp.md)
- [skewPop](../../../sql-reference/aggregate-functions/reference/skewpop.md)
- [kurtSamp](../../../sql-reference/aggregate-functions/reference/kurtsamp.md)
- [kurtPop](../../../sql-reference/aggregate-functions/reference/kurtpop.md)
- [timeSeriesGroupSum](../../../sql-reference/aggregate-functions/reference/timeseriesgroupsum.md)
- [timeSeriesGroupRateSum](../../../sql-reference/aggregate-functions/reference/timeseriesgroupratesum.md)
- [uniq](../../../sql-reference/aggregate-functions/reference/uniq.md)
- [uniqExact](../../../sql-reference/aggregate-functions/reference/uniqexact.md)
- [uniqCombined](../../../sql-reference/aggregate-functions/reference/uniqcombined.md)
- [uniqCombined64](../../../sql-reference/aggregate-functions/reference/uniqcombined64.md)
- [uniqHLL12](../../../sql-reference/aggregate-functions/reference/uniqhll12.md)
- [quantile](../../../sql-reference/aggregate-functions/reference/quantile.md)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md)
- [quantileExact](../../../sql-reference/aggregate-functions/reference/quantileexact.md)
- [quantileExactWeighted](../../../sql-reference/aggregate-functions/reference/quantileexactweighted.md)
- [quantileTiming](../../../sql-reference/aggregate-functions/reference/quantiletiming.md)
- [quantileTimingWeighted](../../../sql-reference/aggregate-functions/reference/quantiletimingweighted.md)
- [quantileDeterministic](../../../sql-reference/aggregate-functions/reference/quantiledeterministic.md)
- [quantileTDigest](../../../sql-reference/aggregate-functions/reference/quantiletdigest.md)
- [quantileTDigestWeighted](../../../sql-reference/aggregate-functions/reference/quantiletdigestweighted.md)
- [simpleLinearRegression](../../../sql-reference/aggregate-functions/reference/simplelinearregression.md)
- [stochasticLinearRegression](../../../sql-reference/aggregate-functions/reference/stochasticlinearregression.md)
- [stochasticLogisticRegression](../../../sql-reference/aggregate-functions/reference/stochasticlogisticregression.md)
[Original article](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/) <!--hide-->
[Оригинальная статья](https://clickhouse.tech/docs/ru/sql-reference/aggregate-functions/reference) <!--hide-->

View File

@ -22,4 +22,6 @@ kurtPop(expr)
``` sql
SELECT kurtPop(value) FROM series_with_value_column
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/kurtpop/) <!--hide-->

View File

@ -25,3 +25,5 @@ kurtSamp(expr)
``` sql
SELECT kurtSamp(value) FROM series_with_value_column
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/kurtsamp/) <!--hide-->

View File

@ -5,3 +5,5 @@ toc_priority: 3
# max {#agg_function-max}
Вычисляет максимум.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/max/) <!--hide-->

View File

@ -38,4 +38,6 @@ SELECT medianDeterministic(val, 1) FROM t
┌─medianDeterministic(val, 1)─┐
│ 1.5 │
└─────────────────────────────┘
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/median/) <!--hide-->

View File

@ -5,3 +5,5 @@ toc_priority: 2
## min {#agg_function-min}
Вычисляет минимум.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/min/) <!--hide-->

View File

@ -64,3 +64,5 @@ SELECT quantile(val) FROM t
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantile/) <!--hide-->

View File

@ -64,3 +64,5 @@ SELECT quantileDeterministic(val, 1) FROM t
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/qurntiledeterministic/) <!--hide-->

View File

@ -52,3 +52,5 @@ SELECT quantileExact(number) FROM numbers(10)
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantileexact/) <!--hide-->

View File

@ -65,3 +65,5 @@ SELECT quantileExactWeighted(n, val) FROM t
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantileexactweited/) <!--hide-->

View File

@ -7,3 +7,5 @@ toc_priority: 201
Syntax: `quantiles(level1, level2, …)(x)`
All the quantile functions also have corresponding quantiles functions: `quantiles`, `quantilesDeterministic`, `quantilesTiming`, `quantilesTimingWeighted`, `quantilesExact`, `quantilesExactWeighted`, `quantilesTDigest`. These functions calculate all the quantiles of the listed levels in one pass, and return an array of the resulting values.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantiles/) <!--hide-->

View File

@ -55,3 +55,5 @@ SELECT quantileTDigest(number) FROM numbers(10)
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/qurntiledigest/) <!--hide-->

View File

@ -56,3 +56,5 @@ SELECT quantileTDigestWeighted(number, 1) FROM numbers(10)
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantiledigestweighted/) <!--hide-->

View File

@ -84,3 +84,5 @@ SELECT quantileTiming(response_time) FROM t
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantiletiming/) <!--hide-->

View File

@ -83,3 +83,5 @@ SELECT quantileTimingWeighted(response_time, weight) FROM t
- [median](../../../sql-reference/aggregate-functions/reference/median.md#median)
- [quantiles](../../../sql-reference/aggregate-functions/reference/quantiles.md#quantiles)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/quantiletiming weighted/) <!--hide-->

View File

@ -39,4 +39,6 @@ SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6])
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6])─┐
│ (1,3) │
└───────────────────────────────────────────────────────────────────┘
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/simplelinearregression/) <!--hide-->

View File

@ -22,4 +22,6 @@ skewPop(expr)
``` sql
SELECT skewPop(value) FROM series_with_value_column
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/skewpop/) <!--hide-->

View File

@ -24,4 +24,6 @@ skewSamp(expr)
``` sql
SELECT skewSamp(value) FROM series_with_value_column
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/skewsamp/) <!--hide-->

View File

@ -8,3 +8,5 @@ toc_priority: 30
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `stddevPopStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/stddevpop/) <!--hide-->

View File

@ -8,3 +8,5 @@ toc_priority: 31
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `stddevSampStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/stddevsamp/) <!--hide-->

View File

@ -84,4 +84,6 @@ evalMLMethod(model, param1, param2) FROM test_data
**Смотрите также**
- [stochasticLogisticRegression](../../../sql-reference/aggregate-functions/reference/stochasticlinearregression.md#agg_functions-stochasticlogisticregression)
- [Отличие линейной от логистической регрессии.](https://stackoverflow.com/questions/12146914/what-is-the-difference-between-linear-regression-and-logistic-regression)
- [Отличие линейной от логистической регрессии.](https://stackoverflow.com/questions/12146914/what-is-the-difference-between-linear-regression-and-logistic-regression)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/stochasticlinearregression/) <!--hide-->

View File

@ -53,3 +53,5 @@ stochasticLogisticRegression(1.0, 1.0, 10, 'SGD')
- [stochasticLinearRegression](../../../sql-reference/aggregate-functions/reference/stochasticlinearregression.md#agg_functions-stochasticlinearregression)
- [Отличие линейной от логистической регрессии](https://moredez.ru/q/51225972/)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/stochasticlogisticregression/) <!--hide-->

View File

@ -6,3 +6,5 @@ toc_priority: 4
Вычисляет сумму.
Работает только для чисел.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/sum/) <!--hide-->

View File

@ -39,3 +39,5 @@ GROUP BY timeslot
│ 2000-01-01 00:01:00 │ ([4,5,6,7,8],[10,10,20,10,10]) │
└─────────────────────┴──────────────────────────────────────────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/summap/) <!--hide-->

View File

@ -7,3 +7,5 @@ toc_priority: 140
Вычисляет сумму чисел, используя для результата тот же тип данных, что и для входных параметров. Если сумма выйдет за максимальное значение для заданного типа данных, то функция вернёт ошибку.
Работает только для чисел.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/sumwithoverflow/) <!--hide-->

View File

@ -15,3 +15,4 @@ toc_priority: 171
[(2,0),(3,0.1),(7,0.3),(8,0.3),(12,0.3),(17,0.3),(18,0.3),(24,0.3),(25,0.1)]
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/timeseriesgroupratesum/) <!--hide-->

View File

@ -54,4 +54,6 @@ FROM (
``` text
[(2,0.2),(3,0.9),(7,2.1),(8,2.4),(12,3.6),(17,5.1),(18,5.4),(24,7.2),(25,2.5)]
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/timeseriesgroupsum/) <!--hide-->

View File

@ -34,4 +34,6 @@ FROM ontime
┌─res─────────────────┐
│ [19393,19790,19805] │
└─────────────────────┘
```
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/topk/) <!--hide-->

View File

@ -40,3 +40,5 @@ SELECT topKWeighted(10)(number, number) FROM numbers(1000)
│ [999,998,997,996,995,994,993,992,991,990] │
└───────────────────────────────────────────┘
```
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/topkweighted/) <!--hide-->

View File

@ -38,3 +38,5 @@ uniq(x[, ...])
- [uniqCombined64](../../../sql-reference/aggregate-functions/reference/uniqcombined64.md#agg_function-uniqcombined64)
- [uniqHLL12](../../../sql-reference/aggregate-functions/reference/uniqhll12.md#agg_function-uniqhll12)
- [uniqExact](../../../sql-reference/aggregate-functions/reference/uniqexact.md#agg_function-uniqexact)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/uniq/) <!--hide-->

View File

@ -49,3 +49,5 @@ uniqCombined(HLL_precision)(x[, ...])
- [uniqCombined64](../../../sql-reference/aggregate-functions/reference/uniqcombined64.md#agg_function-uniqcombined64)
- [uniqHLL12](../../../sql-reference/aggregate-functions/reference/uniqhll12.md#agg_function-uniqhll12)
- [uniqExact](../../../sql-reference/aggregate-functions/reference/uniqexact.md#agg_function-uniqexact)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/uniqcombined/) <!--hide-->

View File

@ -5,3 +5,5 @@ toc_priority: 193
# uniqCombined64 {#agg_function-uniqcombined64}
Использует 64-битный хэш для всех типов, в отличие от [uniqCombined](../../../sql-reference/aggregate-functions/reference/uniqcombined.md#agg_function-uniqcombined).
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/uniqcombined64/) <!--hide-->

View File

@ -23,3 +23,5 @@ uniqExact(x[, ...])
- [uniq](../../../sql-reference/aggregate-functions/reference/uniq.md#agg_function-uniq)
- [uniqCombined](../../../sql-reference/aggregate-functions/reference/uniq.md#agg_function-uniqcombined)
- [uniqHLL12](../../../sql-reference/aggregate-functions/reference/uniq.md#agg_function-uniqhll12)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/uniqexact/) <!--hide-->

View File

@ -36,3 +36,6 @@ uniqHLL12(x[, ...])
- [uniq](../../../sql-reference/aggregate-functions/reference/uniq.md#agg_function-uniq)
- [uniqCombined](../../../sql-reference/aggregate-functions/reference/uniqcombined.md#agg_function-uniqcombined)
- [uniqExact](../../../sql-reference/aggregate-functions/reference/uniqexact.md#agg_function-uniqexact)
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/uniqhll12/) <!--hide-->

View File

@ -10,3 +10,5 @@ toc_priority: 32
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `varPopStable`. Она работает медленнее, но обеспечивает меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/varpop/) <!--hide-->

View File

@ -12,3 +12,5 @@ toc_priority: 33
!!! note "Примечание"
Функция использует вычислительно неустойчивый алгоритм. Если для ваших расчётов необходима [вычислительная устойчивость](https://ru.wikipedia.org/wiki/Вычислительная_устойчивость), используйте функцию `varSampStable`. Она работает медленнее, но обеспечиват меньшую вычислительную ошибку.
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/vasamp/) <!--hide-->

View File

@ -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();

View File

@ -1,5 +1,3 @@
#include <iomanip>
#include <Poco/Net/NetException.h>
#include <Core/Defines.h>
#include <Compression/CompressedReadBuffer.h>

View File

@ -17,7 +17,6 @@
#endif
#include <Common/Exception.h>
#include <IO/WriteHelpers.h>
#include <Poco/String.h>
#include <algorithm>

View File

@ -1,7 +1,6 @@
#include <Columns/ColumnAggregateFunction.h>
#include <Columns/ColumnsCommon.h>
#include <Common/assert_cast.h>
#include <AggregateFunctions/AggregateFunctionState.h>
#include <DataStreams/ColumnGathererStream.h>
#include <IO/WriteBufferFromArena.h>
#include <IO/WriteBufferFromString.h>

View File

@ -2,11 +2,9 @@
#include <Columns/ColumnConst.h>
#include <Columns/ColumnsCommon.h>
#include <Common/PODArray.h>
#include <Common/typeid_cast.h>
#include <Common/WeakHash.h>
#include <Common/HashTable/Hash.h>
#include <common/defines.h>
#if defined(MEMORY_SANITIZER)
#include <sanitizer/msan_interface.h>

View File

@ -1,4 +1,3 @@
#include <Core/Defines.h>
#include <Common/Arena.h>
#include <Common/memcmpSmall.h>
#include <Common/assert_cast.h>

View File

@ -11,7 +11,6 @@
#include <Common/assert_cast.h>
#include <Common/WeakHash.h>
#include <Common/HashTable/Hash.h>
#include <IO/WriteBuffer.h>
#include <IO/WriteHelpers.h>
#include <Columns/ColumnsCommon.h>
#include <DataStreams/ColumnGathererStream.h>

View File

@ -6,7 +6,6 @@
#include <cstring>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <functional>
#include <Poco/DOM/Text.h>
#include <Poco/DOM/Attr.h>

View File

@ -1,6 +1,5 @@
#include "configReadClient.h"
#include <Poco/Util/Application.h>
#include <Poco/Util/LayeredConfiguration.h>
#include <Poco/File.h>
#include "ConfigProcessor.h"

View File

@ -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;

View File

@ -1,9 +1,7 @@
#include <Core/UUID.h>
#include <IO/ReadBuffer.h>
#include <IO/WriteBuffer.h>
#include <IO/ReadHelpers.h>
#include <IO/WriteHelpers.h>
#include <IO/ReadBufferFromString.h>
#include <IO/WriteBufferFromString.h>
#include <IO/Operators.h>
#include <Common/FieldVisitors.h>

View File

@ -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.") \

View File

@ -5,7 +5,6 @@
#include <Common/StackTrace.h>
#include <Common/TraceCollector.h>
#include <Common/thread_local_rng.h>
#include <common/StringRef.h>
#include <common/logger_useful.h>
#include <common/phdr_cache.h>
#include <common/errnoToString.h>

View File

@ -1,7 +1,5 @@
#include "StatusFile.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <fcntl.h>
#include <errno.h>

View File

@ -1,5 +1,4 @@
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#if defined(OS_LINUX)
# include <sys/sysinfo.h>
@ -8,9 +7,7 @@
#include <random>
#include <common/defines.h>
#include <common/sleep.h>
#include <common/getThreadId.h>
#include <IO/ReadHelpers.h>

View File

@ -13,9 +13,6 @@
#include <Common/StackTrace.h>
#include <common/logger_useful.h>
#include <unistd.h>
#include <fcntl.h>
namespace DB
{

View File

@ -1,5 +1,3 @@
#include <string.h>
#include <Common/ProfileEvents.h>
#include <Common/ZooKeeper/IKeeper.h>

View File

@ -3,7 +3,6 @@
#include "KeeperException.h"
#include "TestKeeper.h"
#include <random>
#include <functional>
#include <pcg-random/pcg_random.hpp>
@ -11,8 +10,6 @@
#include <common/find_symbols.h>
#include <Common/randomSeed.h>
#include <Common/StringUtils/StringUtils.h>
#include <Common/PODArray.h>
#include <Common/thread_local_rng.h>
#include <Common/Exception.h>
#include <Poco/Net/NetException.h>

View File

@ -8,9 +8,6 @@
#include <IO/Operators.h>
#include <IO/WriteBufferFromString.h>
#include <Poco/Exception.h>
#include <Poco/Net/NetException.h>
#if !defined(ARCADIA_BUILD)
# include <Common/config.h>
#endif

View File

@ -5,7 +5,6 @@
#include <syscall.h>
#include <unistd.h>
#include <linux/capability.h>
#include <linux/netlink.h>
#include <Common/Exception.h>

View File

@ -1,5 +1,4 @@
#include "CompressedReadBuffer.h"
#include <Compression/CompressionInfo.h>
#include <Compression/LZ4_decompress_faster.h>

View File

@ -1,14 +1,11 @@
#include "CompressedReadBufferBase.h"
#include <vector>
#include <cstring>
#include <cassert>
#include <city.h>
#include <Common/PODArray.h>
#include <Common/ProfileEvents.h>
#include <Common/Exception.h>
#include <Common/hex.h>
#include <common/unaligned.h>
#include <Compression/ICompressionCodec.h>
#include <Compression/CompressionFactory.h>
#include <IO/ReadBuffer.h>

View File

@ -2,7 +2,6 @@
#include "CompressedReadBufferFromFile.h"
#include <Compression/CompressionInfo.h>
#include <Compression/LZ4_decompress_faster.h>
#include <IO/WriteHelpers.h>
#include <IO/createReadBufferFromFileBase.h>

View File

@ -1,4 +1,3 @@
#include <memory>
#include <city.h>
#include <string.h>

View File

@ -5,7 +5,6 @@
#include <Parsers/IAST.h>
#include <Parsers/ASTLiteral.h>
#include <IO/WriteHelpers.h>
#include <cstdlib>
namespace DB

View File

@ -9,7 +9,6 @@
#include <string.h>
#include <algorithm>
#include <cstdlib>
#include <type_traits>
#include <bitset>

View File

@ -3,12 +3,10 @@
#include <Common/PODArray.h>
#include <common/unaligned.h>
#include <Compression/CompressionFactory.h>
#include <IO/ReadHelpers.h>
#include <IO/WriteHelpers.h>
#include <IO/WriteBufferFromString.h>
#include <IO/Operators.h>
#include <Common/hex.h>
#include <sstream>
namespace DB

View File

@ -1,9 +1,7 @@
#include <Compression/CompressionCodecZSTD.h>
#include <Compression/CompressionInfo.h>
#include <IO/ReadHelpers.h>
#include <Compression/CompressionFactory.h>
#include <zstd.h>
#include <Core/Field.h>
#include <Parsers/IAST.h>
#include <Parsers/ASTLiteral.h>
#include <Common/typeid_cast.h>

View File

@ -1,10 +1,7 @@
#include <Compression/CompressionFactory.h>
#include <Parsers/parseQuery.h>
#include <Parsers/ParserCreateQuery.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTLiteral.h>
#include <Common/typeid_cast.h>
#include <Poco/String.h>
#include <IO/ReadBuffer.h>
#include <Parsers/queryToString.h>

View File

@ -2,8 +2,6 @@
#include <string.h>
#include <iostream>
#include <random>
#include <algorithm>
#include <Core/Defines.h>
#include <Common/Stopwatch.h>
#include <common/types.h>

View File

@ -1,11 +1,9 @@
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <Core/Types.h>
#include <Common/Stopwatch.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/ReadBufferFromFile.h>

View File

@ -11,8 +11,6 @@
#include <Parsers/IParser.h>
#include <Parsers/TokenIterator.h>
#include <fmt/format.h>
#include <random>
#include <bitset>
#include <cmath>

View File

@ -6,13 +6,11 @@
#include <IO/WriteBufferFromString.h>
#include <IO/Operators.h>
#include <Common/typeid_cast.h>
#include <Common/assert_cast.h>
#include <Columns/ColumnConst.h>
#include <iterator>
#include <memory>
namespace DB

Some files were not shown because too many files have changed in this diff Show More