This is an automated email from the ASF dual-hosted git repository.
fsaintjacques pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new c69e3b4 ARROW-5923: [C++][Parquet] Reword comment about UBSan and
Int96 in writer.cc
c69e3b4 is described below
commit c69e3b4f69bbf22f86e6c474dd2cdd612c847b4b
Author: Micah Kornfield <[email protected]>
AuthorDate: Fri Jul 12 08:28:55 2019 -0400
ARROW-5923: [C++][Parquet] Reword comment about UBSan and Int96 in writer.cc
CC @fsaintjacques @pitrou
Author: Micah Kornfield <[email protected]>
Closes #4858 from emkornfield/fix_docs and squashes the following commits:
5294aa75b <Micah Kornfield> fix typo in comment
---
cpp/src/parquet/arrow/writer.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cpp/src/parquet/arrow/writer.h b/cpp/src/parquet/arrow/writer.h
index 5a72da6..6906e46 100644
--- a/cpp/src/parquet/arrow/writer.h
+++ b/cpp/src/parquet/arrow/writer.h
@@ -212,7 +212,8 @@ inline void ArrowTimestampToImpalaTimestamp(const int64_t
time, Int96* impala_ti
int64_t last_day_units = time % UnitPerDay;
auto last_day_nanos = last_day_units * NanosecondsPerUnit;
- // Strage might be unaligned, so use mempcy instead of reinterpret_cast
+ // 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));
}