Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 47 additions & 28 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/common/hashtable/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion src/common/io/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ mod borsh_serialization;
mod cursor_ext;
mod escape;
mod interval;
mod serialization_format_compatability;
mod serialization_format_compatibility;
2 changes: 1 addition & 1 deletion src/meta/api/src/garbage_collection_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/meta/api/src/kv_pb_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ mod tests {
) -> Result<KVStream<Self::Error>, 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;
Expand Down
6 changes: 3 additions & 3 deletions src/meta/api/src/schema_api_test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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!(
Expand All @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion src/meta/app/src/principal/procedure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/meta/app/src/schema/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub struct TableStatistics {
pub number_of_blocks: Option<u64>,
}

/// Iceberg table parition
/// Iceberg table partition
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, Eq, PartialEq)]
pub enum TablePartition {
Identity { columns: Vec<String> },
Expand Down
2 changes: 1 addition & 1 deletion src/meta/client/src/grpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/meta/proto-conv/tests/it/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down
2 changes: 1 addition & 1 deletion src/meta/protos/proto/virtual_schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> metadata = 2;
// start from 3_000_000_001, Avoid conflicts with the column ids of normal columns
uint32 next_column_id = 3;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/applier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ where SM: StateMachineApi<SysData> + '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 {
Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/sm_v003/writer_v003.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/snapshot_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/meta/raft-store/src/state/raft_state_kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
2 changes: 1 addition & 1 deletion src/meta/raft-store/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/meta/semaphore/src/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion src/meta/service/src/meta_node/meta_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion src/meta/types/src/sys_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/query/ast/src/parser/error_suggestion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/query/ast/src/parser/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3298,7 +3298,7 @@ pub fn column_def(i: Input) -> IResult<ColumnDefinition> {
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 ~ ^")"
Expand Down Expand Up @@ -3341,7 +3341,7 @@ pub fn column_def(i: Input) -> IResult<ColumnDefinition> {
map(
rule! {
(AUTOINCREMENT | IDENTITY)
~ #identity_parmas?
~ #identity_params?
~ (ORDER | NOORDER)?
},
|(_, params, order_token)| {
Expand Down
5 changes: 3 additions & 2 deletions src/query/ast/tests/it/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;"#,
Expand Down Expand Up @@ -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"#,
Expand Down Expand Up @@ -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)"#,
Expand Down
2 changes: 1 addition & 1 deletion src/query/config/src/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions src/query/ee/tests/it/aggregating_index/index_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,13 +702,13 @@ async fn fuzz(ctx: Arc<QueryContext>, 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
Expand Down
2 changes: 1 addition & 1 deletion src/query/ee/tests/it/inverted_index/pruning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/query/ee/tests/it/storages/fuse/operations/vacuum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/tests/it/meta_scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IndexScalar> = rmp_serde::from_slice(&data).unwrap();
// assert_eq!(simple_scalars, new_scalars);
Expand Down
Loading
Loading