Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove utils crate and move utils into spark-expr crate #658

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions native/Cargo.lock

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

3 changes: 1 addition & 2 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

[workspace]
members = ["core", "spark-expr", "utils"]
members = ["core", "spark-expr"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -47,7 +47,6 @@ datafusion-physical-plan = { git = "https://github.com/apache/datafusion.git", r
datafusion-physical-expr-common = { git = "https://github.com/apache/datafusion.git", rev = "40.0.0", default-features = false }
datafusion-physical-expr = { git = "https://github.com/apache/datafusion.git", rev = "40.0.0", default-features = false }
datafusion-comet-spark-expr = { path = "spark-expr", version = "0.1.0" }
datafusion-comet-utils = { path = "utils", version = "0.1.0" }
chrono = { version = "0.4", default-features = false, features = ["clock"] }
chrono-tz = { version = "0.8" }
num = "0.4"
Expand Down
1 change: 0 additions & 1 deletion native/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ regex = { workspace = true }
crc32fast = "1.3.2"
simd-adler32 = "0.3.7"
datafusion-comet-spark-expr = { workspace = true }
datafusion-comet-utils = { workspace = true }

[build-dependencies]
prost-build = "0.9.0"
Expand Down
2 changes: 1 addition & 1 deletion native/core/src/execution/datafusion/expressions/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// under the License.

// re-export for legacy reasons
pub use datafusion_comet_utils::{array_with_timezone, down_cast_any_ref};
pub use datafusion_comet_spark_expr::utils::{array_with_timezone, down_cast_any_ref};
2 changes: 1 addition & 1 deletion native/core/src/execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub mod operators;
pub mod serde;
pub mod shuffle;
pub(crate) mod sort;
pub use datafusion_comet_utils::timezone;
pub use datafusion_comet_spark_expr::timezone;
pub(crate) mod utils;

mod memory_pool;
Expand Down
3 changes: 2 additions & 1 deletion native/spark-expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ datafusion-common = { workspace = true }
datafusion-functions = { workspace = true }
datafusion-expr = { workspace = true }
datafusion-physical-expr = { workspace = true }
datafusion-comet-utils = { workspace = true }
datafusion-physical-plan = { workspace = true }
chrono-tz = { workspace = true }
num = { workspace = true }
regex = { workspace = true }
thiserror = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion native/spark-expr/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use num::{
};
use regex::Regex;

use datafusion_comet_utils::{array_with_timezone, down_cast_any_ref};
use crate::utils::{array_with_timezone, down_cast_any_ref};

use crate::{EvalMode, SparkError, SparkResult};

Expand Down
2 changes: 1 addition & 1 deletion native/spark-expr/src/if_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use datafusion::logical_expr::ColumnarValue;
use datafusion_common::{cast::as_boolean_array, Result};
use datafusion_physical_expr::PhysicalExpr;

use datafusion_comet_utils::down_cast_any_ref;
use crate::utils::down_cast_any_ref;

#[derive(Debug, Hash)]
pub struct IfExpr {
Expand Down
3 changes: 3 additions & 0 deletions native/spark-expr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pub mod cast;
mod error;
mod if_expr;

pub mod timezone;
pub mod utils;

pub use abs::Abs;
pub use error::{SparkError, SparkResult};
pub use if_expr::IfExpr;
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions native/utils/src/lib.rs → native/spark-expr/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ use arrow_schema::{ArrowError, DataType};
use std::any::Any;
use std::sync::Arc;

use crate::timezone::Tz;
use arrow::{
array::{as_dictionary_array, Array, ArrayRef, PrimitiveArray},
temporal_conversions::as_datetime,
};
use chrono::{DateTime, Offset, TimeZone};
use timezone::Tz;

pub mod timezone;

use datafusion_physical_plan::PhysicalExpr;

Expand Down
39 changes: 0 additions & 39 deletions native/utils/Cargo.toml

This file was deleted.

22 changes: 0 additions & 22 deletions native/utils/README.md

This file was deleted.

Loading