From c000ade278e5916413effd0ab630e6074c392c88 Mon Sep 17 00:00:00 2001 From: sundy-li <543950155@qq.com> Date: Tue, 21 Feb 2023 09:42:37 +0800 Subject: [PATCH] update --- scripts/ci/deploy/config/databend-query-node-1.toml | 1 + scripts/ci/deploy/config/databend-query-node-2.toml | 1 + scripts/ci/deploy/config/databend-query-node-3.toml | 2 +- scripts/ci/deploy/config/databend-query-node-shared.toml | 1 + src/query/config/src/config.rs | 6 ++++++ src/query/config/src/inner.rs | 2 ++ src/query/storages/fuse/src/fuse_table.rs | 2 +- 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/ci/deploy/config/databend-query-node-1.toml b/scripts/ci/deploy/config/databend-query-node-1.toml index eb482d51d62fd..c404bf476004a 100644 --- a/scripts/ci/deploy/config/databend-query-node-1.toml +++ b/scripts/ci/deploy/config/databend-query-node-1.toml @@ -32,6 +32,7 @@ cluster_id = "test_cluster" table_engine_memory_enabled = true default_storage_format = 'parquet' +default_compression = 'zstd' # [[query.users]] # name = "admin" diff --git a/scripts/ci/deploy/config/databend-query-node-2.toml b/scripts/ci/deploy/config/databend-query-node-2.toml index 3f725c8f3ab06..3436aa97d972b 100644 --- a/scripts/ci/deploy/config/databend-query-node-2.toml +++ b/scripts/ci/deploy/config/databend-query-node-2.toml @@ -32,6 +32,7 @@ cluster_id = "test_cluster" table_engine_memory_enabled = true default_storage_format = 'parquet' +default_compression = 'zstd' [log] diff --git a/scripts/ci/deploy/config/databend-query-node-3.toml b/scripts/ci/deploy/config/databend-query-node-3.toml index 9b0c0f38fe379..80de1fc49994d 100644 --- a/scripts/ci/deploy/config/databend-query-node-3.toml +++ b/scripts/ci/deploy/config/databend-query-node-3.toml @@ -33,7 +33,7 @@ cluster_id = "test_cluster" table_engine_memory_enabled = true default_storage_format = 'parquet' - +default_compression = 'zstd' [log] diff --git a/scripts/ci/deploy/config/databend-query-node-shared.toml b/scripts/ci/deploy/config/databend-query-node-shared.toml index b3f017704f5a1..13813076dd5d9 100644 --- a/scripts/ci/deploy/config/databend-query-node-shared.toml +++ b/scripts/ci/deploy/config/databend-query-node-shared.toml @@ -32,6 +32,7 @@ cluster_id = "test_cluster" table_engine_memory_enabled = true default_storage_format = 'parquet' +default_compression = 'zstd' share_endpoint_address = "127.0.0.1:33003" # receive shared information from open sharing # [[query.users]] diff --git a/src/query/config/src/config.rs b/src/query/config/src/config.rs index b7ad9b1b2d3f1..1ce53645c9e2a 100644 --- a/src/query/config/src/config.rs +++ b/src/query/config/src/config.rs @@ -1160,6 +1160,9 @@ pub struct QueryConfig { #[clap(long, default_value = "auto")] pub default_storage_format: String, + #[clap(long, default_value = "auto")] + pub default_compression: String, + #[clap(skip)] users: Vec, @@ -1280,6 +1283,7 @@ impl TryInto for QueryConfig { async_insert_busy_timeout: self.async_insert_busy_timeout, async_insert_stale_timeout: self.async_insert_stale_timeout, default_storage_format: self.default_storage_format, + default_compression: self.default_compression, idm: InnerIDMConfig { users: users_to_inner(self.users)?, }, @@ -1339,6 +1343,8 @@ impl From for QueryConfig { async_insert_busy_timeout: inner.async_insert_busy_timeout, async_insert_stale_timeout: inner.async_insert_stale_timeout, default_storage_format: inner.default_storage_format, + default_compression: inner.default_compression, + users: users_from_inner(inner.idm.users), share_endpoint_address: inner.share_endpoint_address, share_endpoint_auth_token_file: inner.share_endpoint_auth_token_file, diff --git a/src/query/config/src/inner.rs b/src/query/config/src/inner.rs index b644de7d74cef..c649c2aa1a97b 100644 --- a/src/query/config/src/inner.rs +++ b/src/query/config/src/inner.rs @@ -159,6 +159,7 @@ pub struct QueryConfig { pub async_insert_busy_timeout: u64, pub async_insert_stale_timeout: u64, pub default_storage_format: String, + pub default_compression: String, pub idm: IDMConfig, pub share_endpoint_address: String, pub share_endpoint_auth_token_file: String, @@ -207,6 +208,7 @@ impl Default for QueryConfig { async_insert_busy_timeout: 200, async_insert_stale_timeout: 0, default_storage_format: "auto".to_string(), + default_compression: "auto".to_string(), idm: IDMConfig::default(), share_endpoint_address: "".to_string(), share_endpoint_auth_token_file: "".to_string(), diff --git a/src/query/storages/fuse/src/fuse_table.rs b/src/query/storages/fuse/src/fuse_table.rs index 26065a67ad688..997e255086167 100644 --- a/src/query/storages/fuse/src/fuse_table.rs +++ b/src/query/storages/fuse/src/fuse_table.rs @@ -137,7 +137,7 @@ impl FuseTable { .options() .get(OPT_KEY_TABLE_COMPRESSION) .cloned() - .unwrap_or_default(); + .unwrap_or_default(|| config.query.default_compression.clone()); let part_prefix = table_info.meta.part_prefix.clone();