comphead commented on code in PR #604:
URL: https://github.com/apache/datafusion-comet/pull/604#discussion_r1681581735
##########
native/core/src/parquet/read/values.rs:
##########
@@ -285,6 +261,59 @@ impl PlainDecoding for Int32DateType {
}
}
+impl PlainDecoding for Int32TimestampMicrosType {
+ #[inline]
+ fn decode(src: &mut PlainDecoderInner, dst: &mut ParquetMutableVector,
num: usize) {
+ let src_data = &src.data;
+ let byte_width = src.desc.type_length() as usize;
+ let num_bytes = byte_width * num;
+
+ {
+ let mut offset = src.offset;
+ for _ in 0..num {
+ let v = &src_data[offset..offset + byte_width] as *const [u8]
as *const u8
+ as *const i32;
+
+ // TODO: optimize this further as checking value one by one is
not very efficient
+ unsafe {
+ if unlikely(v.read_unaligned() <
JULIAN_GREGORIAN_SWITCH_OFF_DAY) {
+ panic!(
+ "Encountered timestamp value {}, which is before
1582-10-15 (counting \
+ backwards from Unix eopch date 1970-01-01), and could
be ambigous \
Review Comment:
```suggestion
backwards from Unix epoch date 1970-01-01), and
could be ambiguous \
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]