e-dard commented on a change in pull request #722:
URL: https://github.com/apache/arrow-datafusion/pull/722#discussion_r671826737
##########
File path: datafusion/src/physical_plan/sort_preserving_merge.rs
##########
@@ -246,7 +274,19 @@ impl SortKeyCursor {
.zip(other.columns.iter())
.zip(options.iter());
- for ((l, r), sort_options) in zipped {
+ // Recall or initialise a collection of comparators for comparing
+ // columnar arrays of this cursor and "other".
+ let cmp = self
+ .batch_comparators
+ .entry(other.batch_idx)
+ .or_insert_with(|| Vec::with_capacity(other.columns.len()));
Review comment:
The HashMap only lives for as long as the lifetime of the sort
preserving merge operator. I suppose you could merge n streams large enough to
make the old comparators take up non-negligible memory.
--
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]