Commit Graph

87 Commits

Author SHA1 Message Date
tavplubix
d7c69f6c02
Merge pull request #29202 from aiven/kmichel-replicated-database-alter-attach
Allow non-replicated ALTER TABLE FETCH/ATTACH in Replicated databases
2021-10-27 16:42:54 +03:00
Alexander Tokmakov
2e7e195e77 change alter_lock to std::timed_mutex 2021-10-26 13:37:00 +03:00
mergify[bot]
477ea62257
Merge branch 'master' into remove-sample-by 2021-10-15 15:14:17 +00:00
Anton Popov
476d7a411f allow to remove SAMPLE BY expression 2021-10-14 17:05:20 +03:00
Maksim Kita
c1f04452de AddDefaultDatabaseVisitor support dictGet 2021-10-14 16:31:32 +03:00
Nikolai Kochetov
236d71ea94
Merge pull request #28582 from ClickHouse/rewrite-pushing-to-views
Rewrite PushingToViews
2021-09-27 21:19:11 +03:00
Kevin Michel
045d4f2d32
Don't replicate DROP/DETACH/DROP DETACHED on Replicated database 2021-09-27 10:10:46 +02:00
Vasily Nemkov
cb1ca9b33e Implemented modifying table comments with ALTER TABLE t MODIFY COMMENT 'value' 2021-09-23 01:14:00 +03:00
Kevin Michel
008c3c812b
Allow non-replicated ALTER TABLE FETCH/ATTACH in Replicated databases
`ALTER TABLE ... FETCH` and `ALTER TABLE ... ATTACH` queries were
disabled in the Replicated database engine, because it could cause
accidental duplication of data.

This enables these queries but without replicating them.

In the case of `FETCH`, the part will only be fetched on the server
where the query is issued.

Similarly, in the case of `ATTACH`, the attached part only needs to
be available on the server where the query is issued.

If the table itself is using one of the Replicated MergeTree engines,
the attached data is then replicated by the table engine itself,
without intervention of the database engine.

This change is meant to help with live backup/restore when using the
Replicated database engine, using FREEZE for backup and ATTACH for
restore.
2021-09-21 17:45:23 +02:00
Nikolai Kochetov
a790d391c0 Merge branch 'master' into rewrite-pushing-to-views 2021-09-20 19:43:15 +03:00
Nikolai Kochetov
a8c3b02598 Merge branch 'master' into rewrite-pushing-to-views 2021-09-17 15:38:11 +03:00
Nikolai Kochetov
e616732743 Small refactoring. 2021-09-15 22:35:48 +03:00
kssenii
489a92c067 Review fixes 2021-09-15 18:36:49 +03:00
kssenii
710c8d12dd Merge branch 'master' of github.com:ClickHouse/ClickHouse into materialized-postgresql 2021-09-15 12:28:09 +03:00
kssenii
f26da04cdf Fix checks 2021-09-09 09:53:58 +03:00
kssenii
bed2688dad Review fixes 2021-09-09 01:25:08 +03:00
kssenii
d0113743c9 Merge branch 'master' of github.com:ClickHouse/ClickHouse into materialized-postgresql 2021-09-05 01:07:31 +03:00
kssenii
97e0a0310a Slightly better 2021-09-04 12:02:07 +03:00
alesapin
dd7493d871
Merge pull request #27038 from excitoon-favorites/altermaterializecolumn
`ALTER TABLE ... MATERIALIZE COLUMN`
2021-09-03 15:50:52 +03:00
kssenii
f17d1bc7a5 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into materialized-postgresql 2021-09-03 09:03:48 +00:00
Vladimir Chebotarev
ce0850007f 1. Draw some circles. 2021-08-30 11:49:26 +03:00
kssenii
378e1f74aa Fix tests 2021-08-28 19:51:04 +03:00
kssenii
174340074c Dynamically add tables complete 2021-08-28 17:35:44 +03:00
kssenii
4cd62227cf Almost done 2021-08-28 17:34:23 +03:00
kssenii
5307d31924 Throw for alter and silence for drop 2021-08-23 23:48:53 +00:00
Alexander Tokmakov
42a8bb6872 fix assertions in Replicated database 2021-08-02 16:19:11 +03:00
Aleksei Semiglazov
9a5365fc41
CLICKHOUSE-784: reset merge tree setting
Add an ability to reset custom setting to default and remove it from table's metadata.
This will allow to rollback the change without knowing the system/config's default.

