Skip to content

Apache DataFusion SQL Query Engine

chore: Remove "extern crate criterion" in benches (#20299)

Neil Conway2cca3fad33be
diff --git a/datafusion/core/benches/aggregate_query_sql.rs b/datafusion/core/benches/aggregate_query_sql.rs
index 4aa667504e..f785c94580 100644
--- a/datafusion/core/benches/aggregate_query_sql.rs
+++ b/datafusion/core/benches/aggregate_query_sql.rs
@@ -15,14 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate arrow;
-extern crate datafusion;
-
mod data_utils;
-use crate::criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use data_utils::create_table_provider;
use datafusion::error::Result;
use datafusion::execution::context::SessionContext;
diff --git a/datafusion/core/benches/csv_load.rs b/datafusion/core/benches/csv_load.rs
index 228457947f..13843daddd 100644
--- a/datafusion/core/benches/csv_load.rs
+++ b/datafusion/core/benches/csv_load.rs
@@ -15,14 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate arrow;
-extern crate datafusion;
-
mod data_utils;
-use crate::criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion::error::Result;
use datafusion::execution::context::SessionContext;
use datafusion::prelude::CsvReadOptions;
diff --git a/datafusion/core/benches/dataframe.rs b/datafusion/core/benches/dataframe.rs
index 726187ab5e..5aeade315c 100644
--- a/datafusion/core/benches/dataframe.rs
+++ b/datafusion/core/benches/dataframe.rs
@@ -15,13 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-extern crate arrow;
-#[macro_use]
-extern crate criterion;
-extern crate datafusion;
-
use arrow_schema::{DataType, Field, Schema};
-use criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion::datasource::MemTable;
use datafusion::prelude::SessionContext;
use datafusion_expr::col;
diff --git a/datafusion/core/benches/distinct_query_sql.rs b/datafusion/core/benches/distinct_query_sql.rs
index 0e638e293d..d389b1b3d6 100644
--- a/datafusion/core/benches/distinct_query_sql.rs
+++ b/datafusion/core/benches/distinct_query_sql.rs
@@ -15,13 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate arrow;
-extern crate datafusion;
-
mod data_utils;
-use crate::criterion::Criterion;
+
+use criterion::{Criterion, criterion_group, criterion_main};
use data_utils::{create_table_provider, make_data};
use datafusion::execution::context::SessionContext;
use datafusion::physical_plan::{ExecutionPlan, collect};
diff --git a/datafusion/core/benches/math_query_sql.rs b/datafusion/core/benches/math_query_sql.rs
index 4d1d4abb67..f5df56e95a 100644
--- a/datafusion/core/benches/math_query_sql.rs
+++ b/datafusion/core/benches/math_query_sql.rs
@@ -15,18 +15,13 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-use criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use parking_lot::Mutex;
use std::sync::Arc;
use tokio::runtime::Runtime;
-extern crate arrow;
-extern crate datafusion;
-
use arrow::{
array::{Float32Array, Float64Array},
datatypes::{DataType, Field, Schema},
diff --git a/datafusion/core/benches/physical_plan.rs b/datafusion/core/benches/physical_plan.rs
index e6763b4761..7b66996b05 100644
--- a/datafusion/core/benches/physical_plan.rs
+++ b/datafusion/core/benches/physical_plan.rs
@@ -15,11 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-use criterion::{BatchSize, Criterion};
-extern crate arrow;
-extern crate datafusion;
+use criterion::{BatchSize, Criterion, criterion_group, criterion_main};
use std::sync::Arc;
diff --git a/datafusion/core/benches/range_and_generate_series.rs b/datafusion/core/benches/range_and_generate_series.rs
index 2b1463a210..10d560df08 100644
--- a/datafusion/core/benches/range_and_generate_series.rs
+++ b/datafusion/core/benches/range_and_generate_series.rs
@@ -15,13 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate datafusion;
-
mod data_utils;
-use crate::criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion::execution::context::SessionContext;
use parking_lot::Mutex;
use std::hint::black_box;
diff --git a/datafusion/core/benches/sort_limit_query_sql.rs b/datafusion/core/benches/sort_limit_query_sql.rs
index c18070fb77..54cd9a0bcd 100644
--- a/datafusion/core/benches/sort_limit_query_sql.rs
+++ b/datafusion/core/benches/sort_limit_query_sql.rs
@@ -15,9 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-use criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion::datasource::file_format::csv::CsvFormat;
use datafusion::datasource::listing::{
ListingOptions, ListingTable, ListingTableConfig, ListingTableUrl,
@@ -27,9 +25,6 @@ use datafusion::prelude::SessionConfig;
use parking_lot::Mutex;
use std::sync::Arc;
-extern crate arrow;
-extern crate datafusion;
-
use arrow::datatypes::{DataType, Field, Schema};
use datafusion::datasource::MemTable;
diff --git a/datafusion/core/benches/sql_planner.rs b/datafusion/core/benches/sql_planner.rs
index 664de33519..59502da987 100644
--- a/datafusion/core/benches/sql_planner.rs
+++ b/datafusion/core/benches/sql_planner.rs
@@ -15,20 +15,15 @@
// specific language governing permissions and limitations
// under the License.
-extern crate arrow;
-#[macro_use]
-extern crate criterion;
-extern crate datafusion;
-
mod data_utils;
-use crate::criterion::Criterion;
use arrow::array::PrimitiveArray;
use arrow::array::{ArrayRef, RecordBatch};
use arrow::datatypes::ArrowNativeTypeOp;
use arrow::datatypes::ArrowPrimitiveType;
use arrow::datatypes::{DataType, Field, Fields, Schema};
use criterion::Bencher;
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion::datasource::MemTable;
use datafusion::execution::context::SessionContext;
use datafusion_common::{ScalarValue, config::Dialect};
diff --git a/datafusion/core/benches/window_query_sql.rs b/datafusion/core/benches/window_query_sql.rs
index e4643567a0..1657cae913 100644
--- a/datafusion/core/benches/window_query_sql.rs
+++ b/datafusion/core/benches/window_query_sql.rs
@@ -15,14 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate arrow;
-extern crate datafusion;
-
mod data_utils;
-use crate::criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use data_utils::create_table_provider;
use datafusion::error::Result;
use datafusion::execution::context::SessionContext;
diff --git a/datafusion/functions-aggregate-common/benches/accumulate.rs b/datafusion/functions-aggregate-common/benches/accumulate.rs
index f1e4fe23cb..aceec57df9 100644
--- a/datafusion/functions-aggregate-common/benches/accumulate.rs
+++ b/datafusion/functions-aggregate-common/benches/accumulate.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::sync::Arc;
use arrow::array::{ArrayRef, BooleanArray, Int64Array};
diff --git a/datafusion/functions-nested/benches/array_expression.rs b/datafusion/functions-nested/benches/array_expression.rs
index 8d72ffa3c1..ad9f565f4d 100644
--- a/datafusion/functions-nested/benches/array_expression.rs
+++ b/datafusion/functions-nested/benches/array_expression.rs
@@ -15,11 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate arrow;
-
-use crate::criterion::Criterion;
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_expr::lit;
use datafusion_functions_nested::expr_fn::{array_replace_all, make_array};
use std::hint::black_box;
diff --git a/datafusion/functions-nested/benches/array_has.rs b/datafusion/functions-nested/benches/array_has.rs
index a44a80c6ae..d96f26d410 100644
--- a/datafusion/functions-nested/benches/array_has.rs
+++ b/datafusion/functions-nested/benches/array_has.rs
@@ -15,10 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-
-use criterion::{BenchmarkId, Criterion};
+use criterion::{
+ criterion_group, criterion_main, {BenchmarkId, Criterion},
+};
use datafusion_expr::lit;
use datafusion_functions_nested::expr_fn::{
array_has, array_has_all, array_has_any, make_array,
diff --git a/datafusion/functions-nested/benches/array_remove.rs b/datafusion/functions-nested/benches/array_remove.rs
index 2be154a2f8..a494d32239 100644
--- a/datafusion/functions-nested/benches/array_remove.rs
+++ b/datafusion/functions-nested/benches/array_remove.rs
@@ -15,16 +15,15 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-
use arrow::array::{
Array, ArrayRef, BinaryArray, BooleanArray, Decimal128Array, FixedSizeBinaryArray,
Float64Array, Int64Array, ListArray, StringArray,
};
use arrow::buffer::OffsetBuffer;
use arrow::datatypes::{DataType, Field};
-use criterion::{BenchmarkId, Criterion};
+use criterion::{
+ criterion_group, criterion_main, {BenchmarkId, Criterion},
+};
use datafusion_common::ScalarValue;
use datafusion_common::config::ConfigOptions;
use datafusion_expr::{ColumnarValue, ScalarFunctionArgs, ScalarUDFImpl};
diff --git a/datafusion/functions-nested/benches/array_repeat.rs b/datafusion/functions-nested/benches/array_repeat.rs
index 69297b5fd3..0ce8db00ce 100644
--- a/datafusion/functions-nested/benches/array_repeat.rs
+++ b/datafusion/functions-nested/benches/array_repeat.rs
@@ -15,13 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-
use arrow::array::{ArrayRef, BooleanArray, Float64Array, Int64Array, ListArray};
use arrow::buffer::OffsetBuffer;
use arrow::datatypes::{DataType, Field};
-use criterion::{BenchmarkId, Criterion};
+use criterion::{
+ criterion_group, criterion_main, {BenchmarkId, Criterion},
+};
use datafusion_common::ScalarValue;
use datafusion_common::config::ConfigOptions;
use datafusion_expr::{ColumnarValue, ScalarFunctionArgs, ScalarUDFImpl};
diff --git a/datafusion/functions-nested/benches/array_reverse.rs b/datafusion/functions-nested/benches/array_reverse.rs
index 92a65128fe..0c37296188 100644
--- a/datafusion/functions-nested/benches/array_reverse.rs
+++ b/datafusion/functions-nested/benches/array_reverse.rs
@@ -15,18 +15,14 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-extern crate arrow;
-
use std::{hint::black_box, sync::Arc};
-use crate::criterion::Criterion;
use arrow::{
array::{ArrayRef, FixedSizeListArray, Int32Array, ListArray, ListViewArray},
buffer::{NullBuffer, OffsetBuffer, ScalarBuffer},
datatypes::{DataType, Field},
};
+use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_functions_nested::reverse::array_reverse_inner;
fn array_reverse(array: &ArrayRef) -> ArrayRef {
diff --git a/datafusion/functions-nested/benches/array_set_ops.rs b/datafusion/functions-nested/benches/array_set_ops.rs
index 2b21c50b27..237c2d1474 100644
--- a/datafusion/functions-nested/benches/array_set_ops.rs
+++ b/datafusion/functions-nested/benches/array_set_ops.rs
@@ -15,13 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-#[macro_use]
-extern crate criterion;
-
use arrow::array::{ArrayRef, Int64Array, ListArray};
use arrow::buffer::OffsetBuffer;
use arrow::datatypes::{DataType, Field};
-use criterion::{BenchmarkId, Criterion};
+use criterion::{
+ criterion_group, criterion_main, {BenchmarkId, Criterion},
+};
use datafusion_common::config::ConfigOptions;
use datafusion_expr::{ColumnarValue, ScalarFunctionArgs, ScalarUDFImpl};
use datafusion_functions_nested::set_ops::{ArrayIntersect, ArrayUnion};
diff --git a/datafusion/functions-nested/benches/array_slice.rs b/datafusion/functions-nested/benches/array_slice.rs
index 858e438996..b95fe47575 100644
--- a/datafusion/functions-nested/benches/array_slice.rs
+++ b/datafusion/functions-nested/benches/array_slice.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{
Int64Array, ListArray, ListViewArray, NullBufferBuilder, PrimitiveArray,
};
diff --git a/datafusion/functions-nested/benches/map.rs b/datafusion/functions-nested/benches/map.rs
index 75b4045a19..e50c4659b1 100644
--- a/datafusion/functions-nested/benches/map.rs
+++ b/datafusion/functions-nested/benches/map.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{Int32Array, ListArray, StringArray};
use arrow::buffer::{OffsetBuffer, ScalarBuffer};
use arrow::datatypes::{DataType, Field};
diff --git a/datafusion/functions/benches/ascii.rs b/datafusion/functions/benches/ascii.rs
index e15483c19a..a2424ed352 100644
--- a/datafusion/functions/benches/ascii.rs
+++ b/datafusion/functions/benches/ascii.rs
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
mod helper;
use arrow::datatypes::{DataType, Field};
diff --git a/datafusion/functions/benches/character_length.rs b/datafusion/functions/benches/character_length.rs
index 35a0cf886b..4927627ec2 100644
--- a/datafusion/functions/benches/character_length.rs
+++ b/datafusion/functions/benches/character_length.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_common::config::ConfigOptions;
diff --git a/datafusion/functions/benches/chr.rs b/datafusion/functions/benches/chr.rs
index fcb72771ac..a702dc161a 100644
--- a/datafusion/functions/benches/chr.rs
+++ b/datafusion/functions/benches/chr.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::{array::PrimitiveArray, datatypes::Int64Type};
use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_common::ScalarValue;
diff --git a/datafusion/functions/benches/contains.rs b/datafusion/functions/benches/contains.rs
index 052eff3886..6c39f45e14 100644
--- a/datafusion/functions/benches/contains.rs
+++ b/datafusion/functions/benches/contains.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/cot.rs b/datafusion/functions/benches/cot.rs
index 061d14cbf0..16c3fba217 100644
--- a/datafusion/functions/benches/cot.rs
+++ b/datafusion/functions/benches/cot.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::{
datatypes::{Float32Type, Float64Type},
util::bench_util::create_primitive_array,
diff --git a/datafusion/functions/benches/crypto.rs b/datafusion/functions/benches/crypto.rs
index bf30cc9a0c..9a86efbff9 100644
--- a/datafusion/functions/benches/crypto.rs
+++ b/datafusion/functions/benches/crypto.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::create_string_array_with_len;
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/date_bin.rs b/datafusion/functions/benches/date_bin.rs
index eb4e960d83..28dee96987 100644
--- a/datafusion/functions/benches/date_bin.rs
+++ b/datafusion/functions/benches/date_bin.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/date_trunc.rs b/datafusion/functions/benches/date_trunc.rs
index 664221f7ba..0668a1cc50 100644
--- a/datafusion/functions/benches/date_trunc.rs
+++ b/datafusion/functions/benches/date_trunc.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/encoding.rs b/datafusion/functions/benches/encoding.rs
index af0385b6fc..0b8f0c5c51 100644
--- a/datafusion/functions/benches/encoding.rs
+++ b/datafusion/functions/benches/encoding.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::Array;
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::create_binary_array;
diff --git a/datafusion/functions/benches/ends_with.rs b/datafusion/functions/benches/ends_with.rs
index 926fd9ff72..474e8a1555 100644
--- a/datafusion/functions/benches/ends_with.rs
+++ b/datafusion/functions/benches/ends_with.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/factorial.rs b/datafusion/functions/benches/factorial.rs
index 5c5ff991d7..c441b50c28 100644
--- a/datafusion/functions/benches/factorial.rs
+++ b/datafusion/functions/benches/factorial.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::Int64Array;
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/find_in_set.rs b/datafusion/functions/benches/find_in_set.rs
index e207c1fa48..9ee20ecd14 100644
--- a/datafusion/functions/benches/find_in_set.rs
+++ b/datafusion/functions/benches/find_in_set.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/floor_ceil.rs b/datafusion/functions/benches/floor_ceil.rs
index 7995779ab5..dc095e0152 100644
--- a/datafusion/functions/benches/floor_ceil.rs
+++ b/datafusion/functions/benches/floor_ceil.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field, Float64Type};
use arrow::util::bench_util::create_primitive_array;
use criterion::{Criterion, SamplingMode, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/gcd.rs b/datafusion/functions/benches/gcd.rs
index 9705af8a2f..3c72a46e66 100644
--- a/datafusion/functions/benches/gcd.rs
+++ b/datafusion/functions/benches/gcd.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::Field;
use arrow::{
array::{ArrayRef, Int64Array},
diff --git a/datafusion/functions/benches/initcap.rs b/datafusion/functions/benches/initcap.rs
index a92c2cc2d5..e68e41baa2 100644
--- a/datafusion/functions/benches/initcap.rs
+++ b/datafusion/functions/benches/initcap.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::OffsetSizeTrait;
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/isnan.rs b/datafusion/functions/benches/isnan.rs
index d4e41e882f..e353b9d27a 100644
--- a/datafusion/functions/benches/isnan.rs
+++ b/datafusion/functions/benches/isnan.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use arrow::{
datatypes::{Float32Type, Float64Type},
diff --git a/datafusion/functions/benches/iszero.rs b/datafusion/functions/benches/iszero.rs
index 93bb2e7512..c6d0aed4c6 100644
--- a/datafusion/functions/benches/iszero.rs
+++ b/datafusion/functions/benches/iszero.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use arrow::{
datatypes::{Float32Type, Float64Type},
diff --git a/datafusion/functions/benches/left_right.rs b/datafusion/functions/benches/left_right.rs
index 913a2194f7..59f8d8a75f 100644
--- a/datafusion/functions/benches/left_right.rs
+++ b/datafusion/functions/benches/left_right.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/levenshtein.rs b/datafusion/functions/benches/levenshtein.rs
index 19f81b6caf..08733b245f 100644
--- a/datafusion/functions/benches/levenshtein.rs
+++ b/datafusion/functions/benches/levenshtein.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::OffsetSizeTrait;
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::create_string_array_with_len;
diff --git a/datafusion/functions/benches/lower.rs b/datafusion/functions/benches/lower.rs
index 333dca3900..6dbc8dcb7d 100644
--- a/datafusion/functions/benches/lower.rs
+++ b/datafusion/functions/benches/lower.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrayRef, StringArray, StringViewBuilder};
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/make_date.rs b/datafusion/functions/benches/make_date.rs
index 8b1b32edfc..42b5b10195 100644
--- a/datafusion/functions/benches/make_date.rs
+++ b/datafusion/functions/benches/make_date.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/nullif.rs b/datafusion/functions/benches/nullif.rs
index f937d19421..f9f063c52d 100644
--- a/datafusion/functions/benches/nullif.rs
+++ b/datafusion/functions/benches/nullif.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::create_string_array_with_len;
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/pad.rs b/datafusion/functions/benches/pad.rs
index f6b2ed7636..99f177c035 100644
--- a/datafusion/functions/benches/pad.rs
+++ b/datafusion/functions/benches/pad.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrowPrimitiveType, OffsetSizeTrait, PrimitiveArray};
use arrow::datatypes::{DataType, Field, Int64Type};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/random.rs b/datafusion/functions/benches/random.rs
index 3d8631140c..71ded120eb 100644
--- a/datafusion/functions/benches/random.rs
+++ b/datafusion/functions/benches/random.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_common::config::ConfigOptions;
diff --git a/datafusion/functions/benches/regexp_count.rs b/datafusion/functions/benches/regexp_count.rs
index eae7ef00f1..bce76c0558 100644
--- a/datafusion/functions/benches/regexp_count.rs
+++ b/datafusion/functions/benches/regexp_count.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::Int64Array;
use arrow::array::OffsetSizeTrait;
use arrow::datatypes::{DataType, Field};
diff --git a/datafusion/functions/benches/regx.rs b/datafusion/functions/benches/regx.rs
index 32378ccd12..c5014655a8 100644
--- a/datafusion/functions/benches/regx.rs
+++ b/datafusion/functions/benches/regx.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::builder::StringBuilder;
use arrow::array::{ArrayRef, AsArray, Int64Array, StringArray, StringViewArray};
use arrow::compute::cast;
diff --git a/datafusion/functions/benches/repeat.rs b/datafusion/functions/benches/repeat.rs
index 0fdefbafa1..354812c0d2 100644
--- a/datafusion/functions/benches/repeat.rs
+++ b/datafusion/functions/benches/repeat.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrayRef, Int64Array, OffsetSizeTrait};
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/replace.rs b/datafusion/functions/benches/replace.rs
index deadbfeb99..55fbd6ae57 100644
--- a/datafusion/functions/benches/replace.rs
+++ b/datafusion/functions/benches/replace.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::OffsetSizeTrait;
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/reverse.rs b/datafusion/functions/benches/reverse.rs
index 73f5be5b45..f2e2898bbf 100644
--- a/datafusion/functions/benches/reverse.rs
+++ b/datafusion/functions/benches/reverse.rs
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
mod helper;
use arrow::datatypes::{DataType, Field};
diff --git a/datafusion/functions/benches/round.rs b/datafusion/functions/benches/round.rs
index ea59584919..7010aa3507 100644
--- a/datafusion/functions/benches/round.rs
+++ b/datafusion/functions/benches/round.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field, Float32Type, Float64Type};
use arrow::util::bench_util::create_primitive_array;
use criterion::{Criterion, SamplingMode, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/signum.rs b/datafusion/functions/benches/signum.rs
index b34e52d7f2..e98d1b2c22 100644
--- a/datafusion/functions/benches/signum.rs
+++ b/datafusion/functions/benches/signum.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::DataType;
use arrow::{
datatypes::{Field, Float32Type, Float64Type},
diff --git a/datafusion/functions/benches/split_part.rs b/datafusion/functions/benches/split_part.rs
index e23610338d..7ef84a0589 100644
--- a/datafusion/functions/benches/split_part.rs
+++ b/datafusion/functions/benches/split_part.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrayRef, Int64Array, StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/starts_with.rs b/datafusion/functions/benches/starts_with.rs
index 9ee39b6945..17483f0da7 100644
--- a/datafusion/functions/benches/starts_with.rs
+++ b/datafusion/functions/benches/starts_with.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/strpos.rs b/datafusion/functions/benches/strpos.rs
index 9babf1d05c..8cfbc791c4 100644
--- a/datafusion/functions/benches/strpos.rs
+++ b/datafusion/functions/benches/strpos.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/substr.rs b/datafusion/functions/benches/substr.rs
index a6989c1bca..37a1e178f5 100644
--- a/datafusion/functions/benches/substr.rs
+++ b/datafusion/functions/benches/substr.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrayRef, Int64Array, OffsetSizeTrait};
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/functions/benches/substr_index.rs b/datafusion/functions/benches/substr_index.rs
index 28ce6e444e..663e7928bf 100644
--- a/datafusion/functions/benches/substr_index.rs
+++ b/datafusion/functions/benches/substr_index.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/to_char.rs b/datafusion/functions/benches/to_char.rs
index ac5b5dc7e0..65f4999d23 100644
--- a/datafusion/functions/benches/to_char.rs
+++ b/datafusion/functions/benches/to_char.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/to_hex.rs b/datafusion/functions/benches/to_hex.rs
index 356c3c6c05..33f8d9c49e 100644
--- a/datafusion/functions/benches/to_hex.rs
+++ b/datafusion/functions/benches/to_hex.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::Int64Array;
use arrow::datatypes::{DataType, Field, Int32Type, Int64Type};
use arrow::util::bench_util::create_primitive_array;
diff --git a/datafusion/functions/benches/to_timestamp.rs b/datafusion/functions/benches/to_timestamp.rs
index ed865fa6e8..90ea145d5d 100644
--- a/datafusion/functions/benches/to_timestamp.rs
+++ b/datafusion/functions/benches/to_timestamp.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use std::hint::black_box;
use std::sync::Arc;
diff --git a/datafusion/functions/benches/translate.rs b/datafusion/functions/benches/translate.rs
index 601bdec7cd..f63faacd39 100644
--- a/datafusion/functions/benches/translate.rs
+++ b/datafusion/functions/benches/translate.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::OffsetSizeTrait;
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::create_string_array_with_len;
diff --git a/datafusion/functions/benches/trim.rs b/datafusion/functions/benches/trim.rs
index ad2b10e201..23a53eefb2 100644
--- a/datafusion/functions/benches/trim.rs
+++ b/datafusion/functions/benches/trim.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrayRef, LargeStringArray, StringArray, StringViewArray};
use arrow::datatypes::{DataType, Field};
use criterion::{
diff --git a/datafusion/functions/benches/trunc.rs b/datafusion/functions/benches/trunc.rs
index d88d56a94e..ffbedcb142 100644
--- a/datafusion/functions/benches/trunc.rs
+++ b/datafusion/functions/benches/trunc.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::{
datatypes::{Field, Float32Type, Float64Type},
util::bench_util::create_primitive_array,
diff --git a/datafusion/functions/benches/upper.rs b/datafusion/functions/benches/upper.rs
index 51ce1da0fa..3f6fa36b18 100644
--- a/datafusion/functions/benches/upper.rs
+++ b/datafusion/functions/benches/upper.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::create_string_array_with_len;
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/functions/benches/uuid.rs b/datafusion/functions/benches/uuid.rs
index df9b2bed4b..629fb950dd 100644
--- a/datafusion/functions/benches/uuid.rs
+++ b/datafusion/functions/benches/uuid.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use criterion::{Criterion, criterion_group, criterion_main};
use datafusion_common::config::ConfigOptions;
diff --git a/datafusion/spark/benches/char.rs b/datafusion/spark/benches/char.rs
index b5f87857ae..38d9ebdeb4 100644
--- a/datafusion/spark/benches/char.rs
+++ b/datafusion/spark/benches/char.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::datatypes::{DataType, Field};
use arrow::{array::PrimitiveArray, datatypes::Int64Type};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/spark/benches/hex.rs b/datafusion/spark/benches/hex.rs
index 756352b034..9785371cc5 100644
--- a/datafusion/spark/benches/hex.rs
+++ b/datafusion/spark/benches/hex.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::*;
use arrow::datatypes::*;
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/spark/benches/sha2.rs b/datafusion/spark/benches/sha2.rs
index 8ab602d31c..6e83598470 100644
--- a/datafusion/spark/benches/sha2.rs
+++ b/datafusion/spark/benches/sha2.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::*;
use arrow::datatypes::*;
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/spark/benches/slice.rs b/datafusion/spark/benches/slice.rs
index 0061e9be5c..da392dc042 100644
--- a/datafusion/spark/benches/slice.rs
+++ b/datafusion/spark/benches/slice.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{
Int64Array, ListArray, ListViewArray, NullBufferBuilder, PrimitiveArray,
};
diff --git a/datafusion/spark/benches/space.rs b/datafusion/spark/benches/space.rs
index 8ace7219a1..bd9d370ca3 100644
--- a/datafusion/spark/benches/space.rs
+++ b/datafusion/spark/benches/space.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::PrimitiveArray;
use arrow::datatypes::{DataType, Field, Int32Type};
use criterion::{Criterion, criterion_group, criterion_main};
diff --git a/datafusion/spark/benches/substring.rs b/datafusion/spark/benches/substring.rs
index 286758f43d..d6eac817c3 100644
--- a/datafusion/spark/benches/substring.rs
+++ b/datafusion/spark/benches/substring.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{ArrayRef, Int64Array, OffsetSizeTrait};
use arrow::datatypes::{DataType, Field};
use arrow::util::bench_util::{
diff --git a/datafusion/spark/benches/unhex.rs b/datafusion/spark/benches/unhex.rs
index f5ded8d8d7..7dce683485 100644
--- a/datafusion/spark/benches/unhex.rs
+++ b/datafusion/spark/benches/unhex.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-extern crate criterion;
-
use arrow::array::{
Array, LargeStringArray, LargeStringBuilder, StringArray, StringBuilder,
StringViewArray, StringViewBuilder,