Skip to content

Commit

Permalink
Minor: Move proxy to datafusion common (#10561)
Browse files Browse the repository at this point in the history
* move proxy to common

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>

* fix doc

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>

* move to utils

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>

* fix doc

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>

---------

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
  • Loading branch information
jayzhan211 authored May 20, 2024
1 parent e6920c3 commit b36f5e2
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions datafusion-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion datafusion/execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 3 additions & 1 deletion datafusion/execution/src/memory_pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion datafusion/optimizer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit b36f5e2

Please sign in to comment.