Merge 'cnch_dev_fix_multi_round_dedup' into 'cnch-dev'

fix(clickhousech@m-5371640225): fix multi round dedup with dump then read

See merge request: !25908
This commit is contained in:
勾王敏浩 2024-10-21 03:00:31 +00:00 committed by Fred Wang
parent e181b2a622
commit 46e3c945cf
3 changed files with 28 additions and 1 deletions

View File

@ -618,7 +618,7 @@ IMergeTreeDataPart::ChecksumsPtr IMergeTreeDataPart::getChecksums() const
/// XXX: Currently, the checksum of a part depends on the remote load, which is unreasonable.
/// The mutation in the file of the memory part object may not correct.
/// Here we do special processing for partial update
if (needPartialUpdateProcess())
if (partial_update_state != PartialUpdateState::NotPartialUpdate)
{
for (auto & file : res->files)
file.second.mutation = parent_part ? parent_part->info.mutation : info.mutation;

View File

@ -0,0 +1 @@
2023-01-02 1005 30 d2 x2

View File

@ -0,0 +1,26 @@
DROP TABLE IF EXISTS unique_partial_update_multi_round;
CREATE TABLE unique_partial_update_multi_round
(
`p_date` Date,
`id` UInt32,
`number` UInt32,
`content` String,
`extra` String
)
ENGINE = CnchMergeTree
PARTITION BY p_date
ORDER BY id
UNIQUE KEY id
SETTINGS enable_unique_partial_update = 1, partial_update_max_process_parts = 1, partial_update_optimize_for_batch_task = 0;
SYSTEM STOP DEDUP WORKER unique_partial_update_multi_round;
SET enable_staging_area_for_write=1, enable_unique_partial_update=1;
INSERT INTO unique_partial_update_multi_round VALUES ('2023-01-02', 1005, 30, 'd2', 'x2');
SET enable_staging_area_for_write=0, enable_unique_partial_update=1;
INSERT INTO unique_partial_update_multi_round VALUES ('2023-01-02', 1005, 30, 'd2', 'x2');
SELECT * FROM unique_partial_update_multi_round ORDER BY id;
DROP TABLE IF EXISTS unique_partial_update_multi_round;