Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не работают мержи в ReplicatedMergeTree после CLEAR COLUMN IN PARTITION #2315

Closed
kshvakov opened this issue May 4, 2018 · 0 comments
Assignees

Comments

@kshvakov
Copy link
Contributor

kshvakov commented May 4, 2018

CREATE TABLE clear_column_and_merges (
    ActionDate Date,
    ActionTime DateTime DEFAULT toDateTime(ActionDate),
    Count Int64
) Engine = ReplicatedSummingMergeTree('/clickhouse/tables/clear_column_and_merges', '{replica}')
PARTITION BY toYYYYMM(ActionDate)
ORDER BY (
      ActionDate
    , ActionTime
) SETTINGS index_granularity = 64;

INSERT INTO clear_column_and_merges VALUES 
    ('2018-04-01', '2018-04-01 12:00:00', 1),
    ('2018-04-01', '2018-04-01 13:00:00', 1),
    ('2018-05-01', '2018-05-01 12:00:00', 1),
    ('2018-05-01', '2018-05-01 13:00:00', 1),
    ('2018-04-01', '2018-04-01 12:00:00', 2),
    ('2018-04-01', '2018-04-01 13:00:00', 2),
    ('2018-05-01', '2018-05-01 12:00:00', 2),
    ('2018-05-01', '2018-05-01 13:00:00', 2);

INSERT INTO clear_column_and_merges VALUES 
    ('2018-04-01', '2018-04-01 12:00:00', 1),
    ('2018-04-01', '2018-04-01 13:00:00', 2),
    ('2018-05-01', '2018-05-01 12:00:00', 2),
    ('2018-05-01', '2018-05-01 13:00:00', 2);
SET optimize_throw_if_noop = 1;

OPTIMIZE TABLE clear_column_and_merges PARTITION 201804 final;

SELECT *
FROM clear_column_and_merges 

┌─ActionDate─┬──────────ActionTime─┬─Count─┐
│ 2018-05-012018-05-01 12:00:002 │
│ 2018-05-012018-05-01 13:00:002 │
└────────────┴─────────────────────┴───────┘
┌─ActionDate─┬──────────ActionTime─┬─Count─┐
│ 2018-05-012018-05-01 12:00:001 │
│ 2018-05-012018-05-01 12:00:002 │
│ 2018-05-012018-05-01 13:00:001 │
│ 2018-05-012018-05-01 13:00:002 │
└────────────┴─────────────────────┴───────┘
┌─ActionDate─┬──────────ActionTime─┬─Count─┐
│ 2018-04-012018-04-01 12:00:004 │
│ 2018-04-012018-04-01 13:00:005 │
└────────────┴─────────────────────┴───────┘


ALTER TABLE clear_column_and_merges CLEAR COLUMN ActionTime IN PARTITION 201804;


OPTIMIZE TABLE clear_column_and_merges PARTITION 201804 FINAL

Получаем ошибку

Received exception from server (version 1.1.54343):
Code: 388. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Part 201804_0_1_2 cannot be merged yet, a merge has already assigned for it or it is temporarily disabled. 

0 rows in set. Elapsed: 0.148 sec. 
@ludv1x ludv1x self-assigned this May 20, 2018
ludv1x added a commit that referenced this issue May 23, 2018
ludv1x added a commit that referenced this issue May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants