pitrou commented on code in PR #48205:
URL: https://github.com/apache/arrow/pull/48205#discussion_r2584474050


##########
cpp/src/parquet/column_writer.h:
##########
@@ -267,9 +267,14 @@ inline void ArrowTimestampToImpalaTimestamp(const int64_t 
time, Int96* impala_ti
   }
   impala_timestamp->value[2] = static_cast<uint32_t>(julian_days);
   uint64_t last_day_nanos = static_cast<uint64_t>(last_day_units) * 
NanosecondsPerUnit;
+#if ARROW_LITTLE_ENDIAN
   // impala_timestamp will be unaligned every other entry so do memcpy instead
   // of assign and reinterpret cast to avoid undefined behavior.
-  std::memcpy(impala_timestamp, &last_day_nanos, sizeof(uint64_t));
+  std::memcpy(impala_timestamp, &last_day_nanos, sizeof(int64_t));
+#else
+  (*impala_timestamp).value[0] = static_cast<uint32_t>(last_day_nanos);
+  (*impala_timestamp).value[1] = static_cast<uint32_t>(last_day_nanos >> 32);

Review Comment:
   Why is this not changing the endianness of values?



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