diff --git a/cpp/core/shuffle/FallbackRangePartitioner.cc b/cpp/core/shuffle/FallbackRangePartitioner.cc index 902abbfc29ce..c76940b56350 100644 --- a/cpp/core/shuffle/FallbackRangePartitioner.cc +++ b/cpp/core/shuffle/FallbackRangePartitioner.cc @@ -44,7 +44,7 @@ arrow::Status gluten::FallbackRangePartitioner::compute( auto index = static_cast(vectorIndex) << 32; for (auto i = 0; i < numRows; ++i) { auto pid = pidArr[i]; - int64_t combined = index | (i & 0xFFFFFFFFLL); + int64_t combined = index | (static_cast(i) & 0xFFFFFFFFLL); auto& vec = rowVectorIndexMap[pid]; vec.push_back(combined); if (pid >= numPartitions_) { diff --git a/cpp/core/shuffle/HashPartitioner.cc b/cpp/core/shuffle/HashPartitioner.cc index f4b567384b66..1f64e567d91f 100644 --- a/cpp/core/shuffle/HashPartitioner.cc +++ b/cpp/core/shuffle/HashPartitioner.cc @@ -55,7 +55,7 @@ arrow::Status gluten::HashPartitioner::compute( auto index = static_cast(vectorIndex) << 32; for (auto i = 0; i < numRows; ++i) { auto pid = computePid(pidArr, i, numPartitions_); - int64_t combined = index | (i & 0xFFFFFFFFLL); + int64_t combined = index | (static_cast(i) & 0xFFFFFFFFLL); auto& vec = rowVectorIndexMap[pid]; vec.push_back(combined); } diff --git a/cpp/core/shuffle/RandomPartitioner.cc b/cpp/core/shuffle/RandomPartitioner.cc index 0c08e632587e..890125c337fd 100644 --- a/cpp/core/shuffle/RandomPartitioner.cc +++ b/cpp/core/shuffle/RandomPartitioner.cc @@ -35,7 +35,7 @@ arrow::Status gluten::RandomPartitioner::compute( std::unordered_map>& rowVectorIndexMap) { auto index = static_cast(vectorIndex) << 32; for (int32_t i = 0; i < numRows; ++i) { - int64_t combined = index | (i & 0xFFFFFFFFLL); + int64_t combined = index | (static_cast(i) & 0xFFFFFFFFLL); auto& vec = rowVectorIndexMap[dist_(rng_)]; vec.push_back(combined); } diff --git a/cpp/core/shuffle/RoundRobinPartitioner.cc b/cpp/core/shuffle/RoundRobinPartitioner.cc index 2e06c421dd32..4365e334755e 100644 --- a/cpp/core/shuffle/RoundRobinPartitioner.cc +++ b/cpp/core/shuffle/RoundRobinPartitioner.cc @@ -38,7 +38,7 @@ arrow::Status gluten::RoundRobinPartitioner::compute( std::unordered_map>& rowVectorIndexMap) { auto index = static_cast(vectorIndex) << 32; for (int32_t i = 0; i < numRows; ++i) { - int64_t combined = index | (i & 0xFFFFFFFFLL); + int64_t combined = index | (static_cast(i) & 0xFFFFFFFFLL); auto& vec = rowVectorIndexMap[pidSelection_]; vec.push_back(combined); pidSelection_ = (pidSelection_ + 1) % numPartitions_; diff --git a/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc b/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc index 19a2bbafd2c2..1ec043e66035 100644 --- a/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc +++ b/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc @@ -33,8 +33,8 @@ inline int64_t getFieldOffset(int64_t nullBitsetWidthInBytes, int32_t index) { } inline bool isNull(uint8_t* buffer_address, int32_t index) { - int64_t mask = 1L << (index & 0x3f); // mod 64 and shift - int64_t wordOffset = (index >> 6) * 8; + int64_t mask = 1L << (static_cast(index) & 0x3f); // mod 64 and shift + int64_t wordOffset = (static_cast(index) >> 6) * 8; int64_t value = *((int64_t*)(buffer_address + wordOffset)); return (value & mask) != 0; }