From 360a8e76cd19da73ac14ca15b505a86914d71fcf Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 3 Apr 2024 13:35:37 -0700 Subject: [PATCH] Implement Send + Sync for Datum --- arrow-array/src/scalar.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arrow-array/src/scalar.rs b/arrow-array/src/scalar.rs index f2a696a8f329..52f726993166 100644 --- a/arrow-array/src/scalar.rs +++ b/arrow-array/src/scalar.rs @@ -75,7 +75,7 @@ use crate::Array; /// let r = eq(&a, &b).unwrap(); /// let values: Vec<_> = r.values().iter().collect(); /// assert_eq!(values, &[true, false, false, false, false]); -pub trait Datum { +pub trait Datum: Send + Sync { /// Returns the value for this [`Datum`] and a boolean indicating if the value is scalar fn get(&self) -> (&dyn Array, bool); } @@ -144,3 +144,6 @@ impl Datum for Scalar { (&self.0, true) } } + +unsafe impl Send for Scalar {} +unsafe impl Sync for Scalar {}