FelixYBW commented on code in PR #5952:
URL: https://github.com/apache/incubator-gluten/pull/5952#discussion_r1623880020
##########
cpp/velox/operators/serializer/VeloxColumnarToRowConverter.cc:
##########
@@ -16,46 +16,64 @@
*/
#include "VeloxColumnarToRowConverter.h"
+#include <velox/common/base/SuccinctPrinter.h>
+#include <cstdint>
#include "memory/VeloxColumnarBatch.h"
+#include "utils/exception.h"
#include "velox/row/UnsafeRowDeserializers.h"
#include "velox/row/UnsafeRowFast.h"
using namespace facebook;
namespace gluten {
-void VeloxColumnarToRowConverter::refreshStates(facebook::velox::RowVectorPtr
rowVector) {
- numRows_ = rowVector->size();
+void VeloxColumnarToRowConverter::refreshStates(
+ facebook::velox::RowVectorPtr rowVector,
+ int64_t rowId,
+ int64_t memoryThreshold) {
+ auto vectorLength = rowVector->size();
numCols_ = rowVector->childrenSize();
fast_ = std::make_unique<velox::row::UnsafeRowFast>(rowVector);
size_t totalMemorySize = 0;
if (auto fixedRowSize =
velox::row::UnsafeRowFast::fixedRowSize(velox::asRowType(rowVector->type()))) {
- totalMemorySize += fixedRowSize.value() * numRows_;
+ GLUTEN_CHECK(
+ memoryThreshold > fixedRowSize.value(),
+ "spark.gluten.sql.columnarToRowMemoryThreshold(" +
velox::succinctBytes(memoryThreshold) +
+ ") is too small, it can't hold even one row(" +
velox::succinctBytes(fixedRowSize.value()) + ")");
Review Comment:
Let's not report exception here, just try to allocate the new size for one
row. After all, user needs to increases the number.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]