YjyJeff opened a new issue, #12187: URL: https://github.com/apache/datafusion/issues/12187
### Describe the bug According to the [code](https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/joins/nested_loop_join.rs#L474), when the outer table returns `None` for the first time, the `NestedLoopJoinStream` may return `Some(RecordBatch)` to produce the result for the unmatched rows. Therefore, the `NestedLoopJoinStream` is not exhausted and will be polled again. However, the next poll will also poll the outer_table, when the outer_table does not support the [FusedStream](https://docs.rs/futures/latest/futures/prelude/stream/trait.FusedStream.html), it may panic. To fix the bug, we could require the [execute](https://docs.rs/datafusion/latest/datafusion/physical_plan/trait.ExecutionPlan.html#tymethod.execute) method returns a `FusedStream` or add a wrapper for the outer_table ### To Reproduce _No response_ ### Expected behavior _No response_ ### Additional context _No response_ -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
