Skip to content

Commit 88f4623

Browse files
authored
Merge branch 'master' into analyzer-01655_plan_optimizations_optimize_read_in_window_order
2 parents 53b751b + e4500a7 commit 88f4623

File tree

108 files changed

+1938
-1027
lines changed

Some content is hidden

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

108 files changed

+1938
-1027
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,9 @@
338338
[submodule "contrib/liburing"]
339339
path = contrib/liburing
340340
url = https://github.com/axboe/liburing
341+
[submodule "contrib/libfiu"]
342+
path = contrib/libfiu
343+
url = https://github.com/ClickHouse/libfiu.git
341344
[submodule "contrib/isa-l"]
342345
path = contrib/isa-l
343346
url = https://github.com/ClickHouse/isa-l.git

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ if ((NOT OS_LINUX AND NOT OS_ANDROID) OR (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG"))
395395
set(ENABLE_GWP_ASAN OFF)
396396
endif ()
397397

398+
option (ENABLE_FIU "Enable Fiu" ON)
399+
398400
option(WERROR "Enable -Werror compiler option" ON)
399401

400402
if (WERROR)

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ curl https://clickhouse.com/ | sh
2121
* [Contacts](https://clickhouse.com/company/contact) can help to get your questions answered if there are any.
2222

2323
## Upcoming Events
24-
* [**ClickHouse Spring Meetup in Manhattan**](https://www.meetup.com/clickhouse-new-york-user-group/events/292517734) - April 26 - It's spring, and it's time to meet again in the city! Talks include: "Building a domain specific query language on top of Clickhouse", "A Galaxy of Information", "Our Journey to ClickHouse Cloud from Redshift", and a ClickHouse update!
24+
2525
* [**v23.4 Release Webinar**](https://clickhouse.com/company/events/v23-4-release-webinar?utm_source=github&utm_medium=social&utm_campaign=release-webinar-2023-04) - April 26 - 23.4 is rapidly approaching. Original creator, co-founder, and CTO of ClickHouse Alexey Milovidov will walk us through the highlights of the release.
26-
* [**ClickHouse Meetup in Berlin**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - May 16 - Save the date! ClickHouse is coming back to Berlin. We’re excited to announce an upcoming ClickHouse Meetup that you won’t want to miss. Join us as we gather together to discuss the latest in the world of ClickHouse and share user stories.
26+
* [**ClickHouse Meetup in Berlin**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - May 16
27+
* [**ClickHouse Meetup in Barcelona**](https://www.meetup.com/clickhouse-barcelona-user-group/events/292892669) - May 25
28+
* [**ClickHouse Meetup in London**](https://www.meetup.com/clickhouse-london-user-group/events/292892824) - May 25
29+
* [**ClickHouse Meetup in San Francisco**](https://www.meetup.com/clickhouse-silicon-valley-meetup-group/events/293426725/) - Jun 7
30+
* [**ClickHouse Meetup in Stockholm**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - Jun 13
31+
32+
Also, keep an eye out for upcoming meetups in Amsterdam, Boston, NYC, Beijing, and Toronto. Somewhere else you want us to be? Please feel free to reach out to tyler <at> clickhouse <dot> com.
2733

2834
## Recent Recordings
2935
* **Recent Meetup Videos**: [Meetup Playlist](https://www.youtube.com/playlist?list=PL0Z2YDlm0b3iNDUzpY1S3L_iV4nARda_U) Whenever possible recordings of the ClickHouse Community Meetups are edited and presented as individual talks. Current featuring "Modern SQL in 2023", "Fast, Concurrent, and Consistent Asynchronous INSERTS in ClickHouse", and "Full-Text Indices: Design and Experiments"
30-
* **Recording available**: [**v23.3 Release Webinar**](https://www.youtube.com/watch?v=ISaGUjvBNao) UNDROP TABLE, server settings introspection, nested dynamic disks, MySQL compatibility, parseDate Time, Lightweight Deletes, Parallel Replicas, integrations updates, and so much more! Watch it now!
36+
* **Recording available**: [**v23.4 Release Webinar**]([https://www.youtube.com/watch?v=ISaGUjvBNao](https://www.youtube.com/watch?v=4rrf6bk_mOg)) UNDROP TABLE, server settings introspection, nested dynamic disks, MySQL compatibility, parseDate Time, Lightweight Deletes, Parallel Replicas, integrations updates, and so much more! Watch it now!
3137
* **All release webinar recordings**: [YouTube playlist](https://www.youtube.com/playlist?list=PL0Z2YDlm0b3jAlSy1JxyP8zluvXaN3nxU)

contrib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ add_contrib (libfarmhash)
105105
add_contrib (icu-cmake icu)
106106
add_contrib (h3-cmake h3)
107107
add_contrib (mariadb-connector-c-cmake mariadb-connector-c)
108+
add_contrib (libfiu-cmake libfiu)
108109

109110
if (ENABLE_TESTS)
110111
add_contrib (googletest-cmake googletest)

contrib/libfiu

Submodule libfiu added at b85edbd
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
if (NOT ENABLE_FIU)
2+
message (STATUS "Not using fiu")
3+
return ()
4+
endif ()
5+
6+
set(FIU_DIR "${ClickHouse_SOURCE_DIR}/contrib/libfiu/")
7+
8+
set(FIU_SOURCES
9+
${FIU_DIR}/libfiu/fiu.c
10+
${FIU_DIR}/libfiu/fiu-rc.c
11+
${FIU_DIR}/libfiu/backtrace.c
12+
${FIU_DIR}/libfiu/wtable.c
13+
)
14+
15+
set(FIU_HEADERS "${FIU_DIR}/libfiu")
16+
17+
add_library(_fiu ${FIU_SOURCES})
18+
target_compile_definitions(_fiu PUBLIC DUMMY_BACKTRACE)
19+
target_include_directories(_fiu PUBLIC ${FIU_HEADERS})
20+
add_library(ch_contrib::fiu ALIAS _fiu)

docker/test/fasttest/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function clone_submodules
147147
contrib/xxHash
148148
contrib/simdjson
149149
contrib/liburing
150+
contrib/libfiu
150151
)
151152

152153
git submodule sync

docs/en/operations/settings/settings.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,12 @@ If unsuccessful, several attempts are made to connect to various replicas.
11251125

11261126
Default value: 1000.
11271127

1128+
## connect_timeout_with_failover_secure_ms
1129+
1130+
Connection timeout for selecting first healthy replica (for secure connections)
1131+
1132+
Default value: 1000.
1133+
11281134
## connection_pool_max_wait_ms {#connection-pool-max-wait-ms}
11291135

11301136
The wait time in milliseconds for a connection when the connection pool is full.
@@ -3562,7 +3568,7 @@ Default value: `1`.
35623568

35633569
If the setting is set to `0`, the table function does not make Nullable columns and inserts default values instead of NULL. This is also applicable for NULL values inside arrays.
35643570

3565-
## allow_experimental_projection_optimization {#allow-experimental-projection-optimization}
3571+
## optimize_use_projections {#optimize_use_projections}
35663572

35673573
Enables or disables [projection](../../engines/table-engines/mergetree-family/mergetree.md/#projections) optimization when processing `SELECT` queries.
35683574

@@ -3575,7 +3581,7 @@ Default value: `1`.
35753581

35763582
## force_optimize_projection {#force-optimize-projection}
35773583

3578-
Enables or disables the obligatory use of [projections](../../engines/table-engines/mergetree-family/mergetree.md/#projections) in `SELECT` queries, when projection optimization is enabled (see [allow_experimental_projection_optimization](#allow-experimental-projection-optimization) setting).
3584+
Enables or disables the obligatory use of [projections](../../engines/table-engines/mergetree-family/mergetree.md/#projections) in `SELECT` queries, when projection optimization is enabled (see [optimize_use_projections](#optimize_use_projections) setting).
35793585

35803586
Possible values:
35813587

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
slug: /en/sql-reference/aggregate-functions/reference/first_value
3+
sidebar_position: 7
4+
---
5+
6+
# first_value
7+
8+
Selects the first encountered value, similar to `any`, but could accept NULL.
9+
10+
## examples
11+
12+
```sql
13+
insert into test_data (a,b) values (1,null), (2,3), (4, 5), (6,null)
14+
```
15+
16+
### example1
17+
The NULL value is ignored at default.
18+
```sql
19+
select first_value(b) from test_data
20+
```
21+
22+
```text
23+
┌─first_value_ignore_nulls(b)─┐
24+
│ 3 │
25+
└─────────────────────────────┘
26+
27+
```
28+
29+
### example2
30+
The NULL value is ignored.
31+
```sql
32+
select first_value(b) ignore nulls sfrom test_data
33+
```
34+
35+
```text
36+
┌─first_value_ignore_nulls(b)─┐
37+
│ 3 │
38+
└─────────────────────────────┘
39+
40+
```
41+
42+
### example3
43+
The NULL value is accepted.
44+
```sql
45+
select first_value(b) respect nulls from test_data
46+
```
47+
48+
```text
49+
50+
┌─first_value_respect_nulls(b)─┐
51+
│ ᴺᵁᴸᴸ │
52+
└──────────────────────────────┘
53+
```
54+
55+

docs/en/sql-reference/aggregate-functions/reference/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ ClickHouse-specific aggregate functions:
2626

2727
- [anyHeavy](../../../sql-reference/aggregate-functions/reference/anyheavy.md)
2828
- [anyLast](../../../sql-reference/aggregate-functions/reference/anylast.md)
29+
- [first_value](../../../sql-reference/aggregate-functions/reference/first_value.md)
30+
- [last_value](../../../sql-reference/aggregate-functions/reference/last_value.md)
2931
- [argMin](../../../sql-reference/aggregate-functions/reference/argmin.md)
3032
- [argMax](../../../sql-reference/aggregate-functions/reference/argmax.md)
3133
- [avgWeighted](../../../sql-reference/aggregate-functions/reference/avgweighted.md)

0 commit comments

Comments
 (0)