Vishwanatha-HD commented on code in PR #48203:
URL: https://github.com/apache/arrow/pull/48203#discussion_r2557387031


##########
cpp/src/parquet/decoder.cc:
##########
@@ -458,7 +470,24 @@ inline int DecodePlain(const uint8_t* data, int64_t 
data_size, int num_values,
   }
   // If bytes_to_decode == 0, data could be null
   if (bytes_to_decode > 0) {
+#if ARROW_LITTLE_ENDIAN
     memcpy(out, data, static_cast<size_t>(bytes_to_decode));
+#else
+    // On big-endian systems, we need to byte-swap each value
+    // since Parquet data is stored in little-endian format.
+    // Only apply to integer and floating-point types that have 
FromLittleEndian support.
+    if constexpr (std::is_same_v<T, int32_t> || std::is_same_v<T, uint32_t> ||
+                  std::is_same_v<T, int64_t> || std::is_same_v<T, uint64_t> ||
+                  std::is_same_v<T, float> || std::is_same_v<T, double>) {

Review Comment:
   Hi @pitrou.. Thanks for your rerview comments.. Please note that 
std::is_arithmetic_v<T> will have the "bool" type also.. And on s390x, we dont 
want to convert the byte value, as you know, there is no endianess in one byte 
value.. Hence this change will not be proper.. Thanks.. 



-- 
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]

Reply via email to