viirya commented on code in PR #11218:
URL: https://github.com/apache/datafusion/pull/11218#discussion_r1682236590
##########
datafusion/physical-plan/src/joins/sort_merge_join.rs:
##########
@@ -858,6 +889,57 @@ impl SMJStream {
}
}
+ fn free_reservation(&mut self, buffered_batch: BufferedBatch) ->
Result<()> {
+ // Shrink memory usage for in memory batches only
+ if buffered_batch.spill_file.is_none() &&
buffered_batch.batch.is_some() {
+ self.reservation
+ .try_shrink(buffered_batch.size_estimation)?;
+ }
Review Comment:
We should also handle `else` cases, i.e., spilling file is `Some` and
`batch` is also `Some`, and both are `None`, etc.
--
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]