fix: properly handle larger final IPC chunk in mmap store (#645)

This commit is contained in:
egolearner
2026-08-04 16:58:10 +08:00
committed by GitHub
parent 3e66f8b268
commit 6eed986ac5
2 changed files with 50 additions and 4 deletions
+5 -3
View File
@@ -118,11 +118,13 @@ arrow::Status MmapForwardStore::OpenIPC(
chunk_index_map_.emplace_back(num_rows_, num_rows_ + chunk->length() - 1);
num_rows_ += chunk->length();
// Check if all chunks have the same size except possibly the last one
// All non-last chunks must have the same size. The last chunk may be
// smaller, but a larger last chunk also requires the general lookup path.
if (fixed_batch_size_ == -1) {
fixed_batch_size_ = chunk->length();
} else if (fixed_batch_size_ != chunk->length()) {
if (i != chunked_array->num_chunks() - 1) {
if (i != chunked_array->num_chunks() - 1 ||
chunk->length() > fixed_batch_size_) {
is_fixed_batch_size_ = false;
}
}
@@ -568,4 +570,4 @@ RecordBatchReaderPtr MmapForwardStore::scan(
}
}
} // namespace zvec
} // namespace zvec