Forward-port of #1991 , an 0.11.1 hotfix for the BitCraft alpha, into master.
What was happening was, num_distinct_values on an empty table returned 0, which index_row_est then used as a divisor, leading to a panic. It seems reasonably clear to me that
the correct estimate of distinct values in an empty index is 0, not bottom, so adjusting num_distinct_values to return Option<NonZeroU64>, and then making index_row_est return 0 in that case, seems an obvious fix.
API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!
Description of Changes
Forward-port of #1991 , an 0.11.1 hotfix for the BitCraft alpha, into master.
What was happening was,
num_distinct_values
on an empty table returned 0, whichindex_row_est
then used as a divisor, leading to a panic. It seems reasonably clear to me that the correct estimate of distinct values in an empty index is 0, not bottom, so adjustingnum_distinct_values
to returnOption<NonZeroU64>
, and then makingindex_row_est
return 0 in that case, seems an obvious fix.API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do, so that you're confident that all the changes work as expected!