diff --git a/cpp/velox/memory/VeloxColumnarBatch.h b/cpp/velox/memory/VeloxColumnarBatch.h index cecadd3cdfdb..4b83d302a09f 100644 --- a/cpp/velox/memory/VeloxColumnarBatch.h +++ b/cpp/velox/memory/VeloxColumnarBatch.h @@ -29,6 +29,13 @@ class VeloxColumnarBatch final : public ColumnarBatch { VeloxColumnarBatch(facebook::velox::RowVectorPtr rowVector) : ColumnarBatch(rowVector->childrenSize(), rowVector->size()), rowVector_(rowVector) {} +#ifdef GLUTEN_ENABLE_GPU + // The batch may be CudfVector, it's childrenSize is not correct, many tests failed if correcting the value + // https://github.com/facebookincubator/velox/pull/15629#discussion_r2581655771 + VeloxColumnarBatch(facebook::velox::RowVectorPtr rowVector, int32_t numColumns) + : ColumnarBatch(numColumns, rowVector->size()), rowVector_(rowVector) {} +#endif + std::string getType() const override { return kType; } diff --git a/cpp/velox/utils/GpuBufferBatchResizer.cc b/cpp/velox/utils/GpuBufferBatchResizer.cc index ad98fd47017d..518f280fc3eb 100644 --- a/cpp/velox/utils/GpuBufferBatchResizer.cc +++ b/cpp/velox/utils/GpuBufferBatchResizer.cc @@ -159,7 +159,7 @@ std::shared_ptr makeCudfTable( auto cudfTable = std::make_unique(std::move(cudfColumns)); stream.synchronize(); return std::make_shared( - std::make_shared(pool, type, numRows, std::move(cudfTable), stream)); + std::make_shared(pool, type, numRows, std::move(cudfTable), stream), type->size()); } } // namespace