This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new b36f5e2020 Minor: Move proxy to datafusion common (#10561)
b36f5e2020 is described below

commit b36f5e20207270378f753c2d8c5fc73d8bc80781
Author: Jay Zhan <[email protected]>
AuthorDate: Mon May 20 23:27:40 2024 +0800

    Minor: Move proxy to datafusion common (#10561)
    
    * move proxy to common
    
    Signed-off-by: jayzhan211 <[email protected]>
    
    * fix doc
    
    Signed-off-by: jayzhan211 <[email protected]>
    
    * move to utils
    
    Signed-off-by: jayzhan211 <[email protected]>
    
    * fix doc
    
    Signed-off-by: jayzhan211 <[email protected]>
    
    ---------
    
    Signed-off-by: jayzhan211 <[email protected]>
---
 Cargo.toml                                                        | 1 +
 datafusion-cli/Cargo.lock                                         | 1 +
 datafusion/common/Cargo.toml                                      | 1 +
 datafusion/common/src/{utils.rs => utils/mod.rs}                  | 2 ++
 .../{execution/src/memory_pool => common/src/utils}/proxy.rs      | 8 ++++----
 datafusion/core/Cargo.toml                                        | 2 +-
 datafusion/execution/Cargo.toml                                   | 2 +-
 datafusion/execution/src/memory_pool/mod.rs                       | 4 +++-
 datafusion/functions/Cargo.toml                                   | 2 +-
 datafusion/optimizer/Cargo.toml                                   | 2 +-
 datafusion/physical-expr/Cargo.toml                               | 2 +-
 datafusion/physical-plan/Cargo.toml                               | 2 +-
 12 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index e78fe4767d..04c5f4755f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -93,6 +93,7 @@ doc-comment = "0.3"
 env_logger = "0.11"
 futures = "0.3"
 half = { version = "2.2.1", default-features = false }
+hashbrown = { version = "0.14", features = ["raw"] }
 indexmap = "2.0.0"
 itertools = "0.12"
 log = "^0.4"
diff --git a/datafusion-cli/Cargo.lock b/datafusion-cli/Cargo.lock
index fd471e7501..62ae154a42 100644
--- a/datafusion-cli/Cargo.lock
+++ b/datafusion-cli/Cargo.lock
@@ -1206,6 +1206,7 @@ dependencies = [
  "arrow-schema",
  "chrono",
  "half",
+ "hashbrown 0.14.5",
  "instant",
  "libc",
  "num_cpus",
diff --git a/datafusion/common/Cargo.toml b/datafusion/common/Cargo.toml
index 2391b2f830..22944133f8 100644
--- a/datafusion/common/Cargo.toml
+++ b/datafusion/common/Cargo.toml
@@ -56,6 +56,7 @@ arrow-buffer = { workspace = true }
 arrow-schema = { workspace = true }
 chrono = { workspace = true }
 half = { workspace = true }
+hashbrown = { workspace = true }
 libc = "0.2.140"
 num_cpus = { workspace = true }
 object_store = { workspace = true, optional = true }
diff --git a/datafusion/common/src/utils.rs b/datafusion/common/src/utils/mod.rs
similarity index 99%
rename from datafusion/common/src/utils.rs
rename to datafusion/common/src/utils/mod.rs
index a8ca283fcd..402ec95b33 100644
--- a/datafusion/common/src/utils.rs
+++ b/datafusion/common/src/utils/mod.rs
@@ -17,6 +17,8 @@
 
 //! This module provides the bisect function, which implements binary search.
 
+pub mod proxy;
+
 use crate::error::{_internal_datafusion_err, _internal_err};
 use crate::{arrow_datafusion_err, DataFusionError, Result, ScalarValue};
 use arrow::array::{ArrayRef, PrimitiveArray};
diff --git a/datafusion/execution/src/memory_pool/proxy.rs 
b/datafusion/common/src/utils/proxy.rs
similarity index 95%
rename from datafusion/execution/src/memory_pool/proxy.rs
rename to datafusion/common/src/utils/proxy.rs
index 29874fdaed..d68b5e3543 100644
--- a/datafusion/execution/src/memory_pool/proxy.rs
+++ b/datafusion/common/src/utils/proxy.rs
@@ -31,7 +31,7 @@ pub trait VecAllocExt {
     ///
     /// # Example:
     /// ```
-    /// # use datafusion_execution::memory_pool::proxy::VecAllocExt;
+    /// # use datafusion_common::utils::proxy::VecAllocExt;
     /// // use allocated to incrementally track how much memory is allocated 
in the vec
     /// let mut allocated = 0;
     /// let mut vec = Vec::new();
@@ -49,7 +49,7 @@ pub trait VecAllocExt {
     /// ```
     /// # Example with other allocations:
     /// ```
-    /// # use datafusion_execution::memory_pool::proxy::VecAllocExt;
+    /// # use datafusion_common::utils::proxy::VecAllocExt;
     /// // You can use the same allocated size to track memory allocated by
     /// // another source. For example
     /// let mut allocated = 27;
@@ -68,7 +68,7 @@ pub trait VecAllocExt {
     ///
     /// # Example:
     /// ```
-    /// # use datafusion_execution::memory_pool::proxy::VecAllocExt;
+    /// # use datafusion_common::utils::proxy::VecAllocExt;
     /// let mut vec = Vec::new();
     /// // Push data into the vec and the accounting will be updated to reflect
     /// // memory allocation
@@ -119,7 +119,7 @@ pub trait RawTableAllocExt {
     ///
     /// # Example:
     /// ```
-    /// # use datafusion_execution::memory_pool::proxy::RawTableAllocExt;
+    /// # use datafusion_common::utils::proxy::RawTableAllocExt;
     /// # use hashbrown::raw::RawTable;
     /// let mut table = RawTable::new();
     /// let mut allocated = 0;
diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml
index 2bd552aacc..cef45e41a3 100644
--- a/datafusion/core/Cargo.toml
+++ b/datafusion/core/Cargo.toml
@@ -111,7 +111,7 @@ flate2 = { version = "1.0.24", optional = true }
 futures = { workspace = true }
 glob = "0.3.0"
 half = { workspace = true }
-hashbrown = { version = "0.14", features = ["raw"] }
+hashbrown = { workspace = true }
 indexmap = { workspace = true }
 itertools = { workspace = true }
 log = { workspace = true }
diff --git a/datafusion/execution/Cargo.toml b/datafusion/execution/Cargo.toml
index a00b3354eb..fb2e7e914f 100644
--- a/datafusion/execution/Cargo.toml
+++ b/datafusion/execution/Cargo.toml
@@ -42,7 +42,7 @@ dashmap = { workspace = true }
 datafusion-common = { workspace = true, default-features = true }
 datafusion-expr = { workspace = true }
 futures = { workspace = true }
-hashbrown = { version = "0.14", features = ["raw"] }
+hashbrown = { workspace = true }
 log = { workspace = true }
 object_store = { workspace = true }
 parking_lot = { workspace = true }
diff --git a/datafusion/execution/src/memory_pool/mod.rs 
b/datafusion/execution/src/memory_pool/mod.rs
index 7816f15bc2..321a89127b 100644
--- a/datafusion/execution/src/memory_pool/mod.rs
+++ b/datafusion/execution/src/memory_pool/mod.rs
@@ -22,7 +22,9 @@ use datafusion_common::Result;
 use std::{cmp::Ordering, sync::Arc};
 
 mod pool;
-pub mod proxy;
+pub mod proxy {
+    pub use datafusion_common::utils::proxy::{RawTableAllocExt, VecAllocExt};
+}
 
 pub use pool::*;
 
diff --git a/datafusion/functions/Cargo.toml b/datafusion/functions/Cargo.toml
index 0886dee034..ceb851a390 100644
--- a/datafusion/functions/Cargo.toml
+++ b/datafusion/functions/Cargo.toml
@@ -74,7 +74,7 @@ datafusion-common = { workspace = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
 datafusion-physical-expr = { workspace = true, default-features = true }
-hashbrown = { version = "0.14", features = ["raw"], optional = true }
+hashbrown = { workspace = true, optional = true }
 hex = { version = "0.4", optional = true }
 itertools = { workspace = true }
 log = { workspace = true }
diff --git a/datafusion/optimizer/Cargo.toml b/datafusion/optimizer/Cargo.toml
index 45ece35c23..67d5c9b23b 100644
--- a/datafusion/optimizer/Cargo.toml
+++ b/datafusion/optimizer/Cargo.toml
@@ -46,7 +46,7 @@ chrono = { workspace = true }
 datafusion-common = { workspace = true, default-features = true }
 datafusion-expr = { workspace = true }
 datafusion-physical-expr = { workspace = true }
-hashbrown = { version = "0.14", features = ["raw"] }
+hashbrown = { workspace = true }
 indexmap = { workspace = true }
 itertools = { workspace = true }
 log = { workspace = true }
diff --git a/datafusion/physical-expr/Cargo.toml 
b/datafusion/physical-expr/Cargo.toml
index 5261f1c896..7104b5d660 100644
--- a/datafusion/physical-expr/Cargo.toml
+++ b/datafusion/physical-expr/Cargo.toml
@@ -61,7 +61,7 @@ datafusion-expr = { workspace = true }
 datafusion-functions-aggregate = { workspace = true }
 datafusion-physical-expr-common = { workspace = true }
 half = { workspace = true }
-hashbrown = { version = "0.14", features = ["raw"] }
+hashbrown = { workspace = true }
 hex = { version = "0.4", optional = true }
 indexmap = { workspace = true }
 itertools = { workspace = true, features = ["use_std"] }
diff --git a/datafusion/physical-plan/Cargo.toml 
b/datafusion/physical-plan/Cargo.toml
index 25e1a6ad5b..3e9c9ee0e6 100644
--- a/datafusion/physical-plan/Cargo.toml
+++ b/datafusion/physical-plan/Cargo.toml
@@ -55,7 +55,7 @@ datafusion-physical-expr = { workspace = true, 
default-features = true }
 datafusion-physical-expr-common = { workspace = true }
 futures = { workspace = true }
 half = { workspace = true }
-hashbrown = { version = "0.14", features = ["raw"] }
+hashbrown = { workspace = true }
 indexmap = { workspace = true }
 itertools = { workspace = true, features = ["use_std"] }
 log = { workspace = true }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to