tustvold commented on code in PR #6507:
URL: https://github.com/apache/arrow-datafusion/pull/6507#discussion_r1212993937
##########
datafusion/core/src/physical_plan/analyze.rs:
##########
@@ -146,18 +137,12 @@ impl ExecutionPlan for AnalyzeExec {
// future that gathers the results from all the tasks in the
// JoinSet that computes the overall row count and final
// record batch
+ let mut input_stream = builder.build();
let output = async move {
let mut total_rows = 0;
- while let Some(res) = set.join_next().await {
- // translate join errors (aka task panic's) into
ExecutionErrors
- match res {
- Ok(row_count) => total_rows += row_count?,
- Err(e) => {
- return Err(DataFusionError::Execution(format!(
- "Join error in AnalyzeExec: {e}"
- )))
- }
- }
+ while let Some(batch) = input_stream.next().await {
+ let batch = batch?;
Review Comment:
```suggestion
while let Some(batch) = input_stream.next().await.transpose()? {
```
FWIW, this pattern comes up a lot
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]