@@ -63,10 +63,12 @@ macro_rules! with_counter {
6363// Encoding tree setup functions
6464
6565mod setup {
66+ use rand:: rngs:: StdRng ;
67+
6668 use super :: * ;
6769
6870 fn setup_primitive_arrays ( ) -> ( PrimitiveArray , PrimitiveArray , PrimitiveArray ) {
69- let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 0 ) ;
71+ let mut rng = StdRng :: seed_from_u64 ( 0 ) ;
7072 let uint_array =
7173 PrimitiveArray :: from_iter ( ( 0 ..NUM_VALUES ) . map ( |_| rng. random_range ( 42u32 ..256 ) ) ) ;
7274 let int_array = cast ( uint_array. as_ref ( ) , PType :: I32 . into ( ) )
@@ -113,7 +115,7 @@ mod setup {
113115 /// Create Dict <- VarBinView encoding tree for strings with BitPacked codes
114116 #[ allow( clippy:: cast_possible_truncation) ]
115117 pub fn dict_varbinview_string ( ) -> ArrayRef {
116- let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 42 ) ;
118+ let mut rng = StdRng :: seed_from_u64 ( 42 ) ;
117119
118120 // Create unique values (0.005% uniqueness = 50 unique strings)
119121 let num_unique = ( ( NUM_VALUES as f64 ) * 0.00005 ) as usize ;
@@ -147,7 +149,7 @@ mod setup {
147149 /// Create RunEnd <- FoR <- BitPacked encoding tree for u32
148150 #[ allow( clippy:: cast_possible_truncation) ]
149151 pub fn runend_for_bp_u32 ( ) -> ArrayRef {
150- let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 42 ) ;
152+ let mut rng = StdRng :: seed_from_u64 ( 42 ) ;
151153 // Create data with runs of repeated values
152154 let mut values = Vec :: with_capacity ( NUM_VALUES as usize ) ;
153155 let mut current_value = rng. random_range ( 0u32 ..100 ) ;
@@ -189,7 +191,7 @@ mod setup {
189191 /// Create Dict <- FSST <- VarBin encoding tree for strings
190192 #[ allow( clippy:: cast_possible_truncation) ]
191193 pub fn dict_fsst_varbin_string ( ) -> ArrayRef {
192- let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 43 ) ;
194+ let mut rng = StdRng :: seed_from_u64 ( 43 ) ;
193195
194196 // Create unique values (1% uniqueness = 10,000 unique strings)
195197 let num_unique = ( ( NUM_VALUES as f64 ) * 0.01 ) as usize ;
@@ -221,7 +223,7 @@ mod setup {
221223 /// Compress the VarBin offsets inside FSST with BitPacked
222224 #[ allow( clippy:: cast_possible_truncation) ]
223225 pub fn dict_fsst_varbin_bp_string ( ) -> ArrayRef {
224- let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 45 ) ;
226+ let mut rng = StdRng :: seed_from_u64 ( 45 ) ;
225227
226228 // Create unique values (1% uniqueness = 10,000 unique strings)
227229 let num_unique = ( ( NUM_VALUES as f64 ) * 0.01 ) as usize ;
@@ -276,7 +278,7 @@ mod setup {
276278 /// Create DateTimeParts <- FoR <- BitPacked encoding tree
277279 pub fn datetime_for_bp ( ) -> ArrayRef {
278280 // Create timestamp data (microseconds since epoch)
279- let mut rng = rand :: rngs :: StdRng :: seed_from_u64 ( 123 ) ;
281+ let mut rng = StdRng :: seed_from_u64 ( 123 ) ;
280282 let base_timestamp = 1_600_000_000_000_000i64 ; // Sept 2020 in microseconds
281283 let timestamps: Vec < i64 > = ( 0 ..NUM_VALUES )
282284 . map ( |_| base_timestamp + rng. random_range ( 0 ..86_400_000_000 ) ) // Random times within a day
0 commit comments