File tree Expand file tree Collapse file tree
encodings/decimal-byte-parts/src/decimal_byte_parts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ use vortex_array::scalar_fn::fns::cast::CastReduce;
1010use vortex_error:: VortexResult ;
1111
1212use crate :: DecimalByteParts ;
13+ use crate :: decimal_byte_parts:: DecimalBytePartsArrayExt ;
1314use crate :: decimal_byte_parts:: DecimalBytePartsArraySlotsExt ;
14- use crate :: decimal_byte_parts:: with_msp;
1515
1616impl CastReduce for DecimalByteParts {
1717 fn cast ( array : ArrayView < ' _ , Self > , dtype : & DType ) -> VortexResult < Option < ArrayRef > > {
@@ -20,7 +20,7 @@ impl CastReduce for DecimalByteParts {
2020 return Ok ( None ) ;
2121 }
2222 // DecimalBytePartsArray can only have Decimal dtype, so we only handle decimal-to-decimal casts
23- let DType :: Decimal ( target_decimal , target_nullability) = dtype else {
23+ let DType :: Decimal ( _ , target_nullability) = dtype else {
2424 // Cannot cast decimal to non-decimal types - delegate to canonical form
2525 return Ok ( None ) ;
2626 } ;
@@ -30,7 +30,7 @@ impl CastReduce for DecimalByteParts {
3030 . msp ( )
3131 . cast ( array. msp ( ) . dtype ( ) . with_nullability ( * target_nullability) ) ?;
3232
33- with_msp ( array , new_msp, * target_decimal ) . map ( |a| Some ( a. into_array ( ) ) )
33+ array . with_msp ( new_msp) . map ( |a| Some ( a. into_array ( ) ) )
3434 }
3535}
3636
Original file line number Diff line number Diff line change @@ -9,11 +9,13 @@ use vortex_error::VortexResult;
99use vortex_mask:: Mask ;
1010
1111use crate :: DecimalByteParts ;
12- use crate :: decimal_byte_parts:: map_parts ;
12+ use crate :: decimal_byte_parts:: DecimalBytePartsArrayExt ;
1313
1414impl FilterReduce for DecimalByteParts {
1515 fn filter ( array : ArrayView < ' _ , Self > , mask : & Mask ) -> VortexResult < Option < ArrayRef > > {
16- map_parts ( array, |part| part. filter ( mask. clone ( ) ) ) . map ( |d| Some ( d. into_array ( ) ) )
16+ array
17+ . map_parts ( |part| part. filter ( mask. clone ( ) ) )
18+ . map ( |d| Some ( d. into_array ( ) ) )
1719 }
1820}
1921
Original file line number Diff line number Diff line change @@ -9,15 +9,14 @@ use vortex_array::scalar_fn::fns::mask::MaskReduce;
99use vortex_error:: VortexResult ;
1010
1111use crate :: DecimalByteParts ;
12+ use crate :: decimal_byte_parts:: DecimalBytePartsArrayExt ;
1213use crate :: decimal_byte_parts:: DecimalBytePartsArraySlotsExt ;
13- use crate :: decimal_byte_parts:: decimal_dtype;
14- use crate :: decimal_byte_parts:: with_msp;
1514
1615impl MaskReduce for DecimalByteParts {
1716 fn mask ( array : ArrayView < ' _ , Self > , mask : & ArrayRef ) -> VortexResult < Option < ArrayRef > > {
1817 // Validity lives in the MSP, so only that part needs masking: the lower parts hold
1918 // undefined bits in null slots, which is exactly what a masked-out row is.
2019 let masked_msp = MaskExpr :: try_new ( array. msp ( ) . clone ( ) , mask. clone ( ) ) ?. into_array ( ) ;
21- with_msp ( array , masked_msp, decimal_dtype ( array ) ) . map ( |a| Some ( a. into_array ( ) ) )
20+ array . with_msp ( masked_msp) . map ( |a| Some ( a. into_array ( ) ) )
2221 }
2322}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ mod filter;
77pub ( crate ) mod is_constant;
88pub ( crate ) mod kernel;
99mod mask;
10+ mod slice;
1011mod take;
1112
1213#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ use vortex_array::arrays::slice::SliceReduce;
1010use vortex_error:: VortexResult ;
1111
1212use crate :: DecimalByteParts ;
13- use crate :: decimal_byte_parts:: map_parts ;
13+ use crate :: decimal_byte_parts:: DecimalBytePartsArrayExt ;
1414
1515impl SliceReduce for DecimalByteParts {
1616 fn slice ( array : ArrayView < ' _ , Self > , range : Range < usize > ) -> VortexResult < Option < ArrayRef > > {
17- map_parts ( array, |part| part. slice ( range. clone ( ) ) ) . map ( |d| Some ( d. into_array ( ) ) )
17+ array
18+ . map_parts ( |part| part. slice ( range. clone ( ) ) )
19+ . map ( |d| Some ( d. into_array ( ) ) )
1820 }
1921}
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ use vortex_array::arrays::dict::TakeReduce;
88use vortex_error:: VortexResult ;
99
1010use crate :: DecimalByteParts ;
11+ use crate :: decimal_byte_parts:: DecimalBytePartsArrayExt ;
1112use crate :: decimal_byte_parts:: DecimalBytePartsArraySlotsExt ;
12- use crate :: decimal_byte_parts:: map_parts;
1313
1414impl TakeReduce for DecimalByteParts {
1515 /// Taking wraps each part in a `Dict` without reading any buffer, so it reduces rather
@@ -22,7 +22,9 @@ impl TakeReduce for DecimalByteParts {
2222 return Ok ( None ) ;
2323 }
2424
25- map_parts ( array, |part| part. take ( indices. clone ( ) ) ) . map ( |a| Some ( a. into_array ( ) ) )
25+ array
26+ . map_parts ( |part| part. take ( indices. clone ( ) ) )
27+ . map ( |a| Some ( a. into_array ( ) ) )
2628 }
2729}
2830
You can’t perform that action at this time.
0 commit comments