Skip to content

Unable to add new values to Enum column if it belongs to primary key #364

@valyala

Description

@valyala

The issue

We had a table with an Enum column in primary key:

CREATE TABLE x (
   EventDate Date,
   a Enum8('foo'=1)
) Engine = MergeTree(EventDate, (EventDate, a), 8192);

Then we tried adding new Enum value to column a:

ALTER TABLE x MODIFY COLUMN a Enum8('foo'=1, 'bar'=2);

Unfortunately, clickhouse returned the error instead of altering the table:

DB::Exception: trying to ALTER key column a

Expected behavior

clickhouse must note that the new Enum for column a contains all the old values plus new one, so it must instantly add new value to a Enum without column scanning/rebuilding.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions