Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Sep 7, 2019
1 parent 42566c3 commit 63c88d8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rust/datafusion/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,18 @@ impl ExecutionContext {
let it = p.execute().unwrap();
let mut it = it.lock().unwrap();
let mut results: Vec<RecordBatch> = vec![];
while let Ok(Some(batch)) = it.next() {
results.push(batch);
loop {
match it.next() {
Ok(Some(batch)) => {
results.push(batch);
}
Ok(None) => {
// end of result set
return Ok(results);
}
Err(e) => return Err(e),
}
}
Ok(results)
})
})
.collect();
Expand Down

0 comments on commit 63c88d8

Please sign in to comment.