This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 221de70  ARROW-10382: [Rust] Fix typos
221de70 is described below

commit 221de706aa0cee65ea902ffe161752b724117d47
Author: Kazuaki Ishizaki <[email protected]>
AuthorDate: Sun Oct 25 03:50:05 2020 +0900

    ARROW-10382: [Rust] Fix typos
    
    This PR fixes typos in files under `rust` directory.
    
    Closes #8518 from kiszk/ARROW-10382
    
    Authored-by: Kazuaki Ishizaki <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 rust/arrow-flight/src/utils.rs                            | 2 +-
 rust/arrow/examples/tensor_builder.rs                     | 2 +-
 rust/arrow/src/compute/kernels/cast.rs                    | 4 ++--
 rust/arrow/src/lib.rs                                     | 2 +-
 rust/arrow/src/tensor.rs                                  | 2 +-
 rust/datafusion/src/execution/context.rs                  | 2 +-
 rust/datafusion/src/logical_plan/mod.rs                   | 4 ++--
 rust/datafusion/src/physical_plan/datetime_expressions.rs | 4 ++--
 rust/datafusion/src/physical_plan/type_coercion.rs        | 2 +-
 rust/datafusion/src/sql/parser.rs                         | 2 +-
 rust/datafusion/src/variable/mod.rs                       | 2 +-
 rust/datafusion/tests/sql.rs                              | 2 +-
 rust/datafusion/tests/user_defined_plan.rs                | 4 ++--
 13 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/rust/arrow-flight/src/utils.rs b/rust/arrow-flight/src/utils.rs
index fcc5847..ee19f34 100644
--- a/rust/arrow-flight/src/utils.rs
+++ b/rust/arrow-flight/src/utils.rs
@@ -154,4 +154,4 @@ pub fn flight_data_to_arrow_batch(
         )
 }
 
