Commit Graph

3012 Commits

Author SHA1 Message Date
János Benjamin Antal
1a4f56a61a Fix ASTAlterCommand::formatImpl in case of column specific settings modifications 2024-02-01 14:43:31 +00:00
Yarik Briukhovetskyi
5816424c2b
Merge pull request #59119 from AVMusorin/trailing-comma-tuples
Allow trailing commas in types with several items
2024-01-30 16:31:54 +01:00
Alexey Milovidov
ac90637170
Merge pull request #59122 from arthurpassos/bring_back_attach_partition_pr
Revert revert attach partition PR
2024-01-30 04:02:31 +01:00
Alexey Milovidov
fe2b5cde05
Merge pull request #59338 from vitlibar/support-format-clause-in-backup-query
Support the FORMAT clause in BACKUP and RESTORE queries
2024-01-30 04:00:21 +01:00
Arthur Passos
15d04d0a78
Merge branch 'master' into bring_back_attach_partition_pr 2024-01-29 15:16:49 -03:00
Vitaly Baranov
1f446f78b5 Fix parameter's name. 2024-01-29 16:24:16 +01:00
Vitaly Baranov
9fa76bea7e Support FORMAT clause in BACKUP/RESTORE query. 2024-01-29 14:19:16 +01:00
Yarik Briukhovetskyi
9f2093df75
Restart CI 2024-01-29 12:54:29 +01:00
Aleksandr Musorin
e6352234c3 Added parsing trailing symbols for type expressions
```sql
SELECT (1, 'foo')::Tuple(a Int, b String,);
SELECT (1, 'foo')::Tuple(Int, String,);
SELECT (1, (2,'foo'))::Tuple(Int, Tuple(Int, String,),);
````

fix
2024-01-26 17:56:14 +01:00
avogar
5833641fa5 Merge branch 'master' of github.com:ClickHouse/ClickHouse into variant-data-type 2024-01-26 16:54:02 +00:00
Arthur Passos
ce6877cbb6
Merge branch 'ClickHouse:master' into bring_back_attach_partition_pr 2024-01-26 10:57:11 -03:00
Maksim Kita
2a327107b6 Updated implementation 2024-01-25 14:31:49 +03:00
Arthur Passos
799a94081b Revert "Revert "Allow to attach partition from table with different partition expression when destination partition expression doesn't re-partition""
This reverts commit a1c83e2f51.
2024-01-23 11:40:42 -03:00
Robert Schulze
a1c83e2f51
Revert "Allow to attach partition from table with different partition expression when destination partition expression doesn't re-partition" 2024-01-23 15:26:04 +01:00
Robert Schulze
e23e7e6b73
Merge pull request #53710 from rschu1ze/system-reload-asynchronous-metrics
Add statement `SYSTEM RELOAD ASYNCHRONOUS METRICS`
2024-01-23 11:56:25 +01:00
Robert Schulze
e67076ea2b
Merge pull request #55201 from canhld94/column_level_compress_block
Column-level compression block sizes
2024-01-23 11:22:03 +01:00
Arthur Passos
24b8bbe9fa
Allow to attach partition from table with different partition expression when destination partition expression doesn't re-partition (#39507)
* temp commit

* temp commit

* draft impl for feedback

* fix weird style changes

* fix weird style changes

* fix weird style changes

* fix weird style changes

* fix weird style changes

* aa

* aa

* Add integ tests and remove partition key restriction

* fix small incosistency in partition id

* style fix

* style fix

* style fix

* use existing DataPartStorageBuilder instead of new one

* Refactor part clone to make it more readable and maintainable

* Add MergeTreeDataPartCloner docs

* define ErrorCodes::BAD_ARGUMENTS

* Rebase

* camel case methods

* address some comments

* yet another rebase?

* Move from integ tests to stateless tests

* address more comments

* add finalize on min_max_idx files

* Add sync option to DistinctPartitionExpCloner

* just a temp test

* revert temp change

* Use echoOn to distinguish test queries

* remove comment

* fix build issue during rebase

* atempt to fix build after rebase

* finally fix build

* clear minmaxidx hyperrectangle before loading it

* Fix error on min_max files deletion where it was being assumed that partition expression contained all columns

* get it to the state it was previously

* add missing include

* getting functional?

* refactoring and renaming

* some more refactoring

* extern bad arguments

* try to fix style

* improvements and docs

* remove duplicate includes

* fix crash

* make tests more stable by ordering

* rebase once again..

* fix

* make ci happy?

* fix rebase issues

* docs

* rebase, but prolly needs to be improved

* refactor out from nasty inheritance to static methods

* fix style

* work around optional

* refactor & integrate some changes

* update column_type

* add tests by dencrane

* set utc

* fix ref file

* fix tests

* use MergeTree instead of SummingMergeTree

* mark MergeTreeDataPart::getBlock as const

* address a few comments

* compute module function name size at compile time

* simplify branching in getPartitionAstFieldsCount

* remove column_indexes argument

* merge getBlock with buildBlock

* add some const specifiers

* small adjustments

* remove no longer needed isNull check

* use std::min and max to update global min max idx

* add some assertions

* forward declare some symbols

* fix grammar

* forward decl

* try to fix build..

* remove IFunction forward decl

* Revert "use std::min and max to update global min max idx"

This reverts commit b2fe79dda7.

* Revert "remove no longer needed isNull check"

This reverts commit 129db2610f.

* Revert "Revert "remove no longer needed isNull check""

This reverts commit 9416087dd8.

* Revert "Revert "use std::min and max to update global min max idx""

This reverts commit 20246d4416.

* remove some comments

* partial use of MonotonicityCheckMatcher

* ranges

* remove KeyDescriptionMonotonicityChecker

* remove duplication of applyfunction

* move functions to anonymous namespace

* move functions to cpp

* Relax partition compatibility requirements by accepting subset, add tests from partitioned to unpartitioned

* updte reference file

* Support for partition by a, b, c to partition by a, b

* refactoring part 1

* refactoring part 2, use hyperrectangle, still not complete

* refactoring part 3, build hyperrectangle with intersection of source & destination min max columns

* Support attaching to table with partition expression of multiple expressions

* add tests

* rename method

* remove some code duplication

* draft impl for replicatedmergetree, need to dive deeper

* ship ref file

* fix impl for replicatedmergetree..

* forbid attach empty partition replicatedmergetree

* Add replicated merge tree integration tests

* add test missing files

* fix black

* do not check for monotonicity of empty partition

* add empty tests & fix replicated

* remove no longer needed buildBlockWithMinMaxINdexes

* remove column logic in buildHyperrectangle

* simplify implementation by using existing methods

* further simplify implementation

* move all MergeTreeDataPartClone private methods to .cpp file

* decrease decomposition

* use different namespaces

* reduce code duplication

* fix style

* address a few comments

* add chassert to assert arguments size on MonotonicityCheckVisitor

* remove deleteMinMaxFiles method

* remove useless checks from sanitycheck

* add tests for attach partition (not id)

* Remove sanityCheckASTPartition and bring back conditional getPartitionIDFromQuery

* remove empty block comment

* small fixes

* fix formatting

* add missing include

* remove duplicate iuncludes

* trigger ci

* reduce some code duplication

* use updated partition id on replicatedmergetree

* fix build

* fix build

* small refactor

* do not use insert increment on fetch part

* remove duplicate includes

* add one more integ test

* black

* black

* rely on partition exp instead of partition id on replicated part fetch to decide if it is a different partition exp

* add one more integ test

* add order by clause

* fix black

---------

Co-authored-by: Alexey Milovidov <milovidov@clickhouse.com>
2024-01-22 21:00:04 +01:00
Robert Schulze
90a0ea36b3
Add statement 'SYSTEM RELOAD ASYNCHRONOUS METRICS' 2024-01-22 17:14:58 +00:00
Duc Canh Le
ed031f32af address review comments
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-22 16:06:29 +00:00
vdimir
0791c75315
Merge pull request #58654 from yariks5s/paste_join_aliases_requirement
Avoid alias duplicates in PASTE JOIN and fix aliases requirement
2024-01-22 14:48:13 +01:00
Robert Schulze
1bfeee1954
Some fixups 2024-01-18 20:49:50 +00:00
Robert Schulze
15700592f7
Merge remote-tracking branch 'ClickHouse/master' into column_level_compress_block 2024-01-18 19:12:57 +00:00
Kruglov Pavel
5444cde408
Merge branch 'master' into variant-data-type 2024-01-18 18:31:27 +01:00
Duc Canh Le
b16a4cf361 add document
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-18 07:55:44 +00:00
Duc Canh Le
22afcd46f4 add ALTER COLUMN MODIFY/RESET SETTING
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-18 05:17:07 +00:00
Kseniia Sumarokova
7ded82e51f
Merge pull request #58297 from azat/qp-alter-part
Support query parameters in ALTER TABLE ... PART
2024-01-15 18:18:34 +01:00
Yarik Briukhovetskyi
61889faabd
Merge pull request #58710 from aiven-sal/aiven-sal/fix_normq2
Handle signed numeric literals in normalizeQuery
2024-01-15 14:40:03 +01:00
Azat Khuzhin
48a700edba Support query parameters in ALTER TABLE ... PART
But, to make this happen it is not enough to simply fix the parser, the
whole ASTs for ALTER should be fixed as well, since they store `ASTPtr`
instead of `IAST *`, and so because of `ReplaceQueryParameterVisitor`
does not work for ALTER query.

So this patch converts ASTPtr to `IAST *` for ASTAlterQuery and
ASTAlterCommand (plus it also fixes when the children for
ASTAlterCommand had not been updated sometimes).

And only after this it is possible to adjust the parser (see
places with `parser_string_and_substituion` in the parser code).

v2: also fix ASTAlterCommand::clone (add missing components) and ParserAlterCommand::parseImpl
v3: fix APPLY DELETED MASK
v4: fix mutations_execute_nondeterministic_on_initiator/mutations_execute_subqueries_on_initiator
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-01-15 14:16:54 +03:00
Alexander Tokmakov
5128607995
Merge pull request #58393 from jaymebrd/feat/add-from-modifier-sync-replica-lightweight
add `from srcreplicas` modifier  for `SYSTEM SYNC REPLICA LIGHTWEIGHT`
2024-01-14 20:53:16 +01:00
Duc Canh Le
f755e77534 move column level setting to the end of declaration
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-14 09:36:32 +00:00
Duc Canh Le
ac76eecb1e Merge branch 'master' into column_level_compress_block
Resolve conflicts

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-01-14 09:32:43 +00:00
Alexey Milovidov
d112492c56 Remove some code 2024-01-13 03:48:04 +01:00
Antonio Andelic
654fee820e
Merge pull request #58665 from ClickHouse/jemalloc-system-commands
Add SYSTEM commands and Keeper 4LW for jemalloc
2024-01-12 10:08:13 +01:00
Nikolai Kochetov
119b5ccf76
Merge pull request #56944 from amosbird/fix-56666
Fix a bug with projections and the aggregate_functions_null_for_empty setting during insertion.
2024-01-11 14:16:49 +01:00
Salvatore Mesoraca
d134c1521d
Handle signed numeric literals in normalizeQuery
This solution is non-ideal, but it's difficult to achieve
better results using only the Lexer.

Close #57919
2024-01-11 11:04:28 +01:00
Antonio Andelic
2bfed6b8eb Add system commands and 4lw for jemalloc 2024-01-11 08:24:56 +00:00
yariks5s
7a1c1a3b62 analyzer implementation 2024-01-10 13:38:46 +00:00
Amos Bird
ad46103cd3
Also disable legacy_column_name_of_tuple_literal 2024-01-09 22:08:29 +08:00
Amos Bird
330c576740
projection with aggregate_functions_null_for_empty 2024-01-09 22:08:29 +08:00
Jayme Bird
d169383c6c more explicit logical flow 2024-01-08 10:02:09 +00:00
Jayme Bird
a996015c9c clang format 2024-01-08 10:02:09 +00:00
Jayme Bird
18b7f1de5f various fixups 2024-01-08 10:02:09 +00:00
Jayme Bird
b1580efffa switch to use comma join seperated list of srcReplicas 2024-01-08 10:02:09 +00:00
Jayme Bird
128a421d84 add from <srcReplica> modified to SYSTEM SYNC REPLICA LIGHTWEIGHT 2024-01-08 10:02:09 +00:00
Robert Schulze
c11a2fcb7f
Fix style 2024-01-08 08:50:34 +00:00
Robert Schulze
8e804487f3
Some fixups 2024-01-07 22:28:08 +00:00
Robert Schulze
8d4b519bb1
Replace std::regex by re2 2024-01-03 15:06:20 +00:00
Kruglov Pavel
4d8cf71ba7
Merge branch 'master' into variant-data-type 2024-01-03 15:21:23 +01:00
Alexander Tokmakov
1013f6b23f
Merge branch 'master' into reintroduce_is_deleted 2023-12-29 15:46:24 +01:00
Michael Kolupaev
96c68e5aae Remove pausing, enable multithreading, kick off refresh on table creation unless the query says EMPTY 2023-12-28 17:56:06 +00:00