Skip to content

Commit

Permalink
Fixed small typos in files of the optimizer (#5356)
Browse files Browse the repository at this point in the history
* Fixed small typos in files of the optimizer

* Cleaned up the sentence in the file "simplify_expressions/expr_simplifier.rs"

* Found more typos in the file "src/utils.rs"

* Deleted the duplicate in the file "src/unwrap_cast_in_comparison.rs"
  • Loading branch information
izveigor committed Feb 24, 2023
1 parent cef119d commit d6ef463
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion datafusion/optimizer/src/eliminate_cross_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl EliminateCrossJoin {
}
}

/// Attempt to reorder join tp eliminate cross joins to inner joins.
/// Attempt to reorder join to eliminate cross joins to inner joins.
/// for queries:
/// 'select ... from a, b where a.x = b.y and b.xx = 100;'
/// 'select ... from a, b where (a.x = b.y and b.xx = 100) or (a.x = b.y and b.xx = 200);'
Expand Down
4 changes: 2 additions & 2 deletions datafusion/optimizer/src/eliminate_outer_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use std::sync::Arc;
/// Attempt to replace outer joins with inner joins.
///
/// Outer joins are typically more expensive to compute at runtime
/// than inner joins and prevent various forms fo predicate pushdown
/// than inner joins and prevent various forms of predicate pushdown
/// and other optimizations, so removing them if possible is beneficial.
///
/// Inner joins filter out rows that do match. Outer joins pass rows
Expand All @@ -44,7 +44,7 @@ use std::sync::Arc;
/// For example, in the `select ... from a left join b on ... where b.xx = 100;`
///
/// For rows when `b.xx` is null (as it would be after an outer join),
/// the `b.xx = 100` predicate filters them out and there there is no
/// the `b.xx = 100` predicate filters them out and there is no
/// need to produce null rows for output.
///
/// Generally, an outer join can be rewritten to inner join if the
Expand Down
2 changes: 1 addition & 1 deletion datafusion/optimizer/src/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub trait OptimizerRule {

/// How should the rule be applied by the optimizer? See comments on [`ApplyOrder`] for details.
///
/// If a rule use default None, its should traverse recursively plan inside itself
/// If a rule use default None, it should traverse recursively plan inside itself
fn apply_order(&self) -> Option<ApplyOrder> {
None
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct ConstEvaluator<'a> {
/// traversal when we are N levels deep in the tree, one entry for
/// this Expr and each of its parents.
///
/// After visiting all siblings if `can_evauate.top()`` is true, that
/// After visiting all siblings if `can_evaluate.top()` is true, that
/// means there were no non evaluatable siblings (or their
/// descendants) so this `Expr` can be evaluated
can_evaluate: Vec<bool>,
Expand Down
2 changes: 1 addition & 1 deletion datafusion/optimizer/src/unwrap_cast_in_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use std::sync::Arc;
/// 4. `literal_expr IN (cast(expr1) , cast(expr2), ...)`
///
/// If the expression matches one of the forms above, the rule will
/// ensure the value of `literal` is in within range(min, max) of the
/// ensure the value of `literal` is in range(min, max) of the
/// expr's data_type, and if the scalar is within range, the literal
/// will be casted to the data type of expr on the other side, and the
/// cast will be removed from the other side.
Expand Down
4 changes: 2 additions & 2 deletions datafusion/optimizer/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ pub fn only_or_err<T>(slice: &[T]) -> Result<&T> {
/// Rewrites `expr` using `rewriter`, ensuring that the output has the
/// same name as `expr` prior to rewrite, adding an alias if necessary.
///
/// This is important when optimizing plans to ensure the the output
/// This is important when optimizing plans to ensure the output
/// schema of plan nodes don't change after optimization
pub fn rewrite_preserving_name<R>(expr: Expr, rewriter: &mut R) -> Result<Expr>
where
Expand All @@ -436,7 +436,7 @@ fn name_for_alias(expr: &Expr) -> Result<String> {
}
}

/// Ensure `expr` has the name name as `original_name` by adding an
/// Ensure `expr` has the name as `original_name` by adding an
/// alias if necessary.
fn add_alias_if_changed(original_name: String, expr: Expr) -> Result<Expr> {
let new_name = name_for_alias(&expr)?;
Expand Down

0 comments on commit d6ef463

Please sign in to comment.