Signed-off-by: Aleksei Semiglazov <asemiglazov@cloudflare.com>
2021-07-01 20:09:54 +01:00
alesapin
d68338a792
Merge pull request #24979 from nvartolomei/nv/parts-uuid-move-shard-acl
Part movement between shards ACL
2021-06-15 17:19:10 +03:00
Nicolae Vartolomei
af311c8642 Add acl for move partition between shards
We can not easily verify permissions on destination shard

and instead we require a custom grant that can be given to

superadmins.
2021-06-05 10:41:30 +01:00
Nicolae Vartolomei
4d91dfda7e Replace if over an enum with a switch to make it hard to miss new cases 2021-06-04 17:57:17 +01:00
Ivan Lezhankin
bd16dd22b9 Merge remote-tracking branch 'upstream/master' into ast-table-identifier-2 2021-05-14 15:40:33 +03:00
Amos Bird
264cff6415
Projections
TODO (suggested by Nikolai)

1. Build query plan fro current query (inside storage::read) up to WithMergableState
2. Check, that plan is simple enough: Aggregating - Expression - Filter - ReadFromStorage (or simplier)
3. Check, that filter is the same as filter in projection, and also expression calculates the same aggregation keys as in projection
4. Return WithMergableState if projection applies

3 will be easier to do with ActionsDAG, cause it sees all functions, and dependencies are direct (but it is possible with ExpressionActions also)

Also need to figure out how prewhere works for projections, and
row_filter_policies.

wip
2021-05-11 18:12:23 +08:00
Alexander Kuzmenkov
06ca44a378 fix pvs warnings 2021-04-22 22:54:58 +03:00
Ivan Lezhankin
00e8571088 Fix for alter update and IN operator 2021-04-14 18:35:52 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
Alexander Tokmakov
a5b07f2f03 Merge branch 'master' into test_multiple_nodes 2021-03-29 22:43:25 +03:00
tavplubix
7ae5e51ee9
Update InterpreterAlterQuery.cpp 2021-03-17 01:50:37 +03:00
Alexander Tokmakov
69cbb99f2c fix 2021-03-17 01:01:48 +03:00
Pavel Kovalenko
39f3b17041 Merge remote-tracking branch 'origin/master' into unfreeze-partitions 2021-03-16 10:56:24 +03:00
Pavel Kovalenko
483e63ca45 ALTER TABLE UNFREEZE rework. 2021-03-03 00:10:09 +03:00
feng lv
51021c1164 forbid to drop a column if it's referenced by materialized view 2021-02-28 05:24:39 +00:00
alesapin
5c6c318737 Restrict mutations for engines which doesn't support them 2021-02-25 13:07:48 +03:00
Pavel Kovalenko
078dfce038 Add ALTER TABLE UNFREEZE command. 2021-02-24 17:28:30 +03:00
Alexander Tokmakov
2a36d6cb55 review suggestions 2021-02-20 02:41:58 +03:00
Alexander Tokmakov
78c1d69b8c better code 2021-02-08 22:36:17 +03:00
Alexander Tokmakov
18f6b5bbad add timeouts 2021-02-04 22:41:44 +03:00
Alexander Tokmakov
6456ccf0da better test 2021-02-02 22:39:04 +03:00
Alexander Tokmakov
9da445e740 execute initial query in the same thread 2021-02-01 22:29:47 +03:00
Alexander Tokmakov
7f97a11c84 Merge branch 'master' into database_replicated 2021-01-18 17:09:39 +03:00
Amos Bird
2a28c127eb
Better code for real 2020-12-18 14:13:59 +08:00