`DROP TABLE if exists default.test_20221226 on cluster clickhouse;
CREATE TABLE default.test_20221226 on cluster clickhouse
(
   uid Int64,
   start Int64,
   end Int64,
   ck_insert_time DateTime default now()
)
ENGINE = ReplacingMergeTree(ck_insert_time)
ORDER BY (uid, start)
;

DROP TABLE if exists default.test_20221226_all on cluster clickhouse;
CREATE TABLE default.test_20221226_all on cluster clickhouse AS default.test_20221226
ENGINE = Distributed('clickhouse', 'default', 'test_20221226', cityHash64(uid))
;

DROP DICTIONARY if exists default.test_20221226_dict on cluster clickhouse;
CREATE DICTIONARY default.test_20221226_dict on cluster clickhouse
(
    uid Int64,
    start Int64,
    end Int64,
    ck_insert_time DateTime
)
PRIMARY KEY uid
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' PASSWORD 'default' DB 'default' TABLE 'test_20221226_all' UPDATE_FIELD 'ck_insert_time' UPDATE_LAG 60))
LIFETIME(MIN 10 MAX 60)
LAYOUT(RANGE_HASHED())
RANGE(MIN start MAX end)
;

INSERT INTO default.test_20221226_all(uid,start,end) values (1, 0, 100),(1, 101,200),(2,0,999),(2,1000,10000);

select * from default.test_20221226_all ;
uid	start	end	ck_insert_time
1	0	100	2022-12-26 11:38:34
1	101	200	2022-12-26 11:38:34
2	0	999	2022-12-26 11:38:34
2	1000	10000	2022-12-26 11:38:34

select * from default.test_20221226_dict ;
uid	start	end	ck_insert_time
1	0	100	2022-12-26 11:38:34
1	101	200	2022-12-26 11:38:34
2	0	999	2022-12-26 11:38:34
2	1000	10000	2022-12-26 11:38:34

`

after the DICTIONARY update. (one minute later)

`
select * from default.test_20221226_all ;
uid	start	end	ck_insert_time
1	0	100	2022-12-26 11:38:34
1	101	200	2022-12-26 11:38:34
2	0	999	2022-12-26 11:38:34
2	1000	10000	2022-12-26 11:38:34

select * from default.test_20221226_dict ;
uid	start	end	ck_insert_time
1	101	200	2022-12-26 11:38:34
2	1000	10000	2022-12-26 11:38:34

`

the result in dict is wrong, missing the first range for each PRIMARY KEY.

somthing wrong in my create sql? or a bug for this version. because i have used this plan in version 21.11.4.14, that's greats on it,



blockToAttributes(*update_field_loaded_block.get());
    }
}
template <DictionaryKeyType dictionary_key_type>
void RangeHashedDictionary<dictionary_key_type>::blockToAttributes(const Block & block)
{
    size_t attributes_size = attributes.size();
    size_t dictionary_keys_size = dict_struct.getKeysSize();
    static constexpr size_t ranges_size = 2;
    size_t block_columns = block.columns();
    size_t range_dictionary_attributes_size = attributes_size + dictionary_keys_size + ranges_size;
    if (range_dictionary_attributes_size != block.columns())
    {
        throw Exception(ErrorCodes::UNSUPPORTED_METHOD,
            "Block size mismatch. Actual {}. Expected {}",
            block_columns,
            range_dictionary_attributes_size);
    }
    Columns key_columns;
    key_columns.reserve(dictionary_keys_size);
    
    for (size_t i = 0; i < dictionary_keys_size; ++i)
        key_columns.emplace_back(block.getByPosition(i).column);
    DictionaryKeysArenaHolder<dictionary_key_type> arena_holder;
    DictionaryKeysExtractor<dictionary_key_type> keys_extractor(key_columns, arena_holder.getComplexKeyArena());
    const size_t keys_size = keys_extractor.getKeysSize();
    size_t block_attributes_skip_offset = dictionary_keys_size;
    const auto * min_range_column = block.getByPosition(block_attributes_skip_offset).column.get();
    const auto * max_range_column = block.getByPosition(block_attributes_skip_offset + 1).column.get();
    const NullMap * min_range_null_map = nullptr;