diff --git a/.typos.toml b/.typos.toml index 015175dee80dc..f221e9c4058e6 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,39 +1,58 @@ # If there are words that you think should not be treated as typo. # Please list here along with a comment. + +[default] +extend-ignore-re = [ + "(?Rm)^.*(#|//)\\s*typos:disable-line$", + "(#|//)\\s*typos:ignore-next-line\\n.*", + "(?s)(#|//)\\s*typos:off.*?\\n\\s*(#|//)\\s*typos:on", +] + [default.extend-words] # Preserved for NdJson -"Nd" = "Nd" -# Microsoft K8s Server -"AKS" = "AKS" +Nd = "Nd" +typ = "typ" +aranges = "aranges" + +[default.extend-identifiers] + # Wrong cases -"ba" = "ba" -"ue" = "ue" -"INOUT" = "INOUT" -"ser" = "ser" -"Ser" = "Ser" -"flate" = "flate" -"Tke" = "Tke" -"typ" = "typ" -"dows" = "dows" -# created_ons & updated_ons -"ons" = "ons" - -# Intentional typos used in SQL error suggestion test cases -"tabl" = "tabl" -"optmize" = "optmize" -"vacum" = "vacum" -"creat" = "creat" -"crate" = "crate" +Tke = "Tke" +ba = "ba" + +# sql function name: diff_dows, between_dows +diff_dows = "diff_dows" +between_dows = "between_dows" + +into_flate2 = "into_flate2" [files] extend-exclude = [ "**/Cargo.toml", - "scripts/benchmark/", "benchmark/", - "tests/", - "src/meta", - # masked secrets - "src/query/config/src/mask.rs", - # Forked from upstream - "src/common/parquet2" + "tests/sqllogictests", + "tests/nox/java_client/testng.xml", + "tests/data/ddl", ] + +# todo: fix me +[type.py] +check-file = false + +# todo: fix me +[type.sh] +check-file = false + +[type.txt] +check-file = false + +[type.sql] +check-file = false + +[type.csr] +extend-glob = ["*.csr"] +check-file = false + +[type.result] +extend-glob = ["*.result"] +check-file = false diff --git a/src/common/hashtable/src/utils.rs b/src/common/hashtable/src/utils.rs index eca5ac0aee6de..1576568eab973 100644 --- a/src/common/hashtable/src/utils.rs +++ b/src/common/hashtable/src/utils.rs @@ -234,7 +234,7 @@ pub struct MergeIntoBlockInfoIndex { pub type Interval = (u32, u32); /// the segment blocks are not sequential,because we do parallel hashtable build. -/// the block lay out in chunks could be like belows: +/// the block lay out in chunks could be like bellows: /// segment0_block1 | /// segment1_block0 | chunk0 /// segment0_block0 | diff --git a/src/common/io/tests/it/main.rs b/src/common/io/tests/it/main.rs index 9ac5464bb2948..9deb879a3a64c 100644 --- a/src/common/io/tests/it/main.rs +++ b/src/common/io/tests/it/main.rs @@ -24,4 +24,4 @@ mod borsh_serialization; mod cursor_ext; mod escape; mod interval; -mod serialization_format_compatability; +mod serialization_format_compatibility; diff --git a/src/common/io/tests/it/serialization_format_compatability.rs b/src/common/io/tests/it/serialization_format_compatibility.rs similarity index 100% rename from src/common/io/tests/it/serialization_format_compatability.rs rename to src/common/io/tests/it/serialization_format_compatibility.rs diff --git a/src/meta/api/src/garbage_collection_api.rs b/src/meta/api/src/garbage_collection_api.rs index 28cdfbba937a3..9e0c9aeb6dab6 100644 --- a/src/meta/api/src/garbage_collection_api.rs +++ b/src/meta/api/src/garbage_collection_api.rs @@ -129,7 +129,7 @@ async fn remove_copied_files_for_dropped_table( // Loop until: // - all cleaned // - or table is removed from meta-service - // - or is no longer in `droppped` state. + // - or is no longer in `dropped` state. for i in 0..usize::MAX { let mut txn = TxnRequest::default(); diff --git a/src/meta/api/src/kv_pb_api/mod.rs b/src/meta/api/src/kv_pb_api/mod.rs index 349329184a1e1..ba24d7096a3fe 100644 --- a/src/meta/api/src/kv_pb_api/mod.rs +++ b/src/meta/api/src/kv_pb_api/mod.rs @@ -559,7 +559,7 @@ mod tests { ) -> Result, Self::Error> { let mut res = Vec::with_capacity(keys.len()); for (i, key) in keys.iter().enumerate() { - // For tesing early return stream. + // For testing early return stream. if let Some(early_return) = self.early_return { if i >= early_return { break; diff --git a/src/meta/api/src/schema_api_test_suite.rs b/src/meta/api/src/schema_api_test_suite.rs index 15831d1797dfc..adf766a7301dc 100644 --- a/src/meta/api/src/schema_api_test_suite.rs +++ b/src/meta/api/src/schema_api_test_suite.rs @@ -2714,7 +2714,7 @@ impl SchemaApiTestSuite { // Change the comment, this modification should not be committed req.new_table_meta.comment = "some new comment".to_string(); // Expects no KV api level error, and no app level error. - // For the convenience of reviewing, using explict type signature + // For the convenience of reviewing, using explicit type signature let _r: databend_common_meta_app::schema::UpdateTableMetaReply = mt .update_multi_table_meta_with_sender( UpdateMultiTableMetaReq { @@ -5526,7 +5526,7 @@ impl SchemaApiTestSuite { let handle = runtime.spawn(async move { let resp = arc_mt.create_table(create_table_req.clone()).await; - // assert that when create table concurrently with corret params return error, + // assert that when create table concurrently with correct params return error, // the error MUST be TxnRetryMaxTimes if resp.is_err() { assert!(matches!( @@ -5547,7 +5547,7 @@ impl SchemaApiTestSuite { }; let resp = arc_mt.commit_table_meta(commit_table_req).await; - // assert that when commit_table_meta concurrently with corret params return error, + // assert that when commit_table_meta concurrently with correct params return error, // the error MUST be TxnRetryMaxTimes or CommitTableMetaError(prev table id has been changed) if resp.is_err() { assert!( diff --git a/src/meta/app/src/principal/procedure.rs b/src/meta/app/src/principal/procedure.rs index 35f0611cd9ab5..8bfdb4ea614e5 100644 --- a/src/meta/app/src/principal/procedure.rs +++ b/src/meta/app/src/principal/procedure.rs @@ -71,7 +71,7 @@ impl Display for ProcedureMeta { fn fmt(&self, f: &mut Formatter) -> fmt::Result { write!( f, - "Lanuage: {:?}, args {} return_type: {}, CreatedOn: {:?}, Script: {}, Comment: {:?}", + "Language: {:?}, args {} return_type: {}, CreatedOn: {:?}, Script: {}, Comment: {:?}", self.procedure_language, self.arg_names.display_n(1000), self.return_types.display_n(1000), diff --git a/src/meta/app/src/schema/table/mod.rs b/src/meta/app/src/schema/table/mod.rs index 9c9936392a1bb..9f219d4a12059 100644 --- a/src/meta/app/src/schema/table/mod.rs +++ b/src/meta/app/src/schema/table/mod.rs @@ -137,7 +137,7 @@ pub struct TableStatistics { pub number_of_blocks: Option, } -/// Iceberg table parition +/// Iceberg table partition #[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Eq, PartialEq)] pub enum TablePartition { Identity { columns: Vec }, diff --git a/src/meta/client/src/grpc_client.rs b/src/meta/client/src/grpc_client.rs index 7d15517de5165..6edcf87f0e574 100644 --- a/src/meta/client/src/grpc_client.rs +++ b/src/meta/client/src/grpc_client.rs @@ -440,7 +440,7 @@ impl MetaGrpcClient { resp_err: Option<&(dyn std::error::Error + 'static)>, ) { // TODO: this current endpoint is not stable, may be modified by other thread. - // The caller should pasing the in use endpoint. + // The caller should passing the in use endpoint. let current_endpoint = self.get_current_endpoint(); let Some(endpoint) = current_endpoint else { diff --git a/src/meta/proto-conv/tests/it/common.rs b/src/meta/proto-conv/tests/it/common.rs index a74cc898bd375..072a672266505 100644 --- a/src/meta/proto-conv/tests/it/common.rs +++ b/src/meta/proto-conv/tests/it/common.rs @@ -32,7 +32,7 @@ where MT: FromToProto + PartialEq + Debug { prost::Message::encode(&p, &mut buf)?; let var_name = n.split("::").last().unwrap(); - // The encoded data should be saved for compatability test. + // The encoded data should be saved for compatibility test. println!("// Encoded data of version {} of {}:", VER, n); println!("// It is generated with common::test_pb_from_to()."); println!( diff --git a/src/meta/proto-conv/tests/it/v137_add_grant_object_connection.rs b/src/meta/proto-conv/tests/it/v137_add_grant_object_connection.rs index 540a5c2759156..ab4626a67b476 100644 --- a/src/meta/proto-conv/tests/it/v137_add_grant_object_connection.rs +++ b/src/meta/proto-conv/tests/it/v137_add_grant_object_connection.rs @@ -59,7 +59,7 @@ fn test_decode_v137_grant_object() -> anyhow::Result<()> { mt::principal::GrantObject::Connection("c1".to_string()), make_bitflags!(UserPrivilegeType::{AccessConnection}), ), - // test new global privilege CreateConneciton, AccessConnection + // test new global privilege CreateConnection, AccessConnection mt::principal::GrantEntry::new( mt::principal::GrantObject::Global, make_bitflags!(UserPrivilegeType::{Create | Select | Insert | Update | Delete | Drop | Alter | Super | CreateUser | DropUser | CreateRole | DropRole | Grant | CreateStage | Set | CreateDataMask | Ownership | Read | Write | CreateWarehouse | CreateConnection | AccessConnection }), diff --git a/src/meta/protos/proto/virtual_schema.proto b/src/meta/protos/proto/virtual_schema.proto index 4c7b5cf7280ad..11602b25ad524 100644 --- a/src/meta/protos/proto/virtual_schema.proto +++ b/src/meta/protos/proto/virtual_schema.proto @@ -59,7 +59,7 @@ message VirtualDataSchema { // Virtual Fields in the table repeated VirtualDataField fields = 1; - // Other optional virutal columns info + // Other optional virtual columns info map metadata = 2; // start from 3_000_000_001, Avoid conflicts with the column ids of normal columns uint32 next_column_id = 3; diff --git a/src/meta/raft-store/src/applier/mod.rs b/src/meta/raft-store/src/applier/mod.rs index a6cab74ce52b0..49fd13bfa840b 100644 --- a/src/meta/raft-store/src/applier/mod.rs +++ b/src/meta/raft-store/src/applier/mod.rs @@ -315,7 +315,7 @@ where SM: StateMachineApi + 'static debug!("apply txn cmd {}: {}", self.cmd_ctx, req); // 1. Evaluate conditional operations one by one. - // Once one of them is successful, execute the corresponding operations and retrun. + // Once one of them is successful, execute the corresponding operations and return. // Otherwise, try next. for (i, conditional) in req.operations.iter().enumerate() { let success = if let Some(predicate) = &conditional.predicate { diff --git a/src/meta/raft-store/src/sm_v003/writer_v003.rs b/src/meta/raft-store/src/sm_v003/writer_v003.rs index fe6153a6d858d..2e5a45bf1f2f2 100644 --- a/src/meta/raft-store/src/sm_v003/writer_v003.rs +++ b/src/meta/raft-store/src/sm_v003/writer_v003.rs @@ -133,7 +133,7 @@ impl WriterV003 { /// It returns a sender to send entries and a handle to wait for the thread to finish. /// Internally it calls tokio::spawn_blocking. /// - /// When a [`WritenEntry::Finish`] is received, the thread will flush the data to disk and return + /// When a [`WriteEntry::Finish`] is received, the thread will flush the data to disk and return /// a [`TempSnapshotDataV003`] and a [`SnapshotStat`]. /// /// [`TempSnapshotDataV003`] is a temporary snapshot data that will be renamed to the final path by the caller. diff --git a/src/meta/raft-store/src/snapshot_config.rs b/src/meta/raft-store/src/snapshot_config.rs index 3d4b4cb4dd6af..772641df63c7b 100644 --- a/src/meta/raft-store/src/snapshot_config.rs +++ b/src/meta/raft-store/src/snapshot_config.rs @@ -84,7 +84,7 @@ impl SnapshotConfig { (self.snapshot_dir(), temp_snapshot_id) } - // TODO: remvoe this + // TODO: remove this pub fn snapshot_temp_path(&self) -> String { let temp_snapshot_id = self.temp_snapshot_id(); format!("{}/{}", self.snapshot_dir(), temp_snapshot_id) diff --git a/src/meta/raft-store/src/state/raft_state_kv.rs b/src/meta/raft-store/src/state/raft_state_kv.rs index 3906a5a025a5a..f044257dcf22d 100644 --- a/src/meta/raft-store/src/state/raft_state_kv.rs +++ b/src/meta/raft-store/src/state/raft_state_kv.rs @@ -31,6 +31,7 @@ pub enum RaftStateKey { /// The node id. Id, + // typos:ignore-next-line /// Hard state of the raft log, including `current_term` and `voted_vor`. HardState, diff --git a/src/meta/raft-store/src/utils.rs b/src/meta/raft-store/src/utils.rs index 424168ab93e9a..f8e28eece8f5f 100644 --- a/src/meta/raft-store/src/utils.rs +++ b/src/meta/raft-store/src/utils.rs @@ -118,7 +118,7 @@ mod tests { #[test] fn test_prefix_right_bound_basic() { // Basic functionality test - assert_eq!(prefix_right_bound("abc"), Some(s("abd"))); + assert_eq!(prefix_right_bound("abc"), Some(s("abd"))); // typos:disable-line } #[test] diff --git a/src/meta/semaphore/src/errors/mod.rs b/src/meta/semaphore/src/errors/mod.rs index c31206d888b8d..5f76bff3e142a 100644 --- a/src/meta/semaphore/src/errors/mod.rs +++ b/src/meta/semaphore/src/errors/mod.rs @@ -17,11 +17,11 @@ mod acquirer_closed; mod connection_closed; mod early_removed; mod either; -mod processer_error; +mod processor_error; pub use acquire_error::AcquireError; pub use acquirer_closed::AcquirerClosed; pub use connection_closed::ConnectionClosed; pub use early_removed::EarlyRemoved; pub use either::Either; -pub use processer_error::ProcessorError; +pub use processor_error::ProcessorError; diff --git a/src/meta/semaphore/src/errors/processer_error.rs b/src/meta/semaphore/src/errors/processor_error.rs similarity index 100% rename from src/meta/semaphore/src/errors/processer_error.rs rename to src/meta/semaphore/src/errors/processor_error.rs diff --git a/src/meta/service/src/meta_node/meta_node.rs b/src/meta/service/src/meta_node/meta_node.rs index bdd8c30fb3be7..92223d4b24691 100644 --- a/src/meta/service/src/meta_node/meta_node.rs +++ b/src/meta/service/src/meta_node/meta_node.rs @@ -183,7 +183,7 @@ impl MetaNode { max_in_snapshot_log_to_keep: config.max_applied_log_to_keep, snapshot_max_chunk_size: config.snapshot_chunk_size, // Allow Leader to reset replication if a follower clears its log. - // Usefull in a testing environment. + // Useful in a testing environment. allow_log_reversion: Some(true), ..Default::default() } diff --git a/src/meta/types/src/sys_data.rs b/src/meta/types/src/sys_data.rs index 549ba15c46bcd..1d942602d9062 100644 --- a/src/meta/types/src/sys_data.rs +++ b/src/meta/types/src/sys_data.rs @@ -216,7 +216,7 @@ mod tests { assert_eq!(want, serialized); } - /// Test serialze will all fields set. + /// Test serialize will all fields set. #[test] fn test_sys_data_serialize() { let sys_data = SysData { diff --git a/src/query/ast/src/parser/error_suggestion.rs b/src/query/ast/src/parser/error_suggestion.rs index 4904495aae2de..c06422a6ac7b1 100644 --- a/src/query/ast/src/parser/error_suggestion.rs +++ b/src/query/ast/src/parser/error_suggestion.rs @@ -242,11 +242,11 @@ mod tests { fn test_typo_corrections() { // Typo corrections - may return multiple suggestions if scores are close assert_eq!( - suggest_correction("show tabl"), + suggest_correction("show tabl"), // typos:disable-line Some("Did you mean `SHOW TABLE FUNCTIONS` or `SHOW TABLES`?".to_string()) ); assert_eq!( - suggest_correction("vacum drop table"), + suggest_correction("vacum drop table"), // typos:disable-line Some("Did you mean `VACUUM DROP TABLE`?".to_string()) ); assert_eq!( @@ -316,7 +316,7 @@ mod tests { fn test_edit_distance() { assert_eq!(edit_distance("show", "show"), 0); assert_eq!(edit_distance("tempare", "temporary"), 3); - assert_eq!(edit_distance("tabl", "tables"), 2); + assert_eq!(edit_distance("tabl", "tables"), 2); // typos:disable-line } #[test] diff --git a/src/query/ast/src/parser/statement.rs b/src/query/ast/src/parser/statement.rs index cf0665bf7a362..b45514bf1a45b 100644 --- a/src/query/ast/src/parser/statement.rs +++ b/src/query/ast/src/parser/statement.rs @@ -3298,7 +3298,7 @@ pub fn column_def(i: Input) -> IResult { value(ColumnConstraint::Nullable(true), rule! { NULL }), value(ColumnConstraint::Nullable(false), rule! { NOT ~ ^NULL }), )); - let identity_parmas = alt(( + let identity_params = alt(( map( rule! { "(" ~ ^#literal_u64 ~ ^"," ~ ^#literal_i64 ~ ^")" @@ -3341,7 +3341,7 @@ pub fn column_def(i: Input) -> IResult { map( rule! { (AUTOINCREMENT | IDENTITY) - ~ #identity_parmas? + ~ #identity_params? ~ (ORDER | NOORDER)? }, |(_, params, order_token)| { diff --git a/src/query/ast/tests/it/parser.rs b/src/query/ast/tests/it/parser.rs index c09bf41c1ce3d..65aedab8e6763 100644 --- a/src/query/ast/tests/it/parser.rs +++ b/src/query/ast/tests/it/parser.rs @@ -302,7 +302,7 @@ SELECT * from s;"#, r#"ALTER TABLE t CLUSTER BY(c1);"#, r#"ALTER TABLE t1 swap with t2;"#, r#"ALTER TABLE t refresh cache;"#, - r#"ALTER TABLE t COMMENT='t1-commnet';"#, + r#"ALTER TABLE t COMMENT='t1-commnet';"#, // typos:disable-line r#"ALTER TABLE t DROP CLUSTER KEY;"#, r#"ALTER TABLE t RECLUSTER FINAL WHERE c1 > 0 LIMIT 10;"#, r#"ALTER TABLE t ADD c int null;"#, @@ -1049,7 +1049,7 @@ fn test_statement_error() { r#"GRANT select ON UDF a TO 'test-grant';"#, r#"REVOKE SELECT, CREATE, ALL PRIVILEGES ON * FROM 'test-grant';"#, r#"REVOKE SELECT, CREATE ON * TO 'test-grant';"#, - r#"COPY INTO mytable FROM 's3://bucket' CONECTION= ();"#, + r#"COPY INTO mytable FROM 's3://bucket' CONECTION= ();"#, // typos:disable-line r#"COPY INTO mytable FROM @mystage CONNECTION = ();"#, r#"CALL system$test"#, r#"CALL system$test(a"#, @@ -1097,6 +1097,7 @@ fn test_statement_error() { r#"GRANT OWNERSHIP ON *.* TO ROLE 'd20_0015_owner';"#, r#"CREATE FUNCTION IF NOT EXISTS isnotempty AS(p) -> not(is_null(p)"#, r#"CREATE FUNCTION my_agg (INT) STATE { s STRING } RETURNS BOOLEAN LANGUAGE javascript HANDLER = 'my_agg' ADDRESS = 'http://0.0.0.0:8815';"#, + // typos:ignore-next-line r#"CREATE FUNCTION my_agg (INT) STATE { s STRIN } RETURNS BOOLEAN LANGUAGE javascript ADDRESS = 'http://0.0.0.0:8815';"#, r#"drop table :a"#, r#"drop table IDENTIFIER(a)"#, diff --git a/src/query/config/src/mask.rs b/src/query/config/src/mask.rs index 27c4810ae307c..20a5247dee335 100644 --- a/src/query/config/src/mask.rs +++ b/src/query/config/src/mask.rs @@ -338,7 +338,7 @@ mod tests { let masked_config = config.mask_display(); assert_eq!(masked_config.oss_access_key_id, "*************y_id"); - assert_eq!(masked_config.oss_access_key_secret, "****************ecret"); + assert_eq!(masked_config.oss_access_key_secret, "****************ecret"); // typos:disable-line assert_eq!( masked_config.oss_server_side_encryption_key_id, "**************************_key_id" diff --git a/src/query/ee/tests/it/aggregating_index/index_scan.rs b/src/query/ee/tests/it/aggregating_index/index_scan.rs index 8383e8476df08..4d78e89c8bf86 100644 --- a/src/query/ee/tests/it/aggregating_index/index_scan.rs +++ b/src/query/ee/tests/it/aggregating_index/index_scan.rs @@ -702,13 +702,13 @@ async fn fuzz(ctx: Arc, params: FuzzParams) -> Result<()> { let actual = DataBlock::concat(&actual)?; let actual = DataBlock::sort(&actual, &get_sort_col_descs(actual.num_columns()), None)?; - let formated_expect = pretty_format_blocks(&[expect])?; - let formated_actual = pretty_format_blocks(&[actual])?; + let formatted_expect = pretty_format_blocks(&[expect])?; + let formatted_actual = pretty_format_blocks(&[actual])?; assert_eq!( - formated_expect, formated_actual, + formatted_expect, formatted_actual, "Test params:{}\nExpected data block:\n{}\nActual data block:\n{}\n", - fuzz_info, formated_expect, formated_actual + fuzz_info, formatted_expect, formatted_actual ); // Clear diff --git a/src/query/ee/tests/it/inverted_index/pruning.rs b/src/query/ee/tests/it/inverted_index/pruning.rs index 61426207e65ce..8f8977a0faa4c 100644 --- a/src/query/ee/tests/it/inverted_index/pruning.rs +++ b/src/query/ee/tests/it/inverted_index/pruning.rs @@ -336,7 +336,7 @@ async fn test_block_pruner() -> Result<()> { "Spill the beans".to_string(), ]), StringType::from_data(vec![ - "Put a projet on hold".to_string(), + "Put a projet on hold".to_string(), // typos:disable-line "To spoil something".to_string(), "Saving money for later".to_string(), "Reliability is more important than speed".to_string(), diff --git a/src/query/ee/tests/it/storages/fuse/operations/vacuum.rs b/src/query/ee/tests/it/storages/fuse/operations/vacuum.rs index e32f247f7d86d..19a387d3083c6 100644 --- a/src/query/ee/tests/it/storages/fuse/operations/vacuum.rs +++ b/src/query/ee/tests/it/storages/fuse/operations/vacuum.rs @@ -729,7 +729,7 @@ async fn test_vacuum_dropped_table_clean_ownership() -> Result<()> { let v = meta.get_pb(&table_ownership_key).await?; assert!(v.is_none()); - // 8. Chek that DbIdTableName mapping is cleaned up + // 8. Check that DbIdTableName mapping is cleaned up let (seq, _) = get_u64_value(&meta, &db_id_table_name).await?; assert_eq!(seq, 0); diff --git a/src/query/expression/tests/it/meta_scalar.rs b/src/query/expression/tests/it/meta_scalar.rs index b8c58fd7ff6c8..9a9905e77b563 100644 --- a/src/query/expression/tests/it/meta_scalar.rs +++ b/src/query/expression/tests/it/meta_scalar.rs @@ -94,7 +94,7 @@ pub fn test_simple_converts() -> databend_common_exception::Result<()> { assert_eq!(scalar, convert_back_scalar); } - // TODO: comment these when we swith string in scalar + // TODO: comment these when we switch string in scalar // let data = rmp_serde::to_vec(&scalars).unwrap(); // let new_scalars: Vec = rmp_serde::from_slice(&data).unwrap(); // assert_eq!(simple_scalars, new_scalars); diff --git a/src/query/functions/tests/it/aggregates/agg.rs b/src/query/functions/tests/it/aggregates/agg.rs index e725f99d549a3..28ffec61a53ea 100644 --- a/src/query/functions/tests/it/aggregates/agg.rs +++ b/src/query/functions/tests/it/aggregates/agg.rs @@ -49,7 +49,7 @@ fn eval_aggr( } #[test] -fn test_aggr_funtions() { +fn test_aggr_functions() { let mut mint = Mint::new("tests/it/aggregates/testdata"); let file = &mut mint.new_goldenfile("agg.txt").unwrap(); diff --git a/src/query/functions/tests/it/scalars/comparison.rs b/src/query/functions/tests/it/scalars/comparison.rs index b2343ec996fcb..ea9c5086fba5f 100644 --- a/src/query/functions/tests/it/scalars/comparison.rs +++ b/src/query/functions/tests/it/scalars/comparison.rs @@ -386,6 +386,7 @@ fn test_gte(file: &mut impl Write) { run_ast(file, "lhs >= rhs", &table); } +// typos:off fn test_like(file: &mut impl Write) { run_ast(file, "'1' like '2'", &[]); run_ast(file, "'hello\n' like 'h%'", &[]); @@ -442,6 +443,7 @@ fn test_regexp(file: &mut impl Write) { run_ast(file, "lhs regexp rhs", &columns); run_ast(file, "lhs rlike rhs", &columns); } +// typos:on fn test_decimal(file: &mut impl Write) { run_ast(file, "92233720368547758000000 > 5::decimal(38,37)", &[]); diff --git a/src/query/functions/tests/it/scalars/regexp.rs b/src/query/functions/tests/it/scalars/regexp.rs index 8d4252bc25a9f..cf19a76670106 100644 --- a/src/query/functions/tests/it/scalars/regexp.rs +++ b/src/query/functions/tests/it/scalars/regexp.rs @@ -266,6 +266,7 @@ fn test_glob(file: &mut impl Write) { run_ast(file, "glob('abc', '*bc')", &[]); } +// typos:off fn test_regexp_like(file: &mut impl Write) { run_ast(file, "regexp_like('Michael!', '.*')", &[]); run_ast(file, "regexp_like('a', '^[a-d]')", &[]); @@ -374,6 +375,7 @@ fn test_regexp_like(file: &mut impl Write) { match_type_join_error2_three_columns, ); } +// typos:on fn test_regexp_replace(file: &mut impl Write) { run_ast(file, "regexp_replace('a b c', 'b', 'X')", &[]); diff --git a/src/query/service/src/physical_plans/physical_mutation.rs b/src/query/service/src/physical_plans/physical_mutation.rs index d61ba6fa9e175..c75f721a49bf6 100644 --- a/src/query/service/src/physical_plans/physical_mutation.rs +++ b/src/query/service/src/physical_plans/physical_mutation.rs @@ -433,7 +433,7 @@ impl PhysicalPlanBuilder { DUMMY_COLUMN_INDEX }; - // For distributed merge, we shuffle data blocks by block_id (drived from row_id) to avoid + // For distributed merge, we shuffle data blocks by block_id (derived from row_id) to avoid // different nodes update the same physical block simultaneously, data blocks that are needed // to insert just keep in local node. if *distributed && *row_id_shuffle && !is_not_matched_only { diff --git a/src/query/service/src/servers/flight/v1/actions/flight_actions.rs b/src/query/service/src/servers/flight/v1/actions/flight_actions.rs index dee278884b30e..1e54b10056d74 100644 --- a/src/query/service/src/servers/flight/v1/actions/flight_actions.rs +++ b/src/query/service/src/servers/flight/v1/actions/flight_actions.rs @@ -95,7 +95,7 @@ impl FlightActions { let future = CatchUnwindFuture::create(future); match future .await - .with_context(|| "failed to do filght action") + .with_context(|| "failed to do flight action") .flatten() { Ok(v) => { diff --git a/src/query/service/src/sessions/session_privilege_mgr.rs b/src/query/service/src/sessions/session_privilege_mgr.rs index 7a205f7310057..414be79b99521 100644 --- a/src/query/service/src/sessions/session_privilege_mgr.rs +++ b/src/query/service/src/sessions/session_privilege_mgr.rs @@ -171,7 +171,7 @@ impl SessionPrivilegeManager for SessionPrivilegeManagerImpl<'_> { /// If secondary_roles is set, it must be ALL or NONE: /// 1. ALL: all the roles granted to the current user will have effects on validate_privilege, /// `secondary_roles` will be set to None, which is default. - /// 2. NONE: only the current_role has effects on validate_privilge, `secondary_roles` + /// 2. NONE: only the current_role has effects on validate_privilege, `secondary_roles` /// will be set to Some([]). /// 3. SpecifyRoles: Some([role1, role2, .. etc.]). #[async_backtrace::framed] diff --git a/src/query/service/tests/it/pipelines/transforms/sort/k_way.rs b/src/query/service/tests/it/pipelines/transforms/sort/k_way.rs index 9508f20a9b2e2..9e4d1103885d7 100644 --- a/src/query/service/tests/it/pipelines/transforms/sort/k_way.rs +++ b/src/query/service/tests/it/pipelines/transforms/sort/k_way.rs @@ -71,7 +71,7 @@ async fn run_fuzz(ctx: Arc, rng: &mut ThreadRng, with_limit: bool) // println!("\nwith_limit {with_limit}"); // for (input, blocks) in data.iter().enumerate() { - // println!("intput {input}"); + // println!("input {input}"); // for b in blocks { // println!("{:?}", b.columns()[0].value); // } diff --git a/src/query/service/tests/it/servers/flight/flight_service.rs b/src/query/service/tests/it/servers/flight/flight_service.rs index 8912b616db25c..a589de4fdc85b 100644 --- a/src/query/service/tests/it/servers/flight/flight_service.rs +++ b/src/query/service/tests/it/servers/flight/flight_service.rs @@ -34,7 +34,7 @@ use crate::tests::tls_constants::TEST_SERVER_KEY; #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn test_tls_rpc_server() -> Result<()> { - // Set dafault crypto provider to use + // Set default crypto provider to use // See: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html#using-the-per-process-default-cryptoprovider let _ = rustls::crypto::ring::default_provider().install_default(); diff --git a/src/query/service/tests/it/servers/mysql/mysql_handler.rs b/src/query/service/tests/it/servers/mysql/mysql_handler.rs index 3e1df9690997f..08f41c403e3ba 100644 --- a/src/query/service/tests/it/servers/mysql/mysql_handler.rs +++ b/src/query/service/tests/it/servers/mysql/mysql_handler.rs @@ -55,7 +55,7 @@ async fn test_generic_code_with_on_query() -> Result<()> { #[tokio::test(flavor = "current_thread")] async fn test_connect_with_tls() -> Result<()> { - // Set dafault crypto provider to use + // Set default crypto provider to use // See: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html#using-the-per-process-default-cryptoprovider let _ = rustls::crypto::ring::default_provider().install_default(); diff --git a/src/query/service/tests/it/sessions/session_setting.rs b/src/query/service/tests/it/sessions/session_setting.rs index 3b5ca18f4151c..df7257dfba629 100644 --- a/src/query/service/tests/it/sessions/session_setting.rs +++ b/src/query/service/tests/it/sessions/session_setting.rs @@ -55,12 +55,12 @@ async fn test_session_setting_override() -> Result<()> { // Settings. { let settings = session.get_settings(); - let overrided = settings.get_parquet_fast_read_bytes()?; + let overridden = settings.get_parquet_fast_read_bytes()?; let expect = 1000000; - assert_eq!(overrided, expect); - let overrided = settings.get_max_storage_io_requests()?; + assert_eq!(overridden, expect); + let overridden = settings.get_max_storage_io_requests()?; let expect = 1000; - assert_eq!(overrided, expect); + assert_eq!(overridden, expect); settings.set_setting("max_storage_io_requests".to_string(), "300".to_string())?; let actual = settings.get_max_storage_io_requests()?; let expect = 300; diff --git a/src/query/service/tests/it/sql/exec/mod.rs b/src/query/service/tests/it/sql/exec/mod.rs index 47674ad222be0..1dac047fc0a8d 100644 --- a/src/query/service/tests/it/sql/exec/mod.rs +++ b/src/query/service/tests/it/sql/exec/mod.rs @@ -161,7 +161,7 @@ pub async fn test_snapshot_consistency() -> Result<()> { Ok::<(), ErrorCode>(()) }; - // b. thread2: optmize table + // b. thread2: optimize table let compact_handler = runtime.spawn(compact_task); query_handler.await.unwrap()?; diff --git a/src/query/service/tests/it/sql/expr/location.rs b/src/query/service/tests/it/sql/expr/location.rs index 3470967161151..c87a271f6a223 100644 --- a/src/query/service/tests/it/sql/expr/location.rs +++ b/src/query/service/tests/it/sql/expr/location.rs @@ -386,7 +386,7 @@ async fn test_parse_uri_location() -> Result<()> { "example.com".to_string(), "/path/to/dir/".to_string(), vec![ - ("https", "TrUE"), + ("https", "TrUE"), // typos:disable-line ("delegation", "databendthebest"), ("disable_list_batch", "true"), ("user_name", "test"), diff --git a/src/query/service/tests/it/sql/planner/semantic/name_resolution.rs b/src/query/service/tests/it/sql/planner/semantic/name_resolution.rs index 6f965d8ae37ca..ab4593692c303 100644 --- a/src/query/service/tests/it/sql/planner/semantic/name_resolution.rs +++ b/src/query/service/tests/it/sql/planner/semantic/name_resolution.rs @@ -21,6 +21,7 @@ use databend_query::sql::IdentifierNormalizer; use databend_query::sql::NameResolutionContext; use derive_visitor::DriveMut; +// typos:off #[test] fn test_normalize_identifier_default() { let ctx = NameResolutionContext::default(); @@ -97,6 +98,7 @@ fn test_normalize_identifier_unquoted_case_sensitive() { ); } } +// typos:on #[test] fn test_normalize_identifiers_in_expr() { diff --git a/src/query/service/tests/it/storages/fuse/operations/create_or_replace_ownership_object.rs b/src/query/service/tests/it/storages/fuse/operations/create_or_replace_ownership_object.rs index a872f33b82a09..c25f22ac12863 100644 --- a/src/query/service/tests/it/storages/fuse/operations/create_or_replace_ownership_object.rs +++ b/src/query/service/tests/it/storages/fuse/operations/create_or_replace_ownership_object.rs @@ -39,7 +39,7 @@ async fn test_fuse_db_table_create_replace_clean_ownership_key() -> Result<()> { })? }; - // Extracts endpoints to comunicate with meta service + // Extracts endpoints to communicate with meta service let MetaStore::L(local) = &meta else { panic!("MetaStore should not be local"); }; diff --git a/src/query/sql/src/planner/binder/column_binding.rs b/src/query/sql/src/planner/binder/column_binding.rs index d9a1860fe674b..5d3f23d05a628 100644 --- a/src/query/sql/src/planner/binder/column_binding.rs +++ b/src/query/sql/src/planner/binder/column_binding.rs @@ -36,7 +36,7 @@ pub struct ColumnBinding { pub data_type: Box, pub visibility: Visibility, - // Opitonal virtual expr, used by virtual computed column and variant virtual column, + // Optional virtual expr, used by virtual computed column and variant virtual column, // `virtual_expr` will be parsed and bind to a `ScalarExpr`. pub virtual_expr: Option, // A flag indicates the column binding from srf or not diff --git a/src/query/sql/src/planner/format/display_rel_operator.rs b/src/query/sql/src/planner/format/display_rel_operator.rs index b8673f1a4eb99..9783a950280dd 100644 --- a/src/query/sql/src/planner/format/display_rel_operator.rs +++ b/src/query/sql/src/planner/format/display_rel_operator.rs @@ -504,7 +504,7 @@ fn merge_into_to_format_tree( )); // add matched clauses let mut matched_children = Vec::with_capacity(merge_into.matched_evaluators.len()); - let taregt_schema = table_entry.table().schema_with_stream(); + let target = table_entry.table().schema_with_stream(); for evaluator in &merge_into.matched_evaluators { let condition_format = evaluator.condition.as_ref().map_or_else( || "condition: None".to_string(), @@ -526,7 +526,7 @@ fn merge_into_to_format_tree( let expr = map.get(field_idx).unwrap(); format!( "{} = {}", - taregt_schema.field(*field_idx).name(), + target.field(*field_idx).name(), format_scalar(id_humanizer, expr) ) }) diff --git a/src/query/sql/src/planner/semantic/type_check.rs b/src/query/sql/src/planner/semantic/type_check.rs index 8d24eaf4ce7f9..76d75b026de49 100644 --- a/src/query/sql/src/planner/semantic/type_check.rs +++ b/src/query/sql/src/planner/semantic/type_check.rs @@ -2369,7 +2369,7 @@ impl<'a> TypeChecker<'a> { /// multiple fields can have a optional per-field boosting that /// gives preferential weight to fields being searched in. /// For example: title^5, content^1.2 - /// The scond argument is the query text without query syntax. + /// The second argument is the query text without query syntax. fn resolve_match_search_function( &mut self, span: Span, diff --git a/src/query/storages/common/index/tests/it/eliminate_cast.rs b/src/query/storages/common/index/tests/it/eliminate_cast.rs index 10daa7a0cf745..75290df97b879 100644 --- a/src/query/storages/common/index/tests/it/eliminate_cast.rs +++ b/src/query/storages/common/index/tests/it/eliminate_cast.rs @@ -66,10 +66,10 @@ fn run_text(file: &mut impl Write, text: &str, ctx: &[(&str, DataType, Domain)]) .collect(); match eliminate_cast(&expr, input_domains) { Some(new_expr) => { - writeln!(file, "rewrited : {new_expr}").unwrap(); + writeln!(file, "rewrited : {new_expr}").unwrap(); // typos:disable-line } None => { - writeln!(file, "rewrited : Unchange").unwrap(); + writeln!(file, "rewrited : Unchange").unwrap(); // typos:disable-line } }; writeln!(file).unwrap(); diff --git a/src/query/storages/common/index/tests/it/page_pruner.rs b/src/query/storages/common/index/tests/it/page_pruner.rs index b1bf5db7a153d..3dd4a9740d4fa 100644 --- a/src/query/storages/common/index/tests/it/page_pruner.rs +++ b/src/query/storages/common/index/tests/it/page_pruner.rs @@ -33,7 +33,7 @@ use super::eliminate_cast::parse_expr; #[test] fn test_page_index() -> Result<()> { let mut mint = Mint::new("tests/it/testdata"); - let file = &mut mint.new_goldenfile("test_page_indexs.txt").unwrap(); + let file = &mut mint.new_goldenfile("test_page_indies.txt").unwrap(); fn n(n: i32) -> Scalar { Scalar::Number(n.into()) diff --git a/src/query/storages/common/index/tests/it/range_pruner.rs b/src/query/storages/common/index/tests/it/range_pruner.rs index e944536b9b6d1..31170ffffc1b7 100644 --- a/src/query/storages/common/index/tests/it/range_pruner.rs +++ b/src/query/storages/common/index/tests/it/range_pruner.rs @@ -34,7 +34,7 @@ use super::eliminate_cast::parse_expr; #[test] fn test_range_index() -> Result<()> { let mut mint = Mint::new("tests/it/testdata"); - let file = &mut mint.new_goldenfile("test_range_indexs.txt").unwrap(); + let file = &mut mint.new_goldenfile("test_range_indies.txt").unwrap(); fn n(n: i32) -> Scalar { Scalar::Number(n.into()) diff --git a/src/query/storages/common/index/tests/it/testdata/test_page_indexs.txt b/src/query/storages/common/index/tests/it/testdata/test_page_indies.txt similarity index 100% rename from src/query/storages/common/index/tests/it/testdata/test_page_indexs.txt rename to src/query/storages/common/index/tests/it/testdata/test_page_indies.txt diff --git a/src/query/storages/common/index/tests/it/testdata/test_range_indexs.txt b/src/query/storages/common/index/tests/it/testdata/test_range_indies.txt similarity index 100% rename from src/query/storages/common/index/tests/it/testdata/test_range_indexs.txt rename to src/query/storages/common/index/tests/it/testdata/test_range_indies.txt diff --git a/src/query/storages/fuse/src/io/read/virtual_column/virtual_column_reader.rs b/src/query/storages/fuse/src/io/read/virtual_column/virtual_column_reader.rs index 016f042c61ca3..f06a3f31c5724 100644 --- a/src/query/storages/fuse/src/io/read/virtual_column/virtual_column_reader.rs +++ b/src/query/storages/fuse/src/io/read/virtual_column/virtual_column_reader.rs @@ -53,7 +53,7 @@ use opendal::Operator; // otherwise, extract them from the source columns. // // If all the virtual columns of the source column have been generated, -// and this source colume does not need to be read, the source column +// and this source column does not need to be read, the source column // can be ignored when reading. #[derive(Clone)] pub struct VirtualColumnReader { diff --git a/src/tests/sqlsmith/src/query_fuzzer.rs b/src/tests/sqlsmith/src/query_fuzzer.rs index c433140b80b58..7ac9d8ee79b59 100644 --- a/src/tests/sqlsmith/src/query_fuzzer.rs +++ b/src/tests/sqlsmith/src/query_fuzzer.rs @@ -780,7 +780,7 @@ impl QueryVisitor { let idx = self.rng.gen_range(0..func.args.len()); func.args.remove(idx); } - // try replace arguemnts with fuzzed arguments + // try replace arguments with fuzzed arguments if self.rng.gen_bool(0.05) { func.args = func.args.iter().map(|arg| self.fuzz_expr(arg)).collect(); } diff --git a/tests/compat/meta_meta/README.md b/tests/compat/meta_meta/README.md index 69eaf1b642fe6..44cfc5eeee880 100644 --- a/tests/compat/meta_meta/README.md +++ b/tests/compat/meta_meta/README.md @@ -1,4 +1,4 @@ -# Test protocol compatability between latest and old databend-meta +# Test protocol compatibility between latest and old databend-meta ## Prerequisites diff --git a/tests/compat/util.sh b/tests/compat/util.sh index a57985628e975..6e0a947b84161 100755 --- a/tests/compat/util.sh +++ b/tests/compat/util.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Supporting utilities for compatiblity test. +# Supporting utilities for compatibility test. query_config_path="scripts/ci/deploy/config/databend-query-node-1.toml" bend_repo_url="https://github.com/datafuselabs/databend" diff --git a/tests/compat_fuse/README.md b/tests/compat_fuse/README.md index 5352245bb65ba..fc52c4464bafe 100644 --- a/tests/compat_fuse/README.md +++ b/tests/compat_fuse/README.md @@ -1,4 +1,4 @@ -# Fuse table compatability test +# Fuse table compatibility test This script tests whether a newer version databend-query can read fuse table data written by a older version databend-query. diff --git a/tests/databend-test b/tests/databend-test index 8f24835d04252..c1ac351adeafa 100755 --- a/tests/databend-test +++ b/tests/databend-test @@ -510,6 +510,7 @@ def main(args): ) databend_query_proc_create.communicate(b"SELECT 1") + # typos:ignore-next-line def sute_key_func(item): if -1 == item.find("_"): return 99998, "" @@ -564,6 +565,7 @@ def main(args): return all_tests total_tests_run = 0 + # typos:ignore-next-line for suite in sorted(os.listdir(base_dir), key=sute_key_func): if SERVER_DIED: break diff --git a/tests/longrun/README.md b/tests/longrun/README.md index e33ef2da293dd..5d5bbb322b5a3 100644 --- a/tests/longrun/README.md +++ b/tests/longrun/README.md @@ -3,7 +3,7 @@ ## Introduction Databend long run tests would test the data correctness and performance of Databend under concurrency and heavy load. For example: -Test on concurrent large scale data ingestion, table maintainence(optimization, recluster and vacuum) and query. +Test on concurrent large scale data ingestion, table maintenance(optimization, recluster and vacuum) and query. ## How to use it? ### Prerequisite diff --git a/tests/nox/java_client/perpare.py b/tests/nox/java_client/prepare.py similarity index 100% rename from tests/nox/java_client/perpare.py rename to tests/nox/java_client/prepare.py diff --git a/tests/nox/noxfile.py b/tests/nox/noxfile.py index ee75112a854f2..a0ab92aece620 100644 --- a/tests/nox/noxfile.py +++ b/tests/nox/noxfile.py @@ -33,7 +33,7 @@ def java_client(session, driver_version): raise Exception("evn JDBC_MAIN_VER should not be empty") session.install("requests") - session.run("python", "java_client/perpare.py", driver_version) + session.run("python", "java_client/prepare.py", driver_version) run_jdbc_test(session, driver_version, main_ver) diff --git a/tests/sqllogictests/src/main.rs b/tests/sqllogictests/src/main.rs index b8656830e74c7..b6f4380aa9591 100644 --- a/tests/sqllogictests/src/main.rs +++ b/tests/sqllogictests/src/main.rs @@ -299,7 +299,7 @@ async fn run_suits(args: SqlLogicTestArgs, client_type: ClientType) -> Result<() } if !args.bench { - // lazy load test datas + // lazy load test data lazy_prepare_data(&lazy_dirs, args.force_load)?; } // lazy run dictionaries containers diff --git a/tests/sqllogictests/suites/duckdb/join/asof/test_asof_join.test b/tests/sqllogictests/suites/duckdb/join/asof/test_asof_join.test index 1d8dc9d36e2f8..374884ad89bf9 100644 --- a/tests/sqllogictests/suites/duckdb/join/asof/test_asof_join.test +++ b/tests/sqllogictests/suites/duckdb/join/asof/test_asof_join.test @@ -1,5 +1,5 @@ # name: test/sql/join/asof/test_asof_join.test -# description: Test As-Of join useage +# description: Test As-Of join usage # group: [asof] # Use doubles for readable infinities