Skip to content

Commit

Permalink
chore: fix typos (databendlabs#15153)
Browse files Browse the repository at this point in the history
* chore: fix typos

* add to exclude temporarily

* fix typos.toml
  • Loading branch information
Dousir9 authored Apr 2, 2024
1 parent ec9a2af commit fdc4e53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ extend-exclude = [
"scripts/benchmark/",
"benchmark/",
"tests/",
"src/meta",
"src/query",
"src/binaries",
]
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl PipelineBuilder {
// ...... ..... .....
// ----------------------------------------------------------------------
// the complete pipeline(with matched and unmatched) below:
// 1. matched only or compelete pipeline are same with above
// 1. matched only or complete pipeline are same with above
// 2. for unmatched only or insert only, there are no row_id ports
if need_match {
let mut rules = Vec::with_capacity(self.main_pipeline.output_len());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn extract_or_predicate(
let mut sub_scalars = Vec::new();
match or_arg {
ScalarExpr::FunctionCall(func) if func.func_name == "and" => {
let and_args = flatten_ands(&func.arguments);
let and_args = flatten_and(&func.arguments);
for and_arg in and_args.iter() {
match and_arg {
ScalarExpr::FunctionCall(func) if func.func_name == "or" => {
Expand Down Expand Up @@ -118,17 +118,17 @@ fn flatten_ors(or_args: &[ScalarExpr]) -> Vec<ScalarExpr> {

// Flatten nested ORs, such as `a=1 and b=1 and c=1`
// It'll be flatten to [a=1, b=1, c=1]
fn flatten_ands(and_args: &[ScalarExpr]) -> Vec<ScalarExpr> {
let mut flattened_ands = Vec::new();
fn flatten_and(and_args: &[ScalarExpr]) -> Vec<ScalarExpr> {
let mut flattened_and = Vec::new();
for and_arg in and_args.iter() {
match and_arg {
ScalarExpr::FunctionCall(func) if func.func_name == "and" => {
flattened_ands.extend(flatten_ands(&func.arguments));
flattened_and.extend(flatten_and(&func.arguments));
}
_ => flattened_ands.push(and_arg.clone()),
_ => flattened_and.push(and_arg.clone()),
}
}
flattened_ands
flattened_and
}

// Merge predicates to AND scalar
Expand Down

0 comments on commit fdc4e53

Please sign in to comment.