Skip to content

Commit cf38f59

Browse files
authored
Merge branch 'master' into proj_optimization_analyzer
2 parents 30e5076 + 906d17e commit cf38f59

File tree

150 files changed

+1906
-520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1906
-520
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ At a minimum, the following information should be added (but add more as needed)
4242
> Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/
4343
4444
<details>
45-
<summary>Modify your CI run</summary>
45+
<summary>CI Settings</summary>
4646

4747
**NOTE:** If your merge the PR with modified CI you **MUST KNOW** what you are doing
4848
**NOTE:** Checked options will be applied if set before CI RunConfig/PrepareRunConfig step
4949

50-
#### Include tests (required builds will be added automatically):
51-
- [ ] <!---ci_include_fast--> Fast test
50+
#### Run these jobs only (required builds will be added automatically):
5251
- [ ] <!---ci_include_integration--> Integration Tests
5352
- [ ] <!---ci_include_stateless--> Stateless tests
5453
- [ ] <!---ci_include_stateful--> Stateful tests
5554
- [ ] <!---ci_include_unit--> Unit tests
5655
- [ ] <!---ci_include_performance--> Performance tests
56+
- [ ] <!---ci_include_aarch64--> All with aarch64
5757
- [ ] <!---ci_include_asan--> All with ASAN
5858
- [ ] <!---ci_include_tsan--> All with TSAN
5959
- [ ] <!---ci_include_analyzer--> All with Analyzer
6060
- [ ] <!---ci_include_azure --> All with Azure
6161
- [ ] <!---ci_include_KEYWORD--> Add your option here
6262

63-
#### Exclude tests:
63+
#### Deny these jobs:
6464
- [ ] <!---ci_exclude_fast--> Fast test
6565
- [ ] <!---ci_exclude_integration--> Integration Tests
6666
- [ ] <!---ci_exclude_stateless--> Stateless tests
@@ -72,7 +72,6 @@ At a minimum, the following information should be added (but add more as needed)
7272
- [ ] <!---ci_exclude_ubsan--> All with UBSAN
7373
- [ ] <!---ci_exclude_coverage--> All with Coverage
7474
- [ ] <!---ci_exclude_aarch64--> All with Aarch64
75-
- [ ] <!---ci_exclude_KEYWORD--> Add your option here
7675

7776
#### Extra options:
7877
- [ ] <!---do_not_test--> do not test (only style check)

.github/workflows/merge_queue.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
clear-repository: true # to ensure correct digests
2323
fetch-depth: 0 # to get version
2424
filter: tree:0
25+
- name: Cancel PR workflow
26+
run: |
27+
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --cancel-previous-run
2528
- name: Python unit tests
2629
run: |
2730
cd "$GITHUB_WORKSPACE/tests/ci"

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ if (ENABLE_CHECK_HEAVY_BUILDS)
6868
set (RLIMIT_AS 20000000000)
6969
endif()
7070

71-
# For some files currently building RISCV64 might be too slow. TODO: Improve compilation times per file
72-
if (ARCH_RISCV64)
71+
# For some files currently building RISCV64/LOONGARCH64 might be too slow.
72+
# TODO: Improve compilation times per file
73+
if (ARCH_RISCV64 OR ARCH_LOONGARCH64)
7374
set (RLIMIT_CPU 1800)
7475
endif()
7576

cmake/autogenerated_versions.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# NOTE: has nothing common with DBMS_TCP_PROTOCOL_VERSION,
44
# only DBMS_TCP_PROTOCOL_VERSION should be incremented on protocol changes.
5-
SET(VERSION_REVISION 54486)
5+
SET(VERSION_REVISION 54487)
66
SET(VERSION_MAJOR 24)
7-
SET(VERSION_MINOR 5)
7+
SET(VERSION_MINOR 6)
88
SET(VERSION_PATCH 1)
9-
SET(VERSION_GITHASH 6d4b31322d168356c8b10c43b4cef157c82337ff)
10-
SET(VERSION_DESCRIBE v24.5.1.1-testing)
11-
SET(VERSION_STRING 24.5.1.1)
9+
SET(VERSION_GITHASH 70a1d3a63d47f0be077d67b8deb907230fc7cfb0)
10+
SET(VERSION_DESCRIBE v24.6.1.1-testing)
11+
SET(VERSION_STRING 24.6.1.1)
1212
# end of autochange

