Commit Graph

3586 Commits

Author SHA1 Message Date
Anton Popov
c2754c34f4 Merge remote-tracking branch 'upstream/master' into HEAD 2021-06-21 12:42:48 +03:00
Anton Popov
d8b6f15ef4
Merge pull request #23027 from azat/distributed-push-down-limit
Add ability to push down LIMIT for distributed queries
2021-06-20 23:08:50 +03:00
Mike Kot
4c391f8e99
SYSTEM RESTORE REPLICA replica [ON CLUSTER cluster] (#13652)
* initial commit: add setting and stub

* typo

* added test stub

* fix

* wip merging new integration test and code proto

* adding steps interpreters

* adding firstly proposed solution (moving parts etc)

* added checking zookeeper path existence

* fixing the include

* fixing and sorting includes

* fixing outdated struct

* fix the name

* added ast ptr as level of indirection

* fix ref

* updating the changes

* working on test stub

* fix iterator -> reference

* revert rocksdb submodule update

* fixed show privileges test

* updated the test stub

* replaced rand() with thread_local_rng(), updated the tests

updated the test

fixed test config path

test fix

removed error messages

fixed the test

updated the test

fixed string literal

fixed literal

typo: =

* fixed the empty replica error message

* updated the test and the code with logs

* updated the possible test cases, updated

* added the code/test milestone comments

* updated the test (added more testcases)

* replaced native assert with CH one

* individual replicas recursive delete fix

* updated the AS db.name AST

* two small logging fixes

* manually generated AST fixes

* Updated the test, added the possible algo change

* Some thoughts about optimizing the solution:

ALTER MOVE PARTITION .. TO TABLE -> move to detached/ + ALTER ... ATTACH

* fix

* Removed the replica sync in test as it's invalid

* Some test tweaks

* tmp

* Rewrote the algo by using the executeQuery instead of

hand-crafting the ASTPtr.

Two questions still active.

* tr: logging active parts

* Extracted the parts moving algo into a separate helper function

* Fixed the test data and the queries slightly

* Replaced query to system.parts to direct invocation,

started building the test that breaks on various parts.

* Added the case for tables when at least one replica is alive

* Updated the test to test replicas restoration by detaching/attaching

* Altered the test to check restoration without replica restart

* Added the tables swap in the start if the server failed last time

* Hotfix when only /replicas/replica... path was deleted

* Restore ZK paths while creating a replicated MergeTree table

* Updated the docs, fixed the algo for individual replicas restoration case

* Initial parts table storage fix, tests sync fix

* Reverted individual replica restoration to general algo

* Slightly optimised getDataParts

* Trying another solution with parts detaching

* Rewrote algo without any steps, added ON CLUSTER support

* Attaching parts from other replica on restoration

* Getting part checksums from ZK

* Removed ON CLUSTER, finished working solution

* Multiple small changes after review

* Fixing parallel test

* Supporting rewritten form on cluster

* Test fix

* Moar logging

* Using source replica as checksum provider

* improve test, remove some code from parser

* Trying solution with move to detached + forget

* Moving all parts (not only Committed) to detached

* Edited docs for RESTORE REPLICA

* Re-merging

* minor fixes

Co-authored-by: Alexander Tokmakov <avtokmakov@yandex-team.ru>
2021-06-20 11:24:43 +03:00
Vladimir
1c91a8d2c2
Merge pull request #25454 from vdimir/issue-23351-v2 2021-06-18 21:56:46 +03:00
Kseniia Sumarokova
5974f96f0c
Merge pull request #23656 from kssenii/progress-bar
Progress indication for File table engine in clickhouse-local and insert from file in clickhouse-client
2021-06-18 17:46:54 +03:00
vdimir
0ebca58e86
Check column in removeColumnNullability 2021-06-18 14:06:55 +03:00
Vladimir
6af272891a
Merge pull request #24870 from azat/mv-dist-join-fix 2021-06-18 11:18:43 +03:00
vdimir
b25f6ba5b6
Remove assumeMutable from removeColumnNullability 2021-06-18 11:13:53 +03:00
Vladimir
fab7c9c7f6
Merge pull request #24061 from vdimir/issue-23351 2021-06-18 11:07:28 +03:00
kssenii
bdc8fe1ca0 Merge branch 'master' of github.com:ClickHouse/ClickHouse into progress-bar 2021-06-18 09:33:29 +03:00
Nikolai Kochetov
b2620e1def
Merge pull request #24405 from amosbird/replacemorealias
Rewrite more alias columns
2021-06-18 09:10:31 +03:00
Nikolai Kochetov
669b8a8b96
Merge pull request #25370 from ClickHouse/disable-query_plan_filter_push_down-because-of-25368
Fix lost WHERE condition in expression-push-down optimization of query plan
2021-06-17 23:07:32 +03:00
Nikolai Kochetov
5227a76e3a Add comment. 2021-06-17 23:05:39 +03:00
Vladimir
9e5ef95677
Merge pull request #25288 from amosbird/fixjoingetornull 2021-06-17 21:54:21 +03:00
alexey-milovidov
c48402d997
Merge pull request #23434 from amosbird/preferglobal
Add prefer_global_in_and_join setting
2021-06-17 19:48:28 +03:00
Amos Bird
0f7728cd5e
Fix RBAC test again 2021-06-17 23:00:03 +08:00
vdimir
23fb229dec
Merge branch 'update_01049_join_low_card_bug' into issue-23351 2021-06-17 15:38:40 +03:00
vdimir
0cee5ad8e8
Use IColumn::mutate in JoinCommon::convertColumnToNullable 2021-06-17 13:24:17 +03:00
vdimir
ebdce8e1a6
Fix JoinCommon::convertColumnToNullable for LC(Nullable) 2021-06-17 13:17:28 +03:00
Nikolai Kochetov
4a496f1374 Fix lost considion in predicate push down. 2021-06-17 12:47:12 +03:00
mergify[bot]
13fdefebf5
Merge branch 'master' into fixjoingetornull 2021-06-17 08:26:13 +00:00
Amos Bird
c8ea6527cb
Add prefer_global_in_and_join setting 2021-06-17 14:27:29 +08:00
mergify[bot]
41d007a1b3
Merge branch 'master' into MySQL-column-comments-support 2021-06-17 05:40:15 +00:00
tavplubix
2b62a09aa3
Merge pull request #25373 from ClickHouse/improve_replicated_database_tests2
Improve Replicated database tests 2
2021-06-17 08:34:06 +03:00
Alexander Tokmakov
c235539620 minor fixes 2021-06-17 00:20:35 +03:00
Maksim Kita
67e9b85951 Merge ext into common 2021-06-16 23:28:41 +03:00
Anton Popov
ea9b890618
Merge branch 'master' into add-compatibility-setting 2021-06-16 21:10:56 +03:00
Anton Popov
8bd7cbd925 add compatibility setting for name of columns 2021-06-16 21:10:07 +03:00
tavplubix
710546b9e8
Merge branch 'master' into improve_replicated_database_tests 2021-06-16 13:24:32 +03:00
Storozhuk Kostiantyn
46b230ddd7 Update InterpretersMySQLDDLQuery.cpp 2021-06-16 14:22:07 +08:00
alexey-milovidov
7180cf2367
Merge pull request #25265 from ClickHouse/minor-changes-3
Minor change
2021-06-16 08:33:12 +03:00
Maksim Kita
0a057773f1
Merge pull request #24814 from kitaisreal/expression-jit-simplify-loop
ExpressionJIT simplify loop
2021-06-16 01:42:15 +03:00
Alexander Tokmakov
c873714698 improve replicated database tests 2021-06-15 23:52:29 +03:00
mergify[bot]
7959d92029
Merge branch 'master' into minor-changes-3 2021-06-15 18:07:24 +00:00
Storozhuk Kostiantyn
74849bbe0c
Update InterpretersMySQLDDLQuery.cpp
Added space after if
2021-06-15 18:21:02 +03: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
alesapin
ca4628d31c
Merge pull request #25197 from ClickHouse/disable-paln-optimizations-for-mutations
Do not optimize query plan for mutations.
2021-06-15 17:15:36 +03:00
Kostiantyn Storozhuk
d96478c9ff Integration test added and small fixes 2021-06-15 21:45:30 +08:00
Nikita Mikhaylov
a52bba91b7
Merge pull request #16401 from abyss7/ast-table-identifier-2
ASTTableIdentifier part #2: Introduce ASTTableIdentifier
2021-06-15 13:51:30 +03:00
Amos Bird
8bf897b9c6
Add some comment 2021-06-15 18:37:22 +08:00
Amos Bird
aaac231c6a
Record expanded aliases for RBAC 2021-06-15 18:28:13 +08:00
Amos Bird
6795209ae4
Reuse local variable 2021-06-15 17:54:28 +08:00
Amos Bird
e3ae2f6e7a
Rewrite more alias columns 2021-06-15 17:54:28 +08:00
vdimir
05115dcd32
Merge branch 'master' into issue-23351 2021-06-15 12:06:42 +03:00
Amos Bird
4c573b36fe
Fix joinGetOrNull with not-nullable columns 2021-06-15 16:34:53 +08:00
Maksim Kita
a32d9cdbcd Added compileFunction preudocode documentation 2021-06-15 10:56:08 +03:00
Maksim Kita
e9bfcd20e6 ExpressionJIT fix loop 2021-06-15 10:56:08 +03:00
Alexey Milovidov
447d7bb8cd Minor changes 2021-06-14 07:13:35 +03:00
alexey-milovidov
99cfa9f463
Merge pull request #25248 from matwey/missed_include_condition_variable
Add missed #include <condition_variable>
2021-06-13 22:55:10 +03:00
Matwey V. Kornilov
797b29d082 Add missed #include <condition_variable>
std::condition_variable is used for wait_table_finally_dropped

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
2021-06-13 22:14:05 +03:00
mergify[bot]
9cfedd9c64
Merge branch 'master' into progress-bar 2021-06-12 01:15:23 +00:00
alexey-milovidov
05d1af153c
Merge branch 'master' into rename-const-context-ptr 2021-06-12 03:25:09 +03:00
alexey-milovidov
768b8fed75
Merge branch 'master' into mv-dist-join-fix 2021-06-12 03:19:09 +03:00
alexey-milovidov
99f108d704
Merge pull request #25162 from kitaisreal/rewrite-function-to-subcolumn-visitor-add-into-ya-make
RewriteFunctionToSubcolumnVisitor add into ya.make
2021-06-12 02:58:53 +03:00
alexey-milovidov
320f253912
Merge pull request #25022 from amosbird/initialquerystarttimefix
Add initial_query_start_time to query log
2021-06-12 02:41:24 +03:00
Ivan Lezhankin
e6b9ab6261 Fix false-positive issue from clang-tidy 2021-06-11 21:05:45 +03:00
Ivan Lezhankin
f7979292d6 Merge branch 'ast-table-identifier-2' of github.com:abyss7/ClickHouse into ast-table-identifier-2 2021-06-11 18:29:04 +03:00
Ivan Lezhankin
4773c79300 Fix ANTLR grammar 2021-06-11 18:27:32 +03:00
Amos Bird
49db4dbe6a
Update comment 2021-06-11 23:24:38 +08:00
tavplubix
182c10826c
Update TableJoin.h 2021-06-11 17:47:30 +03:00
Amos Bird
7d9a1106b8
Add initial_query_start_time to query log 2021-06-11 22:24:53 +08:00
Storozhuk Kostiantyn
b2ddc98958
Update InterpretersMySQLDDLQuery.cpp 2021-06-11 14:34:03 +03:00
Kostiantyn Storozhuk
3dc718ff36 style fixes 2021-06-11 19:29:12 +08:00
vdimir
c3aec8ae57
Fix random indentation to trigger ci 2021-06-11 14:03:53 +03:00
Nikolai Kochetov
52f60692c8 Do not optimize query plan for mutations. 2021-06-11 11:48:12 +03:00
Storozhuk Kostiantyn
6c9f701636
Wip my sql column comments support (#1)
Implemented MySQL engine column comments support
2021-06-11 11:43:36 +03:00
alexey-milovidov
7616216f10
Merge pull request #25015 from ClickHouse/fix-wrong-code-in-aggregate-functions
Remove a chunk of wrong code and look what will happen
2021-06-11 00:36:35 +03:00
Alexey Milovidov
7a6df49964 Fix clang-tidy 2021-06-10 22:14:24 +03:00
Ivan
a7fa4e641c
Merge branch 'master' into ast-table-identifier-2 2021-06-10 16:43:22 +03:00
Maksim Kita
005946945f RewriteFunctionToSubcolumnVisitor add into ya.make 2021-06-10 11:41:16 +03:00
Alexey Milovidov
39abf41b4d Fix clang-tidy 2021-06-10 02:16:01 +03:00
Alexander Kuzmenkov
c0e6aa97a6
Merge pull request #24734 from ClickHouse/aku/frame-expressions
support expressions in window frame
2021-06-10 00:25:32 +03:00
Nikolai Kochetov
a163453e74
Merge pull request #25082 from ClickHouse/fix-24011
Fix crash in explain syntax and cross join.
2021-06-09 19:40:23 +03:00
Nikolai Kochetov
9e0f3e5e9e Avoid using empty table name in identifier. 2021-06-09 13:13:13 +03:00
Anton Popov
bb6f0dfbb8
Merge pull request #24406 from CurtizJ/rewrite-functions-to-subcolumns
Optimize some functions to subcolumns
2021-06-09 11:07:09 +03:00
mergify[bot]
3a47feedb0
Merge branch 'master' into progress-bar 2021-06-09 08:04:48 +00:00
Azat Khuzhin
18e8f0eb5e Add ability to push down LIMIT for distributed queries
This way the remote nodes will not need to send all the rows, so this
will decrease network io and also this will make queries w/
optimize_aggregation_in_order=1/LIMIT X and w/o ORDER BY faster since it
initiator will not need to read all the rows, only first X (but note
that for this you need to your data to be sharded correctly or you may
get inaccurate results).

Note, that having lots of processing stages will increase the complexity
of interpreter (it is already not that clean and simple right now).

Although using separate QueryProcessingStage looks pretty natural.

Another option is to make WithMergeableStateAfterAggregation always, but
in this case you will not be able to disable only this optimization,
i.e. if there will be some issue with it.

v2: fix OFFSET
v3: convert 01814_distributed_push_down_limit test to .sh and add retries
v4: add test with OFFSET
v5: add new query stage into the bash completion
v6/tests: use LIMIT O,L syntax over LIMIT L OFFSET O since it is broken in ANTLR parser
          https://clickhouse-test-reports.s3.yandex.net/23027/a18a06399b7aeacba7c50b5d1e981ada5df19745/functional_stateless_tests_(antlr_debug).html#fail1
v7/tests: set use_hedged_requests to 0, to avoid excessive log entries on retries
          https://clickhouse-test-reports.s3.yandex.net/23027/a18a06399b7aeacba7c50b5d1e981ada5df19745/functional_stateless_tests_flaky_check_(address).html#fail1
2021-06-09 02:29:50 +03:00
alesapin
185fb83587
Merge pull request #25059 from ClickHouse/fix_loop_aliases
Ban loop aliases in table definitions
2021-06-08 23:36:54 +03:00
alexey-milovidov
e25d9843d1
Merge pull request #25025 from azat/parallel-kill-mutation
Distinguish KILL MUTATION for different tables.
2021-06-08 21:40:53 +03:00
alesapin
11a1606c15 Less strict 2021-06-08 12:54:00 +03:00
Azat Khuzhin
33b0429dd1 Add StorageID::operator==() 2021-06-08 10:51:22 +03:00
Azat Khuzhin
d5a8a1a8a1 Mark StorageID::operator bool() as explicit
This will avoid bugs, like comparing StorageID w/o operator== via cast
to bool.
2021-06-08 10:51:22 +03:00
Alexey Milovidov
d6513b22cb Merge remote-tracking branch 'origin/master' into fix-wrong-code-in-aggregate-functions 2021-06-08 03:08:03 +03:00
alesapin
5284f192ee Ban loop aliases in table definitions 2021-06-07 23:59:38 +03:00
Ivan
579250168f
Merge branch 'master' into ast-table-identifier-2 2021-06-07 20:30:39 +03:00
Amos Bird
840895509e
Fix using aggregate projection when group by without key 2021-06-07 22:44:42 +08:00
mergify[bot]
b8dcce68b5
Merge branch 'master' into rename-const-context-ptr 2021-06-07 09:46:24 +00:00
Nikolai Kochetov
0043434d5c
Merge pull request #24894 from amosbird/notinpartitionprune
Allow not in be used in partition pruning
2021-06-07 12:42:48 +03:00
Nikolai Kochetov
cbd46280eb
Update Set.cpp 2021-06-07 12:36:34 +03:00
Alexey Milovidov
885ce194e0 Making fundamentals correct 2021-06-07 00:49:55 +03:00
mergify[bot]
f84ac23951
Merge branch 'master' into compression-codecs-refactoring 2021-06-06 18:02:39 +00:00
alexey-milovidov
295dc6b517
Revert "Add initial_query_start_time to query log" 2021-06-06 20:57:04 +03:00
Alexey Milovidov
6a652ef4f6 Remove a chunk of wrong code and look what will happen 2021-06-06 19:28:54 +03:00
alexey-milovidov
81a12404c7
Merge pull request #24940 from azat/settings-limit-offset-fix
Fix limit/offset settings for distributed queries (ignore on the remote nodes)
2021-06-06 17:39:15 +03:00
alexey-milovidov
c3baba2287
Merge pull request #24930 from amosbird/distributedfix
Allow shard pruning with IN literal
2021-06-06 17:36:47 +03:00
alexey-milovidov
db384a163c
Merge pull request #24388 from amosbird/initialquerystarttime
Add initial_query_start_time to query log
2021-06-06 16:15:37 +03:00
Alexey Milovidov
17962459f5 Merge branch 'master' into issue-16775 2021-06-06 02:18:28 +03:00
Maksim Kita
a7ca1f5999 DictionaryLoader unnecessary dictionary configuration creation fix 2021-06-05 23:37:24 +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