Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Sep 8, 2023
1 parent 652e9dd commit c2de14a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/expr/macro/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl FunctionAttr {
};

// evaluate child expressions and
// - build a chunk if arguments are varibale
// - build a chunk if arguments are variable
// - downcast arrays if arguments are fixed
let eval_children = if varargs {
quote! {
Expand All @@ -238,7 +238,7 @@ impl FunctionAttr {
}
};
// evaluate child expressions and
// - build a row if arguments are varibale
// - build a row if arguments are variable
// - downcast scalars if arguments are fixed
let eval_row_children = if varargs {
quote! {
Expand Down
3 changes: 1 addition & 2 deletions src/expr/src/sig/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ mod tests {
// convert FUNC_SIG_MAP to a more convenient map for testing
let mut new_map: BTreeMap<PbType, BTreeMap<Vec<DataTypeName>, Vec<FuncSign>>> =
BTreeMap::new();
for ((func, num_args), sigs) in &FUNC_SIG_MAP.0 {
for (func, sigs) in &FUNC_SIG_MAP.0 {
for sig in sigs {
// validate the FUNC_SIG_MAP is consistent
assert_eq!(func, &sig.func);
assert_eq!(num_args, &sig.inputs_type.len());
// exclude deprecated functions
if sig.deprecated {
continue;
Expand Down
3 changes: 2 additions & 1 deletion src/expr/src/vector_op/concat_ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ mod tests {
use risingwave_common::row::Row;
use risingwave_common::test_prelude::DataChunkTestExt;
use risingwave_common::types::ToOwnedDatum;
use risingwave_common::util::iter_util::ZipEqDebug;

use crate::expr::build_from_pretty;

Expand All @@ -67,7 +68,7 @@ mod tests {
assert_eq!(&output, expected.column_at(0));

// test eval_row
for (row, expected) in input.rows().zip(expected.rows()) {
for (row, expected) in input.rows().zip_eq_debug(expected.rows()) {
let result = concat_ws.eval_row(&row.to_owned_row()).await.unwrap();
assert_eq!(result, expected.datum_at(0).to_owned_datum());
}
Expand Down
5 changes: 3 additions & 2 deletions src/expr/src/vector_op/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ mod tests {
use risingwave_common::row::Row;
use risingwave_common::test_prelude::DataChunkTestExt;
use risingwave_common::types::ToOwnedDatum;
use risingwave_common::util::iter_util::ZipEqDebug;

use crate::expr::build_from_pretty;

Expand All @@ -178,7 +179,7 @@ mod tests {
"T T T T
Hello%s World . HelloWorld
%s%s Hello World HelloWorld
%I && \"%%\"
%I && . \"&&\"
. a b .",
)
.split_column_at(3);
Expand All @@ -188,7 +189,7 @@ mod tests {
assert_eq!(&output, expected.column_at(0));

// test eval_row
for (row, expected) in input.rows().zip(expected.rows()) {
for (row, expected) in input.rows().zip_eq_debug(expected.rows()) {
let result = format.eval_row(&row.to_owned_row()).await.unwrap();
assert_eq!(result, expected.datum_at(0).to_owned_datum());
}
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/expr/type_inference/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ mod tests {
sig_map.insert(FuncSign {
func: DUMMY_FUNC,
inputs_type: formals,
varargs: false,
ret_type: DUMMY_RET,
build: |_, _| unreachable!(),
deprecated: false,
Expand Down

0 comments on commit c2de14a

Please sign in to comment.