Skip to content

Apache DataFusion SQL Query Engine

Clippy fix on nightly (#1907)

Yijie Shen6f3ca5b85400
diff --git a/ballista/rust/core/src/execution_plans/distributed_query.rs b/ballista/rust/core/src/execution_plans/distributed_query.rs
index e4f5e7d93a..a226622fe9 100644
--- a/ballista/rust/core/src/execution_plans/distributed_query.rs
+++ b/ballista/rust/core/src/execution_plans/distributed_query.rs
@@ -287,7 +287,7 @@ async fn fetch_partition(
BallistaClient::try_new(metadata.host.as_str(), metadata.port as u16)
.await
.map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?;
- Ok(ballista_client
+ ballista_client
.fetch_partition(
&partition_id.job_id,
partition_id.stage_id as usize,
@@ -295,5 +295,5 @@ async fn fetch_partition(
&location.path,
)
.await
- .map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?)
+ .map_err(|e| DataFusionError::Execution(format!("{:?}", e)))
}
diff --git a/ballista/rust/core/src/execution_plans/shuffle_reader.rs b/ballista/rust/core/src/execution_plans/shuffle_reader.rs
index 7505f24118..3bebcd12e1 100644
--- a/ballista/rust/core/src/execution_plans/shuffle_reader.rs
+++ b/ballista/rust/core/src/execution_plans/shuffle_reader.rs
@@ -208,7 +208,7 @@ async fn fetch_partition(
BallistaClient::try_new(metadata.host.as_str(), metadata.port as u16)
.await
.map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?;
- Ok(ballista_client
+ ballista_client
.fetch_partition(
&partition_id.job_id,
partition_id.stage_id as usize,
@@ -216,7 +216,7 @@ async fn fetch_partition(
&location.path,
)
.await
- .map_err(|e| DataFusionError::Execution(format!("{:?}", e)))?)
+ .map_err(|e| DataFusionError::Execution(format!("{:?}", e)))
}
#[cfg(test)]
diff --git a/ballista/rust/executor/src/cpu_bound_executor.rs b/ballista/rust/executor/src/cpu_bound_executor.rs
index 243d5fe69b..9d0816734e 100644
--- a/ballista/rust/executor/src/cpu_bound_executor.rs
+++ b/ballista/rust/executor/src/cpu_bound_executor.rs
@@ -203,7 +203,7 @@ fn set_current_thread_priority(prio: i32) {
}
#[cfg(not(unix))]
-fn set_current_thread_priority(prio: i32) {
+fn set_current_thread_priority(_prio: i32) {
warn!("Setting worker thread priority not supported on this platform");
}
diff --git a/ballista/rust/scheduler/src/lib.rs b/ballista/rust/scheduler/src/lib.rs
index 2c202b50cd..257c12c390 100644
--- a/ballista/rust/scheduler/src/lib.rs
+++ b/ballista/rust/scheduler/src/lib.rs
@@ -227,7 +227,7 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> SchedulerServer<T
async fn fetch_tasks(
&self,
- available_executors: &mut Vec<ExecutorData>,
+ available_executors: &mut [ExecutorData],
job_id: &str,
) -> Result<(Vec<Vec<TaskDefinition>>, usize), BallistaError> {
let mut ret: Vec<Vec<TaskDefinition>> =
diff --git a/ballista/rust/scheduler/src/main.rs b/ballista/rust/scheduler/src/main.rs
index c9066027e3..cb37627201 100644
--- a/ballista/rust/scheduler/src/main.rs
+++ b/ballista/rust/scheduler/src/main.rs
@@ -106,7 +106,7 @@ async fn start_server(
),
};
- Ok(Server::bind(&addr)
+ Server::bind(&addr)
.serve(make_service_fn(move |request: &AddrStream| {
let scheduler_grpc_server =
SchedulerGrpcServer::new(scheduler_server.clone());
@@ -145,7 +145,7 @@ async fn start_server(
))
}))
.await
- .context("Could not start grpc server")?)
+ .context("Could not start grpc server")
}
#[tokio::main]
diff --git a/datafusion-physical-expr/src/tdigest/mod.rs b/datafusion-physical-expr/src/tdigest/mod.rs
index e0c5767b51..6c1b284c15 100644
--- a/datafusion-physical-expr/src/tdigest/mod.rs
+++ b/datafusion-physical-expr/src/tdigest/mod.rs
@@ -357,7 +357,7 @@ impl TDigest {
}
fn external_merge(
- centroids: &mut Vec<Centroid>,
+ centroids: &mut [Centroid],
first: usize,
middle: usize,
last: usize,
diff --git a/datafusion/src/datasource/file_format/parquet.rs b/datafusion/src/datasource/file_format/parquet.rs
index 4afb2f54c3..d1d26e2c6d 100644
--- a/datafusion/src/datasource/file_format/parquet.rs
+++ b/datafusion/src/datasource/file_format/parquet.rs
@@ -122,8 +122,8 @@ impl FileFormat for ParquetFormat {
}
fn summarize_min_max(
- max_values: &mut Vec<Option<MaxAccumulator>>,
- min_values: &mut Vec<Option<MinAccumulator>>,
+ max_values: &mut [Option<MaxAccumulator>],
+ min_values: &mut [Option<MinAccumulator>],
fields: &[Field],
i: usize,
stat: &ParquetStatistics,
diff --git a/datafusion/src/datasource/mod.rs b/datafusion/src/datasource/mod.rs
index 33512b40ce..9a7b17d1a8 100644
--- a/datafusion/src/datasource/mod.rs
+++ b/datafusion/src/datasource/mod.rs
@@ -177,8 +177,8 @@ fn create_max_min_accs(
fn get_col_stats(
schema: &Schema,
null_counts: Vec<usize>,
- max_values: &mut Vec<Option<MaxAccumulator>>,
- min_values: &mut Vec<Option<MinAccumulator>>,
+ max_values: &mut [Option<MaxAccumulator>],
+ min_values: &mut [Option<MinAccumulator>],
) -> Vec<ColumnStatistics> {
(0..schema.fields().len())
.map(|i| {
diff --git a/datafusion/src/logical_plan/extension.rs b/datafusion/src/logical_plan/extension.rs
index 43bf96ffb0..ee19ad43ec 100644
--- a/datafusion/src/logical_plan/extension.rs
+++ b/datafusion/src/logical_plan/extension.rs
@@ -71,6 +71,7 @@ pub trait UserDefinedLogicalNode: fmt::Debug {
/// of self.inputs and self.exprs.
///
/// So, `self.from_template(exprs, ..).expressions() == exprs
+ #[allow(clippy::wrong_self_convention)]
fn from_template(
&self,
exprs: &[Expr],
diff --git a/datafusion/src/physical_plan/hash_utils.rs b/datafusion/src/physical_plan/hash_utils.rs
index 27a5376cf7..00073a6592 100644
--- a/datafusion/src/physical_plan/hash_utils.rs
+++ b/datafusion/src/physical_plan/hash_utils.rs
@@ -42,7 +42,7 @@ fn combine_hashes(l: u64, r: u64) -> u64 {
fn hash_decimal128<'a>(
array: &ArrayRef,
random_state: &RandomState,
- hashes_buffer: &'a mut Vec<u64>,
+ hashes_buffer: &'a mut [u64],
mul_col: bool,
) {
let array = array.as_any().downcast_ref::<DecimalArray>().unwrap();
@@ -207,7 +207,7 @@ macro_rules! hash_array_float {
fn create_hashes_dictionary<K: ArrowDictionaryKeyType>(
array: &ArrayRef,
random_state: &RandomState,
- hashes_buffer: &mut Vec<u64>,
+ hashes_buffer: &mut [u64],
multi_col: bool,
) -> Result<()> {
let dict_array = array.as_any().downcast_ref::<DictionaryArray<K>>().unwrap();