-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
static pruning mode gets wrong results #35295
Comments
It will also happen in v4.0. If using the following SQL, bypass the wrong
But if turn the pruning mode to 'dynamic', the bug disappears. I think the refactor of the partition pruning mode fixed this bug. |
Another workaround seems to be adding |
@mjonss |
@zimulala I will start and see if I can solve it or needs help from the optimizer team. |
@mjonss |
I guess the cause is that some partitioning StreamAggs return empty or null, and the upper HashAgg cannot handle these results correctly. |
@qw4990 You're right.
|
The bug is caused by here: Lines 1368 to 1379 in 2de01b4
The table reader return empty chunk, however, the stream agg add a default value (null) on line 1372 |
This issue is similiar to #30923 We should distinguish partial agg and final agg, and add |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
Sometimes will get this result. Try more times.
4. What is your TiDB version? (Required)
5d4745e
The text was updated successfully, but these errors were encountered: