Skip to content

Commit 3d4822b

Browse files
committed
Fix?
1 parent 13b6bcc commit 3d4822b

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ impl TopK {
357357
let mut threshold_guard = self.filter.threshold_row.write();
358358
if let Some(current_row) = threshold_guard.as_ref() {
359359
match current_row.as_slice().cmp(new_threshold_row) {
360-
Ordering::Less => {
361-
// new > current, so new threshold is more selective
360+
Ordering::Greater => {
361+
// new < current, so new threshold is more selective
362362
// Update threshold and filter atomically to prevent race conditions
363363
*threshold_guard = Some(new_threshold_row.to_vec());
364364

@@ -376,7 +376,7 @@ impl TopK {
376376
thresholds,
377377
)?;
378378
}
379-
Ordering::Equal | Ordering::Greater => {
379+
_ => {
380380
// Same threshold or current is more selective, no need to update
381381
}
382382
}

0 commit comments

Comments
 (0)