diff --git a/velox/exec/OperatorUtils.cpp b/velox/exec/OperatorUtils.cpp index 536706fb9fb0..82468bc9c9b3 100644 --- a/velox/exec/OperatorUtils.cpp +++ b/velox/exec/OperatorUtils.cpp @@ -28,8 +28,10 @@ void scalarGatherCopy( BaseVector* target, vector_size_t targetIndex, vector_size_t count, - const std::vector& sources, - const std::vector& sourceIndices, + const std::vector>& + sources, + const std::vector>& + sourceIndices, column_index_t sourceColumnChannel) { VELOX_DCHECK(target->isFlatEncoding()); @@ -81,8 +83,10 @@ void complexGatherCopy( BaseVector* target, vector_size_t targetIndex, vector_size_t count, - const std::vector& sources, - const std::vector& sourceIndices, + const std::vector>& + sources, + const std::vector>& + sourceIndices, column_index_t sourceChannel) { for (int i = 0; i < count; ++i) { target->copy( @@ -97,8 +101,10 @@ void gatherCopy( BaseVector* target, vector_size_t targetIndex, vector_size_t count, - const std::vector& sources, - const std::vector& sourceIndices, + const std::vector>& + sources, + const std::vector>& + sourceIndices, column_index_t sourceChannel) { if (target->isScalar()) { VELOX_DYNAMIC_SCALAR_TYPE_DISPATCH( @@ -326,8 +332,10 @@ void gatherCopy( RowVector* target, vector_size_t targetIndex, vector_size_t count, - const std::vector& sources, - const std::vector& sourceIndices, + const std::vector>& + sources, + const std::vector>& + sourceIndices, const std::vector& columnMap) { VELOX_DCHECK_GE(count, 0); if (FOLLY_UNLIKELY(count <= 0)) { diff --git a/velox/exec/OperatorUtils.h b/velox/exec/OperatorUtils.h index bea261f3d24a..7dc444e1c915 100644 --- a/velox/exec/OperatorUtils.h +++ b/velox/exec/OperatorUtils.h @@ -100,8 +100,10 @@ void gatherCopy( RowVector* target, vector_size_t targetIndex, vector_size_t count, - const std::vector& sources, - const std::vector& sourceIndices, + const std::vector>& + sources, + const std::vector>& + sourceIndices, const std::vector& columnMap = {}); /// Generates the system-wide unique disk spill file path for an operator. It diff --git a/velox/exec/SortBuffer.cpp b/velox/exec/SortBuffer.cpp index fe12fbecf1c1..523e98b56c6c 100644 --- a/velox/exec/SortBuffer.cpp +++ b/velox/exec/SortBuffer.cpp @@ -35,7 +35,9 @@ SortBuffer::SortBuffer( prefixSortConfig_(prefixSortConfig), spillConfig_(spillConfig), spillStats_(spillStats), - sortedRows_(0, memory::StlAllocator(*pool)) { + sortedRows_(0, memory::StlAllocator(*pool)), + spillSources_(0, memory::StlAllocator(*pool_)), + spillSourceRows_(0, memory::StlAllocator(*pool_)) { VELOX_CHECK_GE(input_->size(), sortCompareFlags_.size()); VELOX_CHECK_GT(sortCompareFlags_.size(), 0); VELOX_CHECK_EQ(sortColumnIndices.size(), sortCompareFlags_.size()); diff --git a/velox/exec/SortBuffer.h b/velox/exec/SortBuffer.h index eafe29f9e16c..781b680e9fe6 100644 --- a/velox/exec/SortBuffer.h +++ b/velox/exec/SortBuffer.h @@ -126,8 +126,10 @@ class SortBuffer { // Used to merge the sorted runs from in-memory rows and spilled rows on disk. std::unique_ptr> spillMerger_; // Records the source rows to copy to 'output_' in order. - std::vector spillSources_; - std::vector spillSourceRows_; + std::vector> + spillSources_; + std::vector> + spillSourceRows_; // Reusable output vector. RowVectorPtr output_; diff --git a/velox/exec/tests/OperatorUtilsTest.cpp b/velox/exec/tests/OperatorUtilsTest.cpp index 5d4bab633b4b..64c12725fe7e 100644 --- a/velox/exec/tests/OperatorUtilsTest.cpp +++ b/velox/exec/tests/OperatorUtilsTest.cpp @@ -89,8 +89,10 @@ class OperatorUtilsTest : public OperatorTestBase { } } - std::vector sourcesVectors(kNumRows); - std::vector sourceIndices(kNumRows); + std::vector> + sourcesVectors(kNumRows, *pool_); + std::vector> + sourceIndices(kNumRows, *pool_); for (int iter = 0; iter < 5; ++iter) { const int count = folly::Random::oneIn(10) ? 0 : folly::Random::rand32() % kNumRows; @@ -259,8 +261,10 @@ TEST_F(OperatorUtilsTest, gatherCopy) { makeFlatVector(kNumRows, [](auto row) { return row % 7; }), BaseVector::createNullConstant(UNKNOWN(), kNumRows, pool()), }); - std::vector sourceVectors(kNumRows); - std::vector sourceIndices(kNumRows); + std::vector> + sourceVectors(kNumRows, *pool_); + std::vector> sourceIndices( + kNumRows, *pool_); for (int i = 0; i < kNumRows; ++i) { sourceVectors[i] = sourceVector.get(); sourceIndices[i] = kNumRows - i - 1; diff --git a/velox/exec/tests/SpillerTest.cpp b/velox/exec/tests/SpillerTest.cpp index 83d6d7983e86..0e9cbae3cfe5 100644 --- a/velox/exec/tests/SpillerTest.cpp +++ b/velox/exec/tests/SpillerTest.cpp @@ -687,8 +687,10 @@ class SpillerTest : public exec::test::RowContainerTestBase { int i = 0; int outputRow = 0; int outputSize = 0; - std::vector sourceVectors(outputBatchSize); - std::vector sourceIndices(outputBatchSize); + std::vector> + sourceVectors(outputBatchSize, *pool_); + std::vector> + sourceIndices(outputBatchSize, *pool_); for (;;) { auto stream = merge->next(); if (stream == nullptr) {