flatten the combined values when dumping into disks

this will reduce the memory used when merging many files together.