Skip to content

Commit

Permalink
Merge pull request #15 from probably-nothing-labs/refactor-imports
Browse files Browse the repository at this point in the history
refactor imports
  • Loading branch information
emgeee authored Aug 8, 2024
2 parents a8a401c + 499fa66 commit e407d6b
Show file tree
Hide file tree
Showing 28 changed files with 226 additions and 189 deletions.
155 changes: 143 additions & 12 deletions Cargo.lock

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

16 changes: 4 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,7 @@ description = "Embeddable stream processing engine"

[workspace.dependencies]
df-streams-core = { path = "crates/core" }

datafusion = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-common = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-expr = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-functions = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-functions-aggregate = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-optimizer = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-physical-expr = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-physical-plan = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-physical-optimizer = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-sql = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion-execution = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
datafusion = "40.0"

arrow = { version = "52.0.0", features = ["prettyprint"] }
arrow-array = { version = "52.0.0", default-features = false, features = [
Expand Down Expand Up @@ -59,3 +48,6 @@ serde_json = "1"
base64 = "0.22.1"
chrono = { version = "0.4.38", default-features = false }
itertools = "0.13"

[patch.crates-io]
datafusion = { git = "https://github.com/probably-nothing-labs/arrow-datafusion" }
6 changes: 0 additions & 6 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ edition = { workspace = true }

[dependencies]
datafusion = { workspace = true }
datafusion-expr = { workspace = true }
datafusion-common = { workspace = true }
datafusion-execution = { workspace = true }
datafusion-physical-expr = { workspace = true }
datafusion-physical-plan = { workspace = true }
datafusion-physical-optimizer = { workspace = true }

arrow = { workspace = true }
arrow-schema = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/accumulators/serializable_accumulator.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use arrow::array::{Array, ArrayRef};
use datafusion::common::{Result, ScalarValue};
use datafusion::functions_aggregate::array_agg::ArrayAggAccumulator;
use datafusion_common::{Result, ScalarValue};
use datafusion_expr::Accumulator;
use datafusion::logical_expr::Accumulator;
use serde::{Deserialize, Serialize};

use super::serialize::SerializableScalarValue;
Expand Down Expand Up @@ -42,7 +42,7 @@ impl SerializableAccumulator for ArrayAggAccumulator {
let datatype = if let Some(ScalarValue::List(list)) = state.first() {
list.data_type().clone()
} else {
return Err(datafusion_common::DataFusionError::Internal(
return Err(datafusion::common::DataFusionError::Internal(
"Invalid state for ArrayAggAccumulator".to_string(),
));
};
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/accumulators/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use arrow_array::GenericListArray;
use base64::{engine::general_purpose::STANDARD, Engine as _};
use datafusion_common::ScalarValue;
use datafusion::common::ScalarValue;

use arrow::{
buffer::{OffsetBuffer, ScalarBuffer},
Expand Down Expand Up @@ -515,7 +515,7 @@ pub fn json_to_scalar(json: &Value) -> Result<ScalarValue, Box<dyn std::error::E
#[cfg(test)]
mod tests {
use super::*;
use datafusion_common::ScalarValue;
use datafusion::common::ScalarValue;

fn test_roundtrip(scalar: ScalarValue) {
let json = scalar_to_json(&scalar);
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/config_extensions/denormalized_config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use datafusion::common::extensions_options;
use datafusion::config::ConfigExtension;
use datafusion_common::extensions_options;

extensions_options! {
pub struct DenormalizedConfig {
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::sync::Arc;
use tokio::sync::RwLock;

use datafusion::common::{DataFusionError, Result};
use datafusion::datasource::TableProvider;
use datafusion::execution::{
config::SessionConfig, context::SessionContext, runtime_env::RuntimeEnv,
session_state::SessionStateBuilder,
};
use datafusion_common::{DataFusionError, Result};

use crate::datasource::kafka::TopicReader;
use crate::datastream::DataStream;
Expand All @@ -23,7 +23,7 @@ impl Context {
pub fn new() -> Result<Self, DataFusionError> {
let config = SessionConfig::new().set(
"datafusion.execution.batch_size",
datafusion_common::ScalarValue::UInt64(Some(32)),
datafusion::common::ScalarValue::UInt64(Some(32)),
);
let runtime = Arc::new(RuntimeEnv::default());

Expand Down
Loading

0 comments on commit e407d6b

Please sign in to comment.