Skip to content

Commit

Permalink
Fix typos in datafusion-examples/datafusion-cli/docs (#11259)
Browse files Browse the repository at this point in the history
* Add typos check in ci workflow

* typos.toml

* exclude more

* typos autofix

* remove typos ci
  • Loading branch information
lewiszlw committed Jul 8, 2024
1 parent c254b8b commit 2f02c43
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,4 +581,4 @@ jobs:
run: cargo msrv verify
- name: Check datafusion-cli
working-directory: datafusion-cli
run: cargo msrv verify
run: cargo msrv verify
4 changes: 2 additions & 2 deletions datafusion-cli/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ mod tests {
fn unescape_readline_input() -> Result<()> {
let validator = CliHelper::default();

// shoule be valid
// should be valid
let result = readline_direct(
Cursor::new(
r"create external table test stored as csv location 'data.csv' options ('format.delimiter' ',');"
Expand Down Expand Up @@ -326,7 +326,7 @@ mod tests {
fn sql_dialect() -> Result<()> {
let mut validator = CliHelper::default();

// shoule be invalid in generic dialect
// should be invalid in generic dialect
let result =
readline_direct(Cursor::new(r"select 1 # 2;".as_bytes()), &validator)?;
assert!(
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/advanced_udaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ impl GroupsAccumulator for GeometricMeanGroupsAccumulator {
Ok(())
}

/// Generate output, as specififed by `emit_to` and update the intermediate state
/// Generate output, as specified by `emit_to` and update the intermediate state
fn evaluate(&mut self, emit_to: datafusion_expr::EmitTo) -> Result<ArrayRef> {
let counts = emit_to.take_needed(&mut self.counts);
let prods = emit_to.take_needed(&mut self.prods);
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/advanced_udwf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl WindowUDFImpl for SmoothItUdf {
Ok(DataType::Float64)
}

/// Create a `PartitionEvalutor` to evaluate this function on a new
/// Create a `PartitionEvaluator` to evaluate this function on a new
/// partition.
fn partition_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>> {
Ok(Box::new(MyPartitionEvaluator::new()))
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async fn main() -> Result<()> {
// register our catalog in the context
ctx.register_catalog("dircat", Arc::new(catalog));
{
// catalog was passed down into our custom catalog list since we overide the ctx's default
// catalog was passed down into our custom catalog list since we override the ctx's default
let catalogs = catlist.catalogs.read().unwrap();
assert!(catalogs.contains_key("dircat"));
};
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/expr_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use datafusion_expr::{AggregateExt, ColumnarValue, ExprSchemable, Operator};
///
/// The code in this example shows how to:
/// 1. Create [`Expr`]s using different APIs: [`main`]`
/// 2. Use the fluent API to easly create complex [`Expr`]s: [`expr_fn_demo`]
/// 2. Use the fluent API to easily create complex [`Expr`]s: [`expr_fn_demo`]
/// 3. Evaluate [`Expr`]s against data: [`evaluate_demo`]
/// 4. Simplify expressions: [`simplify_demo`]
/// 5. Analyze predicates for boundary ranges: [`range_analysis_demo`]
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/parse_sql_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async fn query_parquet_demo() -> Result<()> {
vec![df.parse_sql_expr("SUM(int_col) as sum_int_col")?],
)?
// Directly parsing the SQL text into a sort expression is not supported yet, so
// construct it programatically
// construct it programmatically
.sort(vec![col("double_col").sort(false, false)])?
.limit(0, Some(1))?;

Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/simple_udwf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async fn main() -> Result<()> {
Ok(())
}

/// Create a `PartitionEvalutor` to evaluate this function on a new
/// Create a `PartitionEvaluator` to evaluate this function on a new
/// partition.
fn make_partition_evaluator() -> Result<Box<dyn PartitionEvaluator>> {
Ok(Box::new(MyPartitionEvaluator::new()))
Expand Down
2 changes: 1 addition & 1 deletion datafusion-examples/examples/sql_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn count_trees(plan: &LogicalPlan) -> (usize, Vec<usize>) {
let mut groups = vec![];

while let Some(node) = to_visit.pop() {
// if we encouter a join, we know were at the root of the tree
// if we encounter a join, we know were at the root of the tree
// count this tree and recurse on it's inputs
if matches!(node, LogicalPlan::Join(_) | LogicalPlan::CrossJoin(_)) {
let (group_count, inputs) = count_tree(node);
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributor-guide/inviting.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Subject: [DISCUSS] $NEW_PMC_MEMBER for PMC
I would like to propose adding $NEW_PMC_MEMBER[1] to the DataFusion PMC.
$NEW_PMC_MEMBMER has been a committer since $COMMITER_MONTH [2], has a
$NEW_PMC_MEMBMER has been a committer since $COMMITTER_MONTH [2], has a
strong and sustained contribution record for more than a year, and focused on
helping the community and the project grow[3].
Expand Down
4 changes: 2 additions & 2 deletions docs/source/library-user-guide/adding-udfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl PartitionEvaluator for MyPartitionEvaluator {
}
}

/// Create a `PartitionEvalutor` to evaluate this function on a new
/// Create a `PartitionEvaluator` to evaluate this function on a new
/// partition.
fn make_partition_evaluator() -> Result<Box<dyn PartitionEvaluator>> {
Ok(Box::new(MyPartitionEvaluator::new()))
Expand Down Expand Up @@ -474,7 +474,7 @@ impl Accumulator for GeometricMean {

### registering an Aggregate UDF

To register a Aggreate UDF, you need to wrap the function implementation in a [`AggregateUDF`] struct and then register it with the `SessionContext`. DataFusion provides the [`create_udaf`] helper functions to make this easier.
To register a Aggregate UDF, you need to wrap the function implementation in a [`AggregateUDF`] struct and then register it with the `SessionContext`. DataFusion provides the [`create_udaf`] helper functions to make this easier.
There is a lower level API with more functionality but is more complex, that is documented in [`advanced_udaf.rs`].

```rust
Expand Down
6 changes: 3 additions & 3 deletions docs/source/user-guide/example-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ Set environment [variables](https://doc.rust-lang.org/std/backtrace/index.html#e
```bash
RUST_BACKTRACE=1 ./target/debug/datafusion-cli
DataFusion CLI v31.0.0
> select row_numer() over (partition by a order by a) from (select 1 a);
Error during planning: Invalid function 'row_numer'.
> select row_number() over (partition by a order by a) from (select 1 a);
Error during planning: Invalid function 'row_number'.
Did you mean 'ROW_NUMBER'?

backtrace: 0: std::backtrace_rs::backtrace::libunwind::trace
Expand All @@ -290,7 +290,7 @@ async fn test_get_backtrace_for_failed_code() -> Result<()> {
let ctx = SessionContext::new();

let sql = "
select row_numer() over (partition by a order by a) from (select 1 a);
select row_number() over (partition by a order by a) from (select 1 a);
";

let _ = ctx.sql(sql).await?.collect().await?;
Expand Down

0 comments on commit 2f02c43

Please sign in to comment.