Apache DataFusion SQL Query Engine
Fix typos in datafusion-examples/datafusion-cli/docs (#11259)
张林伟2f02c43b6283
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.ymlindex ce4b4b06cf..2ddeebbc55 100644--- a/.github/workflows/rust.yml+++ b/.github/workflows/rust.yml@@ -581,4 +581,4 @@ jobs:run: cargo msrv verify- name: Check datafusion-cliworking-directory: datafusion-cli- run: cargo msrv verify+ run: cargo msrv verify\ No newline at end of filediff --git a/datafusion-cli/src/helper.rs b/datafusion-cli/src/helper.rsindex f93aaec421..9b1f2aa125 100644--- a/datafusion-cli/src/helper.rs+++ b/datafusion-cli/src/helper.rs@@ -252,7 +252,7 @@ mod tests {fn unescape_readline_input() -> Result<()> {let validator = CliHelper::default();- // shoule be valid+ // should be validlet result = readline_direct(Cursor::new(r"create external table test stored as csv location 'data.csv' options ('format.delimiter' ',');"@@ -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 dialectlet result =readline_direct(Cursor::new(r"select 1 # 2;".as_bytes()), &validator)?;assert!(diff --git a/datafusion-examples/examples/advanced_udaf.rs b/datafusion-examples/examples/advanced_udaf.rsindex 48da09a512..1259f90d64 100644--- a/datafusion-examples/examples/advanced_udaf.rs+++ b/datafusion-examples/examples/advanced_udaf.rs@@ -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 statefn 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);diff --git a/datafusion-examples/examples/advanced_udwf.rs b/datafusion-examples/examples/advanced_udwf.rsindex 41c6381df5..11fb6f6ccc 100644--- a/datafusion-examples/examples/advanced_udwf.rs+++ b/datafusion-examples/examples/advanced_udwf.rs@@ -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()))diff --git a/datafusion-examples/examples/catalog.rs b/datafusion-examples/examples/catalog.rsindex 5bc2cadac1..b9188e1cd5 100644--- a/datafusion-examples/examples/catalog.rs+++ b/datafusion-examples/examples/catalog.rs@@ -83,7 +83,7 @@ async fn main() -> Result<()> {// register our catalog in the contextctx.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 defaultlet catalogs = catlist.catalogs.read().unwrap();assert!(catalogs.contains_key("dircat"));};diff --git a/datafusion-examples/examples/expr_api.rs b/datafusion-examples/examples/expr_api.rsindex 36ce3badcb..43729a913e 100644--- a/datafusion-examples/examples/expr_api.rs+++ b/datafusion-examples/examples/expr_api.rs@@ -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`]diff --git a/datafusion-examples/examples/parse_sql_expr.rs b/datafusion-examples/examples/parse_sql_expr.rsindex 6444eb68b6..a1fc5d269a 100644--- a/datafusion-examples/examples/parse_sql_expr.rs+++ b/datafusion-examples/examples/parse_sql_expr.rs@@ -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))?;diff --git a/datafusion-examples/examples/simple_udwf.rs b/datafusion-examples/examples/simple_udwf.rsindex 95339eff1c..563f02cee6 100644--- a/datafusion-examples/examples/simple_udwf.rs+++ b/datafusion-examples/examples/simple_udwf.rs@@ -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()))diff --git a/datafusion-examples/examples/sql_analysis.rs b/datafusion-examples/examples/sql_analysis.rsindex 3995988751..9a2aabaa79 100644--- a/datafusion-examples/examples/sql_analysis.rs+++ b/datafusion-examples/examples/sql_analysis.rs@@ -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 inputsif matches!(node, LogicalPlan::Join(_) | LogicalPlan::CrossJoin(_)) {let (group_count, inputs) = count_tree(node);diff --git a/docs/source/contributor-guide/inviting.md b/docs/source/contributor-guide/inviting.mdindex be189b95f6..967f417e6e 100644--- a/docs/source/contributor-guide/inviting.md+++ b/docs/source/contributor-guide/inviting.md@@ -294,7 +294,7 @@ Subject: [DISCUSS] $NEW_PMC_MEMBER for PMCI 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 astrong and sustained contribution record for more than a year, and focused onhelping the community and the project grow[3].diff --git a/docs/source/library-user-guide/adding-udfs.md b/docs/source/library-user-guide/adding-udfs.mdindex f805f0a992..fe3990b90c 100644--- a/docs/source/library-user-guide/adding-udfs.md+++ b/docs/source/library-user-guide/adding-udfs.md@@ -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()))@@ -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`].```rustdiff --git a/docs/source/user-guide/example-usage.md b/docs/source/user-guide/example-usage.mdindex 62f09a6a99..7dbd4045e7 100644--- a/docs/source/user-guide/example-usage.md+++ b/docs/source/user-guide/example-usage.md@@ -264,8 +264,8 @@ Set environment [variables](https://doc.rust-lang.org/std/backtrace/index.html#e```bashRUST_BACKTRACE=1 ./target/debug/datafusion-cliDataFusion 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@@ -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?;