Skip to content

Drop partition failed for partition value 2106-02-07 #26263

Closed

Description

@markheger

Drop partition failed with following error:
DB::Exception: Parsed partition value: 2106-02-07 doesn't match partition value for an existing part with the same partition ID: 21060207_1_1_0

Problem observed with releases:

  • 20.8.12.2
  • 20.8.19.4

How to reproduce

SELECT version()

┌─version()─┐
│ 20.8.19.4 │
└───────────┘
CREATE DATABASE Test

CREATE TABLE Test.Example (`d` DateTime, `a` Int) ENGINE = ReplacingMergeTree PARTITION BY toStartOfWeek(toDateTime(d, 'UTC')) ORDER BY d

INSERT INTO Test.Example VALUES (toDateTime(0,'UTC'), 1)

SELECT partition FROM system.parts WHERE database = 'Test'

┌─partition──┐
│ 2106-02-07 │
└────────────┘


ALTER TABLE Test.Example
    DROP PARTITION '2106-02-07'

Received exception from server (version 20.8.19):
Code: 248. DB::Exception: Received from clickhouse-server:9000. DB::Exception: Parsed partition value: 2106-02-07 doesn't match partition value for an existing part with the same partition ID: 21060207_1_1_0. \

Expected behavior

Drop partition should succeed.

Version info

Activity

  1. added
    bug
    on Jul 13, 2021
  2. added and removed
    bug
    on Jul 13, 2021
  3. alexey-milovidov commented on Jul 13, 2021

    @alexey-milovidov
    Member

    Overflow of Date values is implementation specific behaviour. If you have the partition with overflowed value, you should drop it manually from filesystem and restart clickhouse-server.

  4. markheger commented on Jul 13, 2021

    @markheger
    Author

    The problem does not occur in 21.x release, hope that same fix could be done in 20.x release

  5. SaltTan commented on Jul 13, 2021

    @SaltTan
    Contributor

    Try ALTER TABLE Test.Example DROP PARTITION ID '21060207'
    Or whatever SELECT partition_id FROM system.parts is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions