This is an automated email from the ASF dual-hosted git repository.

yangzy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new bbb2e2f5e [VL] Fix std::min params type mismatch in Apple clang 15 
(#6593)
bbb2e2f5e is described below

commit bbb2e2f5e87cc726020cab45777232511b7b9d85
Author: Mingliang Zhu <[email protected]>
AuthorDate: Sat Jul 27 22:25:44 2024 +0800

    [VL] Fix std::min params type mismatch in Apple clang 15 (#6593)
---
 cpp/velox/shuffle/VeloxSortShuffleWriter.cc | 6 +++---
 cpp/velox/shuffle/VeloxSortShuffleWriter.h  | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cpp/velox/shuffle/VeloxSortShuffleWriter.cc 
b/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
index cb81ea5f6..7c033fb98 100644
--- a/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
+++ b/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
@@ -161,7 +161,7 @@ arrow::Status VeloxSortShuffleWriter::insert(const 
facebook::velox::RowVectorPtr
     auto rows = maxRowsToInsert(rowOffset, remainingRows);
     if (rows == 0) {
       auto minSizeRequired = fixedRowSize_ ? fixedRowSize_.value() : 
rowSizes_[rowOffset + 1] - rowSizes_[rowOffset];
-      acquireNewBuffer(memLimit, minSizeRequired);
+      acquireNewBuffer((uint64_t)memLimit, minSizeRequired);
       rows = maxRowsToInsert(rowOffset, remainingRows);
       ARROW_RETURN_IF(
           rows == 0, arrow::Status::Invalid("Failed to insert rows. Remaining 
rows: " + std::to_string(remainingRows)));
@@ -277,8 +277,8 @@ uint32_t VeloxSortShuffleWriter::maxRowsToInsert(uint32_t 
offset, uint32_t rows)
   return iter - beginIter;
 }
 
-void VeloxSortShuffleWriter::acquireNewBuffer(int64_t memLimit, uint64_t 
minSizeRequired) {
-  auto size = std::max(std::min((uint64_t)memLimit >> 2, 64UL * 1024 * 1024), 
minSizeRequired);
+void VeloxSortShuffleWriter::acquireNewBuffer(uint64_t memLimit, uint64_t 
minSizeRequired) {
+  auto size = std::max(std::min<uint64_t>(memLimit >> 2, 64UL * 1024 * 1024), 
minSizeRequired);
   // Allocating new buffer can trigger spill.
   auto newBuffer = facebook::velox::AlignedBuffer::allocate<char>(size, 
veloxPool_.get(), 0);
   pages_.emplace_back(std::move(newBuffer));
diff --git a/cpp/velox/shuffle/VeloxSortShuffleWriter.h 
b/cpp/velox/shuffle/VeloxSortShuffleWriter.h
index 8f01997b1..6ac5308d0 100644
--- a/cpp/velox/shuffle/VeloxSortShuffleWriter.h
+++ b/cpp/velox/shuffle/VeloxSortShuffleWriter.h
@@ -76,7 +76,7 @@ class VeloxSortShuffleWriter final : public 
VeloxShuffleWriter {
 
   uint32_t maxRowsToInsert(uint32_t offset, uint32_t rows);
 
-  void acquireNewBuffer(int64_t memLimit, uint64_t minSizeRequired);
+  void acquireNewBuffer(uint64_t memLimit, uint64_t minSizeRequired);
 
   void growArrayIfNecessary(uint32_t rows);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to