-
Notifications
You must be signed in to change notification settings - Fork 752
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: multi-catalog #4947
Feature: multi-catalog #4947
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Thanks for the contribution! Please review the labels and make any necessary changes. |
the files that |
9830127
to
0d119f1
Compare
0d119f1
to
2a044ad
Compare
5775c24
to
09b199c
Compare
0311467
to
a1cf11e
Compare
6f703cc
to
5b9aaac
Compare
f37c5bc
to
337f4ba
Compare
ed4098b
to
c72186d
Compare
engine_name: "FUSE".to_string(), | ||
comment: "FUSE Storage Engine".to_string(), | ||
support_order_key: true, | ||
// pub fn catalog_name(&self) -> Result<String> { |
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.
remove those
ctx: Arc<QueryContext>, | ||
operations: Vec<DataBlock>, | ||
overwrite: bool, | ||
_ctx: Arc<QueryContext>, |
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.
rename these
@@ -242,7 +242,8 @@ impl FuseTable { | |||
table_info: &TableInfo, | |||
new_snapshot_location: String, | |||
) -> Result<UpsertTableOptionReply> { | |||
let catalog = ctx.get_catalog(); | |||
// TODO catalog name |
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.
use arg catalog_name
@@ -200,7 +207,7 @@ impl AsyncSource for FuseHistorySource { | |||
let tenant_id = self.ctx.get_tenant(); | |||
let tbl = self | |||
.ctx | |||
.get_catalog() | |||
.get_catalog(&self.catalog_name)? // TODO pass in this guy |
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.
clean up TODO
ctx: Arc<QueryContext>, | ||
operations: Vec<DataBlock>, | ||
overwrite: bool, | ||
_ctx: Arc<QueryContext>, |
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.
rename these
@@ -96,7 +95,8 @@ impl ColumnsTable { | |||
ctx: Arc<QueryContext>, | |||
) -> Result<Vec<(String, String, DataField)>> { | |||
let tenant = ctx.get_tenant(); | |||
let catalog = ctx.get_catalog(); | |||
// TODO replace default with real cat | |||
let catalog = ctx.get_catalog("default")?; |
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.
use constant DEFAULT_CATALOG
let table_engine_descriptors = ctx.get_catalog().get_table_engines(); | ||
async fn get_full_data(&self, ctx: Arc<QueryContext>) -> Result<DataBlock> { | ||
// TODO passin catalog name | ||
let table_engine_descriptors = ctx.get_catalog("default")?.get_table_engines(); |
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.
use the CONSTANT
@@ -41,7 +40,8 @@ impl AsyncSystemTable for TablesTable { | |||
|
|||
async fn get_full_data(&self, ctx: Arc<QueryContext>) -> Result<DataBlock> { | |||
let tenant = ctx.get_tenant(); | |||
let catalog = ctx.get_catalog(); | |||
// TODO pass catalog in or embed catalog in table info? | |||
let catalog = ctx.get_catalog("default")?; |
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.
use the constant
query: "SELECT COUNT(system.databases.name) AS name FROM system.databases WHERE system.databases.name = 'xxx'", | ||
expect: "NormalQuery { filter: (name = xxx), aggregate: [COUNT(name)], projection: [COUNT(name) as name] }", | ||
}, | ||
// TODO confirm this |
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.
what's going on herer?
@@ -92,7 +93,7 @@ async fn test_block_pruner() -> Result<()> { | |||
interpreter.execute(None).await?; | |||
|
|||
// get table | |||
let catalog = ctx.get_catalog(); | |||
let catalog = ctx.get_catalog("default")?; |
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.
use constant
@@ -229,7 +231,7 @@ async fn test_block_pruner_monotonic() -> Result<()> { | |||
order_keys: vec![], | |||
}; | |||
|
|||
let catalog = ctx.get_catalog(); | |||
let catalog = ctx.get_catalog("default")?; |
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.
use constant
@@ -100,6 +102,10 @@ impl TestFixture { | |||
gen_db_name(&self.prefix) | |||
} | |||
|
|||
pub fn default_catalog_name(&self) -> String { | |||
"default".to_owned() |
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.
use constant
GRANT SELECT ON 'db01'.'tb1' TO 'test-grant'@'localhost' | ||
GRANT SELECT ON 'db01'.'tb1' TO 'test-grant'@'localhost' | ||
GRANT SELECT ON 'default'.* TO 'test-grant-role' | ||
GRANT ALL ON 'default'.'default'.* TO 'test-grant'@'localhost' |
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.
append docs about privilege in the PR summary
LGTM. |
} | ||
} | ||
|
||
println!("cargo:rerun-if-changed=build.rs"); |
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.
Do we need to move this line to the front?
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.
Not sure about this : (
will moving this line to the front prevent us from some unexpected results? I am not quite familiar with the "mechanism" there.
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.
Me too...
But most build.rs will place the println at the very first line. It's better to keep fit with them.
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.
got it & thanks. I will fix it in PR #5284
The review also welcomed on this PR cc @andylokandy @Xuanwo |
refine: of PR #4947 multi-catalog
I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/
Summary
new feature: multiple catalogs
catalog.database.table
only the current ut/it are covered, there are definitely other codes that should be modified to fully support this
default
catalogCatalogManager
hive
catalog is provided, which can be registered by using de configs.hive
hive
of cratedatabend-query
is NOT enabledcargo build --bin databend-query --features hive
common-hive-meta-store
will be built, even thehive
feature is not specifiedthrift
compiler which is built into dev docker imagestest_stateful_hive_standalone
is addedChangelog
Related Issues
Fixes #issue