This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-22320-b2a5663624c91d17bdbc9d9bb1b680701f03134d in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit fe0d903f938d801862c81ec8c538c0f8767cdd6f Author: Justin O'Dwyer <[email protected]> AuthorDate: Tue May 19 16:01:20 2026 -0400 docs(optimizer): Fix PushDownFilter doc typos. (#22320) ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - N/A, simple doc typos I discovered. These changes should make the `PushDownFilter` optimizer rule documentation a little clearer. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> --- datafusion/optimizer/src/push_down_filter.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/datafusion/optimizer/src/push_down_filter.rs b/datafusion/optimizer/src/push_down_filter.rs index 3564db1ebe..1dd1076bb0 100644 --- a/datafusion/optimizer/src/push_down_filter.rs +++ b/datafusion/optimizer/src/push_down_filter.rs @@ -66,7 +66,7 @@ use datafusion_expr::ExpressionPlacement; /// Sort (a, b) /// ``` /// -/// A better plan is to filter the data *before* the Sort, which sorts fewer +/// A better plan is to filter the data *before* the Sort, which sorts fewer /// rows and therefore does less work overall: /// /// ```text @@ -80,7 +80,7 @@ use datafusion_expr::ExpressionPlacement; /// different result. /// /// ```text -/// Filter (a > 10) <-- can not move this Filter before the limit +/// Filter (a > 10) <-- cannot move this Filter before the limit /// Limit (fetch=3) /// Sort (a, b) /// ``` @@ -90,46 +90,46 @@ use datafusion_expr::ExpressionPlacement; /// satisfies `filter(op(data)) = op(filter(data))`. /// /// The filter-commutative property is plan and column-specific. A filter on `a` -/// can be pushed through a `Aggregate(group_by = [a], agg=[sum(b))`. However, a -/// filter on `sum(b)` can not be pushed through the same aggregate. +/// can be pushed through a `Aggregate(group_by = [a], agg=[sum(b)])`. However, a +/// filter on `sum(b)` cannot be pushed through the same aggregate. /// /// # Handling Conjunctions /// -/// It is possible to only push down **part** of a filter expression if is +/// It is possible to only push down **part** of a filter expression if it is /// connected with `AND`s (more formally if it is a "conjunction"). /// /// For example, given the following plan: /// /// ```text /// Filter(a > 10 AND sum(b) < 5) -/// Aggregate(group_by = [a], agg = [sum(b)) +/// Aggregate(group_by = [a], agg = [sum(b)]) /// ``` /// -/// The `a > 10` is commutative with the `Aggregate` but `sum(b) < 5` is not. -/// Therefore it is possible to only push part of the expression, resulting in: +/// The `a > 10` is commutative with the `Aggregate` but `sum(b) < 5` is not. +/// Therefore it is possible to only push down part of the expression, resulting in: /// /// ```text /// Filter(sum(b) < 5) -/// Aggregate(group_by = [a], agg = [sum(b)) +/// Aggregate(group_by = [a], agg = [sum(b)]) /// Filter(a > 10) /// ``` /// /// # Handling Column Aliases /// -/// This optimizer must sometimes handle re-writing filter expressions when they -/// pushed, for example if there is a projection that aliases `a+1` to `"b"`: +/// This optimizer must sometimes handle rewriting filter expressions when they are +/// pushed. For example, consider a projection that aliases `a+1` to `"b"`: /// /// ```text /// Filter (b > 10) /// Projection: [a+1 AS "b"] <-- changes the name of `a+1` to `b` /// ``` /// -/// To apply the filter prior to the `Projection`, all references to `b` must be +/// To push this filter below the `Projection`, all references to `b` must be /// rewritten to `a+1`: /// /// ```text -/// Projection: a AS "b" -/// Filter: (a + 1 > 10) <--- changed from b to a + 1 +/// Projection: [a+1 AS "b"] +/// Filter: (a+1 > 10) <--- changed from b to a+1 /// ``` /// # Implementation Notes /// --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
