Skip to content

Apache DataFusion SQL Query Engine

Refactor imports to use `util` module (#12885)

Xwgf8add9b8f22f
diff --git a/benchmarks/src/bin/h2o.rs b/benchmarks/src/bin/h2o.rs
index 1bb8cb9d43..1ddeb786a5 100644
--- a/benchmarks/src/bin/h2o.rs
+++ b/benchmarks/src/bin/h2o.rs
@@ -26,7 +26,7 @@ use datafusion::datasource::listing::{
use datafusion::datasource::MemTable;
use datafusion::prelude::CsvReadOptions;
use datafusion::{arrow::util::pretty, error::Result, prelude::SessionContext};
-use datafusion_benchmarks::BenchmarkRun;
+use datafusion_benchmarks::util::BenchmarkRun;
use std::path::PathBuf;
use std::sync::Arc;
use structopt::StructOpt;
diff --git a/benchmarks/src/clickbench.rs b/benchmarks/src/clickbench.rs
index 207da4020b..6ebefa985b 100644
--- a/benchmarks/src/clickbench.rs
+++ b/benchmarks/src/clickbench.rs
@@ -18,6 +18,7 @@
use std::path::Path;
use std::path::PathBuf;
+use crate::util::{BenchmarkRun, CommonOpt};
use datafusion::{
error::{DataFusionError, Result},
prelude::SessionContext,
@@ -26,8 +27,6 @@ use datafusion_common::exec_datafusion_err;
use datafusion_common::instant::Instant;
use structopt::StructOpt;
-use crate::{BenchmarkRun, CommonOpt};
-
/// Run the clickbench benchmark
///
/// The ClickBench[1] benchmarks are widely cited in the industry and
diff --git a/benchmarks/src/imdb/run.rs b/benchmarks/src/imdb/run.rs
index 697c79dc89..fd49606061 100644
--- a/benchmarks/src/imdb/run.rs
+++ b/benchmarks/src/imdb/run.rs
@@ -19,7 +19,7 @@ use std::path::PathBuf;
use std::sync::Arc;
use super::{get_imdb_table_schema, get_query_sql, IMDB_TABLES};
-use crate::{BenchmarkRun, CommonOpt};
+use crate::util::{BenchmarkRun, CommonOpt};
use arrow::record_batch::RecordBatch;
use arrow::util::pretty::{self, pretty_format_batches};
@@ -489,6 +489,7 @@ mod tests {
use super::*;
+ use crate::util::CommonOpt;
use datafusion::common::exec_err;
use datafusion::error::Result;
use datafusion_proto::bytes::{
diff --git a/benchmarks/src/lib.rs b/benchmarks/src/lib.rs
index 52d81ca918..02410e0cfa 100644
--- a/benchmarks/src/lib.rs
+++ b/benchmarks/src/lib.rs
@@ -21,5 +21,4 @@ pub mod imdb;
pub mod parquet_filter;
pub mod sort;
pub mod tpch;
-mod util;
-pub use util::*;
+pub mod util;
diff --git a/benchmarks/src/parquet_filter.rs b/benchmarks/src/parquet_filter.rs
index 5c98a2f8be..34103af0ff 100644
--- a/benchmarks/src/parquet_filter.rs
+++ b/benchmarks/src/parquet_filter.rs
@@ -17,7 +17,7 @@
use std::path::PathBuf;
-use crate::{AccessLogOpt, BenchmarkRun, CommonOpt};
+use crate::util::{AccessLogOpt, BenchmarkRun, CommonOpt};
use arrow::util::pretty;
use datafusion::common::Result;
diff --git a/benchmarks/src/sort.rs b/benchmarks/src/sort.rs
index 19eec2949e..247727e1b4 100644
--- a/benchmarks/src/sort.rs
+++ b/benchmarks/src/sort.rs
@@ -18,7 +18,7 @@
use std::path::PathBuf;
use std::sync::Arc;
-use crate::{AccessLogOpt, BenchmarkRun, CommonOpt};
+use crate::util::{AccessLogOpt, BenchmarkRun, CommonOpt};
use arrow::util::pretty;
use datafusion::common::Result;
diff --git a/benchmarks/src/tpch/run.rs b/benchmarks/src/tpch/run.rs
index 1a1f51f700..e316a66e1c 100644
--- a/benchmarks/src/tpch/run.rs
+++ b/benchmarks/src/tpch/run.rs
@@ -21,7 +21,7 @@ use std::sync::Arc;
use super::{
get_query_sql, get_tbl_tpch_table_schema, get_tpch_table_schema, TPCH_TABLES,
};
-use crate::{BenchmarkRun, CommonOpt};
+use crate::util::{BenchmarkRun, CommonOpt};
use arrow::record_batch::RecordBatch;
use arrow::util::pretty::{self, pretty_format_batches};