From 0bef6412f10e42b87f7e1e1deaa71a63cfdd273f Mon Sep 17 00:00:00 2001 From: Kazuyuki Tanimura Date: Fri, 2 Aug 2024 14:18:26 -0700 Subject: [PATCH] fix: Optimize decimal creation macros --- native/core/src/parquet/read/values.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/native/core/src/parquet/read/values.rs b/native/core/src/parquet/read/values.rs index 7a64bf6b6..a65db79f5 100644 --- a/native/core/src/parquet/read/values.rs +++ b/native/core/src/parquet/read/values.rs @@ -211,12 +211,12 @@ macro_rules! make_int_variant_dict_impl { make_int_variant_dict_impl!(Int16ToDoubleType, i16, f64); make_int_variant_dict_impl!(Int32To64Type, i32, i64); make_int_variant_dict_impl!(Int32ToDecimal64Type, i32, i64); -make_int_variant_dict_impl!(Int32DecimalType, i128, i128); make_int_variant_dict_impl!(Int32ToDoubleType, i32, f64); make_int_variant_dict_impl!(Int32TimestampMicrosType, i32, i64); +make_int_variant_dict_impl!(FloatToDoubleType, f32, f64); +make_int_variant_dict_impl!(Int32DecimalType, i128, i128); make_int_variant_dict_impl!(Int64DecimalType, i128, i128); make_int_variant_dict_impl!(UInt64Type, u128, u128); -make_int_variant_dict_impl!(FloatToDoubleType, f32, f64); impl PlainDecoding for Int32DateType { fn decode(src: &mut PlainDecoderInner, dst: &mut ParquetMutableVector, num: usize) { @@ -808,7 +808,7 @@ macro_rules! make_plain_decimal_int_impl { impl PlainDictDecoding for $ty { #[inline] fn decode_dict_one(_: usize, val_idx: usize, src: &ParquetMutableVector, dst: &mut ParquetMutableVector, _: usize) { - let num_bytes = std::mem::size_of::() + let num_bytes = std::mem::size_of::<$dst_type>() bit::memcpy( &src.value_buffer[val_idx * num_bytes..(val_idx + 1) * num_bytes], &mut dst.value_buffer[dst.num_values * num_bytes..],