-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: internal error: estimated distinct and/or null count must be non-zero #37754
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-sqlsmith
Comments
Smaller repro:
|
Ok super small repro:
|
Nice find! Thanks for the repro. Looking into this now. |
rytaft
added a commit
to rytaft/cockroach
that referenced
this issue
May 29, 2019
This commit fixes an issue where both the estimated distinct and null counts could be zero. This was happening because the statistics code for Select expressions was setting the null count to 0 for columns that had null-rejecting filters. If the estimated distinct count for those columns was also zero, the result was that both counts would be zero. This commit changes the logic so that the null count is now transferred to the distinct count if necessary to ensure that at least one is non-zero. Fixes cockroachdb#37754 Release note: None
rytaft
added a commit
to rytaft/cockroach
that referenced
this issue
May 29, 2019
This commit fixes an issue where both the estimated distinct and null counts could be zero. This was happening because the statistics code for Select expressions was setting the null count to 0 for columns that had null-rejecting filters. If the estimated distinct count for those columns was also zero, the result was that both counts would be zero. This commit changes the logic so that the null count is now transferred to the distinct count if necessary to ensure that at least one is non-zero. Fixes cockroachdb#37754 Release note: None
craig bot
pushed a commit
that referenced
this issue
May 29, 2019
37913: opt: fix error due to distinct and/or null count must be non-zero r=rytaft a=rytaft This commit fixes an issue where both the estimated distinct and null counts could be zero. This was happening because the statistics code for Select expressions was setting the null count to 0 for columns that had null-rejecting filters. If the estimated distinct count for those columns was also zero, the result was that both counts would be zero. This commit changes the logic so that the null count is now transferred to the distinct count if necessary to ensure that at least one is non-zero. Fixes #37754 Release note: None Co-authored-by: Rebecca Taft <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-sqlsmith
The text was updated successfully, but these errors were encountered: