Skip to content

Commit

Permalink
Merge branch 'master' into keeper-disk-move-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio2368 committed Feb 27, 2024
2 parents 89789f8 + 466cf93 commit 5530ad5
Show file tree
Hide file tree
Showing 75 changed files with 937 additions and 1,034 deletions.
8 changes: 8 additions & 0 deletions docs/en/engines/table-engines/special/distributed.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ Specifying the `sharding_key` is necessary for the following:

`fsync_directories` - do the `fsync` for directories. Guarantees that the OS refreshed directory metadata after operations related to background inserts on Distributed table (after insert, after sending the data to shard, etc.).

#### skip_unavailable_shards

`skip_unavailable_shards` - If true, ClickHouse silently skips unavailable shards. Shard is marked as unavailable when: 1) The shard cannot be reached due to a connection failure. 2) Shard is unresolvable through DNS. 3) Table does not exist on the shard. Default false.

#### bytes_to_throw_insert

`bytes_to_throw_insert` - if more than this number of compressed bytes will be pending for background INSERT, an exception will be thrown. 0 - do not throw. Default 0.
Expand Down Expand Up @@ -102,6 +106,10 @@ Specifying the `sharding_key` is necessary for the following:

`background_insert_max_sleep_time_ms` - same as [distributed_background_insert_max_sleep_time_ms](../../../operations/settings/settings.md#distributed_background_insert_max_sleep_time_ms)

#### flush_on_detach

`flush_on_detach` - Flush data to remote nodes on DETACH/DROP/server shutdown. Default true.

:::note
**Durability settings** (`fsync_...`):

Expand Down
18 changes: 6 additions & 12 deletions docs/en/operations/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -3449,7 +3449,7 @@ Has an effect only when the connection is made through the MySQL wire protocol.
- 0 - Use `BLOB`.
- 1 - Use `TEXT`.

Default value: `0`.
Default value: `1`.

## mysql_map_fixed_string_to_text_in_show_columns {#mysql_map_fixed_string_to_text_in_show_columns}

Expand All @@ -3460,7 +3460,7 @@ Has an effect only when the connection is made through the MySQL wire protocol.
- 0 - Use `BLOB`.
- 1 - Use `TEXT`.

Default value: `0`.
Default value: `1`.

## execute_merges_on_single_replica_time_threshold {#execute-merges-on-single-replica-time-threshold}

Expand Down Expand Up @@ -3710,7 +3710,7 @@ Default value: `0`.

## allow_experimental_live_view {#allow-experimental-live-view}

Allows creation of experimental [live views](../../sql-reference/statements/create/view.md/#live-view).
Allows creation of a deprecated LIVE VIEW.

Possible values:

Expand All @@ -3721,21 +3721,15 @@ Default value: `0`.

## live_view_heartbeat_interval {#live-view-heartbeat-interval}

Sets the heartbeat interval in seconds to indicate [live view](../../sql-reference/statements/create/view.md/#live-view) is alive .

Default value: `15`.
Deprecated.

## max_live_view_insert_blocks_before_refresh {#max-live-view-insert-blocks-before-refresh}

Sets the maximum number of inserted blocks after which mergeable blocks are dropped and query for [live view](../../sql-reference/statements/create/view.md/#live-view) is re-executed.

Default value: `64`.
Deprecated.

## periodic_live_view_refresh {#periodic-live-view-refresh}

Sets the interval in seconds after which periodically refreshed [live view](../../sql-reference/statements/create/view.md/#live-view) is forced to refresh.

Default value: `60`.
Deprecated.

## http_connection_timeout {#http_connection_timeout}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
slug: /en/sql-reference/aggregate-functions/reference/grouparrayintersect
sidebar_position: 115
---

# groupArrayIntersect

Return an intersection of given arrays (Return all items of arrays, that are in all given arrays).

**Syntax**

``` sql
groupArrayIntersect(x)
```

**Arguments**

- `x` — Argument (column name or expression).

**Returned values**

- Array that contains elements that are in all arrays.

Type: [Array](../../data-types/array.md).

**Examples**

Consider table `numbers`:

``` text
┌─a──────────────┐
│ [1,2,4] │
│ [1,5,2,8,-1,0] │
│ [1,5,7,5,8,2] │
└────────────────┘
```

Query with column name as argument:

``` sql
SELECT groupArrayIntersect(a) as intersection FROM numbers;
```

Result:

```text
┌─intersection──────┐
│ [1, 2] │
└───────────────────┘
```
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ClickHouse-specific aggregate functions:
- [groupArrayMovingSum](/docs/en/sql-reference/aggregate-functions/reference/grouparraymovingsum.md)
- [groupArraySample](./grouparraysample.md)
- [groupArraySorted](/docs/en/sql-reference/aggregate-functions/reference/grouparraysorted.md)
- [groupArrayIntersect](./grouparrayintersect.md)
- [groupBitAnd](/docs/en/sql-reference/aggregate-functions/reference/groupbitand.md)
- [groupBitOr](/docs/en/sql-reference/aggregate-functions/reference/groupbitor.md)
- [groupBitXor](/docs/en/sql-reference/aggregate-functions/reference/groupbitxor.md)
Expand Down
14 changes: 4 additions & 10 deletions docs/ru/operations/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -3258,7 +3258,7 @@ SELECT * FROM test2;

## allow_experimental_live_view {#allow-experimental-live-view}

Включает экспериментальную возможность использования [LIVE-представлений](../../sql-reference/statements/create/view.md#live-view).
Включает устаревшую возможность использования [LIVE-представлений](../../sql-reference/statements/create/view.md#live-view).

Возможные значения:
- 0 — живые представления не поддерживаются.
Expand All @@ -3268,21 +3268,15 @@ SELECT * FROM test2;

## live_view_heartbeat_interval {#live-view-heartbeat-interval}

Задает интервал в секундах для периодической проверки существования [LIVE VIEW](../../sql-reference/statements/create/view.md#live-view).

Значение по умолчанию: `15`.
Устарело.

## max_live_view_insert_blocks_before_refresh {#max-live-view-insert-blocks-before-refresh}

Задает наибольшее число вставок, после которых запрос на формирование [LIVE VIEW](../../sql-reference/statements/create/view.md#live-view) исполняется снова.

Значение по умолчанию: `64`.
Устарело.

## periodic_live_view_refresh {#periodic-live-view-refresh}

Задает время в секундах, по истечении которого [LIVE VIEW](../../sql-reference/statements/create/view.md#live-view) с установленным автообновлением обновляется.

Значение по умолчанию: `60`.
Устарело.

## check_query_single_value_result {#check_query_single_value_result}

Expand Down
3 changes: 0 additions & 3 deletions docs/zh/sql-reference/statements/grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,6 @@ GRANT INSERT(x,y) ON db.table TO john
- `ALTER MOVE PARTITION`. 级别: `TABLE`. 别名: `ALTER MOVE PART`, `MOVE PARTITION`, `MOVE PART`
- `ALTER FETCH PARTITION`. 级别: `TABLE`. 别名: `FETCH PARTITION`
- `ALTER FREEZE PARTITION`. 级别: `TABLE`. 别名: `FREEZE PARTITION`
- `ALTER VIEW` 级别: `GROUP`
- `ALTER VIEW REFRESH`. 级别: `VIEW`. 别名: `ALTER LIVE VIEW REFRESH`, `REFRESH VIEW`
- `ALTER VIEW MODIFY QUERY`. 级别: `VIEW`. 别名: `ALTER TABLE MODIFY QUERY`

如何对待该层级的示例:
- `ALTER` 权限包含所有其它 `ALTER *` 的权限
Expand Down
16 changes: 15 additions & 1 deletion programs/server/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1392,13 +1392,27 @@
<!-- <host_name>replica</host_name> -->
</distributed_ddl>

<!-- Settings to fine tune MergeTree tables. See documentation in source code, in MergeTreeSettings.h -->
<!-- Settings to fine-tune MergeTree tables. See documentation in source code, in MergeTreeSettings.h -->
<!--
<merge_tree>
<max_suspicious_broken_parts>5</max_suspicious_broken_parts>
</merge_tree>
-->

<!-- Settings to fine-tune ReplicatedMergeTree tables. See documentation in source code, in MergeTreeSettings.h -->
<!--
<replicated_merge_tree>
<max_replicated_fetches_network_bandwidth>1000000000</max_replicated_fetches_network_bandwidth>
</replicated_merge_tree>
-->

<!-- Settings to fine-tune Distributed tables. See documentation in source code, in DistributedSettings.h -->
<!--
<distributed>
<flush_on_detach>false</flush_on_detach>
</distributed>
-->

<!-- Protection from accidental DROP.
If size of a MergeTree table is greater than max_table_size_to_drop (in bytes) than table could not be dropped with any DROP query.
If you want do delete one table and don't want to change clickhouse-server config, you could create special file <clickhouse-path>/flags/force_drop_table and make DROP once.
Expand Down
3 changes: 1 addition & 2 deletions src/Access/Common/AccessType.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@ enum class AccessType
M(ALTER_TABLE, "", GROUP, ALTER) \
M(ALTER_DATABASE, "", GROUP, ALTER) \
\
M(ALTER_VIEW_REFRESH, "ALTER LIVE VIEW REFRESH, REFRESH VIEW", VIEW, ALTER_VIEW) \
M(ALTER_VIEW_MODIFY_QUERY, "ALTER TABLE MODIFY QUERY", VIEW, ALTER_VIEW) \
M(ALTER_VIEW_MODIFY_REFRESH, "ALTER TABLE MODIFY QUERY", VIEW, ALTER_VIEW) \
M(ALTER_VIEW, "", GROUP, ALTER) /* allows to execute ALTER VIEW REFRESH, ALTER VIEW MODIFY QUERY, ALTER VIEW MODIFY REFRESH;
implicitly enabled by the grant ALTER_TABLE */\
\
M(ALTER, "", GROUP, ALL) /* allows to execute ALTER {TABLE|LIVE VIEW} */\
M(ALTER, "", GROUP, ALL) /* allows to execute ALTER TABLE */\
\
M(CREATE_DATABASE, "", DATABASE, CREATE) /* allows to execute {CREATE|ATTACH} DATABASE */\
M(CREATE_TABLE, "", TABLE, CREATE) /* allows to execute {CREATE|ATTACH} {TABLE|VIEW} */\
Expand Down
Loading

0 comments on commit 5530ad5

Please sign in to comment.