Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jun 10, 2024
1 parent 17b83de commit f4cc518
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/parquet/read/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,12 @@ macro_rules! make_int_variant_impl {
($ty: ident, $native_ty: ty, $type_size: expr) => {
impl PlainDecoding for $ty {
fn decode(src: &mut PlainDecoderInner, dst: &mut ParquetMutableVector, num: usize) {
let src_ptr = src.data.as_ptr() as *const u8;
assert!(src.offset % 4 == 0);
let src_ptr = src.data.as_ptr() as *const i32;
let dst_ptr = dst.value_buffer.as_mut_ptr() as *mut $native_ty;
unsafe {
for i in 0..num {
let ptr = src_ptr.add(src.offset + i * 4) as *const u32;
let ptr = src_ptr.add(src.offset/4 + i) as *const i32;
dst_ptr
.add(dst.num_values + i)
.write_unaligned(ptr.read_unaligned() as $native_ty);
Expand Down

0 comments on commit f4cc518

Please sign in to comment.