Skip to content

Commit 8985e37

Browse files
alambadriangb
andauthored
Apply suggestions from code review
Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
1 parent b2c9bd6 commit 8985e37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

datafusion/datasource/src/file_stream/scan_state.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,14 @@ impl ScanState {
111111
Poll::Pending => {
112112
self.pending_open = Some(PendingOpen { planner, io_future });
113113
return ScanAndReturn::Return(Poll::Pending);
114-
}
114+
// We polled the IO future but it didn't complete
115+
// Back to the same state and wait until the next round of polling
116+
self.pending_open = Some(PendingOpen { planner, io_future });
117+
return ScanAndReturn::Return(Poll::Pending);
115118
Poll::Ready(Ok(())) => {
119+
// We polled the file open IO future and it completed.
120+
// It yielded us a `MorselPlanner` which we store.
121+
// Now we can move onto polling the next file open.
116122
self.ready_planners.push_back(planner);
117123
return ScanAndReturn::Continue;
118124
}

0 commit comments

Comments
 (0)