SubhamSinghal commented on code in PR #21621:
URL: https://github.com/apache/datafusion/pull/21621#discussion_r3987932589


##########
datafusion/core/src/optimizer_rule_reference.md:
##########
@@ -35,33 +35,34 @@ Rule order matters. The default pipeline may change between 
releases.
 
 ### Logical Optimizer Rules
 
-| order | rule                                      | summary                  
                                                                                
                   |
-| ----- | ----------------------------------------- | 
---------------------------------------------------------------------------------------------------------------------------
 |
-| 1     | `rewrite_set_comparison`                  | Rewrites `ANY` and `ALL` 
set-comparison subqueries into `EXISTS`-based boolean expressions with correct 
SQL NULL semantics. |
-| 2     | `optimize_unions`                         | Flattens nested unions 
and removes unions with a single input.                                         
                     |
-| 3     | `unions_to_filter`                        | Merges `UNION DISTINCT` 
branches that share the same source into a single filtered branch with a 
disjunctive predicate.     |
-| 4     | `simplify_expressions`                    | Constant-folds and 
simplifies expressions while preserving output names.                           
                         |
-| 5     | `replace_distinct_aggregate`              | Rewrites `DISTINCT` and 
`DISTINCT ON` operators into aggregate-based plans that later rules can 
optimize further.           |
-| 6     | `eliminate_join`                          | Replaces keyless inner 
joins with a literal `false` filter by an empty relation.                       
                     |
-| 7     | `decorrelate_predicate_subquery`          | Converts eligible `IN` 
and `EXISTS` predicate subqueries into semi or anti joins.                      
                     |
-| 8     | `scalar_subquery_to_join`                 | Rewrites eligible scalar 
subqueries into joins and adds schema-preserving projections.                   
                   |
-| 9     | `decorrelate_lateral_join`                | Rewrites eligible 
lateral joins into regular joins.                                               
                          |
-| 10    | `extract_equijoin_predicate`              | Splits join filters into 
equijoin keys and residual predicates.                                          
                   |
-| 11    | `eliminate_duplicated_expr`               | Removes duplicate 
expressions from projections, aggregates, and similar operators.                
                          |
-| 12    | `eliminate_filter`                        | Drops always-true 
filters and replaces always-false or NULL filters with empty relations.         
                          |
-| 13    | `eliminate_cross_join`                    | Uses filter predicates 
to replace cross joins with inner joins when join keys can be found.            
                     |
-| 14    | `eliminate_limit`                         | Removes no-op limits and 
simplifies trivial limit shapes.                                                
                   |
-| 15    | `propagate_empty_relation`                | Pushes empty-relation 
knowledge upward so operators fed by no rows collapse early.                    
                      |
-| 16    | `filter_null_join_keys`                   | Adds `IS NOT NULL` 
filters to nullable equijoin keys that can never match.                         
                         |
-| 17    | `eliminate_outer_join`                    | Rewrites outer joins to 
inner joins when later filters reject the NULL-extended rows.                   
                    |
-| 18    | `push_down_limit`                         | Moves literal limits 
closer to scans and unions and merges adjacent limits.                          
                       |
-| 19    | `push_down_filter`                        | Moves filters as early 
as possible through filter-commutative operators.                               
                     |
-| 20    | `single_distinct_aggregation_to_group_by` | Rewrites single-column 
`DISTINCT` aggregations into two-stage `GROUP BY` plans.                        
                     |
-| 21    | `eliminate_group_by_constant`             | Removes constant or 
functionally redundant expressions from `GROUP BY`.                             
                        |
-| 22    | `common_sub_expression_eliminate`         | Computes repeated 
subexpressions once and reuses the result.                                      
                          |
-| 23    | `extract_leaf_expressions`                | Pulls cheap leaf 
expressions closer to data sources so later pruning and filter rules can act 
earlier.                      |
-| 24    | `push_down_leaf_projections`              | Pushes the helper 
projections created by leaf extraction toward leaf inputs.                      
                          |
-| 25    | `optimize_projections`                    | Prunes unused columns 
and removes unnecessary logical projections.                                    
                      |
+| order                                                                        
       | rule                                      | summary                    
                                                                                
                 |
+| 
-----------------------------------------------------------------------------------
 | ----------------------------------------- | 
---------------------------------------------------------------------------------------------------------------------------
 |
+| 1                                                                            
       | `rewrite_set_comparison`                  | Rewrites `ANY` and `ALL` 
set-comparison subqueries into `EXISTS`-based boolean expressions with correct 
SQL NULL semantics. |
+| 2                                                                            
       | `optimize_unions`                         | Flattens nested unions and 
removes unions with a single input.                                             
                 |
+| 3                                                                            
       | `unions_to_filter`                        | Merges `UNION DISTINCT` 
branches that share the same source into a single filtered branch with a 
disjunctive predicate.     |
+| 4                                                                            
       | `simplify_expressions`                    | Constant-folds and 
simplifies expressions while preserving output names.                           
                         |
+| 5                                                                            
       | `replace_distinct_aggregate`              | Rewrites `DISTINCT` and 
`DISTINCT ON` operators into aggregate-based plans that later rules can 
optimize further.           |
+| 6                                                                            
       | `eliminate_join`                          | Replaces keyless inner 
joins with a literal `false` filter by an empty relation.                       
                     |
+| 7                                                                            
       | `decorrelate_predicate_subquery`          | Converts eligible `IN` and 
`EXISTS` predicate subqueries into semi or anti joins.                          
                 |
+| 8                                                                            
       | `scalar_subquery_to_join`                 | Rewrites eligible scalar 
subqueries into joins and adds schema-preserving projections.                   
                   |
+| 9                                                                            
       | `decorrelate_lateral_join`                | Rewrites eligible lateral 
joins into regular joins.                                                       
                  |
+| 10                                                                           
       | `extract_equijoin_predicate`              | Splits join filters into 
equijoin keys and residual predicates.                                          
                   |
+| 11                                                                           
       | `eliminate_duplicated_expr`               | Removes duplicate 
expressions from projections, aggregates, and similar operators.                
                          |
+| 12                                                                           
       | `eliminate_filter`                        | Drops always-true filters 
and replaces always-false or NULL filters with empty relations.                 
                  |
+| 13                                                                           
       | `eliminate_cross_join`                    | Uses filter predicates to 
replace cross joins with inner joins when join keys can be found.               
                  |
+| 14                                                                           
       | `eliminate_limit`                         | Removes no-op limits and 
simplifies trivial limit shapes.                                                
                   |
+| 15                                                                           
       | `propagate_empty_relation`                | Pushes empty-relation 
knowledge upward so operators fed by no rows collapse early.                    
                      |
+| 16                                                                           
       | `filter_null_join_keys`                   | Adds `IS NOT NULL` filters 
to nullable equijoin keys that can never match.                                 
                 |
+| 17                                                                           
       | `eliminate_outer_join`                    | Rewrites outer joins to 
inner joins when later filters reject the NULL-extended rows.                   
                    |
+| 18                                                                           
       | `push_down_limit`                         | Moves literal limits 
closer to scans and unions and merges adjacent limits, and pushes               
                       |

Review Comment:
   Addressed in a1bc5af2f45ced9e91fe9878834496659bb1b520



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to