go-sstables icon indicating copy to clipboard operation
go-sstables copied to clipboard

Update super_sstable_reader.go

Open sebheitzmann opened this issue 8 months ago • 4 comments

The contains of the readers already handle the "tombstone" case.

sebheitzmann avatar Apr 08 '25 07:04 sebheitzmann

Just a question :

https://github.com/thomasjungblut/go-sstables/blob/d00463f192d4d4126a04a6ac66aa18fd26f44995/sstables/sstable_merger.go#L41

https://github.com/thomasjungblut/go-sstables/blob/d00463f192d4d4126a04a6ac66aa18fd26f44995/sstables/sstable_merger.go#L120

There is two merge method. I don't really understand the difference. And I don't understand the need of the context.

sebheitzmann avatar Apr 10 '25 06:04 sebheitzmann

of course. Merge just merges the given iterators into a single file, so it will have duplicated key entries with their respective values.

MergeCompactIterator returns an iterator that merges and runs the reduce function on the same keys, so the iterator always returns a key and all the matching values.

thomasjungblut avatar Apr 10 '25 10:04 thomasjungblut

Thanks for the response. But what about the context ?

sebheitzmann avatar Apr 10 '25 12:04 sebheitzmann

The context is to understand which sstable the iterator originated from, so you can do selection based on this too, e.g. check out: https://github.com/thomasjungblut/go-sstables/blob/main/sstables/super_sstable_reader.go#L57-L63

thomasjungblut avatar Apr 10 '25 12:04 thomasjungblut