Skip to content
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

Merged
merged 6 commits into from
May 21, 2022
Merged

feat: support sort agg #646

merged 6 commits into from
May 21, 2022

Conversation

Kikkon
Copy link
Contributor

@Kikkon Kikkon commented May 14, 2022

close #591

@Kikkon
Copy link
Contributor Author

Kikkon commented May 14, 2022

please help review, and give me some more advice. 🤣

@Kikkon Kikkon force-pushed the kikkon/sort_agg branch 2 times, most recently from ba9fd53 to 2047a61 Compare May 14, 2022 14:24
@Kikkon Kikkon force-pushed the kikkon/sort_agg branch 3 times, most recently from 6535e4d to 8a6c2f8 Compare May 16, 2022 17:18
Copy link
Member

@xxchan xxchan left a 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. 😊

@skyzh skyzh self-requested a review May 17, 2022 05:52
@Kikkon Kikkon requested a review from xxchan May 17, 2022 18:30
@Kikkon Kikkon force-pushed the kikkon/sort_agg branch from 402709c to b7d3c9d Compare May 18, 2022 16:38
@Kikkon Kikkon requested a review from xxchan May 18, 2022 17:48
}
last_key = Some(group_key);
}
yield finish_agg(&states)
Copy link
Member

@xxchan xxchan May 18, 2022

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?

Copy link
Member

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..

Copy link
Member

@xxchan xxchan left a 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.

@Kikkon Kikkon force-pushed the kikkon/sort_agg branch from b7d3c9d to 4afb527 Compare May 18, 2022 18:13
@xxchan
Copy link
Member

xxchan commented May 18, 2022

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>
@Kikkon Kikkon force-pushed the kikkon/sort_agg branch from 4afb527 to c239a6d Compare May 18, 2022 18:18
Signed-off-by: kikkon <nian920@outlook.com>
@Kikkon Kikkon force-pushed the kikkon/sort_agg branch from 569b252 to 14cf3e4 Compare May 18, 2022 18:23
Copy link
Member

@skyzh skyzh left a 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>
@Kikkon Kikkon force-pushed the kikkon/sort_agg branch from e1c83cb to 549894e Compare May 19, 2022 16:25
Signed-off-by: kikkon <nian920@outlook.com>
@Kikkon
Copy link
Contributor Author

Kikkon commented May 19, 2022

@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? 🤣

@Kikkon Kikkon requested a review from skyzh May 20, 2022 02:07
@Kikkon
Copy link
Contributor Author

Kikkon commented May 21, 2022

@xxchan @skyzh any other suggestions? 😄

@skyzh
Copy link
Member

skyzh commented May 21, 2022

Let me take a look 🤣

Copy link
Member

@skyzh skyzh left a 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?

for col in group_cols.iter() {
group_key.push(col.get(row_idx));
}
// Check group key & lask key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lask -> last

Copy link
Contributor Author

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));
Copy link
Member

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.

Signed-off-by: kikkon <nian920@outlook.com>
@skyzh skyzh enabled auto-merge (squash) May 21, 2022 08:07
@skyzh skyzh merged commit b8c57b6 into risinglightdb:main May 21, 2022
@Kikkon
Copy link
Contributor Author

Kikkon commented May 21, 2022

Thank you for your support 😊 @xxchan @skyzh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

executor: implement SortAgg
3 participants