diff --git a/src/query/service/src/interpreters/hook/compact_hook.rs b/src/query/service/src/interpreters/hook/compact_hook.rs index 7ce94db6dd884..6521e16771f90 100644 --- a/src/query/service/src/interpreters/hook/compact_hook.rs +++ b/src/query/service/src/interpreters/hook/compact_hook.rs @@ -26,7 +26,6 @@ use databend_common_exception::Result; use databend_common_pipeline::core::always_callback; use databend_common_pipeline::core::ExecutionInfo; use databend_common_pipeline::core::Pipeline; -use databend_common_sql::executor::physical_plans::MutationKind; use databend_common_sql::optimizer::ir::SExpr; use databend_common_sql::plans::OptimizeCompactBlock; use databend_common_sql::plans::ReclusterPlan; @@ -50,7 +49,6 @@ pub struct CompactTargetTableDescription { pub catalog: String, pub database: String, pub table: String, - pub mutation_kind: MutationKind, } pub struct CompactHookTraceCtx { @@ -95,30 +93,18 @@ async fn do_hook_compact( info!("Operation {op_name} completed successfully, starting table optimization job."); let compact_start_at = Instant::now(); - let compaction_limits = match compact_target.mutation_kind { - MutationKind::Insert => { - let compaction_num_block_hint = - ctx.get_compaction_num_block_hint(&compact_target.table); - info!( - "Table {} requires compaction of {} blocks", - compact_target.table, compaction_num_block_hint - ); - if compaction_num_block_hint == 0 { - return Ok(()); - } - CompactionLimits { - segment_limit: None, - block_limit: Some(compaction_num_block_hint as usize), - } - } - _ => { - let auto_compaction_segments_limit = - ctx.get_settings().get_auto_compaction_segments_limit()?; - CompactionLimits { - segment_limit: Some(auto_compaction_segments_limit as usize), - block_limit: None, - } - } + let compaction_num_block_hint = + ctx.get_compaction_num_block_hint(&compact_target.table); + info!( + "Table {} requires compaction of {} blocks", + compact_target.table, compaction_num_block_hint + ); + if compaction_num_block_hint == 0 { + return Ok(()); + } + let compaction_limits = CompactionLimits { + segment_limit: None, + block_limit: Some(compaction_num_block_hint as usize), }; // keep the original progress value diff --git a/src/query/service/src/interpreters/hook/hook.rs b/src/query/service/src/interpreters/hook/hook.rs index e0ef4835dce06..d670ef1c6c75a 100644 --- a/src/query/service/src/interpreters/hook/hook.rs +++ b/src/query/service/src/interpreters/hook/hook.rs @@ -102,7 +102,6 @@ impl HookOperator { catalog: self.catalog.to_owned(), database: self.database.to_owned(), table: self.table.to_owned(), - mutation_kind: self.mutation_kind, }; let trace_ctx = CompactHookTraceCtx { diff --git a/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs b/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs index f1159f1d1aa46..4a6009300f839 100644 --- a/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs +++ b/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs @@ -40,7 +40,7 @@ async fn test_deletion_mutator_multiple_empty_segments() -> Result<()> { "+----------+----------+", "| Column 0 | Column 1 |", "+----------+----------+", - "| 7 | 7 |", + "| 9 | 9 |", "+----------+----------+", ]; let qry = format!( diff --git a/src/query/settings/src/settings_default.rs b/src/query/settings/src/settings_default.rs index aeaece5d38c0a..8db9af40edc02 100644 --- a/src/query/settings/src/settings_default.rs +++ b/src/query/settings/src/settings_default.rs @@ -892,7 +892,7 @@ impl DefaultSettings { }), ("auto_compaction_segments_limit", DefaultSettingValue { value: UserSettingValue::UInt64(3), - desc: "The maximum number of segments that can be compacted automatically triggered after write(replace-into/merge-into).", + desc: "The maximum number of segments that can be reclustered automatically triggered after write.", mode: SettingMode::Both, scope: SettingScope::Both, range: Some(SettingRange::Numeric(2..=u64::MAX)), diff --git a/src/query/storages/fuse/src/operations/common/generators/append_generator.rs b/src/query/storages/fuse/src/operations/common/generators/append_generator.rs index 037384237d3a0..5d7668e4acf30 100644 --- a/src/query/storages/fuse/src/operations/common/generators/append_generator.rs +++ b/src/query/storages/fuse/src/operations/common/generators/append_generator.rs @@ -30,7 +30,6 @@ use databend_storages_common_table_meta::meta::ColumnStatistics; use databend_storages_common_table_meta::meta::Statistics; use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; -use log::info; use log::warn; use crate::operations::common::ConflictResolveContext; @@ -41,7 +40,8 @@ use crate::statistics::TableStatsGenerator; #[derive(Clone)] pub struct AppendGenerator { - ctx: Arc, + pub(crate) ctx: Arc, + leaf_default_values: HashMap, overwrite: bool, conflict_resolve_ctx: ConflictResolveContext, @@ -194,28 +194,6 @@ impl SnapshotGenerator for AppendGenerator { } } - // check if need to auto compact - // the algorithm is: if the number of imperfect blocks is greater than the threshold, then auto compact. - // the threshold is set by the setting `auto_compaction_imperfect_blocks_threshold`, default is 25. - let imperfect_count = new_summary.block_count - new_summary.perfect_block_count; - let auto_compaction_imperfect_blocks_threshold = self - .ctx - .get_settings() - .get_auto_compaction_imperfect_blocks_threshold()?; - - if imperfect_count >= auto_compaction_imperfect_blocks_threshold { - // If imperfect_count is larger, SLIGHTLY increase the number of blocks - // eligible for auto-compaction, this adjustment is intended to help reduce - // fragmentation over time. - let compact_num_block_hint = std::cmp::min( - imperfect_count, - (auto_compaction_imperfect_blocks_threshold as f64 * 1.5).ceil() as u64, - ); - info!("set compact_num_block_hint to {compact_num_block_hint }"); - self.ctx - .set_compaction_num_block_hint(table_info.name.as_str(), compact_num_block_hint); - } - // merge statistics will set the additional_stats_meta to none, // so reset additional_stats_meta here. let table_statistics_location = table_stats_gen.table_statistics_location(); diff --git a/src/query/storages/fuse/src/operations/common/generators/mod.rs b/src/query/storages/fuse/src/operations/common/generators/mod.rs index 0e4a35dd80969..06b7ab46a8e74 100644 --- a/src/query/storages/fuse/src/operations/common/generators/mod.rs +++ b/src/query/storages/fuse/src/operations/common/generators/mod.rs @@ -24,5 +24,6 @@ pub use conflict_resolve_context::SnapshotChanges; pub use conflict_resolve_context::SnapshotMerged; pub use mutation_generator::MutationGenerator; pub use snapshot_generator::decorate_snapshot; +pub(crate) use snapshot_generator::set_compaction_num_block_hint; pub use snapshot_generator::SnapshotGenerator; pub use truncate_generator::TruncateGenerator; diff --git a/src/query/storages/fuse/src/operations/common/generators/snapshot_generator.rs b/src/query/storages/fuse/src/operations/common/generators/snapshot_generator.rs index e53d388c87e67..f6e924198ba77 100644 --- a/src/query/storages/fuse/src/operations/common/generators/snapshot_generator.rs +++ b/src/query/storages/fuse/src/operations/common/generators/snapshot_generator.rs @@ -15,12 +15,15 @@ use std::any::Any; use std::sync::Arc; +use databend_common_catalog::table_context::TableContext; use databend_common_exception::Result; use databend_common_expression::TableSchema; use databend_common_meta_app::schema::TableInfo; use databend_storages_common_session::TxnManagerRef; +use databend_storages_common_table_meta::meta::Statistics; use databend_storages_common_table_meta::meta::TableMetaTimestamps; use databend_storages_common_table_meta::meta::TableSnapshot; +use log::info; use crate::operations::common::ConflictResolveContext; use crate::statistics::TableStatsGenerator; @@ -92,3 +95,39 @@ pub fn decorate_snapshot( } Ok(()) } + +pub(crate) fn set_compaction_num_block_hint( + ctx: &dyn TableContext, + table_name: &str, + summary: &Statistics, +) { + if let Err(e) = try_set_compaction_num_block_hint(ctx, table_name, summary) { + log::warn!("set_compaction_num_block_hint failed: {}", e); + } +} + +pub(crate) fn try_set_compaction_num_block_hint( + ctx: &dyn TableContext, + table_name: &str, + summary: &Statistics, +) -> Result<()> { + // check if need to auto compact + // the algorithm is: if the number of imperfect blocks is greater than the threshold, then auto compact. + // the threshold is set by the setting `auto_compaction_imperfect_blocks_threshold`, default is 25. + let imperfect_count = summary.block_count - summary.perfect_block_count; + let auto_compaction_imperfect_blocks_threshold = ctx + .get_settings() + .get_auto_compaction_imperfect_blocks_threshold()?; + if imperfect_count >= auto_compaction_imperfect_blocks_threshold { + // If imperfect_count is larger, SLIGHTLY increase the number of blocks + // eligible for auto-compaction, this adjustment is intended to help reduce + // fragmentation over time. + let compact_num_block_hint = std::cmp::min( + imperfect_count, + (auto_compaction_imperfect_blocks_threshold as f64 * 1.5).ceil() as u64, + ); + info!("set compact_num_block_hint to {compact_num_block_hint }"); + ctx.set_compaction_num_block_hint(table_name, compact_num_block_hint); + } + Ok(()) +} diff --git a/src/query/storages/fuse/src/operations/common/processors/multi_table_insert_commit.rs b/src/query/storages/fuse/src/operations/common/processors/multi_table_insert_commit.rs index aee85ce30269e..822855356df21 100644 --- a/src/query/storages/fuse/src/operations/common/processors/multi_table_insert_commit.rs +++ b/src/query/storages/fuse/src/operations/common/processors/multi_table_insert_commit.rs @@ -42,6 +42,7 @@ use log::error; use log::info; use crate::operations::set_backoff; +use crate::operations::set_compaction_num_block_hint; use crate::operations::AppendGenerator; use crate::operations::CommitMeta; use crate::operations::SnapshotGenerator; @@ -272,8 +273,9 @@ async fn build_update_table_meta_req( let table_stats_gen = fuse_table .generate_table_stats(&previous, insert_hll, insert_rows) .await?; + let table_info = table.get_table_info(); let snapshot = snapshot_generator.generate_new_snapshot( - table.get_table_info(), + table_info, fuse_table.cluster_key_id(), previous, txn_mgr, @@ -281,6 +283,11 @@ async fn build_update_table_meta_req( table_stats_gen, )?; snapshot.ensure_segments_unique()?; + set_compaction_num_block_hint( + snapshot_generator.ctx.as_ref(), + table_info.name.as_str(), + &snapshot.summary, + ); // write snapshot let dal = fuse_table.get_operator(); diff --git a/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs b/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs index 8bb5462b4d347..59caafebef139 100644 --- a/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs +++ b/src/query/storages/fuse/src/operations/common/processors/sink_commit.rs @@ -58,6 +58,7 @@ use opendal::Operator; use crate::io::TableMetaLocationGenerator; use crate::operations::set_backoff; +use crate::operations::set_compaction_num_block_hint; use crate::operations::vacuum::vacuum_table; use crate::operations::AppendGenerator; use crate::operations::CommitMeta; @@ -442,6 +443,11 @@ where F: SnapshotGenerator + Send + Sync + 'static table_stats_gen, ) { Ok(snapshot) => { + set_compaction_num_block_hint( + self.ctx.as_ref(), + table_info.name.as_str(), + &snapshot.summary, + ); self.state = State::TryCommit { data: snapshot.to_bytes()?, snapshot, diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0011_change_tracking.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0011_change_tracking.test index 2b319de07601a..5fdf5f19509ad 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0011_change_tracking.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0011_change_tracking.test @@ -111,6 +111,9 @@ select a, _origin_version is null, _origin_block_id is null, _origin_block_row_n statement ok set enable_compact_after_write = 1; +statement ok +set auto_compaction_imperfect_blocks_threshold = 2; + statement ok create table t1(a int) change_tracking = true diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0020_analyze.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0020_analyze.test index 5030a21c1f3da..93592f25ec764 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0020_analyze.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0020_analyze.test @@ -200,7 +200,7 @@ query T show statistics from table db_09_0020.t2; ---- db_09_0020 t2 a 3 3 2 0 2 4 4 (empty) -db_09_0020 t2 b 3 3 2 0 2 4 4 (empty) +db_09_0020 t2 b 3 3 3 0 2 4 4 (empty) statement ok analyze table t2; @@ -209,12 +209,12 @@ query T show statistics from table db_09_0020.t2; ---- db_09_0020 t2 a 3 3 2 0 2 4 4 [bucket id: 0, min: "2", max: "2", ndv: 1.0, count: 1.0], [bucket id: 1, min: "2", max: "2", ndv: 1.0, count: 1.0], [bucket id: 2, min: "4", max: "4", ndv: 1.0, count: 1.0] -db_09_0020 t2 b 3 3 2 0 2 4 4 [bucket id: 0, min: "2", max: "2", ndv: 1.0, count: 1.0], [bucket id: 1, min: "2", max: "2", ndv: 1.0, count: 1.0], [bucket id: 2, min: "4", max: "4", ndv: 1.0, count: 1.0] +db_09_0020 t2 b 3 3 3 0 2 4 4 [bucket id: 0, min: "2", max: "2", ndv: 1.0, count: 1.0], [bucket id: 1, min: "2", max: "2", ndv: 1.0, count: 1.0], [bucket id: 2, min: "4", max: "4", ndv: 1.0, count: 1.0] query I select count() from fuse_snapshot('db_09_0020','t2'); ---- -6 +5 statement ok DROP TABLE t2; diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0026_merge_into.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0026_merge_into.test index 55a566b530543..cdcb48ab61fa3 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0026_merge_into.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0026_merge_into.test @@ -580,12 +580,8 @@ merge into cluster_target as t1 using (select * from cluster_source) as t2 on t1 ---- 5 -# By default setting, all rows merged from `cluster_source` will be resident in a single block of `cluster_target`, -# as table `cluster_target` is clustered by `(a,b)`, the rows inside the one block are assumed to be sorted -# by `(a, b)`, consequently, the result of the following query should be ordered by `(a,b)` without an explicit -# `order by` clause. query TTT -select * from cluster_target; +select * from cluster_target order by a, b; ---- 1 a 2 2 a 4 diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0030_issue_13610.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0030_issue_13610.test index daed2a94a637f..3d1e3244d4e8b 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0030_issue_13610.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0030_issue_13610.test @@ -7,6 +7,9 @@ CREATE DATABASE issue_13610 statement ok USE issue_13610 +statement ok +set auto_compaction_imperfect_blocks_threshold = 2; + statement ok create table t(a int); diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0035_merge_into_separate_pipeline_without_distributed_enable.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0035_merge_into_separate_pipeline_without_distributed_enable.test index 520f6d21dd56e..1fd86d02c114b 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0035_merge_into_separate_pipeline_without_distributed_enable.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0035_merge_into_separate_pipeline_without_distributed_enable.test @@ -115,7 +115,7 @@ merge into t1_separate as t1 using (select * from t2_separate) as t2 on t1.a = t ## without order by query TTT -select * from t1_separate; +select * from t1_separate order by a; ---- 1 a5 b5 3 a6 b6 @@ -129,7 +129,7 @@ merge into t1_separate as t1 using (select * from t2_separate) as t2 on t1.a = t 4 query TTT -select * from t1_separate; +select * from t1_separate order by a; ---- 1 a5 b5 3 a6 b6 @@ -145,14 +145,8 @@ merge into t1_separate as t1 using (select * from t2_separate) as t2 on t1.a = t ---- 2 4 -query T -select count(*) from fuse_block('db','t1_separate'); ----- -1 - -## we will do compact query TTT -select * from t1_separate; +select * from t1_separate order by a; ---- 1 a5 b5 3 a6 b6 diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test index eba63c64d5a0f..0ff95e60ed979 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test @@ -577,12 +577,8 @@ merge into cluster_target as t1 using (select * from cluster_source) as t2 on t1 ---- 5 -# By default setting, all rows merged from `cluster_source` will be resident in a single block of `cluster_target`, -# as table `cluster_target` is clustered by `(a,b)`, the rows inside the one block are assumed to be sorted -# by `(a, b)`, consequently, the result of the following query should be ordered by `(a,b)` without an explicit -# `order by` clause. query TTT -select * from cluster_target; +select * from cluster_target order by a,b; ---- 1 a 2 2 a 4 diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0041_auto_compaction.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0041_auto_compaction.test index 7c9404369b6e0..cf84fd280538b 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0041_auto_compaction.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0041_auto_compaction.test @@ -49,11 +49,6 @@ insert into t values(1); statement ok insert into t values(1); - -# fourth block(after compaction) -statement ok -set auto_compaction_segments_limit = 2; - statement ok insert into t values(1); @@ -63,7 +58,6 @@ replace into t on(c) values(2); query III select segment_count , block_count , row_count from fuse_snapshot('i15760', 't') limit 20; ---- -2 4 11 3 5 11 2 4 10 1 3 9 diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0045_merge_into_issue_16581.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0045_merge_into_issue_16581.test index 3a70e7d761c5b..dd5979605ecc8 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0045_merge_into_issue_16581.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0045_merge_into_issue_16581.test @@ -10,7 +10,7 @@ merge into test_merge as tba using (select * from (values('1','add','11'),('4',' 1 query ITI -select * from test_merge; +select * from test_merge order by col1; ---- 2 abc 2 3 abc 3 diff --git a/tests/sqllogictests/suites/ee/01_ee_system/01_0002_virtual_column.test b/tests/sqllogictests/suites/ee/01_ee_system/01_0002_virtual_column.test index 62715a081c148..3d4db6c404d5c 100644 --- a/tests/sqllogictests/suites/ee/01_ee_system/01_0002_virtual_column.test +++ b/tests/sqllogictests/suites/ee/01_ee_system/01_0002_virtual_column.test @@ -349,7 +349,6 @@ test_virtual_column tweets data['text'] 10 10 7 0 a z 16 (empty) test_virtual_column tweets data['user']['id'] 10 10 6 0 1 7 8 (empty) test_virtual_column tweets id 10 10 10 0 1 10 4 (empty) - statement ok UPDATE tweets SET data = '{"id":4, "create": "1/08", "text": "aa", "user": {"id": 1}, "replies": 10}' WHERE id = 4; @@ -361,7 +360,10 @@ data['create'] 10 0 16 (empty) data['id'] 10 0 8 (empty) data['replies'] 7 3 8 (empty) data['text'] 8 0 16 (empty) -data['user']['id'] 4 0 8 (empty) +data['user']['id'] 6 0 8 (empty) +data['likes'] 2 0 1 (empty) +data['tags'][0] 2 0 3 (empty) +data['tags'][1] 2 0 3 (empty) query TTTIIIITTIT SHOW STATISTICS FROM TABLE test_virtual_column.tweets; @@ -369,9 +371,12 @@ SHOW STATISTICS FROM TABLE test_virtual_column.tweets; test_virtual_column tweets data 10 10 NULL NULL NULL NULL NULL (empty) test_virtual_column tweets data['create'] 10 10 10 0 1/08 6/07 16 (empty) test_virtual_column tweets data['id'] 10 10 10 0 1 10 8 (empty) +test_virtual_column tweets data['likes'] 10 10 2 0 10 25 1 (empty) test_virtual_column tweets data['replies'] 10 10 7 3 0 10 8 (empty) +test_virtual_column tweets data['tags'][0] 10 10 2 0 good new 3 (empty) +test_virtual_column tweets data['tags'][1] 10 10 2 0 interesting popular 3 (empty) test_virtual_column tweets data['text'] 10 10 8 0 a z 16 (empty) -test_virtual_column tweets data['user']['id'] 10 10 4 0 1 7 8 (empty) +test_virtual_column tweets data['user']['id'] 10 10 6 0 1 7 8 (empty) test_virtual_column tweets id 10 10 10 0 1 10 4 (empty) query IITTIITFIT @@ -494,7 +499,7 @@ select id, data['id'], data['create'], data['text'], data['user']['id'], data['r query I SELECT count(*) FROM fuse_virtual_column('test_virtual_column', 'tweets'); ---- -6 +26 statement ok set enable_experimental_virtual_column = 0; @@ -505,7 +510,7 @@ INSERT INTO tweets FROM (SELECT * FROM tweets); query I SELECT count(*) FROM fuse_virtual_column('test_virtual_column', 'tweets'); ---- -6 +26 statement error REFRESH VIRTUAL COLUMN FOR tweets; @@ -516,10 +521,14 @@ set enable_experimental_virtual_column = 1; statement ok REFRESH VIRTUAL COLUMN FOR tweets; +# Compact tweets table, so that number of automatic detected virtual columns could be stablized +statement ok +optimize table test_virtual_column.tweets compact + query I SELECT count(*) FROM fuse_virtual_column('test_virtual_column', 'tweets'); ---- -12 +6 query IITTIITFIT select id, data['id'], data['create'], data['text'], data['user']['id'], data['replies'], data['geo'], data['geo']['lat'], data['likes'], data['tags'] from tweets order by id; diff --git a/tests/sqllogictests/suites/ee/06_ee_stream/06_0000_stream.test b/tests/sqllogictests/suites/ee/06_ee_stream/06_0000_stream.test index 344699014c8c0..46eb595b54d66 100644 --- a/tests/sqllogictests/suites/ee/06_ee_stream/06_0000_stream.test +++ b/tests/sqllogictests/suites/ee/06_ee_stream/06_0000_stream.test @@ -510,8 +510,8 @@ query IIBBI select a, b, _origin_version is null, _origin_block_id is null, _origin_block_row_num from t7 order by a ---- 1 1 0 0 0 -2 2 0 0 0 -4 4 0 0 1 +2 2 1 1 NULL +4 4 1 1 NULL statement ok create stream s7_1 on table t7 at(stream => s7) diff --git a/tests/sqllogictests/suites/ee/06_ee_stream/06_0003_stream_multi_table_insert.test b/tests/sqllogictests/suites/ee/06_ee_stream/06_0003_stream_multi_table_insert.test index 34293e6702406..543d16e477731 100644 --- a/tests/sqllogictests/suites/ee/06_ee_stream/06_0003_stream_multi_table_insert.test +++ b/tests/sqllogictests/suites/ee/06_ee_stream/06_0003_stream_multi_table_insert.test @@ -14,10 +14,10 @@ # multi table INSERT statement ok -create or replace database test_txn_stream_1; +create or replace database test_txn_stream_06_0003; statement ok -use test_txn_stream_1; +use test_txn_stream_06_0003; statement ok CREATE TABLE t_append_only(a INT); @@ -194,4 +194,4 @@ SELECT * FROM t_consume_append_only_6_1; -- empty ---- statement ok -drop database test_txn_stream_1; +drop database test_txn_stream_06_0003; diff --git a/tests/sqllogictests/suites/mode/cluster/shuffle.test b/tests/sqllogictests/suites/mode/cluster/shuffle.test index b3000d38066d2..63a72d4dd066e 100644 --- a/tests/sqllogictests/suites/mode/cluster/shuffle.test +++ b/tests/sqllogictests/suites/mode/cluster/shuffle.test @@ -67,9 +67,9 @@ Sort(Final) │ ├── output columns: [number (#1)] │ ├── read rows: 14 │ ├── read size: < 1 KiB - │ ├── partitions total: 4 - │ ├── partitions scanned: 4 - │ ├── pruning stats: [segments: >, blocks: >] + │ ├── partitions total: 6 + │ ├── partitions scanned: 6 + │ ├── pruning stats: [segments: >, blocks: >] │ ├── push downs: [filters: [], limit: NONE] │ └── estimated rows: 14.00 └── Exchange(Probe) diff --git a/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test b/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test index d7737cc38fa18..56275d246e699 100644 --- a/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test +++ b/tests/sqllogictests/suites/query/index/04_inverted_index/04_0000_inverted_index_base.test @@ -155,23 +155,22 @@ query IRT SELECT id, score(), content FROM t WHERE match(content, '()', 'lenient=true') ---- - statement ok UPDATE t SET content = '科技创新是推动社会进步的重要动力,我们应该积极支持和推动科技创新。' WHERE id=24 query IRT SELECT id, score(), content FROM t WHERE match(content, '中国') ORDER BY score() ---- -21 1.6232129 中国的古代诗词充满了深邃的意境和独特的韵味,是中华文化的重要组成部分。 -28 1.8224978 中国的饮食文化博大精深,各地的美食各具特色,让人流连忘返。 -12 1.9674243 北京的故宫是中国古代建筑的瑰宝,吸引了无数游客前来参观。 -15 2.0775645 中国的茶文化源远流长,品茶已经成为一种生活方式。 +21 1.423108 中国的古代诗词充满了深邃的意境和独特的韵味,是中华文化的重要组成部分。 +12 1.4482267 北京的故宫是中国古代建筑的瑰宝,吸引了无数游客前来参观。 +15 1.5346593 中国的茶文化源远流长,品茶已经成为一种生活方式。 +28 1.5707673 中国的饮食文化博大精深,各地的美食各具特色,让人流连忘返。 query IRT SELECT id, score(), content FROM t WHERE match(content, '科技') ORDER BY score() ---- -13 2.8710475 随着科技的发展,人们的生活变得越来越便利。 -24 3.3270247 科技创新是推动社会进步的重要动力,我们应该积极支持和推动科技创新。 +13 2.1947646 随着科技的发展,人们的生活变得越来越便利。 +24 2.8508463 科技创新是推动社会进步的重要动力,我们应该积极支持和推动科技创新。 statement ok DELETE FROM t WHERE id=21 @@ -179,9 +178,9 @@ DELETE FROM t WHERE id=21 query IRT SELECT id, score(), content FROM t WHERE match(content, '中国') ORDER BY score() ---- -28 2.0144506 中国的饮食文化博大精深,各地的美食各具特色,让人流连忘返。 -12 2.1761932 北京的故宫是中国古代建筑的瑰宝,吸引了无数游客前来参观。 -15 2.299267 中国的茶文化源远流长,品茶已经成为一种生活方式。 +12 1.4482267 北京的故宫是中国古代建筑的瑰宝,吸引了无数游客前来参观。 +15 1.5346593 中国的茶文化源远流长,品茶已经成为一种生活方式。 +28 2.002842 中国的饮食文化博大精深,各地的美食各具特色,让人流连忘返。 # index without optional filters and index rocord is basic statement ok @@ -193,10 +192,10 @@ REFRESH INVERTED INDEX idx1 ON t query IRT SELECT id, score(), content FROM t WHERE match(content, 'the') ---- -1 1.9382918 The quick brown fox jumps over the lazy dog -3 2.253458 The early bird catches the worm -6 2.033073 Beauty is in the eye of the beholder -10 2.033073 An apple a day keeps the doctor away +1 0.8323383 The quick brown fox jumps over the lazy dog +3 0.9893832 The early bird catches the worm +6 0.8788376 Beauty is in the eye of the beholder +10 0.8788376 An apple a day keeps the doctor away query IRT SELECT id, score(), content FROM t WHERE match(content, 'fly')