risinglight icon indicating copy to clipboard operation
risinglight copied to clipboard

storage: should_finish function for dict encoding is always true

Open lokax opened this issue 3 years ago • 0 comments

https://github.com/risinglightdb/risinglight/blob/c859dffc379f8ce78737d60f0e95624766cd0a2b/src/storage/secondary/block/dict_block_builder.rs#L39

If block_builder has no data, the block_builder.estimated_size() will return 0. the target size of rle builder is 0. rle_builder.should_finished() is always true.

fn should_finish(&self, next_item: &Option<&A::Item>) -> bool {
        self.data_builder.should_finish(next_item)
            || self
                .rle_builder
                .should_finish(&Some(&(DICT_NULL_VALUE_KEY)))
    }

lokax avatar Aug 04 '22 16:08 lokax