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(query): support cluster key in fuse engine #4999

Merged
merged 12 commits into from
Apr 22, 2022

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented Apr 22, 2022

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

Summary

Summary about this PR

Syntax example:

CREATE TABLE table_name (a INT) CLUSTER BY(a);

Example:

MySQL [(none)]> CREATE TABLE test (a UInt64, b String) CLUSTER BY(b, -a);
Query OK, 0 rows affected (0.033 sec)

MySQL [(none)]> insert into test select number  , toString(number % 3 ) b  from numbers(10) ;
Query OK, 0 rows affected (0.039 sec)
Read 10 rows, 80 B in 0.017 sec., 583.72 rows/sec., 4.67 KB/sec.

MySQL [(none)]> select * from test;
+------+------+
| a    | b    |
+------+------+
|    9 | 0    |
|    6 | 0    |
|    3 | 0    |
|    0 | 0    |
|    7 | 1    |
|    4 | 1    |
|    1 | 1    |
|    8 | 2    |
|    5 | 2    |
|    2 | 2    |
+------+------+
10 rows in set (0.033 sec)

Changelog

  • Improvement

Related Issues

Related #4268

@vercel
Copy link

vercel bot commented Apr 22, 2022

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

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Apr 22, 2022 at 0:14AM (UTC)

@mergify
Copy link
Contributor

mergify bot commented Apr 22, 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.

@sundy-li sundy-li marked this pull request as ready for review April 22, 2022 07:16
@sundy-li sundy-li requested a review from BohuTANG as a code owner April 22, 2022 07:16
@BohuTANG
Copy link
Member

BohuTANG commented Apr 22, 2022

I think CLUSTER BY ( <expr> [ , <expr> , ... ] ) is better

@@ -16,6 +16,7 @@ SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;

set max_threads = 1;
Copy link
Member

Choose a reason for hiding this comment

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

why set max_thread to 1 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

transform_compact just works in one thread.

@sundy-li sundy-li changed the title feat(query): support order key in fuse engine feat(query): support cluster key in fuse engine Apr 22, 2022
Copy link
Member

@dantengsky dantengsky left a comment

Choose a reason for hiding this comment

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

❤️

@BohuTANG BohuTANG merged commit a162385 into databendlabs:main Apr 22, 2022
@zhyass zhyass mentioned this pull request Apr 24, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants