Skip to content

Commit c00a14e

Browse files
committed
clippy
1 parent c33ac9b commit c00a14e

6 files changed

Lines changed: 9 additions & 7 deletions

File tree

native/core/src/execution/expressions/arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl PhysicalExpr for CheckedBinaryExpr {
102102
if let Some(spark_err) = e.downcast_ref::<SparkError>() {
103103
let wrapped = SparkErrorWithContext::with_context(
104104
spark_err.clone(),
105-
self.query_context.as_ref().unwrap().clone(),
105+
Arc::clone(self.query_context.as_ref().unwrap()),
106106
);
107107
Err(DataFusionError::External(Box::new(wrapped)))
108108
} else {

native/core/src/execution/planner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ impl PhysicalPlanner {
682682
}
683683
}
684684

685+
#[allow(clippy::too_many_arguments)]
685686
pub fn create_binary_expr(
686687
&self,
687688
spark_expr: &Expr,

native/spark-expr/src/agg_funcs/avg_decimal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ struct AvgDecimalGroupsAccumulator {
429429
}
430430

431431
impl AvgDecimalGroupsAccumulator {
432+
#[allow(clippy::too_many_arguments)]
432433
pub fn new(
433434
return_data_type: &DataType,
434435
sum_data_type: &DataType,

native/spark-expr/src/conversion_funcs/boolean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn cast_boolean_to_decimal(
4949
&& e.to_string().contains("too large to store in a Decimal128")
5050
{
5151
// Use the scaled value as it's the only non-zero value that could overflow
52-
crate::error::decimal_overflow_error(scaled_val, precision, scale).into()
52+
crate::error::decimal_overflow_error(scaled_val, precision, scale)
5353
} else {
5454
SparkError::Arrow(Arc::new(e))
5555
}

native/spark-expr/src/conversion_funcs/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,7 @@ impl PhysicalExpr for Cast {
25192519
if let Some(spark_err) = e.downcast_ref::<crate::SparkError>() {
25202520
let wrapped = crate::SparkErrorWithContext::with_context(
25212521
spark_err.clone(),
2522-
self.query_context.as_ref().unwrap().clone(),
2522+
Arc::clone(self.query_context.as_ref().unwrap()),
25232523
);
25242524
Err(DataFusionError::External(Box::new(wrapped)))
25252525
} else {

native/spark-expr/src/math_funcs/internal/checkoverflow.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ impl PhysicalExpr for CheckOverflow {
136136
.iter()
137137
.find(|v| {
138138
if let Some(val) = v {
139-
!arrow::array::types::Decimal128Type::validate_decimal_precision(
139+
arrow::array::types::Decimal128Type::validate_decimal_precision(
140140
*val, *precision, *scale
141-
).is_ok()
141+
).is_err()
142142
} else {
143143
false
144144
}
@@ -151,7 +151,7 @@ impl PhysicalExpr for CheckOverflow {
151151
// Wrap with query_context if present
152152
if let Some(ctx) = &self.query_context {
153153
DataFusionError::External(Box::new(
154-
crate::SparkErrorWithContext::with_context(spark_error, ctx.clone())
154+
crate::SparkErrorWithContext::with_context(spark_error, Arc::clone(ctx))
155155
))
156156
} else {
157157
DataFusionError::External(Box::new(spark_error))
@@ -185,7 +185,7 @@ impl PhysicalExpr for CheckOverflow {
185185
DataFusionError::External(Box::new(
186186
crate::SparkErrorWithContext::with_context(
187187
spark_error,
188-
ctx.clone(),
188+
Arc::clone(ctx),
189189
),
190190
))
191191
} else {

0 commit comments

Comments
 (0)