Commit Graph

812 Commits

Author SHA1 Message Date
Nikolai Kochetov
c92c352d9a Fix crash in EXPLAIN AST without query. 2021-06-23 15:29:10 +03:00
Azat Khuzhin
fabff86788 Fix NOT parsing 2021-06-20 23:27:24 +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
Azat Khuzhin
c6339b4c08 Stable NOT chain formatting 2021-06-19 08:03:36 +03:00
alexey-milovidov
35411d1085
Merge pull request #24427 from azat/formatting-fixes
Fix formatting of negative values
2021-06-17 21:21:47 +03:00
Azat Khuzhin
9242654231 negate: replace special case with parens
v0: negate: add parens for negative values
    Before this patch -(-1) was formatted to --1, but this is not valid
    syntax.
v2: replace special case with parens, otherwise formatting of -(-(-1))
    will be unstable, in v0 it was formatted to -(1) but -(1) is
    formatted to -1 [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/24427/4512460aeb02fec557c558eee3f8291a6297efb2/fuzzer_asan/fuzzer.log
2021-06-17 10:07:03 +03:00
alexey-milovidov
f7707b4409
Merge pull request #25391 from amosbird/ctf
Fix column transformer replace format issue
2021-06-17 09:06:57 +03:00
Amos Bird
f9d00d6dfb
Fix column transformer replace format issue 2021-06-17 11:12:26 +08:00
Maksim Kita
67e9b85951 Merge ext into common 2021-06-16 23:28:41 +03:00
mergify[bot]
7959d92029
Merge branch 'master' into minor-changes-3 2021-06-15 18:07:24 +00: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
Alexey Milovidov
447d7bb8cd Minor changes 2021-06-14 07:13:35 +03:00
Alexey Milovidov
cae9b25074 Minor change 2021-06-14 06:05:27 +03:00
Ivan
d5bd761db9
Typo
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
2021-06-13 22:27:54 +03:00
Ivan Lezhankin
a237229998 Another ANTLR fix 2021-06-12 00:15:38 +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
Maksim Kita
eabeb3076f Added tests 2021-06-10 22:32:09 +03:00
Ivan
a7fa4e641c
Merge branch 'master' into ast-table-identifier-2 2021-06-10 16:43:22 +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
alexey-milovidov
c1d233cabc
Update ASTIdentifier.cpp 2021-06-08 20:40:33 +03:00
alexey-milovidov
736b56ce33
Update ASTIdentifier.cpp 2021-06-08 20:39:42 +03:00
Nikolai Kochetov
5cc005710a
Update ASTIdentifier.cpp 2021-06-08 18:23:42 +03:00
Nikolai Kochetov
194dd91f0c Fix crash in explain syntax and cross join. 2021-06-08 16:54:48 +03:00
Nikolai Kochetov
a73f1b9ebe Fix crash in explain syntax and cross join. 2021-06-08 16:51:17 +03:00
Ivan Lezhankin
7aa08a04b5 Fix unit-tests again 2021-06-07 16:52:47 +03:00
Ivan Lezhankin
977fbbf1e4 Fix unit tests 2021-06-02 20:17:26 +03:00
Ivan Lezhankin
90fe7995c2 Merge remote-tracking branch 'upstream/master' into ast-table-identifier-2 2021-06-02 20:00:24 +03:00
Amos Bird
9bbc9f97b4
Implement antlr parser for projections (#24245)
* implement projection grammer for antlr parser

* Add comment
2021-06-02 18:09:55 +03:00
Ivan Lezhankin
ae38b4a3f1 Merge remote-tracking branch 'upstream/master' into ast-table-identifier-2 2021-06-02 16:07:59 +03:00
Alexander Kuzmenkov
ae79bbea7d Merge remote-tracking branch 'origin/master' into HEAD 2021-06-02 15:06:22 +03:00
Amos Bird
3be331edeb
Better exception for invalid projection creation 2021-05-31 12:24:09 +08:00
Alexander Kuzmenkov
73c2ca7da5 fixes 2021-05-29 16:12:18 +03:00
Alexander Kuzmenkov
40b1dc1812 support expressions in window frame -- draft 2021-05-28 20:49:47 +03:00
Alexander Kuzmenkov
7c6399d82d fixes 2021-05-27 17:45:40 +03:00
Alexander Kuzmenkov
1d0b61dd0e Merge remote-tracking branch 'origin/master' into HEAD 2021-05-27 15:59:00 +03:00
Alexander Kuzmenkov
23e6b6fc48 parent window spec - tmp 2021-05-27 15:58:50 +03:00
Ivan Lezhankin
06a0ab12bc Merge remote-tracking branch 'upstream/master' into ast-table-identifier-2 2021-05-27 15:57:59 +03:00
Anton Popov
8a71af5797
Merge pull request #24471 from CurtizJ/fix-cast-operator
Fix several cases in cast operator
2021-05-27 14:31:51 +03:00
Anton Popov
35e2cc7b2b fix several cases in cast operator 2021-05-25 02:50:28 +03:00
Alexey Milovidov
d32819f068 Mark false positives for PVS-Studio 2021-05-24 06:59:12 +03:00
alesapin
6c0b683d3a
Merge pull request #17871 from nvartolomei/nv/parts-uuid-move-shard
Part movement between shards
2021-05-23 10:20:57 +03:00
mergify[bot]
970243850f
Merge branch 'master' into ast-table-identifier-2 2021-05-21 12:56:49 +00:00
Azat Khuzhin
8b438bcd3c Change formatting of subqueries (make it more human friendly)
Fix trailing whitespaces in FROM/IN clause with subqueries in multiline
mode, and also changes the output of the queries slightly in a more
human friendly way.

Before:

    $ clickhouse-format <<<'select * from system.one, (select * from system.one)'
    SELECT *
    FROM system.one
    ,
    (
        SELECT *
        FROM system.one
    )

After:

    $ clickhouse-format <<<'select * from system.one, (select * from system.one)'
    SELECT *
    FROM system.one,
    (
        SELECT *
        FROM system.one
    )

v2: Fix subqueries formatting in a different way
v3: Adjust *.reference in tests
v4: Fix modernize-loop-convert in ASTTablesInSelectQuery
2021-05-20 21:04:12 +03:00
alesapin
17f229857c Merge branch 'master' into nvartolomei-parts-move 2021-05-17 13:52:48 +03:00
Kseniia Sumarokova
99e2f83c69
Merge pull request #23548 from ucasFL/table-comment
Implement table comments
2021-05-15 19:56:16 +03:00
feng lv
8c82e3f1b9 fix style
fix
2021-05-14 15:50:05 +00:00
Ivan Lezhankin
bd16dd22b9 Merge remote-tracking branch 'upstream/master' into ast-table-identifier-2 2021-05-14 15:40:33 +03:00
alesapin
3abc891107
Merge pull request #24037 from amosbird/dh
Run check_*_compiler_flag earlier
2021-05-13 15:32:23 +03:00