diff --git a/internal/storage/serde.go b/internal/storage/serde.go index a20b3aaba6861..44228e76a651e 100644 --- a/internal/storage/serde.go +++ b/internal/storage/serde.go @@ -538,8 +538,9 @@ func (deser *DeserializeReader[T]) Next() error { deser.pos = 0 deser.rec = deser.rr.Record() - // allocate new slice preventing overwrite previous batch - deser.values = make([]T, deser.rec.Len()) + if deser.values == nil || len(deser.values) != deser.rec.Len() { + deser.values = make([]T, deser.rec.Len()) + } if err := deser.deserializer(deser.rec, deser.values); err != nil { return err }