diff --git a/Cargo.lock b/Cargo.lock index 9fde69c7c..0f193c8f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ "miniz_oxide", "num-bigint", "quad-rand", - "rand", + "rand 0.9.2", "regex-lite", "serde", "serde_bytes", @@ -1010,7 +1010,7 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq", - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -1169,6 +1169,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chacha20" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.0", +] + [[package]] name = "chrono" version = "0.4.42" @@ -1379,6 +1390,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -1651,7 +1671,7 @@ dependencies = [ "object_store", "parking_lot", "parquet", - "rand", + "rand 0.9.2", "regex", "rstest", "sqlparser", @@ -1775,7 +1795,7 @@ dependencies = [ "itertools 0.14.0", "log", "object_store", - "rand", + "rand 0.9.2", "tokio", "tokio-util", "url", @@ -1923,7 +1943,7 @@ dependencies = [ "log", "object_store", "parking_lot", - "rand", + "rand 0.9.2", "tempfile", "url", ] @@ -2010,7 +2030,7 @@ dependencies = [ "log", "md-5", "num-traits", - "rand", + "rand 0.9.2", "regex", "sha2", "unicode-segmentation", @@ -2853,6 +2873,20 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "rand_core 0.10.0", + "wasip2", + "wasip3", +] + [[package]] name = "glam" version = "0.31.0" @@ -3316,6 +3350,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "ident_case" version = "1.0.1" @@ -3351,6 +3391,8 @@ checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", + "serde", + "serde_core", ] [[package]] @@ -3467,6 +3509,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "lexical-core" version = "1.0.6" @@ -3905,7 +3953,7 @@ dependencies = [ "parking_lot", "percent-encoding", "quick-xml", - "rand", + "rand 0.9.2", "reqwest", "ring", "rustls-pemfile", @@ -4367,7 +4415,7 @@ dependencies = [ "bytes", "getrandom 0.3.4", "lru-slab", - "rand", + "rand 0.9.2", "ring", "rustc-hash", "rustls", @@ -4425,7 +4473,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha", - "rand_core", + "rand_core 0.9.3", +] + +[[package]] +name = "rand" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +dependencies = [ + "chacha20", + "getrandom 0.4.1", + "rand_core 0.10.0", ] [[package]] @@ -4435,7 +4494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.3", ] [[package]] @@ -4447,6 +4506,12 @@ dependencies = [ "getrandom 0.3.4", ] +[[package]] +name = "rand_core" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" + [[package]] name = "rand_distr" version = "0.5.1" @@ -4454,7 +4519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" dependencies = [ "num-traits", - "rand", + "rand 0.9.2", ] [[package]] @@ -5150,7 +5215,7 @@ dependencies = [ "log", "num-traits", "pretty_env_logger", - "rand", + "rand 0.10.0", "rand_distr", "robust", "rstar 0.12.2", @@ -5410,7 +5475,7 @@ dependencies = [ "once_cell", "parking_lot", "pin-project-lite", - "rand", + "rand 0.10.0", "rstest", "sedona-common", "sedona-expr", @@ -5444,7 +5509,7 @@ dependencies = [ "geo-traits", "geo-types", "parquet", - "rand", + "rand 0.10.0", "rstest", "sedona-common", "sedona-expr", @@ -5634,7 +5699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest", ] @@ -6224,6 +6289,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "unindent" version = "0.2.4" @@ -6327,7 +6398,16 @@ version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.46.0", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", ] [[package]] @@ -6388,6 +6468,28 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + [[package]] name = "wasm-streams" version = "0.4.2" @@ -6401,6 +6503,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + [[package]] name = "web-sys" version = "0.3.83" @@ -6708,6 +6822,94 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn 2.0.114", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.114", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + [[package]] name = "wkb" version = "0.9.2" diff --git a/Cargo.toml b/Cargo.toml index e0fc7c595..85ed3630c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,7 +120,7 @@ parquet = { version = "57.0.0", default-features = false, features = [ "async", "object_store", ] } -rand = "0.9" +rand = "0.10" regex = "1.12" rstest = "0.26.1" serde = { version = "1" } diff --git a/rust/sedona-spatial-join/bench/partitioning/common.rs b/rust/sedona-spatial-join/bench/partitioning/common.rs index dd77f9738..77269565c 100644 --- a/rust/sedona-spatial-join/bench/partitioning/common.rs +++ b/rust/sedona-spatial-join/bench/partitioning/common.rs @@ -17,7 +17,7 @@ //! Shared helpers for partitioner benchmarks. -use rand::{rngs::StdRng, Rng, SeedableRng}; +use rand::{rngs::StdRng, RngExt, SeedableRng}; use sedona_geometry::{bounding_box::BoundingBox, interval::IntervalTrait}; pub const GRID_DIM: usize = 4; // 4x4 grid => 16 partitions like typical workloads @@ -66,7 +66,7 @@ pub fn sample_queries(extent: &BoundingBox, batch_size: usize) -> Vec BoundingBox { +fn random_bbox(extent: &BoundingBox, rng: &mut impl RngExt, max_span: f64) -> BoundingBox { let (min_x, max_x) = (extent.x().lo(), extent.x().hi()); let (min_y, max_y) = (extent.y().lo(), extent.y().hi()); diff --git a/rust/sedona-spatial-join/bench/partitioning/kdb.rs b/rust/sedona-spatial-join/bench/partitioning/kdb.rs index 1edc4bb61..86a9bc450 100644 --- a/rust/sedona-spatial-join/bench/partitioning/kdb.rs +++ b/rust/sedona-spatial-join/bench/partitioning/kdb.rs @@ -18,7 +18,7 @@ use std::hint::black_box; use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput}; -use rand::{rngs::StdRng, Rng, SeedableRng}; +use rand::{rngs::StdRng, RngExt, SeedableRng}; use sedona_geometry::{bounding_box::BoundingBox, interval::IntervalTrait}; use sedona_spatial_join::partitioning::{kdb::KDBPartitioner, SpatialPartitioner}; @@ -102,7 +102,7 @@ fn synthetic_bboxes( boxes } -fn random_bbox(extent: &BoundingBox, rng: &mut StdRng, max_span: f64) -> BoundingBox { +fn random_bbox(extent: &BoundingBox, rng: &mut impl RngExt, max_span: f64) -> BoundingBox { let (min_x, max_x) = (extent.x().lo(), extent.x().hi()); let (min_y, max_y) = (extent.y().lo(), extent.y().hi()); diff --git a/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs b/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs index eb6453db3..aa4f8a16b 100644 --- a/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs +++ b/rust/sedona-spatial-join/bench/partitioning/stream_repartitioner.rs @@ -31,7 +31,7 @@ use datafusion::config::SpillCompression; use datafusion_execution::runtime_env::RuntimeEnv; use datafusion_physical_plan::metrics::{ExecutionPlanMetricsSet, SpillMetrics}; use futures::executor::block_on; -use rand::{rngs::StdRng, Rng, SeedableRng}; +use rand::{rngs::StdRng, RngExt, SeedableRng}; use sedona_geometry::{bounding_box::BoundingBox, interval::IntervalTrait, wkb_factory::wkb_point}; use sedona_schema::datatypes::WKB_GEOMETRY; use sedona_spatial_join::evaluated_batch::{ @@ -133,7 +133,7 @@ fn random_evaluated_batch( EvaluatedBatch { batch, geom_array } } -fn random_record_batch(schema: Arc, rows: usize, rng: &mut StdRng) -> RecordBatch { +fn random_record_batch(schema: Arc, rows: usize, rng: &mut impl RngExt) -> RecordBatch { let ids = Int64Array::from_iter_values((0..rows).map(|_| rng.random_range(0..1_000_000_i64))); let words = StringArray::from_iter_values((0..rows).map(|_| random_string(rng))); let dates = Date32Array::from_iter_values((0..rows).map(|_| rng.random_range(18_000..20_000))); @@ -151,7 +151,7 @@ fn random_record_batch(schema: Arc, rows: usize, rng: &mut StdRng) -> Re RecordBatch::try_new(schema, columns).expect("record batch assembly should succeed") } -fn random_geometry_array(rows: usize, extent: &BoundingBox, rng: &mut StdRng) -> ArrayRef { +fn random_geometry_array(rows: usize, extent: &BoundingBox, rng: &mut impl RngExt) -> ArrayRef { let wkbs: Vec> = (0..rows) .map(|_| { let x = rng.random_range(extent.x().lo()..=extent.x().hi()); @@ -164,7 +164,7 @@ fn random_geometry_array(rows: usize, extent: &BoundingBox, rng: &mut StdRng) -> Arc::new(binary) } -fn random_string(rng: &mut StdRng) -> String { +fn random_string(rng: &mut impl RngExt) -> String { const CHARSET: &[u8] = b"abcdefghijklmnopqrstuvwxyz"; let mut buf = [0u8; 8]; for slot in &mut buf { @@ -204,7 +204,7 @@ fn build_partitioner(extent: &BoundingBox) -> Arc BoundingBox { +fn random_bbox(extent: &BoundingBox, rng: &mut impl RngExt) -> BoundingBox { let span_x = (extent.x().hi() - extent.x().lo()) / 20.0; let span_y = (extent.y().hi() - extent.y().lo()) / 20.0; let width = rng.random_range(10.0..=span_x).max(1.0); diff --git a/rust/sedona-spatial-join/src/stream.rs b/rust/sedona-spatial-join/src/stream.rs index 177e7b0ff..b1fdfd31d 100644 --- a/rust/sedona-spatial-join/src/stream.rs +++ b/rust/sedona-spatial-join/src/stream.rs @@ -1581,7 +1581,7 @@ mod tests { use arrow::datatypes::{DataType, Field, Schema}; use arrow_array::cast::AsArray; use rand::rngs::StdRng; - use rand::{Rng, SeedableRng}; + use rand::{RngExt, SeedableRng}; fn create_test_batches( num_batches: usize, diff --git a/rust/sedona-spatial-join/src/utils/bbox_sampler.rs b/rust/sedona-spatial-join/src/utils/bbox_sampler.rs index 99280162d..a7cfbeaa2 100644 --- a/rust/sedona-spatial-join/src/utils/bbox_sampler.rs +++ b/rust/sedona-spatial-join/src/utils/bbox_sampler.rs @@ -276,7 +276,7 @@ impl BoundingBoxSamples { mod tests { use super::*; use rand::rngs::StdRng; - use rand::{Rng, SeedableRng}; + use rand::{RngExt, SeedableRng}; use sedona_geometry::interval::IntervalTrait; use std::mem::size_of; diff --git a/rust/sedona-testing/src/benchmark_util.rs b/rust/sedona-testing/src/benchmark_util.rs index 4cd3873be..0a998a12c 100644 --- a/rust/sedona-testing/src/benchmark_util.rs +++ b/rust/sedona-testing/src/benchmark_util.rs @@ -22,7 +22,7 @@ use arrow_schema::DataType; use datafusion_common::{exec_datafusion_err, Result, ScalarValue}; use datafusion_expr::{AggregateUDF, ScalarUDF}; use geo_types::Rect; -use rand::{distr::Uniform, rngs::StdRng, Rng, SeedableRng}; +use rand::{distr::Uniform, rngs::StdRng, Rng, RngExt, SeedableRng}; use sedona_common::sedona_internal_err; use sedona_geometry::types::GeometryTypeId; diff --git a/rust/sedona-testing/src/datagen.rs b/rust/sedona-testing/src/datagen.rs index be94f55da..dafaa819a 100644 --- a/rust/sedona-testing/src/datagen.rs +++ b/rust/sedona-testing/src/datagen.rs @@ -32,7 +32,7 @@ use geo_types::{ Coord, Geometry, GeometryCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, Rect, }; -use rand::{distr::Uniform, rngs::StdRng, Rng, SeedableRng}; +use rand::{distr::Uniform, rngs::StdRng, Rng, RngExt, SeedableRng}; use sedona_common::sedona_internal_err; use sedona_geometry::types::GeometryTypeId; use sedona_schema::datatypes::{SedonaType, WKB_GEOMETRY};