mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
fix
This commit is contained in:
parent
8d2b32fda8
commit
ad07dd2e1f
@ -157,11 +157,10 @@ bool ParserAlterCommand::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
|
||||
command->clear_index = true;
|
||||
command->detach = false;
|
||||
|
||||
if (s_in_partition.ignore(pos, expected))
|
||||
{
|
||||
if (!parser_partition.parse(pos, command->partition, expected))
|
||||
return false;
|
||||
}
|
||||
if (!s_in_partition.ignore(pos, expected))
|
||||
return false;
|
||||
if (!parser_partition.parse(pos, command->partition, expected))
|
||||
return false;
|
||||
}
|
||||
else if (s_materialize_index.ignore(pos, expected))
|
||||
{
|
||||
|
@ -153,10 +153,10 @@ std::optional<AlterCommand> AlterCommand::parse(const ASTAlterCommand * command_
|
||||
|
||||
return command;
|
||||
}
|
||||
else if (command_ast->type == ASTAlterCommand::DROP_INDEX)
|
||||
else if (command_ast->type == ASTAlterCommand::DROP_INDEX && !command_ast->partition)
|
||||
{
|
||||
if (command_ast->clear_column)
|
||||
throw Exception("\"ALTER TABLE table CLEAR COLUMN column\" queries are not supported yet. Use \"CLEAR COLUMN column IN PARTITION\".", ErrorCodes::NOT_IMPLEMENTED);
|
||||
throw Exception("\"ALTER TABLE table CLEAR INDEX index\" queries are not supported yet. Use \"CLEAR INDEX index IN PARTITION\".", ErrorCodes::NOT_IMPLEMENTED);
|
||||
|
||||
AlterCommand command;
|
||||
command.type = AlterCommand::DROP_INDEX;
|
||||
|
@ -910,8 +910,8 @@ void StorageMergeTree::alterPartition(const ASTPtr & query, const PartitionComma
|
||||
case PartitionCommand::CLEAR_INDEX:
|
||||
{
|
||||
AlterCommand alter_command;
|
||||
alter_command.type = AlterCommand::DROP_COLUMN;
|
||||
alter_command.column_name = get<String>(command.index_name);
|
||||
alter_command.type = AlterCommand::DROP_INDEX;
|
||||
alter_command.index_name = get<String>(command.index_name);
|
||||
clearColumnOrIndexInPartition(command.partition, alter_command, context);
|
||||
}
|
||||
break;
|
||||
|
@ -1,4 +1,6 @@
|
||||
5
|
||||
"rows_read": 4,
|
||||
5
|
||||
"rows_read": 6,
|
||||
5
|
||||
"rows_read": 10,
|
||||
"rows_read": 4,
|
@ -25,10 +25,10 @@ $CLICKHOUSE_CLIENT --query="INSERT INTO test.minmax_idx VALUES
|
||||
(1, 1, 1),
|
||||
(2, 1, 1),
|
||||
(3, 1, 1),
|
||||
(4, 2, 3),
|
||||
(5, 2, 3),
|
||||
(6, 2, 2),
|
||||
(7, 2, 2),
|
||||
(4, 1, 1),
|
||||
(5, 2, 1),
|
||||
(6, 1, 2),
|
||||
(7, 1, 2),
|
||||
(8, 1, 2),
|
||||
(9, 1, 2)"
|
||||
|
||||
@ -40,4 +40,10 @@ $CLICKHOUSE_CLIENT --query="ALTER TABLE test.minmax_idx CLEAR INDEX idx IN PARTI
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count() FROM test.minmax_idx WHERE i64 = 2;"
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count() FROM test.minmax_idx WHERE i64 = 2 FORMAT JSON" | grep "rows_read"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="DROP TABLE test.minmax_idx"
|
||||
$CLICKHOUSE_CLIENT --query="ALTER TABLE test.minmax_idx MATERIALIZE INDEX idx IN PARTITION 1;"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count() FROM test.minmax_idx WHERE i64 = 2;"
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count() FROM test.minmax_idx WHERE i64 = 2 FORMAT JSON" | grep "rows_read"
|
||||
|
||||
|
||||
#$CLICKHOUSE_CLIENT --query="DROP TABLE test.minmax_idx"
|
||||
|
Loading…
Reference in New Issue
Block a user