Skip to content

Commit

Permalink
Merge branch 'master' into fix-iceberg
Browse files Browse the repository at this point in the history
  • Loading branch information
alesapin committed May 28, 2023
2 parents 3fefacb + 3a3cee5 commit 1bf32f7
Show file tree
Hide file tree
Showing 275 changed files with 5,114 additions and 1,779 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -23,7 +23,6 @@ curl https://clickhouse.com/ | sh
## Upcoming Events

* [**v23.5 Release Webinar**](https://clickhouse.com/company/events/v23-5-release-webinar?utm_source=github&utm_medium=social&utm_campaign=release-webinar-2023-05) - May 31 - 23.5 is rapidly approaching. Original creator, co-founder, and CTO of ClickHouse Alexey Milovidov will walk us through the highlights of the release.
* [**ClickHouse Meetup in Berlin**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - May 16
* [**ClickHouse Meetup in Barcelona**](https://www.meetup.com/clickhouse-barcelona-user-group/events/292892669) - May 25
* [**ClickHouse Meetup in London**](https://www.meetup.com/clickhouse-london-user-group/events/292892824) - May 25
* [**ClickHouse Meetup in San Francisco**](https://www.meetup.com/clickhouse-silicon-valley-meetup-group/events/293426725/) - Jun 7
Expand Down
2 changes: 1 addition & 1 deletion contrib/aws
Submodule aws updated from ecccfc to ca0235
2 changes: 1 addition & 1 deletion contrib/aws-c-common
Submodule aws-c-common updated 50 files
+16 −5 .github/workflows/ci.yml
+1 −1 .github/workflows/clang-format.yml
+1 −1 .github/workflows/clang-tidy.yml
+25 −0 .github/workflows/codecov.yml
+0 −0 .gitmodules
+1 −0 CMakeLists.txt
+3 −2 builder.json
+32 −0 cmake/AwsCRuntime.cmake
+6 −0 include/aws/common/allocator.h
+13 −7 include/aws/common/assert.h
+1 −1 include/aws/common/bus.h
+3 −3 include/aws/common/command_line_parser.h
+2 −2 include/aws/common/common.h
+34 −1 include/aws/common/encoding.h
+5 −1 include/aws/common/error.h
+4 −1 include/aws/common/file.h
+2 −4 include/aws/common/logging.h
+2 −2 include/aws/common/macros.h
+1 −1 include/aws/common/private/hash_table_impl.h
+1 −1 include/aws/common/thread.h
+5 −5 scripts/appverifier_ctest.py
+1 −1 source/allocator.c
+5 −0 source/allocator_sba.c
+2 −1 source/array_list.c
+1 −1 source/bus.c
+4 −6 source/command_line_parser.c
+13 −1 source/common.c
+1 −1 source/date_time.c
+117 −5 source/encoding.c
+4 −0 source/error.c
+17 −12 source/file.c
+24 −25 source/json.c
+3 −2 source/log_writer.c
+6 −1 source/logging.c
+4 −4 source/memtrace.c
+63 −39 source/posix/file.c
+3 −2 source/posix/thread.c
+6 −4 source/priority_queue.c
+10 −10 source/uri.c
+23 −5 source/windows/file.c
+6 −6 source/xml_parser.c
+2 −0 tests/CMakeLists.txt
+36 −8 tests/alloc_test.c
+262 −0 tests/encoding_test.c
+3 −0 tests/zero_test.c
+1 −1 verification/cbmc/proofs/aws_priority_queue_s_sift_down/aws_priority_queue_s_sift_down_harness.c
+1 −1 verification/cbmc/proofs/aws_priority_queue_s_sift_up/aws_priority_queue_s_sift_up_harness.c
+1 −0 verification/cbmc/stubs/memset_override_0.c
+4 −0 verification/cbmc/stubs/s_expand_table_override.c
+1 −3 verification/cbmc/stubs/s_sift_either_override.c
2 changes: 1 addition & 1 deletion contrib/aws-c-http
Submodule aws-c-http updated 45 files
+2 −0 .builder/action/aws-c-http-test.py
+46 −0 .builder/action/local-server-setup.py
+25 −33 .github/workflows/ci.yml
+3 −1 builder.json
+3 −3 codebuild/linux-integration-tests.yml
+3 −3 include/aws/http/connection.h
+2 −2 include/aws/http/connection_manager.h
+1 −0 include/aws/http/http.h
+2 −2 include/aws/http/http2_stream_manager.h
+5 −1 include/aws/http/private/proxy_impl.h
+11 −2 include/aws/http/private/websocket_decoder.h
+1 −0 include/aws/http/private/websocket_impl.h
+21 −3 include/aws/http/request_response.h
+83 −50 include/aws/http/websocket.h
+2 −2 integration-testing/http_client_test.py
+24 −17 source/connection.c
+1 −1 source/connection_manager.c
+1 −39 source/h1_decoder.c
+2 −2 source/h2_connection.c
+2 −2 source/h2_decoder.c
+7 −7 source/h2_stream.c
+1 −1 source/hpack_decoder.c
+2 −2 source/hpack_encoder.c
+3 −0 source/http.c
+2 −1 source/http2_stream_manager.c
+105 −42 source/proxy_connection.c
+55 −6 source/request_response.c
+146 −111 source/websocket.c
+448 −136 source/websocket_bootstrap.c
+70 −15 source/websocket_decoder.c
+24 −3 source/websocket_encoder.c
+25 −5 tests/CMakeLists.txt
+1 −1 tests/fuzz/fuzz_h2_decoder_correct.c
+3 −0 tests/h2_test_helper.c
+4 −4 tests/py_localhost/README.md
+1 −1 tests/py_localhost/non_tls_server.py
+1 −1 tests/py_localhost/server.py
+73 −13 tests/test_connection_manager.c
+110 −2 tests/test_h2_client.c
+1 −1 tests/test_localhost_integ.c
+62 −1 tests/test_message.c
+14 −22 tests/test_stream_manager.c
+622 −97 tests/test_websocket_bootstrap.c
+220 −6 tests/test_websocket_decoder.c
+124 −94 tests/test_websocket_handler.c
2 changes: 1 addition & 1 deletion contrib/aws-c-mqtt
Submodule aws-c-mqtt updated 60 files
+15 −13 .github/workflows/ci.yml
+25 −0 .github/workflows/codecov.yml
+13 −0 CMakeLists.txt
+2 −2 README.md
+1 −1 bin/elastipubsub/main.c
+29 −0 bin/elastipubsub5/CMakeLists.txt
+769 −0 bin/elastipubsub5/main.c
+29 −0 bin/mqtt5canary/CMakeLists.txt
+984 −0 bin/mqtt5canary/main.c
+3 −1 builder.json
+1 −0 codebuild/.gitignore
+330 −0 codebuild/CanaryWrapper.py
+398 −0 codebuild/CanaryWrapper_24_7.py
+1,294 −0 codebuild/CanaryWrapper_Classes.py
+48 −0 codebuild/CanaryWrapper_MetricFunctions.py
+58 −0 codebuild/mqtt-canary-test.yml
+40 −1 include/aws/mqtt/client.h
+24 −0 include/aws/mqtt/mqtt.h
+89 −1 include/aws/mqtt/private/client_impl.h
+18 −0 include/aws/mqtt/private/shared_constants.h
+642 −0 include/aws/mqtt/private/v5/mqtt5_client_impl.h
+264 −0 include/aws/mqtt/private/v5/mqtt5_decoder.h
+357 −0 include/aws/mqtt/private/v5/mqtt5_encoder.h
+343 −0 include/aws/mqtt/private/v5/mqtt5_options_storage.h
+66 −0 include/aws/mqtt/private/v5/mqtt5_topic_alias.h
+355 −0 include/aws/mqtt/private/v5/mqtt5_utils.h
+110 −0 include/aws/mqtt/private/v5/rate_limiters.h
+802 −0 include/aws/mqtt/v5/mqtt5_client.h
+336 −0 include/aws/mqtt/v5/mqtt5_packet_storage.h
+486 −0 include/aws/mqtt/v5/mqtt5_types.h
+216 −38 source/client.c
+46 −1 source/client_channel_handler.c
+66 −0 source/mqtt.c
+22 −0 source/shared_constants.c
+3,351 −0 source/v5/mqtt5_client.c
+1,174 −0 source/v5/mqtt5_decoder.c
+1,283 −0 source/v5/mqtt5_encoder.c
+3,893 −0 source/v5/mqtt5_options_storage.c
+586 −0 source/v5/mqtt5_topic_alias.c
+333 −0 source/v5/mqtt5_types.c
+539 −0 source/v5/mqtt5_utils.c
+217 −0 source/v5/rate_limiters.c
+260 −4 tests/CMakeLists.txt
+4 −8 tests/v3-client/aws_iot_client_test.c
+3 −7 tests/v3-client/paho_client_test.c
+0 −0 tests/v3/connection_state_test.c
+0 −0 tests/v3/mqtt_mock_server_handler.c
+0 −0 tests/v3/mqtt_mock_server_handler.h
+1,331 −0 tests/v3/operation_statistics_test.c
+0 −0 tests/v3/packet_encoding_test.c
+0 −0 tests/v3/topic_tree_test.c
+5,855 −0 tests/v5/mqtt5_client_tests.c
+1,841 −0 tests/v5/mqtt5_encoding_tests.c
+3,299 −0 tests/v5/mqtt5_operation_and_storage_tests.c
+1,327 −0 tests/v5/mqtt5_operation_validation_failure_tests.c
+1,747 −0 tests/v5/mqtt5_testing_utils.c
+148 −0 tests/v5/mqtt5_testing_utils.h
+589 −0 tests/v5/mqtt5_topic_alias_tests.c
+115 −0 tests/v5/mqtt5_utils_tests.c
+343 −0 tests/v5/rate_limiter_tests.c
2 changes: 1 addition & 1 deletion contrib/aws-c-s3
Submodule aws-c-s3 updated 50 files
+41 −0 .builder/actions/mock_server_setup.py
+8 −0 .github/.codecov.yml
+20 −9 .github/workflows/ci.yml
+28 −0 .github/workflows/codecov.yml
+3 −0 CMakeLists.txt
+5 −0 README.md
+5 −1 builder.json
+3 −0 include/aws/s3/private/s3_auto_ranged_get.h
+13 −7 include/aws/s3/private/s3_auto_ranged_put.h
+1 −1 include/aws/s3/private/s3_checksums.h
+21 −2 include/aws/s3/private/s3_client_impl.h
+11 −5 include/aws/s3/private/s3_meta_request_impl.h
+1 −1 include/aws/s3/private/s3_request.h
+1 −1 include/aws/s3/private/s3_request_messages.h
+24 −2 include/aws/s3/private/s3_util.h
+2 −0 include/aws/s3/s3.h
+146 −18 include/aws/s3/s3_client.h
+3 −1 source/s3.c
+41 −1 source/s3_auto_ranged_get.c
+224 −178 source/s3_auto_ranged_put.c
+207 −45 source/s3_client.c
+6 −7 source/s3_copy_object.c
+1 −1 source/s3_default_meta_request.c
+75 −33 source/s3_meta_request.c
+30 −19 source/s3_paginator.c
+2 −13 source/s3_request.c
+5 −5 source/s3_request_messages.c
+55 −5 source/s3_util.c
+30 −14 tests/CMakeLists.txt
+6 −0 tests/mock_s3_server/AbortMultipartUpload/default.json
+14 −0 tests/mock_s3_server/CompleteMultipartUpload/async_access_denied_error.json
+14 −0 tests/mock_s3_server/CompleteMultipartUpload/async_internal_error.json
+13 −0 tests/mock_s3_server/CompleteMultipartUpload/default.json
+12 −0 tests/mock_s3_server/CreateMultipartUpload/default.json
+7 −0 tests/mock_s3_server/GetObject/get_object_modified_failure.json
+14 −0 tests/mock_s3_server/GetObject/get_object_modified_first_part.json
+10 −0 tests/mock_s3_server/GetObject/get_object_modified_success.json
+47 −0 tests/mock_s3_server/README.md
+6 −0 tests/mock_s3_server/UploadPart/default.json
+325 −0 tests/mock_s3_server/mock_s3_server.py
+9 −8 tests/s3_cancel_tests.c
+285 −178 tests/s3_data_plane_tests.c
+2 −2 tests/s3_endpoint_tests.c
+188 −0 tests/s3_mock_server_tests.c
+6 −7 tests/s3_retry_tests.c
+57 −25 tests/s3_tester.c
+16 −1 tests/s3_tester.h
+52 −2 tests/s3_util_tests.c
+47 −0 tests/test_helper/README.md
+142 −0 tests/test_helper/test_helper.py
2 changes: 1 addition & 1 deletion contrib/aws-c-sdkutils
2 changes: 1 addition & 1 deletion contrib/aws-checksums
6 changes: 3 additions & 3 deletions contrib/aws-cmake/CMakeLists.txt
Expand Up @@ -52,8 +52,8 @@ endif()

# Directories.
SET(AWS_SDK_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws")
SET(AWS_SDK_CORE_DIR "${AWS_SDK_DIR}/aws-cpp-sdk-core")
SET(AWS_SDK_S3_DIR "${AWS_SDK_DIR}/aws-cpp-sdk-s3")
SET(AWS_SDK_CORE_DIR "${AWS_SDK_DIR}/src/aws-cpp-sdk-core")
SET(AWS_SDK_S3_DIR "${AWS_SDK_DIR}/generated/src/aws-cpp-sdk-s3")

SET(AWS_AUTH_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-auth")
SET(AWS_CAL_DIR "${ClickHouse_SOURCE_DIR}/contrib/aws-c-cal")
Expand Down Expand Up @@ -118,7 +118,7 @@ configure_file("${AWS_SDK_CORE_DIR}/include/aws/core/SDKConfig.h.in"
list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MAJOR=1")
list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_MINOR=10")
list(APPEND AWS_PUBLIC_COMPILE_DEFS "-DAWS_SDK_VERSION_PATCH=36")

list(APPEND AWS_SOURCES ${AWS_SDK_CORE_SRC} ${AWS_SDK_CORE_NET_SRC} ${AWS_SDK_CORE_PLATFORM_SRC})

list(APPEND AWS_PUBLIC_INCLUDES
Expand Down
2 changes: 1 addition & 1 deletion contrib/aws-s2n-tls
Submodule aws-s2n-tls updated 719 files
2 changes: 1 addition & 1 deletion contrib/libpqxx
4 changes: 2 additions & 2 deletions contrib/sparse-checkout/update-aws.sh
Expand Up @@ -5,8 +5,8 @@ echo "Using sparse checkout for aws"
FILES_TO_CHECKOUT=$(git rev-parse --git-dir)/info/sparse-checkout
echo '/*' > $FILES_TO_CHECKOUT
echo '!/*/*' >> $FILES_TO_CHECKOUT
echo '/aws-cpp-sdk-core/*' >> $FILES_TO_CHECKOUT
echo '/aws-cpp-sdk-s3/*' >> $FILES_TO_CHECKOUT
echo '/src/aws-cpp-sdk-core/*' >> $FILES_TO_CHECKOUT
echo '/generated/src/aws-cpp-sdk-s3/*' >> $FILES_TO_CHECKOUT

git config core.sparsecheckout true
git checkout $1
Expand Down
3 changes: 3 additions & 0 deletions docker/test/stateless/run.sh
Expand Up @@ -132,6 +132,9 @@ function run_tests()

ADDITIONAL_OPTIONS+=('--report-logs-stats')

clickhouse-test "00001_select_1" > /dev/null ||:
clickhouse-client -q "insert into system.zookeeper (name, path, value) values ('auxiliary_zookeeper2', '/test/chroot/', '')" ||:

set +e
clickhouse-test --testname --shard --zookeeper --check-zookeeper-session --hung-check --print-time \
--test-runs "$NUM_TRIES" "${ADDITIONAL_OPTIONS[@]}" 2>&1 \
Expand Down
6 changes: 6 additions & 0 deletions docker/test/upgrade/run.sh
Expand Up @@ -65,6 +65,9 @@ sudo cat /etc/clickhouse-server/config.d/storage_conf.xml \
> /etc/clickhouse-server/config.d/storage_conf.xml.tmp
sudo mv /etc/clickhouse-server/config.d/storage_conf.xml.tmp /etc/clickhouse-server/config.d/storage_conf.xml

# it contains some new settings, but we can safely remove it
rm /etc/clickhouse-server/config.d/merge_tree.xml

start
stop
mv /var/log/clickhouse-server/clickhouse-server.log /var/log/clickhouse-server/clickhouse-server.initial.log
Expand Down Expand Up @@ -94,6 +97,9 @@ sudo cat /etc/clickhouse-server/config.d/storage_conf.xml \
> /etc/clickhouse-server/config.d/storage_conf.xml.tmp
sudo mv /etc/clickhouse-server/config.d/storage_conf.xml.tmp /etc/clickhouse-server/config.d/storage_conf.xml

# it contains some new settings, but we can safely remove it
rm /etc/clickhouse-server/config.d/merge_tree.xml

start

clickhouse-client --query="SELECT 'Server version: ', version()"
Expand Down
2 changes: 1 addition & 1 deletion docs/en/engines/table-engines/special/distributed.md
Expand Up @@ -258,4 +258,4 @@ Since [remote](../../../sql-reference/table-functions/remote.md) and [cluster](.

- [Virtual columns](../../../engines/table-engines/index.md#table_engines-virtual_columns) description
- [background_distributed_schedule_pool_size](../../../operations/settings/settings.md#background_distributed_schedule_pool_size) setting
- [shardNum()](../../../sql-reference/functions/other-functions.md#shard-num) and [shardCount()](../../../sql-reference/functions/other-functions.md#shard-count) functions
- [shardNum()](../../../sql-reference/functions/other-functions.md#shardnum) and [shardCount()](../../../sql-reference/functions/other-functions.md#shardcount) functions
8 changes: 4 additions & 4 deletions docs/en/interfaces/cli.md
Expand Up @@ -177,11 +177,11 @@ You can pass parameters to `clickhouse-client` (all parameters have a default va
- `--user, -u` – The username. Default value: default.
- `--password` – The password. Default value: empty string.
- `--ask-password` - Prompt the user to enter a password.
- `--query, -q` – The query to process when using non-interactive mode. You must specify either `query` or `queries-file` option.
- `--queries-file` – file path with queries to execute. You must specify either `query` or `queries-file` option.
- `--database, -d` – Select the current default database. Default value: the current database from the server settings (‘default’ by default).
- `--multiline, -m` – If specified, allow multiline queries (do not send the query on Enter).
- `--query, -q` – The query to process when using non-interactive mode. Cannot be used simultaneously with `--queries-file`.
- `--queries-file` – file path with queries to execute. Cannot be used simultaneously with `--query`.
- `--multiquery, -n` – If specified, multiple queries separated by semicolons can be listed after the `--query` option. For convenience, it is also possible to omit `--query` and pass the queries directly after `--multiquery`.
- `--multiline, -m` – If specified, allow multiline queries (do not send the query on Enter).
- `--database, -d` – Select the current default database. Default value: the current database from the server settings (‘default’ by default).
- `--format, -f` – Use the specified default format to output the result.
- `--vertical, -E` – If specified, use the [Vertical format](../interfaces/formats.md#vertical) by default to output the result. This is the same as `–format=Vertical`. In this format, each value is printed on a separate line, which is helpful when displaying wide tables.
- `--time, -t` – If specified, print the query execution time to ‘stderr’ in non-interactive mode.
Expand Down
6 changes: 3 additions & 3 deletions docs/en/operations/named-collections.md
Expand Up @@ -167,9 +167,9 @@ user = 'myuser',
password = 'mypass',
host = '127.0.0.1',
port = 3306,
database = 'test'
connection_pool_size = 8
on_duplicate_clause = 1
database = 'test',
connection_pool_size = 8,
on_duplicate_clause = 1,
replace_query = 1
```

Expand Down
26 changes: 24 additions & 2 deletions docs/en/operations/server-configuration-parameters/settings.md
Expand Up @@ -917,9 +917,9 @@ We recommend using this option in macOS since the `getrlimit()` function returns

Restriction on deleting tables.

If the size of a [MergeTree](../../engines/table-engines/mergetree-family/mergetree.md) table exceeds `max_table_size_to_drop` (in bytes), you can’t delete it using a DROP query.
If the size of a [MergeTree](../../engines/table-engines/mergetree-family/mergetree.md) table exceeds `max_table_size_to_drop` (in bytes), you can’t delete it using a [DROP](../../sql-reference/statements/drop.md) query or [TRUNCATE](../../sql-reference/statements/truncate.md) query.

If you still need to delete the table without restarting the ClickHouse server, create the `<clickhouse-path>/flags/force_drop_table` file and run the DROP query.
This setting does not require a restart of the Clickhouse server to apply. Another way to disable the restriction is to create the `<clickhouse-path>/flags/force_drop_table` file.

Default value: 50 GB.

Expand All @@ -931,6 +931,28 @@ The value 0 means that you can delete all tables without any restrictions.
<max_table_size_to_drop>0</max_table_size_to_drop>
```

## max_partition_size_to_drop {#max-partition-size-to-drop}

Restriction on dropping partitions.

If the size of a [MergeTree](../../engines/table-engines/mergetree-family/mergetree.md) table exceeds `max_partition_size_to_drop` (in bytes), you can’t drop a partition using a [DROP PARTITION](../../sql-reference/statements/alter/partition.md#drop-partitionpart) query.

This setting does not require a restart of the Clickhouse server to apply. Another way to disable the restriction is to create the `<clickhouse-path>/flags/force_drop_table` file.

Default value: 50 GB.

The value 0 means that you can drop partitions without any restrictions.

:::note
This limitation does not restrict drop table and truncate table, see [max_table_size_to_drop](#max-table-size-to-drop)
:::

**Example**

``` xml
<max_partition_size_to_drop>0</max_partition_size_to_drop>
```

## max_thread_pool_size {#max-thread-pool-size}

ClickHouse uses threads from the Global Thread pool to process queries. If there is no idle thread to process a query, then a new thread is created in the pool. `max_thread_pool_size` limits the maximum number of threads in the pool.
Expand Down
27 changes: 27 additions & 0 deletions docs/en/operations/system-tables/build_options.md
@@ -0,0 +1,27 @@
---
slug: /en/operations/system-tables/build_options
---
# build_options

Contains information about the ClickHouse server's build options.

Columns:

- `name` (String) — Name of the build option, e.g. `USE_ODBC`
- `value` (String) — Value of the build option, e.g. `1`

**Example**

``` sql
SELECT * FROM system.build_options LIMIT 5
```

``` text
┌─name─────────────┬─value─┐
│ USE_BROTLI │ 1 │
│ USE_BZIP2 │ 1 │
│ USE_CAPNP │ 1 │
│ USE_CASSANDRA │ 1 │
│ USE_DATASKETCHES │ 1 │
└──────────────────┴───────┘
```
8 changes: 5 additions & 3 deletions docs/en/operations/system-tables/processors_profile_log.md
Expand Up @@ -5,16 +5,18 @@ This table contains profiling on processors level (that you can find in [`EXPLAI
Columns:

- `event_date` ([Date](../../sql-reference/data-types/date.md)) — The date when the event happened.
- `event_time` ([DateTime64](../../sql-reference/data-types/datetime64.md)) — The date and time when the event happened.
- `event_time` ([DateTime](../../sql-reference/data-types/datetime.md)) — The date and time when the event happened.
- `event_time_microseconds` ([DateTime64](../../sql-reference/data-types/datetime64.md)) — The date and time with microseconds precision when the event happened.
- `id` ([UInt64](../../sql-reference/data-types/int-uint.md)) — ID of processor
- `parent_ids` ([Array(UInt64)](../../sql-reference/data-types/array.md)) — Parent processors IDs
- `plan_step` ([UInt64](../../sql-reference/data-types/int-uint.md)) — ID of the query plan step which created this processor. The value is zero if the processor was not added from any step.
- `plan_group` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Group of the processor if it was created by query plan step. A group is a logical partitioning of processors added from the same query plan step. Group is used only for beautifying the result of EXPLAIN PIPELINE result.
- `initial_query_id` ([String](../../sql-reference/data-types/string.md)) — ID of the initial query (for distributed query execution).
- `query_id` ([String](../../sql-reference/data-types/string.md)) — ID of the query
- `name` ([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md)) — Name of the processor.
- `elapsed_us` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Number of microseconds this processor was executed.
- `input_wait_elapsed_us` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Number of microseconds this processor was waiting for data (from other processor).
- `output_wait_elapsed_us` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Number of microseconds this processor was waiting because output port was full.
- `plan_step` ([UInt64](../../sql-reference/data-types/int-uint.md)) — ID of the query plan step which created this processor. The value is zero if the processor was not added from any step.
- `plan_group` ([UInt64](../../sql-reference/data-types/int-uint.md)) — Group of the processor if it was created by query plan step. A group is a logical partitioning of processors added from the same query plan step. Group is used only for beautifying the result of EXPLAIN PIPELINE result.
- `input_rows` ([UInt64](../../sql-reference/data-types/int-uint.md)) — The number of rows consumed by processor.
- `input_bytes` ([UInt64](../../sql-reference/data-types/int-uint.md)) — The number of bytes consumed by processor.
- `output_rows` ([UInt64](../../sql-reference/data-types/int-uint.md)) — The number of rows generated by processor.
Expand Down
3 changes: 2 additions & 1 deletion docs/en/operations/system-tables/query_log.md
Expand Up @@ -59,9 +59,10 @@ Columns:
- `query_kind` ([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md)) — Type of the query.
- `databases` ([Array](../../sql-reference/data-types/array.md)([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md))) — Names of the databases present in the query.
- `tables` ([Array](../../sql-reference/data-types/array.md)([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md))) — Names of the tables present in the query.
- `views` ([Array](../../sql-reference/data-types/array.md)([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md))) — Names of the (materialized or live) views present in the query.
- `columns` ([Array](../../sql-reference/data-types/array.md)([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md))) — Names of the columns present in the query.
- `partitions` ([Array](../../sql-reference/data-types/array.md)([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md))) — Names of the partitions present in the query.
- `projections` ([String](../../sql-reference/data-types/string.md)) — Names of the projections used during the query execution.
- `views` ([Array](../../sql-reference/data-types/array.md)([LowCardinality(String)](../../sql-reference/data-types/lowcardinality.md))) — Names of the (materialized or live) views present in the query.
- `exception_code` ([Int32](../../sql-reference/data-types/int-uint.md)) — Code of an exception.
- `exception` ([String](../../sql-reference/data-types/string.md)) — Exception message.
- `stack_trace` ([String](../../sql-reference/data-types/string.md)) — [Stack trace](https://en.wikipedia.org/wiki/Stack_trace). An empty string, if the query was completed successfully.
Expand Down
6 changes: 3 additions & 3 deletions docs/en/operations/utilities/clickhouse-local.md
Expand Up @@ -183,12 +183,12 @@ Arguments:
- `-S`, `--structure` — table structure for input data.
- `--input-format` — input format, `TSV` by default.
- `-f`, `--file` — path to data, `stdin` by default.
- `-q`, `--query` — queries to execute with `;` as delimiter. You must specify either `query` or `queries-file` option.
- `--queries-file` - file path with queries to execute. You must specify either `query` or `queries-file` option.
- `-q`, `--query` — queries to execute with `;` as delimiter. Cannot be used simultaneously with `--queries-file`.
- `--queries-file` - file path with queries to execute. Cannot be used simultaneously with `--query`.
- `--multiquery, -n` – If specified, multiple queries separated by semicolons can be listed after the `--query` option. For convenience, it is also possible to omit `--query` and pass the queries directly after `--multiquery`.
- `-N`, `--table` — table name where to put output data, `table` by default.
- `--format`, `--output-format` — output format, `TSV` by default.
- `-d`, `--database` — default database, `_local` by default.
- `--multiquery, -n` – If specified, multiple queries separated by semicolons can be listed after the `--query` option. For convenience, it is also possible to omit `--query` and pass the queries directly after `--multiquery`.
- `--stacktrace` — whether to dump debug output in case of exception.
- `--echo` — print query before execution.
- `--verbose` — more details on query execution.
Expand Down
Expand Up @@ -3,7 +3,7 @@ slug: /en/sql-reference/aggregate-functions/reference/last_value
sidebar_position: 8
---

# first_value
# last_value

Selects the last encountered value, similar to `anyLast`, but could accept NULL.

Expand Down
42 changes: 40 additions & 2 deletions docs/en/sql-reference/functions/string-functions.md
Expand Up @@ -323,11 +323,11 @@ Alias: `REPEAT`
**Arguments**

- `s` — The string to repeat. [String](../../sql-reference/data-types/string.md).
- `n` — The number of times to repeat the string. [UInt or Int](../../sql-reference/data-types/int-uint.md).
- `n` — The number of times to repeat the string. [UInt* or Int*](../../sql-reference/data-types/int-uint.md).

**Returned value**

The single string containing string `s` repeated `n` times. If `n` \< 1, the function returns empty string.
A string containing string `s` repeated `n` times. If `n` <= 0, the function returns the empty string.

Type: `String`.

Expand All @@ -345,6 +345,44 @@ Result:
└────────────────────────────────┘
```

## space

Concatenates a space (` `) as many times with itself as specified.

**Syntax**

``` sql
space(n)
```

Alias: `SPACE`.

**Arguments**

- `n` — The number of times to repeat the space. [UInt* or Int*](../../sql-reference/data-types/int-uint.md).

**Returned value**

The string containing string ` ` repeated `n` times. If `n` <= 0, the function returns the empty string.

Type: `String`.

**Example**

Query:

``` sql
SELECT space(3);
```

Result:

``` text
┌─space(3) ────┐
│ │
└──────────────┘
```

## reverse

Reverses the sequence of bytes in a string.
Expand Down

0 comments on commit 1bf32f7

Please sign in to comment.