diff --git a/velox/exec/HashProbe.cpp b/velox/exec/HashProbe.cpp index 0c6369715173..66cc6b7801e9 100644 --- a/velox/exec/HashProbe.cpp +++ b/velox/exec/HashProbe.cpp @@ -478,6 +478,7 @@ void HashProbe::prepareInputIndicesBuffers( VELOX_DCHECK(spillEnabled()); const auto maxIndicesBufferBytes = numInput * sizeof(vector_size_t); if (nonSpillInputIndicesBuffer_ == nullptr || + !nonSpillInputIndicesBuffer_->isMutable() || nonSpillInputIndicesBuffer_->size() < maxIndicesBufferBytes) { nonSpillInputIndicesBuffer_ = allocateIndices(numInput, pool()); rawNonSpillInputIndicesBuffer_ =