ClickHouse / ClickHouse/ClickHouse

Bad mutations with virtual columns

Open
#69,890 4 comments 0 reactions 0 assignees View on GitHub
bug comp-mutations external
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

**Describe what's wrong**

Mutations get stuck when I filter by virtual columns.
For example, `ALTER TABLE tab DELETE WHERE _part_offset < 3;`

With `mutations_sync=1`, it reports
```
Received exception from server (version 24.8.4):
Code: 341. DB::Exception: Received from localhost:9000.
DB::Exception: Exception happened during execution of mutation 'mutation_2.txt' with part 'all_1_1_0'
reason: 'Code: 49. DB::Exception: Virtual column _part_offset must be filled by range reader: While executing MergeTreeSequentialSource. (LOGICAL_ERROR) (version 24.8.4.13 (official build))'.
This error maybe retryable or not. In case of unretryable error, mutation can be killed with KILL MUTATION query. (UNFINISHED)
(query: ALTER TABLE tab DELETE WHERE _part_offset < 3 SETTINGS mutations_sync=1;)
```

**How to reproduce**

https://fiddle.clickhouse.com/e6c2e576-b22f-4c92-a170-299a07658ce7

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.