Skip to content

Commit

Permalink
Remove outdated rewrite_expr.rs example (#11085)
Browse files Browse the repository at this point in the history
* Remove outdated rewrite_expr.rs example

* Update docs
  • Loading branch information
alamb committed Jul 5, 2024
1 parent b46d5b7 commit 351e5f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 255 deletions.
1 change: 0 additions & 1 deletion datafusion-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ cargo run --example dataframe
- [`query-aws-s3.rs`](examples/external_dependency/query-aws-s3.rs): Configure `object_store` and run a query against files stored in AWS S3
- [`query-http-csv.rs`](examples/query-http-csv.rs): Configure `object_store` and run a query against files vi HTTP
- [`regexp.rs`](examples/regexp.rs): Examples of using regular expression functions
- [`rewrite_expr.rs`](examples/rewrite_expr.rs): Define and invoke a custom Query Optimizer pass
- [`simple_udaf.rs`](examples/simple_udaf.rs): Define and invoke a User Defined Aggregate Function (UDAF)
- [`simple_udf.rs`](examples/simple_udf.rs): Define and invoke a User Defined Scalar Function (UDF)
- [`simple_udfw.rs`](examples/simple_udwf.rs): Define and invoke a User Defined Window Function (UDWF)
Expand Down
251 changes: 0 additions & 251 deletions datafusion-examples/examples/rewrite_expr.rs

This file was deleted.

6 changes: 4 additions & 2 deletions datafusion/optimizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ let optimizer = Optimizer::with_rules(vec![

## Writing Optimization Rules

Please refer to the [rewrite_expr example](../../datafusion-examples/examples/rewrite_expr.rs) to learn more about
the general approach to writing optimizer rules and then move onto studying the existing rules.
Please refer to the
[optimizer_rule.rs](../../datafusion-examples/examples/optimizer_rule.rs)
example to learn more about the general approach to writing optimizer rules and
then move onto studying the existing rules.

All rules must implement the `OptimizerRule` trait.

Expand Down
6 changes: 5 additions & 1 deletion docs/source/library-user-guide/working-with-exprs.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ If you'd like to learn more about `Expr`s, before we get into the details of cre

## Rewriting `Expr`s

[rewrite_expr.rs](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/rewrite_expr.rs) contains example code for rewriting `Expr`s.
There are several examples of rewriting and working with `Exprs`:

- [expr_api.rs](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/expr_api.rs)
- [analyzer_rule.rs](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/analyzer_rule.rs)
- [optimizer_rule.rs](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/optimizer_rule.rs)

Rewriting Expressions is the process of taking an `Expr` and transforming it into another `Expr`. This is useful for a number of reasons, including:

Expand Down

0 comments on commit 351e5f9

Please sign in to comment.