Skip to content

Commit 2d03b05

Browse files
author
zuochunwei
committed
xx
1 parent fc1f166 commit 2d03b05

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

velox/common/file/File.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ struct HeapMemoryMock {
251251
size_ += len;
252252
}
253253

254-
void read(void* dst, size_ len, size_t offset) {
254+
void read(void* dst, size_t len, size_t offset) {
255255
assert(offset + len <= size_);
256256
memcpy(dst, (char*)memory_ + offset, len);
257257
}

velox/exec/Spill.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ void SpillFile::startRead() {
7777
auto buffer = AlignedBuffer::allocate<char>(
7878
std::min<uint64_t>(fileSize_, kMaxReadBufferSize), &pool_);
7979
input_ = std::make_unique<SpillInput>(std::move(file), std::move(buffer));
80-
} else {
81-
std::unique_ptr<ReadFile> =
82-
std::make_unique<HeapMemoryReadFile>(heapMemoryMock_);
80+
} else if (toWhere_ == TO_HEAP) {
81+
auto file = std::make_unique<HeapMemoryReadFile>(heapMemoryMock_);
8382
auto buffer = AlignedBuffer::allocate<char>(
8483
std::min<uint64_t>(fileSize_, kMaxReadBufferSize), &pool_);
8584
input_ = std::make_unique<SpillInput>(std::move(file), std::move(buffer));
85+
} else {
86+
VELOX_FAIL("invalid spill destination");
8687
}
8788
}
8889

0 commit comments

Comments
 (0)