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(fuse): add system$clustering_information function #5426

Merged
merged 15 commits into from
May 20, 2022

Conversation

zhyass
Copy link
Member

@zhyass zhyass commented May 17, 2022

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

Summary

mysql> create TABLE t(A int,  B int ) cluster by(B,A);
Query OK, 0 rows affected (0.05 sec)
Read 0 rows, 0.00 B in 0.006 sec., 0 rows/sec., 0.00 B/sec.

mysql> insert into t values(0,3),(1,1);
Query OK, 0 rows affected (0.03 sec)
Read 2 rows, 16.00 B in 0.011 sec., 175.4 rows/sec., 1.37 KiB/sec.

mysql> insert into t values(1,3),(2,1);
Query OK, 0 rows affected (0.06 sec)
Read 2 rows, 16.00 B in 0.012 sec., 165.46 rows/sec., 1.29 KiB/sec.

mysql> insert into t values(4,4) ;
Query OK, 0 rows affected (0.05 sec)
Read 1 rows, 8.00 B in 0.012 sec., 82.9 rows/sec., 663.20 B/sec.

mysql> call system$clustering_information('default','t')\G
*************************** 1. row ***************************
           cluster_by_keys: (B, A)
         total_block_count: 3
total_constant_block_count: 1
          average_overlaps: 0.6667
             average_depth: 1.6667
     block_depth_histogram: {"00001":1,"00002":2}
1 row in set (0.07 sec)
Read 0 rows, 0.00 B in 0.013 sec., 0 rows/sec., 0.00 B/sec.

Changelog

  • New Feature

Related Issues

Fixes #5439

@vercel
Copy link

vercel bot commented May 17, 2022

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

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

@mergify
Copy link
Contributor

mergify bot commented May 17, 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 17, 2022
@zhyass zhyass marked this pull request as draft May 17, 2022 09:26
@zhyass zhyass marked this pull request as ready for review May 18, 2022 16:20
@zhyass zhyass requested review from dantengsky and sundy-li May 18, 2022 16:21
@zhyass zhyass marked this pull request as draft May 19, 2022 00:17
@zhyass zhyass force-pushed the feature_cluster_table branch from 26d8a8e to a0f5686 Compare May 19, 2022 14:22
@zhyass zhyass marked this pull request as ready for review May 19, 2022 14:40
@zhyass zhyass mentioned this pull request May 19, 2022
8 tasks
@dantengsky
Copy link
Member

/LGTM


select * from t09_0014 order by b, a;

--Bug in cluster mode: https://github.com/datafuselabs/databend/issues/5473
Copy link
Member

@BohuTANG BohuTANG May 19, 2022

Choose a reason for hiding this comment

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

We can skip the test in cluster mode with a '_cluster' suffix new test file, let's run it only in the stand-alone mode.

0 3
1 3
4 4
ERROR 1105 (HY000) at line 9: Code: 1002, displayText = Unimplement error.
Copy link
Member

Choose a reason for hiding this comment

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

This error message is not stable with the at line 9:.
Can we set an ErrCode number for it? @zhang2014 @sundy-li

Copy link
Member

Choose a reason for hiding this comment

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

Why not use -- {ErrorCode 1002}

Copy link
Member

@BohuTANG BohuTANG May 20, 2022

Choose a reason for hiding this comment

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

The -- {ErrorCode 1002} should be set on the 09_0014_func_clustering_information_function.sql, but this test will not work with standalone.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me comment out the case first, this bug will be fixed soon.

0 3
1 3
4 4
ERROR 1105 (HY000) at line 9: Code: 1002, displayText = Unimplement error.
Copy link
Member

Choose a reason for hiding this comment

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

This error message is not stable with the at line 9:.
Can we set an ErrCode number for it? @zhang2014 @sundy-li

@BohuTANG
Copy link
Member

Let's merge first.

@BohuTANG BohuTANG merged commit d98a162 into databendlabs:main May 20, 2022
@BohuTANG BohuTANG mentioned this pull request May 27, 2022
55 tasks
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
None yet
Development

Successfully merging this pull request may close these issues.

clustering_information(<database>, <table>)
5 participants