Skip to content

Apache DataFusion SQL Query Engine

ARROW-10382: [Rust] Fix typos

Kazuaki Ishizaki9ea074086512
diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rs
index f2a356925d..308623c866 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 e1bf5fdb1e..b3004f23da 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 9eba91fdff..02d950ac7b 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 52226c98a8..728dd81538 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 08c7b8c15f..032444549c 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 ebcee18969..db9ff7f0a6 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 5bf4525171..9eceb768a3 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 7db7eec516..ad8e618ad5 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(),