@@ -6,9 +6,7 @@ use std::sync::Arc;
66
77use arbitrary:: { Arbitrary , Result , Unstructured } ;
88use vortex_buffer:: { BitBuffer , Buffer } ;
9- use vortex_dtype:: {
10- DType , IntegerPType , NativePType , Nullability , PType , smallest_decimal_value_type,
11- } ;
9+ use vortex_dtype:: { DType , IntegerPType , NativePType , Nullability , PType } ;
1210use vortex_error:: { VortexExpect , VortexUnwrap } ;
1311use vortex_scalar:: arbitrary:: random_scalar;
1412use vortex_scalar:: { Scalar , match_each_decimal_value_type} ;
@@ -97,17 +95,20 @@ fn random_array_chunk(
9795 } ,
9896 DType :: Decimal ( decimal, n) => {
9997 let elem_len = chunk_len. unwrap_or ( u. int_in_range ( 0 ..=20 ) ?) ;
100- match_each_decimal_value_type ! ( smallest_decimal_value_type( decimal) , |DVT | {
101- let mut builder =
102- DecimalBuilder :: new:: <DVT >( decimal. precision( ) , decimal. scale( ) , * n) ;
103- for _i in 0 ..elem_len {
104- let random_decimal = random_scalar( u, & DType :: Decimal ( * decimal, * n) ) ?;
105- builder. append_scalar( & random_decimal) . vortex_expect(
106- "was somehow unable to append a decimal to a decimal builder" ,
107- ) ;
98+ match_each_decimal_value_type ! (
99+ DecimalType :: smallest_decimal_value_type( decimal) ,
100+ |DVT | {
101+ let mut builder =
102+ DecimalBuilder :: new:: <DVT >( decimal. precision( ) , decimal. scale( ) , * n) ;
103+ for _i in 0 ..elem_len {
104+ let random_decimal = random_scalar( u, & DType :: Decimal ( * decimal, * n) ) ?;
105+ builder. append_scalar( & random_decimal) . vortex_expect(
106+ "was somehow unable to append a decimal to a decimal builder" ,
107+ ) ;
108+ }
109+ Ok ( builder. finish( ) )
108110 }
109- Ok ( builder. finish( ) )
110- } )
111+ )
111112 }
112113 DType :: Utf8 ( n) => random_string ( u, * n, chunk_len) ,
113114 DType :: Binary ( n) => random_bytes ( u, * n, chunk_len) ,
0 commit comments