Skip to content

Commit

Permalink
rework dependencies; bump df to 45.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchen Liang <[email protected]>
  • Loading branch information
yliang412 committed Feb 11, 2025
1 parent a8153cb commit a806f07
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 455 deletions.
668 changes: 239 additions & 429 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[workspace]
members = ["optd-core", "optd-datafusion"]
resolver = "2"


[workspace.dependencies]
anyhow = "1.0"
trait-variant = "0.1.2"
async-recursion = "1.1.1"
tokio = { version = "1.43.0", features = ["full"] }
11 changes: 5 additions & 6 deletions optd-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ version = "0.1.0"
edition = "2021"

[dependencies]
sqlx = { version = "0.8", features = [ "sqlite", "runtime-tokio", "migrate" ] }
trait-variant = "0.1.2"

# Pin more recent versions for `-Zminimal-versions`.
proc-macro2 = "1.0.60" # For a missing feature (https://github.com/rust-lang/rust/issues/113152).
anyhow = "1.0.95"
tokio = { version = "1.43.0", features = ["full"] }
tokio.workspace = true
anyhow.workspace = true
async-recursion.workspace = true
trait-variant.workspace = true
sqlx = { version = "0.8", features = [ "sqlite", "runtime-tokio", "migrate" ] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1", features = ["raw_value"] }
dotenvy = "0.15"
async-recursion = "1.1.1"
pest = "2.7.15"
pest_derive = "2.7.15"
1 change: 1 addition & 0 deletions optd-core/src/storage/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::{
};

/// A Storage manager that manages connections to the database.
#[derive(Debug)]
pub struct SqliteMemo {
/// A async connection pool to the SQLite database.
db: SqlitePool,
Expand Down
15 changes: 5 additions & 10 deletions optd-datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.95"
arrow = "54.0.0"
anyhow.workspace = true
async-trait = "0.1.85"
datafusion = "44.0.0"
datafusion = "45.0.0"
futures = "0.3.31"
itertools = "0.14.0"
tokio = { version = "1.43", default-features = false, features = [
"rt",
"rt-multi-thread",
"macros",
] }
trait-variant = "0.1.2"
tokio.workspace = true
trait-variant.workspace = true
optd-core = { path = "../optd-core" }
async-recursion = "1"
async-recursion.workspace = true

7 changes: 6 additions & 1 deletion optd-datafusion/src/converter/from_optd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ impl ConversionContext<'_> {
datafusion::physical_plan::joins::NestedLoopJoinExec::try_new(
left_exec,
right_exec,
Some(JoinFilter::new(physical_expr, column_idxs, filter_schema)),
Some(JoinFilter::new(
physical_expr,
column_idxs,
Arc::new(filter_schema),
)),
&join_type,
None,
)?,
) as Arc<dyn ExecutionPlan + 'static>)
}
Expand Down
3 changes: 1 addition & 2 deletions optd-datafusion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#![allow(clippy::new_without_default)]
use std::sync::Arc;

use datafusion::catalog::CatalogProviderList;
use datafusion::catalog_common::MemoryCatalogProviderList;
use datafusion::catalog::{CatalogProviderList, MemoryCatalogProviderList};
use datafusion::common::Result;
use datafusion::execution::runtime_env::RuntimeEnvBuilder;
use datafusion::execution::SessionStateBuilder;
Expand Down
10 changes: 3 additions & 7 deletions optd-datafusion/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use optd_core::{
use crate::converter::ConversionContext;

/// A mock optimizer for testing purposes.
#[derive(Debug)]
pub struct OptdOptimizer {
memo: SqliteMemo,
}
Expand Down Expand Up @@ -96,6 +97,7 @@ impl OptdOptimizer {
/// The physical plan is created by converting the logical plan to an OptD logical plan,
/// and then running the optd optimizer on the logical plan and then converting it back.
/// This is the entry point for OptD.
#[derive(Debug)]
pub struct OptdQueryPlanner {
pub optimizer: Arc<OptdOptimizer>,
}
Expand Down Expand Up @@ -167,13 +169,7 @@ impl OptdQueryPlanner {
}
}

impl std::fmt::Debug for OptdQueryPlanner {
/// Writes the `OptdQueryPlanner` struct to a formatter, usually for debugging purposes.
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "OptdQueryPlanner")
}
}

// making it `async_trait` only because datafusion is taking it.
#[async_trait]
impl QueryPlanner for OptdQueryPlanner {
/// This function is the entry point for the physical planner. It calls the inner function
Expand Down

0 comments on commit a806f07

Please sign in to comment.