Skip to content

Apache DataFusion SQL Query Engine

chore: update group of 3 crates to rust 2024 edition (#19001)

Tim Saucered836d73970f
diff --git a/datafusion/functions-aggregate-common/Cargo.toml b/datafusion/functions-aggregate-common/Cargo.toml
index 1d4fb29d9c..dd7a97d9c7 100644
--- a/datafusion/functions-aggregate-common/Cargo.toml
+++ b/datafusion/functions-aggregate-common/Cargo.toml
@@ -21,7 +21,7 @@ description = "Utility functions for implementing aggregate functions for the Da
keywords = ["datafusion", "logical", "plan", "expressions"]
readme = "README.md"
version = { workspace = true }
-edition = { workspace = true }
+edition = "2024"
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
diff --git a/datafusion/functions-aggregate-common/benches/accumulate.rs b/datafusion/functions-aggregate-common/benches/accumulate.rs
index f422f8a2a7..f1e4fe23cb 100644
--- a/datafusion/functions-aggregate-common/benches/accumulate.rs
+++ b/datafusion/functions-aggregate-common/benches/accumulate.rs
@@ -20,7 +20,7 @@ extern crate criterion;
use std::sync::Arc;
use arrow::array::{ArrayRef, BooleanArray, Int64Array};
-use criterion::{criterion_group, criterion_main, Criterion};
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_functions_aggregate_common::aggregate::groups_accumulator::accumulate::accumulate_indices;
fn generate_group_indices(len: usize) -> Vec<usize> {
diff --git a/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs b/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs
index 9920bf5bf4..0a4c1692ba 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs
@@ -18,7 +18,7 @@
use arrow::{
array::{ArrayRef, ArrowNumericType},
datatypes::{
- i256, Decimal128Type, Decimal256Type, Decimal32Type, Decimal64Type, DecimalType,
+ Decimal32Type, Decimal64Type, Decimal128Type, Decimal256Type, DecimalType, i256,
},
};
use datafusion_common::{Result, ScalarValue};
@@ -158,7 +158,7 @@ impl<T: DecimalType + ArrowNumericType + Debug> Accumulator
mod tests {
use super::*;
use arrow::array::{
- Decimal128Array, Decimal256Array, Decimal32Array, Decimal64Array,
+ Decimal32Array, Decimal64Array, Decimal128Array, Decimal256Array,
};
use std::sync::Arc;
diff --git a/datafusion/functions-aggregate-common/src/aggregate/count_distinct/bytes.rs b/datafusion/functions-aggregate-common/src/aggregate/count_distinct/bytes.rs
index e321df61dd..6e0d55bd64 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/count_distinct/bytes.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/count_distinct/bytes.rs
@@ -18,9 +18,9 @@
//! [`BytesDistinctCountAccumulator`] for Utf8/LargeUtf8/Binary/LargeBinary values
use arrow::array::{ArrayRef, OffsetSizeTrait};
+use datafusion_common::ScalarValue;
use datafusion_common::cast::as_list_array;
use datafusion_common::utils::SingleRowListArrayBuilder;
-use datafusion_common::ScalarValue;
use datafusion_expr_common::accumulator::Accumulator;
use datafusion_physical_expr_common::binary_map::{ArrowBytesSet, OutputType};
use datafusion_physical_expr_common::binary_view_map::ArrowBytesViewSet;
@@ -48,7 +48,9 @@ impl<O: OffsetSizeTrait> Accumulator for BytesDistinctCountAccumulator<O> {
fn state(&mut self) -> datafusion_common::Result<Vec<ScalarValue>> {
let set = self.0.take();
let arr = set.into_state();
- Ok(vec![SingleRowListArrayBuilder::new(arr).build_list_scalar()])
+ Ok(vec![
+ SingleRowListArrayBuilder::new(arr).build_list_scalar(),
+ ])
}
fn update_batch(&mut self, values: &[ArrayRef]) -> datafusion_common::Result<()> {
@@ -107,7 +109,9 @@ impl Accumulator for BytesViewDistinctCountAccumulator {
fn state(&mut self) -> datafusion_common::Result<Vec<ScalarValue>> {
let set = self.0.take();
let arr = set.into_state();
- Ok(vec![SingleRowListArrayBuilder::new(arr).build_list_scalar()])
+ Ok(vec![
+ SingleRowListArrayBuilder::new(arr).build_list_scalar(),
+ ])
}
fn update_batch(&mut self, values: &[ArrayRef]) -> datafusion_common::Result<()> {
diff --git a/datafusion/functions-aggregate-common/src/aggregate/count_distinct/dict.rs b/datafusion/functions-aggregate-common/src/aggregate/count_distinct/dict.rs
index 854c377380..d71aed3deb 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/count_distinct/dict.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/count_distinct/dict.rs
@@ -18,7 +18,7 @@
use arrow::array::{ArrayRef, BooleanArray};
use arrow::downcast_dictionary_array;
use datafusion_common::internal_err;
-use datafusion_common::{arrow_datafusion_err, ScalarValue};
+use datafusion_common::{ScalarValue, arrow_datafusion_err};
use datafusion_expr_common::accumulator::Accumulator;
#[derive(Debug)]
diff --git a/datafusion/functions-aggregate-common/src/aggregate/count_distinct/native.rs b/datafusion/functions-aggregate-common/src/aggregate/count_distinct/native.rs
index 4d6a2fec51..aa86052bcb 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/count_distinct/native.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/count_distinct/native.rs
@@ -27,15 +27,15 @@ use std::mem::size_of_val;
use std::sync::Arc;
use ahash::RandomState;
-use arrow::array::types::ArrowPrimitiveType;
use arrow::array::ArrayRef;
use arrow::array::PrimitiveArray;
+use arrow::array::types::ArrowPrimitiveType;
use arrow::datatypes::DataType;
+use datafusion_common::ScalarValue;
use datafusion_common::cast::{as_list_array, as_primitive_array};
-use datafusion_common::utils::memory::estimate_memory_size;
use datafusion_common::utils::SingleRowListArrayBuilder;
-use datafusion_common::ScalarValue;
+use datafusion_common::utils::memory::estimate_memory_size;
use datafusion_expr_common::accumulator::Accumulator;
use crate::utils::GenericDistinctBuffer;
@@ -73,7 +73,9 @@ where
PrimitiveArray::<T>::from_iter_values(self.values.iter().cloned())
.with_data_type(self.data_type.clone()),
);
- Ok(vec![SingleRowListArrayBuilder::new(arr).build_list_scalar()])
+ Ok(vec![
+ SingleRowListArrayBuilder::new(arr).build_list_scalar(),
+ ])
}
fn update_batch(&mut self, values: &[ArrayRef]) -> datafusion_common::Result<()> {
diff --git a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator.rs b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator.rs
index 0773109fff..ad2a21bb47 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator.rs
@@ -32,7 +32,7 @@ use arrow::{
compute::take_arrays,
datatypes::UInt32Type,
};
-use datafusion_common::{arrow_datafusion_err, Result, ScalarValue};
+use datafusion_common::{Result, ScalarValue, arrow_datafusion_err};
use datafusion_expr_common::accumulator::Accumulator;
use datafusion_expr_common::groups_accumulator::{EmitTo, GroupsAccumulator};
diff --git a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/accumulate.rs b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/accumulate.rs
index 88bf9f953a..29b8752048 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/accumulate.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/accumulate.rs
@@ -195,11 +195,11 @@ impl NullState {
.zip(group_indices.iter())
.zip(values.iter())
.for_each(|((filter_value, &group_index), new_value)| {
- if let Some(true) = filter_value {
- if let Some(new_value) = new_value {
- seen_values.set_bit(group_index, true);
- value_fn(group_index, new_value)
- }
+ if let Some(true) = filter_value
+ && let Some(new_value) = new_value
+ {
+ seen_values.set_bit(group_index, true);
+ value_fn(group_index, new_value)
}
})
}
@@ -357,10 +357,10 @@ pub fn accumulate<T, F>(
.zip(group_indices.iter())
.zip(values.iter())
.for_each(|((filter_value, &group_index), new_value)| {
- if let Some(true) = filter_value {
- if let Some(new_value) = new_value {
- value_fn(group_index, new_value)
- }
+ if let Some(true) = filter_value
+ && let Some(new_value) = new_value
+ {
+ value_fn(group_index, new_value)
}
})
}
@@ -594,7 +594,7 @@ mod test {
use super::*;
use arrow::array::{Int32Array, UInt32Array};
- use rand::{rngs::ThreadRng, Rng};
+ use rand::{Rng, rngs::ThreadRng};
use std::collections::HashSet;
#[test]
@@ -690,11 +690,7 @@ mod test {
let values_with_nulls: Vec<Option<u32>> = (0..num_values)
.map(|_| {
let is_null = null_pct < rng.random_range(0.0..1.0);
- if is_null {
- None
- } else {
- Some(rng.random())
- }
+ if is_null { None } else { Some(rng.random()) }
})
.collect();
@@ -824,18 +820,20 @@ mod test {
.zip(filter.iter())
.for_each(|((&group_index, value), is_included)| {
// if value passed filter
- if let Some(true) = is_included {
- if let Some(value) = value {
- mock.saw_value(group_index);
- expected_values.push((group_index, value));
- }
+ if let Some(true) = is_included
+ && let Some(value) = value
+ {
+ mock.saw_value(group_index);
+ expected_values.push((group_index, value));
}
});
}
}
- assert_eq!(accumulated_values, expected_values,
- "\n\naccumulated_values:{accumulated_values:#?}\n\nexpected_values:{expected_values:#?}");
+ assert_eq!(
+ accumulated_values, expected_values,
+ "\n\naccumulated_values:{accumulated_values:#?}\n\nexpected_values:{expected_values:#?}"
+ );
let seen_values = null_state.seen_values.finish_cloned();
mock.validate_seen_values(&seen_values);
@@ -895,8 +893,10 @@ mod test {
}
}
- assert_eq!(accumulated_values, expected_values,
- "\n\naccumulated_values:{accumulated_values:#?}\n\nexpected_values:{expected_values:#?}");
+ assert_eq!(
+ accumulated_values, expected_values,
+ "\n\naccumulated_values:{accumulated_values:#?}\n\nexpected_values:{expected_values:#?}"
+ );
}
/// This is effectively a different implementation of
@@ -940,18 +940,20 @@ mod test {
.zip(filter.iter())
.for_each(|((&group_index, value), is_included)| {
// if value passed filter
- if let Some(true) = is_included {
- if let Some(value) = value {
- mock.saw_value(group_index);
- expected_values.push((group_index, value));
- }
+ if let Some(true) = is_included
+ && let Some(value) = value
+ {
+ mock.saw_value(group_index);
+ expected_values.push((group_index, value));
}
});
}
}
- assert_eq!(accumulated_values, expected_values,
- "\n\naccumulated_values:{accumulated_values:#?}\n\nexpected_values:{expected_values:#?}");
+ assert_eq!(
+ accumulated_values, expected_values,
+ "\n\naccumulated_values:{accumulated_values:#?}\n\nexpected_values:{expected_values:#?}"
+ );
let seen_values = null_state.seen_values.finish_cloned();
mock.validate_seen_values(&seen_values);
diff --git a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/nulls.rs b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/nulls.rs
index c8c7736bba..74d361cf25 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/nulls.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/nulls.rs
@@ -24,7 +24,7 @@ use arrow::array::{
};
use arrow::buffer::NullBuffer;
use arrow::datatypes::DataType;
-use datafusion_common::{not_impl_err, Result};
+use datafusion_common::{Result, not_impl_err};
use std::sync::Arc;
/// Sets the validity mask for a `PrimitiveArray` to `nulls`
diff --git a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/prim_op.rs b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/prim_op.rs
index fe920927f3..656b95d140 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/prim_op.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/groups_accumulator/prim_op.rs
@@ -23,7 +23,7 @@ use arrow::buffer::NullBuffer;
use arrow::compute;
use arrow::datatypes::ArrowPrimitiveType;
use arrow::datatypes::DataType;
-use datafusion_common::{internal_datafusion_err, DataFusionError, Result};
+use datafusion_common::{DataFusionError, Result, internal_datafusion_err};
use datafusion_expr_common::groups_accumulator::{EmitTo, GroupsAccumulator};
use super::accumulate::NullState;
diff --git a/datafusion/functions-aggregate-common/src/merge_arrays.rs b/datafusion/functions-aggregate-common/src/merge_arrays.rs
index bdf1490417..fc96931853 100644
--- a/datafusion/functions-aggregate-common/src/merge_arrays.rs
+++ b/datafusion/functions-aggregate-common/src/merge_arrays.rs
@@ -17,7 +17,7 @@
use arrow::compute::SortOptions;
use datafusion_common::utils::compare_rows;
-use datafusion_common::{exec_err, ScalarValue};
+use datafusion_common::{ScalarValue, exec_err};
use std::cmp::Ordering;
use std::collections::{BinaryHeap, VecDeque};
diff --git a/datafusion/functions-aggregate-common/src/min_max.rs b/datafusion/functions-aggregate-common/src/min_max.rs
index 7dd60e1c0e..27620221cf 100644
--- a/datafusion/functions-aggregate-common/src/min_max.rs
+++ b/datafusion/functions-aggregate-common/src/min_max.rs
@@ -19,20 +19,20 @@
use arrow::array::{
ArrayRef, AsArray as _, BinaryArray, BinaryViewArray, BooleanArray, Date32Array,
- Date64Array, Decimal128Array, Decimal256Array, Decimal32Array, Decimal64Array,
+ Date64Array, Decimal32Array, Decimal64Array, Decimal128Array, Decimal256Array,
DurationMicrosecondArray, DurationMillisecondArray, DurationNanosecondArray,
DurationSecondArray, FixedSizeBinaryArray, Float16Array, Float32Array, Float64Array,
- Int16Array, Int32Array, Int64Array, Int8Array, IntervalDayTimeArray,
+ Int8Array, Int16Array, Int32Array, Int64Array, IntervalDayTimeArray,
IntervalMonthDayNanoArray, IntervalYearMonthArray, LargeBinaryArray,
LargeStringArray, StringArray, StringViewArray, Time32MillisecondArray,
Time32SecondArray, Time64MicrosecondArray, Time64NanosecondArray,
TimestampMicrosecondArray, TimestampMillisecondArray, TimestampNanosecondArray,
- TimestampSecondArray, UInt16Array, UInt32Array, UInt64Array, UInt8Array,
+ TimestampSecondArray, UInt8Array, UInt16Array, UInt32Array, UInt64Array,
};
use arrow::compute;
use arrow::datatypes::{DataType, IntervalUnit, TimeUnit};
use datafusion_common::{
- downcast_value, internal_err, DataFusionError, Result, ScalarValue,
+ DataFusionError, Result, ScalarValue, downcast_value, internal_err,
};
use datafusion_expr_common::accumulator::Accumulator;
use std::{cmp::Ordering, mem::size_of_val};
@@ -108,7 +108,9 @@ macro_rules! interval_min_max {
Some(choose_min_max!($OP)) => $RHS.clone(),
Some(_) => $LHS.clone(),
None => {
- return internal_err!("Comparison error while computing interval min/max")
+ return internal_err!(
+ "Comparison error while computing interval min/max"
+ );
}
}
}};
diff --git a/datafusion/functions-aggregate-common/src/tdigest.rs b/datafusion/functions-aggregate-common/src/tdigest.rs
index f45a74d84e..80f016f051 100644
--- a/datafusion/functions-aggregate-common/src/tdigest.rs
+++ b/datafusion/functions-aggregate-common/src/tdigest.rs
@@ -31,8 +31,8 @@
use arrow::datatypes::DataType;
use arrow::datatypes::Float64Type;
-use datafusion_common::cast::as_primitive_array;
use datafusion_common::ScalarValue;
+use datafusion_common::cast::as_primitive_array;
use std::cmp::Ordering;
use std::mem::{size_of, size_of_val};
diff --git a/datafusion/functions-aggregate-common/src/utils.rs b/datafusion/functions-aggregate-common/src/utils.rs
index 9fff5e392d..78b8c52490 100644
--- a/datafusion/functions-aggregate-common/src/utils.rs
+++ b/datafusion/functions-aggregate-common/src/utils.rs
@@ -24,10 +24,10 @@ use arrow::datatypes::{
ArrowNativeType, DataType, DecimalType, Field, FieldRef, ToByteSlice,
};
use datafusion_common::cast::{as_list_array, as_primitive_array};
-use datafusion_common::utils::memory::estimate_memory_size;
use datafusion_common::utils::SingleRowListArrayBuilder;
+use datafusion_common::utils::memory::estimate_memory_size;
use datafusion_common::{
- exec_err, internal_datafusion_err, HashSet, Result, ScalarValue,
+ HashSet, Result, ScalarValue, exec_err, internal_datafusion_err,
};
use datafusion_expr_common::accumulator::Accumulator;
use datafusion_physical_expr_common::sort_expr::{LexOrdering, PhysicalSortExpr};
@@ -215,7 +215,9 @@ impl<T: ArrowPrimitiveType> GenericDistinctBuffer<T> {
// match up with Accumulator::state_fields
.with_data_type(self.data_type.clone()),
);
- Ok(vec![SingleRowListArrayBuilder::new(arr).build_list_scalar()])
+ Ok(vec![
+ SingleRowListArrayBuilder::new(arr).build_list_scalar(),
+ ])
}
/// Mirrors [`Accumulator::update_batch`].
diff --git a/datafusion/functions-window-common/Cargo.toml b/datafusion/functions-window-common/Cargo.toml
index 6af668c145..d15542ffae 100644
--- a/datafusion/functions-window-common/Cargo.toml
+++ b/datafusion/functions-window-common/Cargo.toml
@@ -21,7 +21,7 @@ description = "Common functions for implementing user-defined window functions f
keywords = ["datafusion", "logical", "plan", "expressions"]
readme = "README.md"
authors = { workspace = true }
-edition = { workspace = true }
+edition = "2024"
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
diff --git a/datafusion/physical-expr-common/Cargo.toml b/datafusion/physical-expr-common/Cargo.toml
index 4602e59c42..df46be6f51 100644
--- a/datafusion/physical-expr-common/Cargo.toml
+++ b/datafusion/physical-expr-common/Cargo.toml
@@ -21,7 +21,7 @@ description = "Common functionality of physical expression for DataFusion query
keywords = ["arrow", "query", "sql"]
readme = "README.md"
version = { workspace = true }
-edition = { workspace = true }
+edition = "2024"
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
diff --git a/datafusion/physical-expr-common/src/binary_map.rs b/datafusion/physical-expr-common/src/binary_map.rs
index 24bc430630..ab95302bbb 100644
--- a/datafusion/physical-expr-common/src/binary_map.rs
+++ b/datafusion/physical-expr-common/src/binary_map.rs
@@ -20,10 +20,10 @@
use ahash::RandomState;
use arrow::array::{
- cast::AsArray,
- types::{ByteArrayType, GenericBinaryType, GenericStringType},
Array, ArrayRef, BufferBuilder, GenericBinaryArray, GenericStringArray,
NullBufferBuilder, OffsetSizeTrait,
+ cast::AsArray,
+ types::{ByteArrayType, GenericBinaryType, GenericStringType},
};
use arrow::buffer::{NullBuffer, OffsetBuffer, ScalarBuffer};
use arrow::datatypes::DataType;
diff --git a/datafusion/physical-expr-common/src/datum.rs b/datafusion/physical-expr-common/src/datum.rs
index 262a6540ff..16ef38b094 100644
--- a/datafusion/physical-expr-common/src/datum.rs
+++ b/datafusion/physical-expr-common/src/datum.rs
@@ -16,15 +16,15 @@
// under the License.
use arrow::array::BooleanArray;
-use arrow::array::{make_comparator, ArrayRef, Datum};
+use arrow::array::{ArrayRef, Datum, make_comparator};
use arrow::buffer::NullBuffer;
use arrow::compute::kernels::cmp::{
distinct, eq, gt, gt_eq, lt, lt_eq, neq, not_distinct,
};
-use arrow::compute::{ilike, like, nilike, nlike, SortOptions};
+use arrow::compute::{SortOptions, ilike, like, nilike, nlike};
use arrow::error::ArrowError;
-use datafusion_common::{arrow_datafusion_err, assert_or_internal_err, internal_err};
use datafusion_common::{Result, ScalarValue};
+use datafusion_common::{arrow_datafusion_err, assert_or_internal_err, internal_err};
use datafusion_expr_common::columnar_value::ColumnarValue;
use datafusion_expr_common::operator::Operator;
use std::sync::Arc;
diff --git a/datafusion/physical-expr-common/src/physical_expr.rs b/datafusion/physical-expr-common/src/physical_expr.rs
index f7f6326876..9102f54cc7 100644
--- a/datafusion/physical-expr-common/src/physical_expr.rs
+++ b/datafusion/physical-expr-common/src/physical_expr.rs
@@ -23,7 +23,7 @@ use std::sync::Arc;
use crate::utils::scatter;
-use arrow::array::{new_empty_array, ArrayRef, BooleanArray};
+use arrow::array::{ArrayRef, BooleanArray, new_empty_array};
use arrow::compute::filter_record_batch;
use arrow::datatypes::{DataType, Field, FieldRef, Schema};
use arrow::record_batch::RecordBatch;
@@ -31,7 +31,7 @@ use datafusion_common::tree_node::{
Transformed, TransformedResult, TreeNode, TreeNodeRecursion,
};
use datafusion_common::{
- assert_eq_or_internal_err, exec_err, not_impl_err, Result, ScalarValue,
+ Result, ScalarValue, assert_eq_or_internal_err, exec_err, not_impl_err,
};
use datafusion_expr_common::columnar_value::ColumnarValue;
use datafusion_expr_common::interval_arithmetic::Interval;
@@ -105,7 +105,10 @@ pub trait PhysicalExpr: Any + Send + Sync + Display + Debug + DynEq + DynHash {
) -> Result<ColumnarValue> {
let row_count = batch.num_rows();
if row_count != selection.len() {
- return exec_err!("Selection array length does not match batch row count: {} != {row_count}", selection.len());
+ return exec_err!(
+ "Selection array length does not match batch row count: {} != {row_count}",
+ selection.len()
+ );
}
let selection_count = selection.true_count();
@@ -783,44 +786,44 @@ mod test {
#[test]
pub fn test_evaluate_selection_with_non_empty_record_batch() {
test_evaluate_selection(
- unsafe { &RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
+ &unsafe { RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
&BooleanArray::from(vec![true; 10]),
&ColumnarValue::Array(Arc::new(Int64Array::from(vec![1; 10]))),
);
}
#[test]
- pub fn test_evaluate_selection_with_non_empty_record_batch_with_larger_false_selection(
- ) {
+ pub fn test_evaluate_selection_with_non_empty_record_batch_with_larger_false_selection()
+ {
test_evaluate_selection_error(
- unsafe { &RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
+ &unsafe { RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
&BooleanArray::from(vec![false; 20]),
);
}
#[test]
- pub fn test_evaluate_selection_with_non_empty_record_batch_with_larger_true_selection(
- ) {
+ pub fn test_evaluate_selection_with_non_empty_record_batch_with_larger_true_selection()
+ {
test_evaluate_selection_error(
- unsafe { &RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
+ &unsafe { RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
&BooleanArray::from(vec![true; 20]),
);
}
#[test]
- pub fn test_evaluate_selection_with_non_empty_record_batch_with_smaller_false_selection(
- ) {
+ pub fn test_evaluate_selection_with_non_empty_record_batch_with_smaller_false_selection()
+ {
test_evaluate_selection_error(
- unsafe { &RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
+ &unsafe { RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
&BooleanArray::from(vec![false; 5]),
);
}
#[test]
- pub fn test_evaluate_selection_with_non_empty_record_batch_with_smaller_true_selection(
- ) {
+ pub fn test_evaluate_selection_with_non_empty_record_batch_with_smaller_true_selection()
+ {
test_evaluate_selection_error(
- unsafe { &RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
+ &unsafe { RecordBatch::new_unchecked(Arc::new(Schema::empty()), vec![], 10) },
&BooleanArray::from(vec![true; 5]),
);
}
diff --git a/datafusion/physical-expr-common/src/sort_expr.rs b/datafusion/physical-expr-common/src/sort_expr.rs
index d19d7024a5..1a49db3d58 100644
--- a/datafusion/physical-expr-common/src/sort_expr.rs
+++ b/datafusion/physical-expr-common/src/sort_expr.rs
@@ -24,7 +24,7 @@ use std::ops::{Deref, DerefMut};
use std::sync::Arc;
use std::vec::IntoIter;
-use crate::physical_expr::{fmt_sql, PhysicalExpr};
+use crate::physical_expr::{PhysicalExpr, fmt_sql};
use arrow::compute::kernels::sort::{SortColumn, SortOptions};
use arrow::datatypes::Schema;
diff --git a/datafusion/physical-expr-common/src/tree_node.rs b/datafusion/physical-expr-common/src/tree_node.rs
index c37e67575b..6c7d04a225 100644
--- a/datafusion/physical-expr-common/src/tree_node.rs
+++ b/datafusion/physical-expr-common/src/tree_node.rs
@@ -20,10 +20,10 @@
use std::fmt::{self, Display, Formatter};
use std::sync::Arc;
-use crate::physical_expr::{with_new_children_if_necessary, PhysicalExpr};
+use crate::physical_expr::{PhysicalExpr, with_new_children_if_necessary};
-use datafusion_common::tree_node::{ConcreteTreeNode, DynTreeNode};
use datafusion_common::Result;
+use datafusion_common::tree_node::{ConcreteTreeNode, DynTreeNode};
impl DynTreeNode for dyn PhysicalExpr {
fn arc_children(&self) -> Vec<&Arc<Self>> {
diff --git a/datafusion/physical-expr-common/src/utils.rs b/datafusion/physical-expr-common/src/utils.rs
index 230252eb89..8992fb2092 100644
--- a/datafusion/physical-expr-common/src/utils.rs
+++ b/datafusion/physical-expr-common/src/utils.rs
@@ -20,8 +20,8 @@ use std::sync::Arc;
use crate::physical_expr::PhysicalExpr;
use crate::tree_node::ExprContext;
-use arrow::array::{make_array, Array, ArrayRef, BooleanArray, MutableArrayData};
-use arrow::compute::{and_kleene, is_not_null, SlicesIterator};
+use arrow::array::{Array, ArrayRef, BooleanArray, MutableArrayData, make_array};
+use arrow::compute::{SlicesIterator, and_kleene, is_not_null};
use arrow::record_batch::RecordBatch;
use datafusion_common::Result;
use datafusion_expr_common::sort_properties::ExprProperties;