fix: properly handle larger final IPC chunk in mmap store (#645)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user