Skip to content

Commit

Permalink
bug fix (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jan 29, 2023
1 parent f8ff000 commit 93a4a24
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ log = "0.4"
prost = "0.11"
prost-types = "0.11"
pyo3 = { version = "~0.17.3", features = ["extension-module", "abi3", "abi3-py37"] }
tempfile = "3"
tokio = { version = "1.24", features = ["macros", "rt", "rt-multi-thread", "sync"] }
uuid = "1.2"

[build-dependencies]
rustc_version = "0.4.0"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ python -m pytest
Create a release build when running benchmarks, then use pip to install the wheel.

```bash
cargo clean
maturin develop
maturin build --release
pip install ./target/wheels/raysql-0.1.0-cp37-abi3-manylinux_2_31_x86_64.whl --force-reinstall
```
Expand Down
9 changes: 5 additions & 4 deletions src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use pyo3::prelude::*;
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use tempfile::tempdir;
use uuid::Uuid;

#[pyclass(name = "ExecutionGraph", module = "raysql", subclass)]
pub struct PyExecutionGraph {
Expand Down Expand Up @@ -249,9 +249,10 @@ fn generate_query_stages(
}

fn create_temp_dir(stage_id: usize) -> Result<String> {
let dir = tempdir()?;
let temp_dir = dir.path().join(format!("stage-{}", stage_id));
let temp_dir = format!("{}", temp_dir.display());
// TODO find a crate for temp dir that does not delete the temp dir on process exit
let uuid = Uuid::new_v4();
let temp_dir = format!("/tmp/ray-sql-{uuid}-stage-{stage_id}");
println!("Creating temp shuffle dir: {}", temp_dir);
std::fs::create_dir(&temp_dir)?;
Ok(temp_dir)
}

0 comments on commit 93a4a24

Please sign in to comment.