Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <[email protected]>
  • Loading branch information
stdrc committed Aug 22, 2024
1 parent 7d035d9 commit 8574edc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/frontend/src/binder/expr/function/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl Binder {
match (kind, direct_args.len(), args.as_mut_slice()) {
(AggKind::Builtin(PbAggKind::PercentileCont | PbAggKind::PercentileDisc), 1, [arg]) => {
let fraction = &mut direct_args[0];
decimal_to_float64(fraction, &kind)?;
decimal_to_float64(fraction, kind)?;
if matches!(&kind, AggKind::Builtin(PbAggKind::PercentileCont)) {
arg.cast_implicit_mut(DataType::Float64).map_err(|_| {
ErrorCode::InvalidInputSyntax(format!(
Expand All @@ -153,11 +153,11 @@ impl Binder {
(AggKind::Builtin(PbAggKind::Mode), 0, [_arg]) => {}
(AggKind::Builtin(PbAggKind::ApproxPercentile), 1..=2, [_percentile_col]) => {
let percentile = &mut direct_args[0];
decimal_to_float64(percentile, &kind)?;
decimal_to_float64(percentile, kind)?;
match direct_args.len() {
2 => {
let relative_error = &mut direct_args[1];
decimal_to_float64(relative_error, &kind)?;
decimal_to_float64(relative_error, kind)?;
}
1 => {
let relative_error: ExprImpl = Literal::new(
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/src/binder/expr/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ macro_rules! reject_syntax {
}
};
}
pub(self) use reject_syntax;

impl Binder {
pub(in crate::binder) fn bind_function(
Expand Down Expand Up @@ -537,12 +536,12 @@ impl Binder {
return bind_result;
}

return Err(ErrorCode::InvalidInputSyntax(
Err(ErrorCode::InvalidInputSyntax(
"failed to parse the input query and extract the udf expression,
please recheck the syntax"
.to_string(),
)
.into());
.into())
}

pub(in crate::binder) fn bind_function_expr_arg(
Expand Down

0 comments on commit 8574edc

Please sign in to comment.