Skip to content
Merged
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
4 changes: 2 additions & 2 deletions datafusion/common/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn parse_interval(leading_field: &str, value: &str) -> Result<ScalarValue> {
let (diff_month, diff_days, diff_nanos) =
calculate_from_part(interval_period_str.unwrap(), unit)?;

result_month += diff_month as i64;
result_month += diff_month;

if result_month > (i32::MAX as i64) {
return Err(DataFusionError::NotImplemented(format!(
Expand All @@ -120,7 +120,7 @@ pub fn parse_interval(leading_field: &str, value: &str) -> Result<ScalarValue> {
)));
}

result_days += diff_days as i64;
result_days += diff_days;

if result_days > (i32::MAX as i64) {
return Err(DataFusionError::NotImplemented(format!(
Expand Down
3 changes: 1 addition & 2 deletions datafusion/physical-expr/src/aggregate/count_distinct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ impl Accumulator for DistinctCountAccumulator {
.state_data_types
.iter()
.map(|state_data_type| {
let values = Box::new(Vec::new());
ScalarValue::new_list(Some(*values), state_data_type.clone())
ScalarValue::new_list(Some(Vec::new()), state_data_type.clone())
})
.collect::<Vec<_>>();

Expand Down
3 changes: 2 additions & 1 deletion datafusion/physical-expr/src/aggregate/tdigest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ impl TDigest {

let value = self.centroids[pos].mean()
+ ((rank - t) / self.centroids[pos].weight() - 0.5) * delta;

Self::clamp(value, min, max)
}

Expand Down Expand Up @@ -684,7 +685,7 @@ mod tests {
let mut t = TDigest::new(10);

for v in vals {
t = t.merge_unsorted_f64(vec![v as f64]);
t = t.merge_unsorted_f64(vec![v]);
}

assert_error_bounds!(t, quantile = 0.5, want = 1.0);
Expand Down
14 changes: 7 additions & 7 deletions datafusion/physical-expr/src/expressions/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2439,8 +2439,8 @@ mod tests {
&[
Some(value), // 1.23
None,
Some((value - 1) as i128), // 1.22
Some(value + 1), // 1.24
Some(value - 1), // 1.22
Some(value + 1), // 1.24
],
10,
2,
Expand Down Expand Up @@ -2561,10 +2561,10 @@ mod tests {
let value: i128 = 123;
let decimal_array = Arc::new(create_decimal_array(
&[
Some(value as i128), // 1.23
Some(value), // 1.23
None,
Some(value - 1), // 1.22
Some((value + 1) as i128), // 1.24
Some(value - 1), // 1.22
Some(value + 1), // 1.24
],
10,
2,
Expand Down Expand Up @@ -2682,8 +2682,8 @@ mod tests {
&[
Some(value), // 1.23
None,
Some((value - 1) as i128), // 1.22
Some(value + 1), // 1.24
Some(value - 1), // 1.22
Some(value + 1), // 1.24
],
10,
2,
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-expr/src/window/row_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl BuiltInWindowFunctionExpr for RowNumber {
&self,
_batch: &RecordBatch,
) -> Result<Box<dyn PartitionEvaluator>> {
Ok(Box::new(NumRowsEvaluator::default()))
Ok(Box::<NumRowsEvaluator>::default())
}
}

Expand Down