-
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
executor: check for null values when comparing different groups during streamAgg #15742
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15742 +/- ##
================================================
- Coverage 80.4669% 80.4148% -0.0522%
================================================
Files 504 504
Lines 134649 134617 -32
================================================
- Hits 108348 108252 -96
- Misses 17831 17883 +52
- Partials 8470 8482 +12 |
Do we need to cherry-pick this PR to release-4.0? |
executor/aggregate_test.go
Outdated
tk := testkit.NewTestKitWithInit(c, s.store) | ||
tk.MustExec(`drop table if exists t;`) | ||
tk.MustExec(`create table t(a int);`) | ||
tk.MustExec(`insert into t values(null),(null);`) | ||
tk.MustExec(`insert into t values(0),(2),(2),(4),(8);`) | ||
tk.Se.GetSessionVars().MaxChunkSize = 2 | ||
tk.MustQuery(`select /*+ stream_agg() */ distinct * from t;`).Check(testkit.Rows("<nil>", "0", "2", "4", "8")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost LGTM, but please add more tests to cover more types for safety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing the comment makes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some test cases for splitIntoGroups
like others https://github.com/search?q=splitIntoGroups+repo%3Apingcap%2Ftidb+filename%3A_test.go&type=Code&ref=advsearch&l=&l=?
/run-all-tests |
/run-unit-test |
@SunRunAway @qw4990 @XuHuaiyu Update. PTAL |
tidb/executor/executor_required_rows_test.go Lines 814 to 816 in 7746fbd
splitIntoGroups .
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
cherry pick to release-4.0 in PR #15777 |
if firstRowIsNull { | ||
firstRowDatum.SetNull() | ||
} | ||
if lastRowIsNull { | ||
lastRowDatum.SetNull() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this behand switch eType, and reduce the if to check null in the switch.
What problem does this PR solve?
Close #15690
Close #15691
Close #15695
Close #15696
In the master version, we forget to check the null value when we compare the different groups during
StreamAgg
.What is changed and how it works?
Add checks for null values when comparing different groups during
StreamAgg
.Check List
Tests