Skip to content

Commit c6ad3de

Browse files
committed
Address PR feedback
1 parent ccdf52b commit c6ad3de

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

‎ballista/rust/core/src/execution_plans/query_stage.rs‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ pub struct QueryStageExec {
5959
impl QueryStageExec {
6060
/// Create a new query stage
6161
pub fn try_new(
62-
job_id: &str,
62+
job_id: String,
6363
stage_id: usize,
6464
plan: Arc<dyn ExecutionPlan>,
65-
work_dir: &str,
65+
work_dir: String,
6666
shuffle_output_partitioning: Option<Partitioning>,
6767
) -> Result<Self> {
6868
Ok(Self {
69-
job_id: job_id.to_owned(),
69+
job_id,
7070
stage_id,
7171
plan,
72-
work_dir: work_dir.to_owned(),
72+
work_dir,
7373
shuffle_output_partitioning,
7474
})
7575
}
@@ -109,10 +109,10 @@ impl ExecutionPlan for QueryStageExec {
109109
) -> Result<Arc<dyn ExecutionPlan>> {
110110
assert!(children.len() == 1);
111111
Ok(Arc::new(QueryStageExec::try_new(
112-
&self.job_id,
112+
self.job_id.clone(),
113113
self.stage_id,
114114
children[0].clone(),
115-
&self.work_dir,
115+
self.work_dir.clone(),
116116
None,
117117
)?))
118118
}
@@ -173,7 +173,9 @@ impl ExecutionPlan for QueryStageExec {
173173
//TODO re-use code from RepartitionExec to split each batch into
174174
// partitions and write to one IPC file per partition
175175
// See https://github.com/apache/arrow-datafusion/issues/456
176-
unimplemented!()
176+
Err(DataFusionError::NotImplemented(
177+
"Shuffle partitioning not implemented yet".to_owned(),
178+
))
177179
}
178180

179181
_ => Err(DataFusionError::Execution(
@@ -195,10 +197,10 @@ mod tests {
195197
let input_plan = create_input_plan()?;
196198
let work_dir = TempDir::new()?;
197199
let query_stage = QueryStageExec::try_new(
198-
"jobOne",
200+
"jobOne".to_owned(),
199201
1,
200202
input_plan,
201-
work_dir.into_path().to_str().unwrap(),
203+
work_dir.into_path().to_str().unwrap().to_owned(),
202204
None,
203205
)?;
204206
let mut stream = query_stage.execute(0).await?;

‎ballista/rust/executor/src/executor.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Executor {
5252
plan: Arc<dyn ExecutionPlan>,
5353
) -> Result<RecordBatch, BallistaError> {
5454
let exec =
55-
QueryStageExec::try_new(&job_id, stage_id, plan, &self.work_dir, None)?;
55+
QueryStageExec::try_new(job_id, stage_id, plan, self.work_dir.clone(), None)?;
5656
let mut stream = exec.execute(part).await?;
5757
let batches = utils::collect_stream(&mut stream).await?;
5858
// the output should be a single batch containing metadata (path and statistics)

‎ballista/rust/scheduler/src/planner.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ fn create_query_stage(
227227
plan: Arc<dyn ExecutionPlan>,
228228
) -> Result<Arc<QueryStageExec>> {
229229
Ok(Arc::new(QueryStageExec::try_new(
230-
job_id, stage_id, plan, "", // executor will decide on the work_dir path
230+
job_id.to_owned(),
231+
stage_id,
232+
plan,
233+
"".to_owned(), // executor will decide on the work_dir path
231234
None,
232235
)?))
233236
}

0 commit comments

Comments
 (0)