mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Update settings.md
This commit is contained in:
parent
18a20268d8
commit
55b3bffe59
@ -3948,3 +3948,42 @@ Default value: `0`.
|
|||||||
:::note
|
:::note
|
||||||
Use this setting only for backward compatibility if your use cases depend on old syntax.
|
Use this setting only for backward compatibility if your use cases depend on old syntax.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
## final {#final}
|
||||||
|
|
||||||
|
Automatically applies [FINAL](../../sql-reference/statements/select/from/#final-modifier) modifier to all tables in a query, to tables where [FINAL](../../sql-reference/statements/select/from/#final-modifier) is applicable, including joined tables and tables in sub-queries, and
|
||||||
|
distributed tables.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE TABLE test
|
||||||
|
(
|
||||||
|
key Int64,
|
||||||
|
some String
|
||||||
|
)
|
||||||
|
ENGINE = ReplacingMergeTree
|
||||||
|
ORDER BY key;
|
||||||
|
|
||||||
|
INSERT INTO test FORMAT Values (1, 'first');
|
||||||
|
INSERT INTO test FORMAT Values (1, 'second');
|
||||||
|
|
||||||
|
SELECT * FROM test;
|
||||||
|
┌─key─┬─some───┐
|
||||||
|
│ 1 │ second │
|
||||||
|
└─────┴────────┘
|
||||||
|
┌─key─┬─some──┐
|
||||||
|
│ 1 │ first │
|
||||||
|
└─────┴───────┘
|
||||||
|
|
||||||
|
SELECT * FROM test SETTINGS final = 1;
|
||||||
|
┌─key─┬─some───┐
|
||||||
|
│ 1 │ second │
|
||||||
|
└─────┴────────┘
|
||||||
|
|
||||||
|
SET final = 1;
|
||||||
|
SELECT * FROM test;
|
||||||
|
┌─key─┬─some───┐
|
||||||
|
│ 1 │ second │
|
||||||
|
└─────┴────────┘
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user