Vishwanatha-HD commented on code in PR #48205:
URL: https://github.com/apache/arrow/pull/48205#discussion_r2580322478
##########
cpp/src/parquet/column_writer.h:
##########
@@ -260,13 +261,21 @@ constexpr int64_t kJulianEpochOffsetDays =
INT64_C(2440588);
template <int64_t UnitPerDay, int64_t NanosecondsPerUnit>
inline void ArrowTimestampToImpalaTimestamp(const int64_t time, Int96*
impala_timestamp) {
int64_t julian_days = (time / UnitPerDay) + kJulianEpochOffsetDays;
+#if ARROW_LITTLE_ENDIAN
(*impala_timestamp).value[2] = (uint32_t)julian_days;
+#endif
int64_t last_day_units = time % UnitPerDay;
auto last_day_nanos = 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(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:
Hi @kou.. I tried to run the testcase with the changes that you are
referring above.. Unfortunately, its not working.. I am seeing following
testcase failures on big-endian (s390x) machine..
[ FAILED ] 5 tests, listed below:
[ FAILED ] TestArrowReadWrite.UseDeprecatedInt96
[ FAILED ] TestArrowReadWrite.DownsampleDeprecatedInt96
[ FAILED ] TestArrowReadWrite.ParquetVersionTimestampDifferences
[ FAILED ] ArrowReadWrite.NestedRequiredOuterOptional
[ FAILED ] TestImpalaConversion.ArrowTimestampToImpalaTimestamp
5 FAILED TESTS
These testcases are part of "parquet-arrow-reader-writer-test" testsuites..
--
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]