Skip to content

Commit fe80957

Browse files
committed
wip
1 parent 2d0f7f3 commit fe80957

File tree

1 file changed

+3
-2
lines changed
  • datafusion/physical-plan/src/topk

1 file changed

+3
-2
lines changed

datafusion/physical-plan/src/topk/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ impl TopK {
352352
return Ok(());
353353
};
354354

355-
let thresholds: Option<Vec<ScalarValue>>;
355+
let mut thresholds: Option<Vec<ScalarValue>> = None;
356356

357357
// Are the new thresholds more selective than our existing ones?
358358
let should_update = {
@@ -366,8 +366,9 @@ impl TopK {
366366
if more_selective {
367367
current.clear();
368368
current.extend_from_slice(max.row());
369+
thresholds = self.heap.get_threshold_values(&self.expr)?;
370+
*current_thresholds = thresholds.clone();
369371
}
370-
thresholds = self.heap.get_threshold_values(&self.expr)?;
371372
more_selective
372373
} else {
373374
// No current thresholds, so update with the new ones

0 commit comments

Comments
 (0)