Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ if (COMPILER_CLANG)
if (NOT CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -gdwarf-aranges")
endif ()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fuse-ctor-homing")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xclang -fuse-ctor-homing")
endif()
endif()
endif ()

# If turned `ON`, assumes the user has either the system GTest library or the bundled one.
Expand Down
4 changes: 4 additions & 0 deletions docs/en/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ You can also download and install packages manually from [here](https://repo.cli
- `clickhouse-client` — Creates a symbolic link for `clickhouse-client` and other client-related tools. and installs client configuration files.
- `clickhouse-common-static-dbg` — Installs ClickHouse compiled binary files with debug info.

!!! attention "Attention"
If you need to install specific version of ClickHouse you have to install all packages with the same version:
`sudo apt-get install clickhouse-server=21.8.5.7 clickhouse-client=21.8.5.7 clickhouse-common-static=21.8.5.7`

### From RPM Packages {#from-rpm-packages}

It is recommended to use official pre-compiled `rpm` packages for CentOS, RedHat, and all other rpm-based Linux distributions.
Expand Down
6 changes: 6 additions & 0 deletions docs/en/interfaces/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,8 @@ You can insert Parquet data from a file into ClickHouse table by the following c
$ cat {filename} | clickhouse-client --query="INSERT INTO {some_table} FORMAT Parquet"
```

To insert data into [Nested](../sql-reference/data-types/nested-data-structures/nested.md) columns as an array of structs values you must switch on the [input_format_parquet_import_nested](../operations/settings/settings.md#input_format_parquet_import_nested) setting.

You can select data from a ClickHouse table and save them into some file in the Parquet format by the following command:

``` bash
Expand Down Expand Up @@ -1328,6 +1330,8 @@ You can insert Arrow data from a file into ClickHouse table by the following com
$ cat filename.arrow | clickhouse-client --query="INSERT INTO some_table FORMAT Arrow"
```

To insert data into [Nested](../sql-reference/data-types/nested-data-structures/nested.md) columns as an array of structs values you must switch on the [input_format_arrow_import_nested](../operations/settings/settings.md#input_format_arrow_import_nested) setting.

### Selecting Data {#selecting-data-arrow}

You can select data from a ClickHouse table and save them into some file in the Arrow format by the following command:
Expand Down Expand Up @@ -1384,6 +1388,8 @@ You can insert ORC data from a file into ClickHouse table by the following comma
$ cat filename.orc | clickhouse-client --query="INSERT INTO some_table FORMAT ORC"
```

To insert data into [Nested](../sql-reference/data-types/nested-data-structures/nested.md) columns as an array of structs values you must switch on the [input_format_orc_import_nested](../operations/settings/settings.md#input_format_orc_import_nested) setting.

### Selecting Data {#selecting-data-2}

You can select data from a ClickHouse table and save them into some file in the ORC format by the following command:
Expand Down
33 changes: 33 additions & 0 deletions docs/en/operations/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,39 @@ If an error occurred while reading rows but the error counter is still less than

If both `input_format_allow_errors_num` and `input_format_allow_errors_ratio` are exceeded, ClickHouse throws an exception.

## input_format_parquet_import_nested {#input_format_parquet_import_nested}

Enables or disables the ability to insert the data into [Nested](../../sql-reference/data-types/nested-data-structures/nested.md) columns as an array of structs in [Parquet](../../interfaces/formats.md#data-format-parquet) input format.

Possible values:

- 0 — Data can not be inserted into `Nested` columns as an array of structs.
- 1 — Data can be inserted into `Nested` columns as an array of structs.

Default value: `0`.

## input_format_arrow_import_nested {#input_format_arrow_import_nested}

Enables or disables the ability to insert the data into [Nested](../../sql-reference/data-types/nested-data-structures/nested.md) columns as an array of structs in [Arrow](../../interfaces/formats.md#data_types-matching-arrow) input format.

Possible values:

- 0 — Data can not be inserted into `Nested` columns as an array of structs.
- 1 — Data can be inserted into `Nested` columns as an array of structs.

Default value: `0`.

## input_format_orc_import_nested {#input_format_orc_import_nested}

Enables or disables the ability to insert the data into [Nested](../../sql-reference/data-types/nested-data-structures/nested.md) columns as an array of structs in [ORC](../../interfaces/formats.md#data-format-orc) input format.

Possible values:

- 0 — Data can not be inserted into `Nested` columns as an array of structs.
- 1 — Data can be inserted into `Nested` columns as an array of structs.

Default value: `0`.

## input_format_values_interpret_expressions {#settings-input_format_values_interpret_expressions}

Enables or disables the full SQL parser if the fast stream parser can’t parse the data. This setting is used only for the [Values](../../interfaces/formats.md#data-format-values) format at the data insertion. For more information about syntax parsing, see the [Syntax](../../sql-reference/syntax.md) section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ toc_priority: 57
toc_title: Nested(Name1 Type1, Name2 Type2, ...)
---

# Nested(name1 Type1, Name2 Type2, …) {#nestedname1-type1-name2-type2}
# Nested {#nested}

## Nested(name1 Type1, Name2 Type2, …) {#nestedname1-type1-name2-type2}

A nested data structure is like a table inside a cell. The parameters of a nested data structure – the column names and types – are specified the same way as in a [CREATE TABLE](../../../sql-reference/statements/create/table.md) query. Each table row can correspond to any number of rows in a nested data structure.

Expand Down
13 changes: 13 additions & 0 deletions docs/ru/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not su

Если вы хотите использовать наиболее свежую версию, замените `stable` на `testing` (рекомендуется для тестовых окружений).

Также вы можете вручную скачать и установить пакеты из [репозитория](https://repo.clickhouse.tech/deb/stable/main/).

#### Пакеты {#packages}

- `clickhouse-common-static` — Устанавливает исполняемые файлы ClickHouse.
- `clickhouse-server` — Создает символические ссылки для `clickhouse-server` и устанавливает конфигурационные файлы.
- `clickhouse-client` — Создает символические ссылки для `clickhouse-client` и других клиентских инструментов и устанавливает конфигурационные файлы `clickhouse-client`.
- `clickhouse-common-static-dbg` — Устанавливает исполняемые файлы ClickHouse собранные с отладочной информацией.

!!! attention "Внимание"
Если вам нужно установить ClickHouse определенной версии, вы должны установить все пакеты одной версии:
`sudo apt-get install clickhouse-server=21.8.5.7 clickhouse-client=21.8.5.7 clickhouse-common-static=21.8.5.7`

### Из RPM пакетов {#from-rpm-packages}

Команда ClickHouse в Яндексе рекомендует использовать официальные предкомпилированные `rpm` пакеты для CentOS, RedHat и всех остальных дистрибутивов Linux, основанных на rpm.
Expand Down
12 changes: 9 additions & 3 deletions docs/ru/interfaces/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -1180,14 +1180,16 @@ ClickHouse поддерживает настраиваемую точность

Типы данных столбцов в ClickHouse могут отличаться от типов данных соответствующих полей файла в формате Parquet. При вставке данных ClickHouse интерпретирует типы данных в соответствии с таблицей выше, а затем [приводит](../sql-reference/functions/type-conversion-functions/#type_conversion_function-cast) данные к тому типу, который установлен для столбца таблицы.

### Вставка и выборка данных {#vstavka-i-vyborka-dannykh}
### Вставка и выборка данных {#inserting-and-selecting-data}

Чтобы вставить в ClickHouse данные из файла в формате Parquet, выполните команду следующего вида:

``` bash
$ cat {filename} | clickhouse-client --query="INSERT INTO {some_table} FORMAT Parquet"
```

Чтобы вставить данные в колонки типа [Nested](../sql-reference/data-types/nested-data-structures/nested.md) в виде массива структур, нужно включить настройку [input_format_parquet_import_nested](../operations/settings/settings.md#input_format_parquet_import_nested).

Чтобы получить данные из таблицы ClickHouse и сохранить их в файл формата Parquet, используйте команду следующего вида:

``` bash
Expand Down Expand Up @@ -1246,6 +1248,8 @@ ClickHouse поддерживает настраиваемую точность
$ cat filename.arrow | clickhouse-client --query="INSERT INTO some_table FORMAT Arrow"
```

Чтобы вставить данные в колонки типа [Nested](../sql-reference/data-types/nested-data-structures/nested.md) в виде массива структур, нужно включить настройку [input_format_arrow_import_nested](../operations/settings/settings.md#input_format_arrow_import_nested).

### Вывод данных {#selecting-data-arrow}

Чтобы получить данные из таблицы ClickHouse и сохранить их в файл формата Arrow, используйте команду следующего вида:
Expand Down Expand Up @@ -1294,15 +1298,17 @@ ClickHouse поддерживает настраиваемую точность

Типы данных столбцов в таблицах ClickHouse могут отличаться от типов данных для соответствующих полей ORC. При вставке данных ClickHouse интерпретирует типы данных ORC согласно таблице соответствия, а затем [приводит](../sql-reference/functions/type-conversion-functions/#type_conversion_function-cast) данные к типу, установленному для столбца таблицы ClickHouse.

### Вставка данных {#vstavka-dannykh-1}
### Вставка данных {#inserting-data-2}

Чтобы вставить в ClickHouse данные из файла в формате ORC, используйте команду следующего вида:

``` bash
$ cat filename.orc | clickhouse-client --query="INSERT INTO some_table FORMAT ORC"
```

### Вывод данных {#vyvod-dannykh-1}
Чтобы вставить данные в колонки типа [Nested](../sql-reference/data-types/nested-data-structures/nested.md) в виде массива структур, нужно включить настройку [input_format_orc_import_nested](../operations/settings/settings.md#input_format_orc_import_nested).

### Вывод данных {#selecting-data-2}

Чтобы получить данные из таблицы ClickHouse и сохранить их в файл формата ORC, используйте команду следующего вида:

Expand Down
33 changes: 33 additions & 0 deletions docs/ru/operations/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,39 @@ ClickHouse применяет настройку в тех случаях, ко

В случае превышения `input_format_allow_errors_ratio` ClickHouse генерирует исключение.

## input_format_parquet_import_nested {#input_format_parquet_import_nested}

Включает или отключает возможность вставки данных в колонки типа [Nested](../../sql-reference/data-types/nested-data-structures/nested.md) в виде массива структур в формате ввода [Parquet](../../interfaces/formats.md#data-format-parquet).

Возможные значения:

- 0 — данные не могут быть вставлены в колонки типа `Nested` в виде массива структур.
- 0 — данные могут быть вставлены в колонки типа `Nested` в виде массива структур.

Значение по умолчанию: `0`.

## input_format_arrow_import_nested {#input_format_arrow_import_nested}

Включает или отключает возможность вставки данных в колонки типа [Nested](../../sql-reference/data-types/nested-data-structures/nested.md) в виде массива структур в формате ввода [Arrow](../../interfaces/formats.md#data_types-matching-arrow).

Возможные значения:

- 0 — данные не могут быть вставлены в колонки типа `Nested` в виде массива структур.
- 0 — данные могут быть вставлены в колонки типа `Nested` в виде массива структур.

Значение по умолчанию: `0`.

## input_format_orc_import_nested {#input_format_orc_import_nested}

Включает или отключает возможность вставки данных в колонки типа [Nested](../../sql-reference/data-types/nested-data-structures/nested.md) в виде массива структур в формате ввода [ORC](../../interfaces/formats.md#data-format-orc).

Возможные значения:

- 0 — данные не могут быть вставлены в колонки типа `Nested` в виде массива структур.
- 0 — данные могут быть вставлены в колонки типа `Nested` в виде массива структур.

Значение по умолчанию: `0`.

## input_format_values_interpret_expressions {#settings-input_format_values_interpret_expressions}

Включает или отключает парсер SQL, если потоковый парсер не может проанализировать данные. Этот параметр используется только для формата [Values](../../interfaces/formats.md#data-format-values) при вставке данных. Дополнительные сведения о парсерах читайте в разделе [Синтаксис](../../sql-reference/syntax.md).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Nested(Name1 Type1, Name2 Type2, …) {#nestedname1-type1-name2-type2}
# Nested {#nested}

## Nested(Name1 Type1, Name2 Type2, …) {#nestedname1-type1-name2-type2}

Вложенная структура данных - это как будто вложенная таблица. Параметры вложенной структуры данных - имена и типы столбцов, указываются так же, как у запроса CREATE. Каждой строке таблицы может соответствовать произвольное количество строк вложенной структуры данных.

Expand Down Expand Up @@ -95,4 +97,3 @@ LIMIT 10
При запросе DESCRIBE, столбцы вложенной структуры данных перечисляются так же по отдельности.

Работоспособность запроса ALTER для элементов вложенных структур данных, является сильно ограниченной.

1 change: 1 addition & 0 deletions src/Storages/MergeTree/MergeTreeSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct Settings;
M(Bool, replicated_can_become_leader, true, "If true, Replicated tables replicas on this node will try to acquire leadership.", 0) \
M(Seconds, zookeeper_session_expiration_check_period, 60, "ZooKeeper session expiration check period, in seconds.", 0) \
M(Bool, detach_old_local_parts_when_cloning_replica, true, "Do not remove old local parts when repairing lost replica.", 0) \
M(Bool, detach_not_byte_identical_parts, false, "Do not remove non byte-idential parts for ReplicatedMergeTree, instead detach them (maybe useful for further analysis).", 0) \
M(UInt64, max_replicated_fetches_network_bandwidth, 0, "The maximum speed of data exchange over the network in bytes per second for replicated fetches. Zero means unlimited.", 0) \
M(UInt64, max_replicated_sends_network_bandwidth, 0, "The maximum speed of data exchange over the network in bytes per second for replicated sends. Zero means unlimited.", 0) \
\
Expand Down
10 changes: 8 additions & 2 deletions src/Storages/StorageReplicatedMergeTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,10 @@ bool StorageReplicatedMergeTree::tryExecuteMerge(const LogEntry & entry)

write_part_log(ExecutionStatus::fromCurrentException());

tryRemovePartImmediately(std::move(part));
if (storage_settings_ptr->detach_not_byte_identical_parts)
forgetPartAndMoveToDetached(std::move(part), "merge-not-byte-identical");
else
tryRemovePartImmediately(std::move(part));
/// No need to delete the part from ZK because we can be sure that the commit transaction
/// didn't go through.

Expand Down Expand Up @@ -1935,7 +1938,10 @@ bool StorageReplicatedMergeTree::tryExecutePartMutation(const StorageReplicatedM

write_part_log(ExecutionStatus::fromCurrentException());

tryRemovePartImmediately(std::move(new_part));
if (storage_settings_ptr->detach_not_byte_identical_parts)
forgetPartAndMoveToDetached(std::move(new_part), "mutate-not-byte-identical");
else
tryRemovePartImmediately(std::move(new_part));
/// No need to delete the part from ZK because we can be sure that the commit transaction
/// didn't go through.

Expand Down