fix: panic if only one partition and split is triggered#5241
fix: panic if only one partition and split is triggered#5241BubbleCal merged 6 commits intolance-format:mainfrom
Conversation
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
| } | ||
| } | ||
|
|
||
| pub struct SinglePartitionReader { |
There was a problem hiding this comment.
We can't know how many rows in the reader, but SPFresh needs num_rows to determine whether to trigger a split job, so remove this
There was a problem hiding this comment.
This would slow down indexing if num_partitions=1, but that means the dataset is small (otherwise users should indexing with more partitions), so it's fine
| if min_dist <= d1 && min_dist <= d2 { | ||
| Ok(ReassignPartition::ReassignCandidate( | ||
| reassign_candidate_ids.value(min_dist_idx), | ||
| reassign_candidate_ids.value(min_dist_idx.unwrap()), |
There was a problem hiding this comment.
here min_dist is not f32::INFINITY so min_dist_idx must be Some(...)
| } | ||
| None => Ok(ReassignPartition::ReassignCandidate( | ||
| reassign_candidate_ids.value(min_dist_idx), | ||
| reassign_candidate_ids.value(min_dist_idx.unwrap()), |
There was a problem hiding this comment.
This is a join job, which means there are at least 2 partitions, so min_dist_idx won't be None
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5241 +/- ##
==========================================
+ Coverage 82.23% 82.24% +0.01%
==========================================
Files 344 344
Lines 144755 144774 +19
Branches 144755 144774 +19
==========================================
+ Hits 119033 119067 +34
+ Misses 21800 21788 -12
+ Partials 3922 3919 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading. Please reload this page.