Jefffrey commented on code in PR #10556:
URL: https://github.com/apache/arrow-rs/pull/10556#discussion_r3717134849
##########
arrow-row/src/lib.rs:
##########
@@ -5139,32 +5119,23 @@ mod tests {
15 => Arc::new(generate_byte_view(rng, len, 0.8)),
16 => Arc::new(generate_fixed_stringview_column(len)),
17 => Arc::new(
- generate_list(&mut rng.clone(), len + 1000, 0.8, |rng,
values_len| {
+ generate_list(rng, len + 1000, 0.8, |rng, values_len| {
Arc::new(generate_primitive_array::<Int64Type>(rng,
values_len, 0.8))
})
.slice(500, len),
),
18 => Arc::new(generate_boolean_array(rng, len, 0.8)),
- 19 => Arc::new(generate_list_view(
- &mut rng.clone(),
Review Comment:
they removed `Clone` from `StdRng` so restructured this code a little
##########
parquet-variant-compute/benches/variant_kernels.rs:
##########
@@ -17,15 +17,14 @@
use arrow::array::{Array, ArrayRef, BinaryViewArray, BinaryViewBuilder,
StringArray, StructArray};
use arrow::buffer::Buffer;
-use arrow::util::test_util::seedable_rng;
Review Comment:
because we had this dependency, `rand` dependency of
`parquet-variant-compute` was tied to the `rand` dependency in `arrow`;
decouple them since its calling this single function, makes upgrading easier in
the future
##########
parquet/benches/metadata.rs:
##########
@@ -31,19 +31,19 @@ use parquet::schema::parser::parse_message_type;
use parquet::schema::types::{
ColumnDescPtr, ColumnDescriptor, ColumnPath, SchemaDescriptor, Type as
SchemaType,
};
-use rand::Rng;
+use rand::{RngExt, SeedableRng};
-use arrow::util::test_util::seedable_rng;
use bytes::Bytes;
use criterion::{Criterion, criterion_group, criterion_main};
use parquet::file::reader::SerializedFileReader;
use parquet::file::serialized_reader::ReadOptionsBuilder;
+use rand::rngs::StdRng;
const NUM_COLUMNS: usize = 10_000;
const NUM_ROW_GROUPS: usize = 10;
fn encoded_meta(is_nullable: bool, has_lists: bool, write_path_in_schema:
bool) -> Vec<u8> {
- let mut rng = seedable_rng();
+ let mut rng = StdRng::seed_from_u64(42);
Review Comment:
same issue here for parquet; however we still need the dependency since we
use other functions from arrow test_util; so long as we don't use any that
exposes rand
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]