-
Notifications
You must be signed in to change notification settings - Fork 727
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): show grants support mget table/db name by table/db id. #14862
Conversation
7fafc25
to
989ca14
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.
Reviewed 1 of 16 files at r1, all commit messages.
Reviewable status: 1 of 16 files reviewed, 7 unresolved discussions (waiting on @BohuTANG, @everpcpc, @flaneur2020, and @TCeason)
src/meta/api/src/schema_api.rs
line 212 at r1 (raw file):
) -> Result<(TableIdent, Arc<TableMeta>), KVAppError>; async fn list_tables_name_by_id(
It is a mget
operation. Not a list
.
mget
gets values by keys. list
gets values by a common prefix.
src/meta/api/src/schema_api.rs
line 218 at r1 (raw file):
async fn get_table_name_by_id(&self, table_id: MetaId) -> Result<String, KVAppError>; async fn list_dbs_name_by_id(&self, db_id: Vec<MetaId>) -> Result<Vec<String>, KVAppError>;
It is mget
not list
.
src/query/catalog/src/catalog/interface.rs
line 195 at r1 (raw file):
async fn list_tables_name_by_id( &self, table_id: Vec<MetaId>,
It should be table_ids
:
Suggestion:
table_ids: Vec<MetaId>,
src/query/catalog/src/catalog/interface.rs
line 204 at r1 (raw file):
async fn list_dbs_name_by_id( &self, db_id: Vec<MetaId>,
db_ids
src/query/catalog/src/catalog/session_catalog.rs
line 250 at r1 (raw file):
async fn list_tables_name_by_id( &self, table_id: Vec<MetaId>,
table_ids
src/query/catalog/src/catalog/session_catalog.rs
line 263 at r1 (raw file):
async fn list_dbs_name_by_id( &self, db_id: Vec<MetaId>,
db_ids
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.
Reviewed 1 of 16 files at r1, 1 of 12 files at r2, all commit messages.
Reviewable status: 3 of 16 files reviewed, 5 unresolved discussions (waiting on @BohuTANG, @everpcpc, @flaneur2020, and @TCeason)
src/meta/api/src/schema_api.rs
line 212 at r3 (raw file):
) -> Result<(TableIdent, Arc<TableMeta>), KVAppError>; async fn mget_tables_name_by_id(
Suggestion:
async fn mget_table_names_by_id(
src/meta/api/src/schema_api.rs
line 218 at r3 (raw file):
async fn get_table_name_by_id(&self, table_id: MetaId) -> Result<String, KVAppError>; async fn mget_dbs_name_by_id(&self, db_ids: Vec<MetaId>) -> Result<Vec<String>, KVAppError>;
Suggestion:
async fn mget_database_names_by_id(&self, db_ids: Vec<MetaId>) -> Result<Vec<String>, KVAppError>;
src/query/catalog/src/catalog/session_catalog.rs
line 252 at r3 (raw file):
table_ids: Vec<MetaId>, ) -> databend_common_exception::Result<Vec<String>> { self.inner.mget_tables_name_by_id(table_ids).await
Suggestion:
mget_table_names_by_id
src/query/catalog/src/catalog/session_catalog.rs
line 261 at r3 (raw file):
// List the dbs name by meta ids. async fn mget_dbs_name_by_id(
Suggestion:
mget_database_names_by_id
Done |
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.
Reviewed 6 of 12 files at r4, all commit messages.
Reviewable status: 8 of 16 files reviewed, 2 unresolved discussions (waiting on @BohuTANG, @everpcpc, @flaneur2020, and @TCeason)
src/query/catalog/src/catalog/session_catalog.rs
line 261 at r3 (raw file):
// List the dbs name by meta ids. async fn mget_dbs_name_by_id(
This method name should be updated too.
Already modify in the lastest commit. |
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.
Reviewed 2 of 16 files at r1, 5 of 12 files at r5, all commit messages.
Reviewable status: 9 of 16 files reviewed, 4 unresolved discussions (waiting on @BohuTANG, @everpcpc, @flaneur2020, and @TCeason)
src/query/catalog/src/catalog/session_catalog.rs
line 261 at r3 (raw file):
Previously, TCeason wrote…
Already modify in the lastest commit.
No. They are not modified :(
O, I got, mget_database_names_by_ids |
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.
The meta-data part LGTM.
Reviewed 11 of 12 files at r6, all commit messages.
Reviewable status: 15 of 16 files reviewed, 4 unresolved discussions (waiting on @BohuTANG, @everpcpc, @flaneur2020, @sundy-li, and @TCeason)
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.
Reviewed 3 of 3 files at r7, all commit messages.
Reviewable status: 15 of 16 files reviewed, 4 unresolved discussions (waiting on @BohuTANG, @everpcpc, @flaneur2020, @sundy-li, and @TCeason)
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Speed up show grants.
Under debug mode:
role1 owns 10 thounds table:
After optimize, double Speed bonus
Under release :
After optimize,
In this pr add two api in schema_api:
mget_database_names_by_ids;
mget_table_names_by_ids;
Tests
Type of change
This change is