From 288ea2f347677ddbbe13ade83b3c59de441c8e16 Mon Sep 17 00:00:00 2001 From: jackwener Date: Mon, 12 Sep 2022 22:57:35 +0800 Subject: [PATCH 1/2] minor: fix some typo. --- datafusion-examples/examples/memtable.rs | 10 ++++------ datafusion/core/src/dataframe.rs | 2 +- .../src/physical_optimizer/aggregate_statistics.rs | 4 ++-- datafusion/core/src/physical_optimizer/repartition.rs | 2 +- datafusion/core/src/physical_plan/sort_merge_join.rs | 2 +- datafusion/core/src/physical_plan/stream.rs | 2 +- datafusion/core/src/test_util.rs | 2 +- datafusion/expr/src/expr_visitor.rs | 2 +- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/datafusion-examples/examples/memtable.rs b/datafusion-examples/examples/memtable.rs index 11793a837f3a..bef8f3e5bb8f 100644 --- a/datafusion-examples/examples/memtable.rs +++ b/datafusion-examples/examples/memtable.rs @@ -59,13 +59,11 @@ fn create_record_batch() -> Result { let id_array = UInt8Array::from(vec![1]); let account_array = UInt64Array::from(vec![9000]); - Result::Ok( - RecordBatch::try_new( - get_schema(), - vec![Arc::new(id_array), Arc::new(account_array)], - ) - .unwrap(), + Ok(RecordBatch::try_new( + get_schema(), + vec![Arc::new(id_array), Arc::new(account_array)], ) + .unwrap()) } fn get_schema() -> SchemaRef { diff --git a/datafusion/core/src/dataframe.rs b/datafusion/core/src/dataframe.rs index ea90a9b81b4f..9be7138dca15 100644 --- a/datafusion/core/src/dataframe.rs +++ b/datafusion/core/src/dataframe.rs @@ -1109,7 +1109,7 @@ mod tests { table_name: &str, ) -> Result<()> { let schema = test_util::aggr_test_schema(); - let testdata = crate::test_util::arrow_test_data(); + let testdata = test_util::arrow_test_data(); ctx.register_csv( table_name, &format!("{}/csv/aggregate_test_100.csv", testdata), diff --git a/datafusion/core/src/physical_optimizer/aggregate_statistics.rs b/datafusion/core/src/physical_optimizer/aggregate_statistics.rs index 1237d4911294..4a941ec4bd44 100644 --- a/datafusion/core/src/physical_optimizer/aggregate_statistics.rs +++ b/datafusion/core/src/physical_optimizer/aggregate_statistics.rs @@ -101,11 +101,11 @@ impl PhysicalOptimizerRule for AggregateStatistics { } /// assert if the node passed as argument is a final `AggregateExec` node that can be optimized: -/// - its child (with posssible intermediate layers) is a partial `AggregateExec` node +/// - its child (with possible intermediate layers) is a partial `AggregateExec` node /// - they both have no grouping expression /// - the statistics are exact /// If this is the case, return a ref to the partial `AggregateExec`, else `None`. -/// We would have prefered to return a casted ref to AggregateExec but the recursion requires +/// We would have preferred to return a casted ref to AggregateExec but the recursion requires /// the `ExecutionPlan.children()` method that returns an owned reference. fn take_optimizable(node: &dyn ExecutionPlan) -> Option> { if let Some(final_agg_exec) = node.as_any().downcast_ref::() { diff --git a/datafusion/core/src/physical_optimizer/repartition.rs b/datafusion/core/src/physical_optimizer/repartition.rs index 52e36d8d5b14..20aa59f0cd67 100644 --- a/datafusion/core/src/physical_optimizer/repartition.rs +++ b/datafusion/core/src/physical_optimizer/repartition.rs @@ -62,7 +62,7 @@ use crate::{error::Result, execution::context::SessionConfig}; /// ``` /// /// This optimizer will attempt to add a `RepartitionExec` to increase -/// the parallism (to 3 in this case) +/// the parallelism (to 3 in this case) /// /// ```text /// ┌─────────────────────────────────┐ diff --git a/datafusion/core/src/physical_plan/sort_merge_join.rs b/datafusion/core/src/physical_plan/sort_merge_join.rs index d84ea9a52a45..f11bbe9fe69d 100644 --- a/datafusion/core/src/physical_plan/sort_merge_join.rs +++ b/datafusion/core/src/physical_plan/sort_merge_join.rs @@ -1042,7 +1042,7 @@ fn compare_join_arrays( null_equals_null: bool, ) -> ArrowResult { let mut res = Ordering::Equal; - for ((left_array, right_array), sort_options) in + for ((left_array, _right_array), _sort_options) in left_arrays.iter().zip(right_arrays).zip(sort_options) { macro_rules! compare_value { diff --git a/datafusion/core/src/physical_plan/stream.rs b/datafusion/core/src/physical_plan/stream.rs index 06d670ff45ec..77be217e4cfa 100644 --- a/datafusion/core/src/physical_plan/stream.rs +++ b/datafusion/core/src/physical_plan/stream.rs @@ -42,7 +42,7 @@ pub struct RecordBatchReceiverStream { impl RecordBatchReceiverStream { /// Construct a new [`RecordBatchReceiverStream`] which will send - /// batches of the specfied schema from `inner` + /// batches of the specified schema from `inner` pub fn create( schema: &SchemaRef, rx: tokio::sync::mpsc::Receiver>, diff --git a/datafusion/core/src/test_util.rs b/datafusion/core/src/test_util.rs index ee53a424c82e..ad27ea3c1aaf 100644 --- a/datafusion/core/src/test_util.rs +++ b/datafusion/core/src/test_util.rs @@ -167,7 +167,7 @@ pub fn arrow_test_data() -> String { /// Returns the parquet test data directory, which is by default /// stored in a git submodule rooted at -/// `parquest-testing/data`. +/// `parquet-testing/data`. /// /// The default can be overridden by the optional environment variable /// `PARQUET_TEST_DATA` diff --git a/datafusion/expr/src/expr_visitor.rs b/datafusion/expr/src/expr_visitor.rs index 0eea32b51544..0f2f5077a9a9 100644 --- a/datafusion/expr/src/expr_visitor.rs +++ b/datafusion/expr/src/expr_visitor.rs @@ -34,7 +34,7 @@ pub enum Recursion { /// recursively on all nodes of an expression tree. See the comments /// on `Expr::accept` for details on its use pub trait ExpressionVisitor: Sized { - /// Invoked before any children of `expr` are visisted. + /// Invoked before any children of `expr` are visited. fn pre_visit(self, expr: &E) -> Result> where Self: ExpressionVisitor; From 79773ec49c79b19df7b5d24731f38f4eef48197f Mon Sep 17 00:00:00 2001 From: jackwener Date: Mon, 12 Sep 2022 23:10:35 +0800 Subject: [PATCH 2/2] minor: fix some typo. --- datafusion/core/src/physical_plan/sort_merge_join.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/core/src/physical_plan/sort_merge_join.rs b/datafusion/core/src/physical_plan/sort_merge_join.rs index f11bbe9fe69d..d84ea9a52a45 100644 --- a/datafusion/core/src/physical_plan/sort_merge_join.rs +++ b/datafusion/core/src/physical_plan/sort_merge_join.rs @@ -1042,7 +1042,7 @@ fn compare_join_arrays( null_equals_null: bool, ) -> ArrowResult { let mut res = Ordering::Equal; - for ((left_array, _right_array), _sort_options) in + for ((left_array, right_array), sort_options) in left_arrays.iter().zip(right_arrays).zip(sort_options) { macro_rules! compare_value {