mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Merge b8d5a82f97
into f4038e3153
This commit is contained in:
commit
d6ba33cffa
@ -3226,7 +3226,7 @@ Default value: `0`.
|
||||
|
||||
## lightweight_deletes_sync {#lightweight_deletes_sync}
|
||||
|
||||
The same as 'mutation_sync', but controls only execution of lightweight deletes.
|
||||
The same as [`mutations_sync`](#mutations_sync), but controls only execution of lightweight deletes.
|
||||
|
||||
Possible values:
|
||||
|
||||
|
@ -115,7 +115,10 @@ std::optional<MutationCommand> MutationCommand::parse(ASTAlterCommand * command,
|
||||
res.column_name = getIdentifierName(command->column);
|
||||
return res;
|
||||
}
|
||||
else if (parse_alter_commands && command->type == ASTAlterCommand::MODIFY_COLUMN)
|
||||
/// MODIFY COLUMN x REMOVE MATERIALIZED is a valid alter command, but doesn't have any specified column type, thus no mutation is needed
|
||||
else if (
|
||||
parse_alter_commands && command->type == ASTAlterCommand::MODIFY_COLUMN && command->col_decl
|
||||
&& command->col_decl->as<ASTColumnDeclaration &>().type)
|
||||
{
|
||||
MutationCommand res;
|
||||
res.ast = command->ptr();
|
||||
|
@ -0,0 +1,4 @@
|
||||
BEFORE a x String
|
||||
BEFORE a y String MATERIALIZED \'str\'
|
||||
AFTER a x String
|
||||
AFTER a y String
|
@ -0,0 +1,13 @@
|
||||
DROP TABLE IF EXISTS a SYNC;
|
||||
CREATE TABLE a (x String, y String MATERIALIZED 'str') ENGINE = ReplicatedMergeTree('/clickhouse/{database}/a', 'r1') ORDER BY x;
|
||||
|
||||
INSERT INTO a SELECT toString(number) FROM numbers(100);
|
||||
SELECT 'BEFORE', table, name, type, default_kind, default_expression FROM system.columns WHERE database = currentDatabase() AND table = 'a' ORDER BY table, name;
|
||||
|
||||
-- DROP INDEX is important to make the mutation not a pure metadata mutation
|
||||
ALTER TABLE a
|
||||
DROP INDEX IF EXISTS some_index,
|
||||
MODIFY COLUMN y REMOVE MATERIALIZED
|
||||
SETTINGS alter_sync = 2, mutations_sync = 2;
|
||||
|
||||
SELECT 'AFTER', table, name, type, default_kind, default_expression FROM system.columns WHERE database = currentDatabase() AND table = 'a' ORDER BY table, name;
|
Loading…
Reference in New Issue
Block a user