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

feature(query): support FixedKey u128, u256, u512 in group query #5678

Merged
merged 7 commits into from
May 31, 2022

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented May 30, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Summary about this PR

Changelog

  • New Feature

Related Issues

Fixes #5630

@vercel
Copy link

vercel bot commented May 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) May 31, 2022 at 2:45AM (UTC)

@mergify
Copy link
Contributor

mergify bot commented May 30, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label May 30, 2022
fn aggregate_state(&self) -> Self::State {
Self::State::create((u8::MAX as usize) + 1)
}
macro_rules! dispatch_unsigned_short_types{
Copy link
Member

Choose a reason for hiding this comment

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

Why use macros? It doesn't seem to reduce the duplicate code for us. Instead, it reduces the code readability(and macros are not modification friendly).

@sundy-li
Copy link
Member Author

sundy-li commented May 30, 2022

Performance:

-- (0.217 sec)
select number % 8 as a,number % 9 as b from numbers(1000000000) group by a ,b    limit 3;

-- (1.720 sec) --> (0.714 sec)
select (number % 8)::UInt64 as a,(number % 9)::UInt64 as b from numbers(1000000000) group by a ,b limit 3;

-- (4.183 sec) --> (0.907 sec)
select (number % 8)::UInt64 as a,(number % 9)::UInt64 as b,(number % 10)::UInt64  as c from numbers(1000000000) group by a ,b,c limit 3;
 
 

@@ -214,6 +200,93 @@ impl PolymorphicKeysHelper<HashMethodKeysU64> for HashMethodKeysU64 {
}
}

impl PolymorphicKeysHelper<HashMethodKeysU128> for HashMethodKeysU128 {
Copy link
Member Author

Choose a reason for hiding this comment

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

I think it might be better to apply macro for u128, u256 and u512 here. cc@zhang2014

Copy link
Member

Choose a reason for hiding this comment

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

it may be better not to introduce macros if not necessary

@sundy-li sundy-li marked this pull request as ready for review May 31, 2022 01:15
@sundy-li sundy-li requested a review from xudong963 May 31, 2022 01:15
Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit 84737dc into databendlabs:main May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
Development

Successfully merging this pull request may close these issues.

Feature: support HashMethodKind::KeysU128, KeysU256
4 participants