Skip to content

Commit

Permalink
Replace once_cell::Lazy with std::sync::LazyLock (#14480)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel authored Feb 4, 2025
1 parent 0d9f845 commit 85fbde2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion datafusion/physical-plan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ tokio = { workspace = true }
criterion = { version = "0.5", features = ["async_futures"] }
datafusion-functions-aggregate = { workspace = true }
datafusion-functions-window = { workspace = true }
once_cell = "1.18.0"
rand = { workspace = true }
rstest = { workspace = true }
rstest_reuse = "0.7.0"
Expand Down
7 changes: 3 additions & 4 deletions datafusion/physical-plan/src/joins/symmetric_hash_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ pub enum SHJStreamState {
#[cfg(test)]
mod tests {
use std::collections::HashMap;
use std::sync::Mutex;
use std::sync::{LazyLock, Mutex};

use super::*;
use crate::joins::test_utils::{
Expand All @@ -1729,7 +1729,6 @@ mod tests {
use datafusion_physical_expr::expressions::{binary, col, lit, Column};
use datafusion_physical_expr_common::sort_expr::{LexOrdering, PhysicalSortExpr};

use once_cell::sync::Lazy;
use rstest::*;

const TABLE_SIZE: i32 = 30;
Expand All @@ -1738,8 +1737,8 @@ mod tests {
type TableValue = (Vec<RecordBatch>, Vec<RecordBatch>); // (left, right)

// Cache for storing tables
static TABLE_CACHE: Lazy<Mutex<HashMap<TableKey, TableValue>>> =
Lazy::new(|| Mutex::new(HashMap::new()));
static TABLE_CACHE: LazyLock<Mutex<HashMap<TableKey, TableValue>>> =
LazyLock::new(|| Mutex::new(HashMap::new()));

fn get_or_create_table(
cardinality: (i32, i32),
Expand Down

0 comments on commit 85fbde2

Please sign in to comment.