docker/test/style/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install --yes \
1111
aspell \
1212
curl \
1313
git \
14+
gh \
1415
file \
1516
libxml2-utils \
1617
moreutils \

docs/en/interfaces/formats.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ SELECT * FROM nestedt FORMAT TSV
197197
- [input_format_tsv_enum_as_number](/docs/en/operations/settings/settings-formats.md/#input_format_tsv_enum_as_number) - treat inserted enum values in TSV formats as enum indices. Default value - `false`.
198198
- [input_format_tsv_use_best_effort_in_schema_inference](/docs/en/operations/settings/settings-formats.md/#input_format_tsv_use_best_effort_in_schema_inference) - use some tweaks and heuristics to infer schema in TSV format. If disabled, all fields will be inferred as Strings. Default value - `true`.
199199
- [output_format_tsv_crlf_end_of_line](/docs/en/operations/settings/settings-formats.md/#output_format_tsv_crlf_end_of_line) - if it is set true, end of line in TSV output format will be `\r\n` instead of `\n`. Default value - `false`.
200+
- [input_format_tsv_crlf_end_of_line](/docs/en/operations/settings/settings-formats.md/#input_format_tsv_crlf_end_of_line) - if it is set true, end of line in TSV input format will be `\r\n` instead of `\n`. Default value - `false`.
200201
- [input_format_tsv_skip_first_lines](/docs/en/operations/settings/settings-formats.md/#input_format_tsv_skip_first_lines) - skip specified number of lines at the beginning of data. Default value - `0`.
201202
- [input_format_tsv_detect_header](/docs/en/operations/settings/settings-formats.md/#input_format_tsv_detect_header) - automatically detect header with names and types in TSV format. Default value - `true`.
202203
- [input_format_tsv_skip_trailing_empty_lines](/docs/en/operations/settings/settings-formats.md/#input_format_tsv_skip_trailing_empty_lines) - skip trailing empty lines at the end of data. Default value - `false`.

docs/en/operations/server-configuration-parameters/settings.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,25 @@ Default value: 5000
561561
<max_table_num_to_warn>400</max_table_num_to_warn>
562562
```
563563

564+
## max\_view\_num\_to\_warn {#max-view-num-to-warn}
565+
If the number of attached views exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.
566+
Default value: 10000
567+
568+
**Example**
569+
570+
``` xml
571+
<max_view_num_to_warn>400</max_view_num_to_warn>
572+
```
573+
574+
## max\_dictionary\_num\_to\_warn {#max-dictionary-num-to-warn}
575+
If the number of attached dictionaries exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.
576+
Default value: 1000
577+
578+
**Example**
579+
580+
``` xml
581+
<max_dictionary_num_to_warn>400</max_dictionary_num_to_warn>
582+
```
564583

565584
## max\_part\_num\_to\_warn {#max-part-num-to-warn}
566585
If the number of active parts exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.

docs/en/operations/settings/settings-formats.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,13 @@ Default value: `0`.
831831

832832
### output_format_tsv_crlf_end_of_line {#output_format_tsv_crlf_end_of_line}
833833

834-
Use DOC/Windows-style line separator (CRLF) in TSV instead of Unix style (LF).
834+
Use DOS/Windows-style line separator (CRLF) in TSV instead of Unix style (LF).
835+
836+
Disabled by default.
837+
838+
### input_format_tsv_crlf_end_of_line {#input_format_tsv_crlf_end_of_line}
839+
840+
Use DOS/Windows-style line separator (CRLF) for TSV input files instead of Unix style (LF).
835841

836842
Disabled by default.
837843

docs/en/sql-reference/functions/math-functions.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,3 +947,49 @@ Result:
947947
│ 11 │
948948
└──────────────────────────────────┘
949949
```
950+
951+
## proportionsZTest
952+
953+
Returns test statistics for the two proportion Z-test - a statistical test for comparing the proportions from two populations `x` and `y`.
954+
955+
**Syntax**
956+
957+
```sql
958+
proportionsZTest(successes_x, successes_y, trials_x, trials_y, conf_level, pool_type)
959+
```
960+
961+
**Arguments**
962+
963+
- `successes_x`: Number of successes in population `x`. [UInt64](../data-types/int-uint.md).
964+
- `successes_y`: Number of successes in population `y`. [UInt64](../data-types/int-uint.md).
965+
- `trials_x`: Number of trials in population `x`. [UInt64](../data-types/int-uint.md).
966+
- `trials_y`: Number of trials in population `y`. [UInt64](../data-types/int-uint.md).
967+
- `conf_level`: Confidence level for the test. [Float64](../data-types/float.md).
968+
- `pool_type`: Selection of pooling (way in which the standard error is estimated). Can be either `unpooled` or `pooled`. [String](../data-types/string.md).
969+
970+
:::note
971+
For argument `pool_type`: In the pooled version, the two proportions are averaged, and only one proportion is used to estimate the standard error. In the unpooled version, the two proportions are used separately.
972+
:::
973+
974+
**Returned value**
975+
976+
- `z_stat`: Z statistic. [Float64](../data-types/float.md).
977+
- `p_val`: P value. [Float64](../data-types/float.md).
978+
- `ci_low`: The lower confidence interval. [Float64](../data-types/float.md).
979+
- `ci_high`: The upper confidence interval. [Float64](../data-types/float.md).
980+
981+
**Example**
982+
983+
Query:
984+
985+
```sql
986+
SELECT proportionsZTest(10, 11, 100, 101, 0.95, 'unpooled');
987+
```
988+
989+
Result:
990+
991+
```response
992+
┌─proportionsZTest(10, 11, 100, 101, 0.95, 'unpooled')───────────────────────────────┐
993+
│ (-0.20656724435948853,0.8363478437079654,-0.09345975390115283,0.07563797172293502) │
994+
└────────────────────────────────────────────────────────────────────────────────────┘
995+
```

docs/en/sql-reference/functions/other-functions.md

Lines changed: 159 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -998,17 +998,170 @@ SELECT version()
998998
Returns the build ID generated by a compiler for the running ClickHouse server binary.
999999
If executed in the context of a distributed table, this function generates a normal column with values relevant to each shard. Otherwise it produces a constant value.
10001000

1001-
## blockNumber()
1001+
## blockNumber
10021002

1003-
Returns the sequence number of the data block where the row is located.
1003+
Returns a monotonically increasing sequence number of the [block](../../development/architecture.md#block) containing the row.
1004+
The returned block number is updated on a best-effort basis, i.e. it may not be fully accurate.
10041005

1005-
## rowNumberInBlock() {#rowNumberInBlock}
1006+
**Syntax**
1007+
1008+
```sql
1009+
blockNumber()
1010+
```
1011+
1012+
**Returned value**
1013+
1014+
- Sequence number of the data block where the row is located. [UInt64](../data-types/int-uint.md).
1015+
1016+
**Example**
1017+
1018+
Query:
1019+
1020+
```sql
1021+
SELECT blockNumber()
1022+
FROM
1023+
(
1024+
SELECT *
1025+
FROM system.numbers
1026+
LIMIT 10
1027+
) SETTINGS max_block_size = 2
1028+
```
1029+
1030+
Result:
1031+
1032+
```response
1033+
┌─blockNumber()─┐
1034+
│ 7 │
1035+
│ 7 │
1036+
└───────────────┘
1037+
┌─blockNumber()─┐
1038+
│ 8 │
1039+
│ 8 │
1040+
└───────────────┘
1041+
┌─blockNumber()─┐
1042+
│ 9 │
1043+
│ 9 │
1044+
└───────────────┘
1045+
┌─blockNumber()─┐
1046+
│ 10 │
1047+
│ 10 │
1048+
└───────────────┘
1049+
┌─blockNumber()─┐
1050+
│ 11 │
1051+
│ 11 │
1052+
└───────────────┘
1053+
```
1054+
1055+
## rowNumberInBlock {#rowNumberInBlock}
1056+
1057+
Returns for each [block](../../development/architecture.md#block) processed by `rowNumberInBlock` the number of the current row.
1058+
The returned number starts for each block at 0.
1059+
1060+
**Syntax**
1061+
1062+
```sql
1063+
rowNumberInBlock()
1064+
```
1065+
1066+
**Returned value**
1067+
1068+
- Ordinal number of the row in the data block starting from 0. [UInt64](../data-types/int-uint.md).
1069+
1070+
**Example**
1071+
1072+
Query:
1073+
1074+
```sql
1075+
SELECT rowNumberInBlock()
1076+
FROM
1077+
(
1078+
SELECT *
1079+
FROM system.numbers_mt
1080+
LIMIT 10
1081+
) SETTINGS max_block_size = 2
1082+
```
1083+
1084+
Result:
1085+
1086+
```response
1087+
┌─rowNumberInBlock()─┐
1088+
│ 0 │
1089+
│ 1 │
1090+
└────────────────────┘
1091+
┌─rowNumberInBlock()─┐
1092+
│ 0 │
1093+
│ 1 │
1094+
└────────────────────┘
1095+
┌─rowNumberInBlock()─┐
1096+
│ 0 │
1097+
│ 1 │
1098+
└────────────────────┘
1099+
┌─rowNumberInBlock()─┐
1100+
│ 0 │
1101+
│ 1 │
1102+
└────────────────────┘
1103+
┌─rowNumberInBlock()─┐
1104+
│ 0 │
1105+
│ 1 │
1106+
└────────────────────┘
1107+
```
1108+
1109+
## rowNumberInAllBlocks
1110+
1111+
Returns a unique row number for each row processed by `rowNumberInAllBlocks`. The returned numbers start at 0.
1112+
1113+
**Syntax**
1114+
1115+
```sql
1116+
rowNumberInAllBlocks()
1117+
```
1118+
1119+
**Returned value**
1120+
1121+
- Ordinal number of the row in the data block starting from 0. [UInt64](../data-types/int-uint.md).
1122+
1123+
**Example**
1124+
1125+
Query:
1126+
1127+
```sql
1128+
SELECT rowNumberInAllBlocks()
1129+
FROM
1130+
(
1131+
SELECT *
1132+
FROM system.numbers_mt
1133+
LIMIT 10
1134+
)
1135+
SETTINGS max_block_size = 2
1136+
```
1137+
1138+
Result:
1139+
1140+
```response
1141+
┌─rowNumberInAllBlocks()─┐
1142+
│ 0 │
1143+
│ 1 │
1144+
└────────────────────────┘
1145+
┌─rowNumberInAllBlocks()─┐
1146+
│ 4 │
1147+
│ 5 │
1148+
└────────────────────────┘
1149+
┌─rowNumberInAllBlocks()─┐
1150+
│ 2 │
1151+
│ 3 │
1152+
└────────────────────────┘
1153+
┌─rowNumberInAllBlocks()─┐
1154+
│ 6 │
1155+
│ 7 │
1156+
└────────────────────────┘
1157+
┌─rowNumberInAllBlocks()─┐
1158+
│ 8 │
1159+
│ 9 │
1160+
└────────────────────────┘
1161+
```
10061162

1007-
Returns the ordinal number of the row in the data block. Different data blocks are always recalculated.
10081163

1009-
## rowNumberInAllBlocks()
10101164

1011-
Returns the ordinal number of the row in the data block. This function only considers the affected data blocks.
10121165

10131166
## neighbor
10141167

0 commit comments

Comments
 (0)