-// TODO: add more explicit conversion that expoess flight descriptor and 
metadata options
+// TODO: add more explicit conversion that exposes flight descriptor and 
metadata options
diff --git a/rust/arrow/examples/tensor_builder.rs 
b/rust/arrow/examples/tensor_builder.rs
index b262473..1942171 100644
--- a/rust/arrow/examples/tensor_builder.rs
+++ b/rust/arrow/examples/tensor_builder.rs
@@ -57,7 +57,7 @@ fn main() -> Result<()> {
     println!("{:?}", tensor);
 
     // In order to build a tensor from an array the function to_byte_slice add 
the
-    // required padding to the elements in the the array.
+    // required padding to the elements in the array.
     let buf = Buffer::from(&[0, 1, 2, 3, 4, 5, 6, 7, 9, 10].to_byte_slice());
     let tensor = Int32Tensor::try_new(buf, Some(vec![2, 5]), None, None)?;
     println!("\nInt32 Tensor");
diff --git a/rust/arrow/src/compute/kernels/cast.rs 
b/rust/arrow/src/compute/kernels/cast.rs
index 0b6e172..4e1bc85 100644
--- a/rust/arrow/src/compute/kernels/cast.rs
+++ b/rust/arrow/src/compute/kernels/cast.rs
@@ -1049,7 +1049,7 @@ where
     // use the take kernel to expand out the dictionary
     let cast_dict_values = cast(&dict_array.values(), to_type)?;
 
-    // Note take requires first casting the indicies to u32
+    // Note take requires first casting the indices to u32
     let keys_array: ArrayRef = Arc::new(dict_array.keys_array());
     let indicies = cast(&keys_array, &DataType::UInt32)?;
     let u32_indicies =
@@ -1058,7 +1058,7 @@ where
             .downcast_ref::<UInt32Array>()
             .ok_or_else(|| {
                 ArrowError::ComputeError(
-                    "Internal Error: Cannot cast dict indicies to 
UInt32".to_string(),
+                    "Internal Error: Cannot cast dict indices to 
UInt32".to_string(),
                 )
             })?;
 
diff --git a/rust/arrow/src/lib.rs b/rust/arrow/src/lib.rs
index 6e3eea5..09c04be 100644
--- a/rust/arrow/src/lib.rs
+++ b/rust/arrow/src/lib.rs
@@ -52,7 +52,7 @@
 //! # let array = UInt32Array::from(vec![Some(1), None, Some(3)]);
 //! let array: ArrayRef = Arc::new(array);
 //! assert_eq!(array.len(), 3);
-//! // array.value() is not available in the dynamcally-typed version
+//! // array.value() is not available in the dynamically-typed version
 //! assert_eq!(array.is_null(1), true);
 //! assert_eq!(array.data_type(), &DataType::UInt32);
 //! ```
diff --git a/rust/arrow/src/tensor.rs b/rust/arrow/src/tensor.rs
index c377636..92c5cfe 100644
--- a/rust/arrow/src/tensor.rs
+++ b/rust/arrow/src/tensor.rs
@@ -147,7 +147,7 @@ impl<'a, T: ArrowPrimitiveType> Tensor<'a, T> {
                 let total_elements: usize = s.iter().product();
                 if total_elements != (buffer.len() / 
mem::size_of::<T::Native>()) {
                     return Err(ArrowError::InvalidArgumentError(
-                        "number of elements in buffer does not match dimensios"
+                        "number of elements in buffer does not match 
dimensions"
                             .to_string(),
                     ));
                 }
diff --git a/rust/datafusion/src/execution/context.rs 
b/rust/datafusion/src/execution/context.rs
index f2a3569..308623c 100644
--- a/rust/datafusion/src/execution/context.rs
+++ b/rust/datafusion/src/execution/context.rs
@@ -381,7 +381,7 @@ impl From<ExecutionContextState> for ExecutionContext {
     }
 }
 
-/// A planner used to add extensions to DataFusion logical and phusical plans.
+/// A planner used to add extensions to DataFusion logical and physical plans.
 pub trait QueryPlanner {
     /// Given a `LogicalPlan`, create a new, modified `LogicalPlan`
     /// plan. This method is run after built in `OptimizerRule`s. By
diff --git a/rust/datafusion/src/logical_plan/mod.rs 
b/rust/datafusion/src/logical_plan/mod.rs
index e1bf5fd..b3004f2 100644
--- a/rust/datafusion/src/logical_plan/mod.rs
+++ b/rust/datafusion/src/logical_plan/mod.rs
@@ -710,12 +710,12 @@ impl fmt::Debug for Expr {
 ///
 /// See the example in
 /// [user_defined_plan.rs](../../tests/user_defined_plan.rs) for an
-/// example of how to use this extenison API
+/// example of how to use this extension API
 pub trait UserDefinedLogicalNode: Debug {
     /// Return a reference to self as Any, to support dynamic downcasting
     fn as_any(&self) -> &dyn Any;
 
-    /// Return the the logical plan's inputs
+    /// Return the logical plan's inputs
     fn inputs(&self) -> Vec<&LogicalPlan>;
 
     /// Return the output schema of this logical plan node
diff --git a/rust/datafusion/src/physical_plan/datetime_expressions.rs 
b/rust/datafusion/src/physical_plan/datetime_expressions.rs
index 9eba91f..02d950a 100644
--- a/rust/datafusion/src/physical_plan/datetime_expressions.rs
+++ b/rust/datafusion/src/physical_plan/datetime_expressions.rs
@@ -34,7 +34,7 @@ use chrono::{prelude::*, LocalResult};
 /// Implements the `to_timestamp` function to convert a string to a
 /// timestamp, following the model of spark SQL’s to_`timestamp`.
 ///
-/// In addition to RFC3339 / ISO8601 standard tiemstamps, it also
+/// In addition to RFC3339 / ISO8601 standard timestamps, it also
 /// accepts strings that use a space ` ` to separate the date and time
 /// as well as strings that have no explicit timezone offset.
 ///
@@ -96,7 +96,7 @@ fn string_to_timestamp_nanos(s: &str) -> Result<i64> {
         return Ok(ts.timestamp_nanos());
     }
 
-    // with an explict Z, using ' ' as a separator
+    // with an explicit Z, using ' ' as a separator
     // Example: 2020-09-08 13:42:29Z
     if let Ok(ts) = Utc.datetime_from_str(s, "%Y-%m-%d %H:%M:%S%.fZ") {
         return Ok(ts.timestamp_nanos());
diff --git a/rust/datafusion/src/physical_plan/type_coercion.rs 
b/rust/datafusion/src/physical_plan/type_coercion.rs
index 52226c9..728dd81 100644
--- a/rust/datafusion/src/physical_plan/type_coercion.rs
+++ b/rust/datafusion/src/physical_plan/type_coercion.rs
@@ -19,7 +19,7 @@
 //!
 //! Coercion is performed automatically by DataFusion when the types
 //! of arguments passed to a function do not exacty match the types
-//! required by that function. In this case, DataFuson will attempt to
+//! required by that function. In this case, DataFusion will attempt to
 //! *coerce* the arguments to types accepted by the function by
 //! inserting CAST operations.
 //!
diff --git a/rust/datafusion/src/sql/parser.rs 
b/rust/datafusion/src/sql/parser.rs
index 08c7b8c..0324445 100644
--- a/rust/datafusion/src/sql/parser.rs
+++ b/rust/datafusion/src/sql/parser.rs
@@ -64,7 +64,7 @@ pub struct CreateExternalTable {
 pub struct ExplainPlan {
     /// If true, dumps more intermediate plans and results of optimizaton 
passes
     pub verbose: bool,
-    /// The statement for which to generate an planning explination
+    /// The statement for which to generate an planning explanation
     pub statement: Box<Statement>,
 }
 
diff --git a/rust/datafusion/src/variable/mod.rs 
b/rust/datafusion/src/variable/mod.rs
index ebcee18..db9ff7f 100644
--- a/rust/datafusion/src/variable/mod.rs
+++ b/rust/datafusion/src/variable/mod.rs
@@ -20,7 +20,7 @@
 use crate::error::Result;
 use crate::scalar::ScalarValue;
 
-/// Variable type, system/user defiend
+/// Variable type, system/user defined
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub enum VarType {
     /// System variable, like @@version
diff --git a/rust/datafusion/tests/sql.rs b/rust/datafusion/tests/sql.rs
index 5bf4525..9eceb76 100644
--- a/rust/datafusion/tests/sql.rs
+++ b/rust/datafusion/tests/sql.rs
@@ -268,7 +268,7 @@ async fn csv_query_custom_udf_with_cast() -> Result<()> {
     Ok(())
 }
 
-/// sqrt(f32) is sligthly different than sqrt(CAST(f32 AS double)))
+/// sqrt(f32) is slightly different than sqrt(CAST(f32 AS double)))
 #[tokio::test]
 async fn sqrt_f32_vs_f64() -> Result<()> {
     let mut ctx = create_ctx()?;
diff --git a/rust/datafusion/tests/user_defined_plan.rs 
b/rust/datafusion/tests/user_defined_plan.rs
index 7db7eec..ad8e618 100644
--- a/rust/datafusion/tests/user_defined_plan.rs
+++ b/rust/datafusion/tests/user_defined_plan.rs
@@ -306,8 +306,8 @@ impl UserDefinedLogicalNode for TopKPlanNode {
         exprs: &Vec<Expr>,
         inputs: &Vec<LogicalPlan>,
     ) -> Arc<dyn UserDefinedLogicalNode + Send + Sync> {
-        assert_eq!(inputs.len(), 1, "input size inconistent");
-        assert_eq!(exprs.len(), 1, "expression size inconistent");
+        assert_eq!(inputs.len(), 1, "input size inconsistent");
+        assert_eq!(exprs.len(), 1, "expression size inconsistent");
         Arc::new(TopKPlanNode {
             k: self.k,
             input: inputs[0].clone(),

Reply via email to