Skip to content

Commit 3aaf393

Browse files
authored
minor: More comments to read_spill_as_stream (#21713)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> Clarifying a function with more comments ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent 03ca0aa commit 3aaf393

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

datafusion/physical-plan/src/spill/spill_manager.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,22 @@ impl SpillManager {
160160
Ok(file.map(|f| (f, max_record_batch_size)))
161161
}
162162

163-
/// Reads a spill file as a stream. The file must be created by the current `SpillManager`.
164-
/// This method will generate output in FIFO order: the batch appended first
165-
/// will be read first.
163+
/// Reads a spill file as a stream. The file must be created by the current
164+
/// `SpillManager`; otherwise behavior is undefined.
165+
///
166+
/// Output is produced in FIFO order: the batch appended first is read first.
167+
///
168+
/// # Arg `max_record_batch_memory`
169+
///
170+
/// Most callers should pass `None`. This is mainly useful for the
171+
/// memory-limited sort-preserving merge path.
172+
///
173+
/// When provided, this value is used only as a validation hint. If a
174+
/// decoded batch exceeds this threshold, a debug-level log message is
175+
/// emitted.
176+
///
177+
/// That path uses the maximum spilled batch size to conservatively estimate
178+
/// the merge degree when merging multiple sorted runs.
166179
pub fn read_spill_as_stream(
167180
&self,
168181
spill_file_path: RefCountedTempFile,

0 commit comments

Comments
 (0)