-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat: support sort agg #646
Conversation
please help review, and give me some more advice. 🤣 |
ba9fd53
to
2047a61
Compare
6535e4d
to
8a6c2f8
Compare
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.
Please ping me again when you are ready for review. Also feel free to ask for help about specific questions. 😊
src/executor/sort_agg.rs
Outdated
} | ||
last_key = Some(group_key); | ||
} | ||
yield finish_agg(&states) |
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.
Should also be outside the loop just like states
?
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.
So I think adding relevant tests may be better..
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.
Others LGTM! Ping @skyzh to take a look.
BTW, since we will squash merge, there's no need to force push everytime to make commit history (too) clean. Leave changes in new commits may also help reviewers to focus on new changes since last review 😄 |
Signed-off-by: kikkon <nian920@outlook.com>
Signed-off-by: kikkon <nian920@outlook.com>
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.
Would you please add a test case when there are no rows from child? We should output no rows instead of one row of all null. I guess the current behavior is incorrect 🤣
Signed-off-by: kikkon <nian920@outlook.com>
@skyzh I compared sort_agg and simple_agg on no rows from child, they both return one row of all null. I added a judgment for last_key, it's right? 🤣 |
Let me take a look 🤣 |
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, thanks! Would you please help fix the typo?
src/executor/sort_agg.rs
Outdated
for col in group_cols.iter() { | ||
group_key.push(col.get(row_idx)); | ||
} | ||
// Check group key & lask key |
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.
lask -> last
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.
sure.
// Create group key | ||
let mut group_key = HashKey::new(); | ||
for col in group_cols.iter() { | ||
group_key.push(col.get(row_idx)); |
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.
Maybe we can optimize this in the future. We can first check group key is the same as the current group key, and then clone by .get
if different. Otherwise we will always need to create new vector for every row of hash key.
close #591