Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/velox/shuffle/VeloxGpuShuffleWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void VeloxGpuHashShuffleWriter::splitBoolValueType(const uint8_t* srcAddr, const
if (dstaddr == nullptr) {
continue;
}
auto dstPidBase = (uint8_t*)(dstaddr + partitionBufferBase_[pid] * sizeof(uint8_t));
auto dstPidBase = reinterpret_cast<uint8_t*>(dstaddr + partitionBufferBase_[pid] * sizeof(uint8_t));
auto pos = partition2RowOffsetBase_[pid];
auto end = partition2RowOffsetBase_[pid + 1];
for (; pos < end; ++pos) {
Expand All @@ -42,7 +42,7 @@ void VeloxGpuHashShuffleWriter::splitBoolValueType(const uint8_t* srcAddr, const
// Split timestamp from int128_t to int64_t, both of them represents the timestamp nanoseconds.
arrow::Status VeloxGpuHashShuffleWriter::splitTimestamp(const uint8_t* srcAddr, const std::vector<uint8_t*>& dstAddrs) {
for (auto& pid : partitionUsed_) {
auto dstPidBase = (int64_t*)(dstAddrs[pid] + partitionBufferBase_[pid] * sizeof(int64_t));
auto dstPidBase = reinterpret_cast<int64_t*>(dstAddrs[pid] + partitionBufferBase_[pid] * sizeof(int64_t));
auto pos = partition2RowOffsetBase_[pid];
auto end = partition2RowOffsetBase_[pid + 1];
for (; pos < end; ++pos) {
Expand Down
6 changes: 3 additions & 3 deletions cpp/velox/shuffle/VeloxHashShuffleWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ arrow::Status VeloxHashShuffleWriter::splitBinaryType(
auto& binaryBuf = dst[pid];

// use 32bit offset
auto dstLengthBase = (StringLengthType*)(binaryBuf.lengthPtr) + partitionBufferBase_[pid];
auto dstLengthBase = reinterpret_cast<StringLengthType*>(binaryBuf.lengthPtr) + partitionBufferBase_[pid];

auto valueOffset = binaryBuf.valueOffset;
auto dstValuePtr = binaryBuf.valuePtr + valueOffset;
Expand All @@ -661,7 +661,7 @@ arrow::Status VeloxHashShuffleWriter::splitBinaryType(
if (valueOffset >= capacity) {
auto oldCapacity = capacity;
(void)oldCapacity; // suppress warning
capacity = capacity + std::max((capacity >> multiply), (uint64_t)stringLen);
capacity = capacity + std::max((capacity >> multiply), static_cast<uint64_t>(stringLen));
multiply = std::min(3, multiply + 1);

const auto& valueBuffer = partitionBuffers_[fixedWidthColumnCount_ + binaryIdx][pid][kBinaryValueBufferIndex];
Expand All @@ -675,7 +675,7 @@ arrow::Status VeloxHashShuffleWriter::splitBinaryType(
binaryBuf.valueCapacity = capacity;
dstValuePtr = binaryBuf.valuePtr + valueOffset - stringLen;
// Need to update dstLengthBase because lengthPtr can be updated if Reserve triggers spill.
dstLengthBase = (StringLengthType*)(binaryBuf.lengthPtr) + partitionBufferBase_[pid];
dstLengthBase = reinterpret_cast<StringLengthType*>(binaryBuf.lengthPtr) + partitionBufferBase_[pid];
}

// 2. copy value
Expand Down
2 changes: 1 addition & 1 deletion cpp/velox/shuffle/VeloxHashShuffleWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class VeloxHashShuffleWriter : public VeloxShuffleWriter {
template <typename T>
arrow::Status splitFixedType(const uint8_t* srcAddr, const std::vector<uint8_t*>& dstAddrs) {
for (auto& pid : partitionUsed_) {
auto dstPidBase = (T*)(dstAddrs[pid] + partitionBufferBase_[pid] * sizeof(T));
auto dstPidBase = reinterpret_cast<T*>(dstAddrs[pid] + partitionBufferBase_[pid] * sizeof(T));
auto pos = partition2RowOffsetBase_[pid];
auto end = partition2RowOffsetBase_[pid + 1];
for (; pos < end; ++pos) {
Expand Down